instruction
stringlengths
0
30k
"Adobe Flex is a collection of technologies released by Adobe Systems for the development and deployment of cross platform rich Internet applications based on the proprietary Adobe Flash platform." [Adobe Flex][1] [1]: http://en.wikipedia.org/wiki/Adobe_Flex
Flex and Flash have different target audiences. Flex is more geared towards developers where as Flash is more geared towards designers and artists.
Yeah, I was confused by this for quite a while too. Flex seems to be thier name for the 'Flex Builder' IDE (based on Eclipse), and the general approach of building flash files using [mxml][1] and ActionScript rather than the normal flash tools. I think the mxml and ActionScript approach (i.e. Flex) is designed to...
How do I save each sheet in an Excel workbook to seperate CSV files with a macro?
|excel|csv|macro|vb|
Title says it all. I have an excel with multiple sheets. And I was looking for a macro that will save each sheet to a seperate CSV (comma seperated file). Excel will not allow you to save all sheets to different CSV files.
|excel|macros|csv|vb|
|javascript|dom|
I have a javascript function that manipulates the DOM when it is called (adds CSS classes, etc). This is invoked when the user changes some values in a form. When the document is first loading, I want to invoke this function to prepare the initial state (which is simpler in this case than setting up the DOM from the ...
@Lars Truijens - Thanks, but I think for 99% of cases that's a horrible idea, and sure, there are uses - but I've found that with WPF there's typically a much better way to do it. Plus you can use textboxes, and use an Enter as Tab override to move through them easily and swiftly.
Well, I personally really like what I have been using since I started with Emacs, which is GNU Emacs. It looks like it is built for [windows too][1]. That link also answers your [.emacs file question][2]. [Here is a place you can download it][3]. You should probably get version 22.2 (the latest). If this is your...
See <http://www.gnu.org/software/emacs/windows/ntemacs.html>. Section 2.1 describes where to get it, and section 3.5 describes where the .emacs file goes (by default, in your home directory, as specified by the HOME environment variable).
Freetype might be good for rendering fonts. [www.freetype.org][1] [1]: http://www.freetype.org/
I prefer to use minimal size. Memory may be cheap, <b>cache is not</b>.
Assuming you know the size of the full stack you could probably add some assembly code to read ESP. If you read ESP and save it aside in the main function you can compare the current ESP to the ESP you have in main and see how much ESP has changed. That'll give you an indication of how much stack you're used.
Taking the address of a local variable off the stack would work. Then in a more nested call you can subtract the address of another local to find the difference between them size_t top_of_stack; void Main() { int x=0; top_of_stack = (size_t) &x; do_something_very_recursi...
We use an in-memory database (hsql : http://hsqldb.org/). Hibernate (http://www.hibernate.org/) makes it easy for us to point our unit tests at the testing db, with the added bonus that they run as quick as lightning..
What about <a href="http://www.stagecast.com/">Stagecast Creator</a>? I've been using it with my 7 year old daughter (we started when she was 6). Don't be fooled by the kiddie interface. Once you start to use it, you realize it's teaching many complex ideas. It's sequential processing, and it's all graphic driven...
What is the best tool or utility to benchmark my JavaScript/.
|javascript|dom|traversal|
I'm currently working on a JavaScript tool that, during the course of its execution, will ultimately traverse each node in the DOM. Because this has potential to be a very expensive task, I'd like to benchmark the performance of this script. What's the best, free tool for benchmarking a script such as this across th...
How about obtaining the version of a system file? The best file would be kernel32.dll, located in %WINDIR%\System32\kernel32.dll. There are APIs to obtain the file version. eg: I'm using Windows XP -> "5.1.2600.5512 (xpsp.080413-2111)"
final Response response = new Client(Protocol.HTTP).get(uri); So, if I understand this correctly, the above line is where the actual call to the web service is being made, with the response being converted to an appropriate format and manipulated after this line. Assuming I were not using Restlet, how would t...
One more approach is having 3 tables for storing the 3 entities and having a separate table for storing the relations.
Returning "self" or "this" is a common pattern, sometimes referred to as <a href="http://www.martinfowler.com/dslwip/MethodChaining.html">"method chaining"</a>. As for your proposed syntax sugar, I'm not so sure. I'm not a .NET guy, but it doesn't seem terribly useful to me.
You can't do this with `public interface IMySpecialCollection : IList<MyObject>, IList { ... }` But you can do what you want with a class, you will need to make the implementations for one of the interfaces explicit. In my example I made IList explicit. `public class MySpecialCollection : IList<MyObject>, ILi...
What's the best way to handle one-to-one relationships in SQL?
|database-design|database|schema|linq|linq-to-sql|
|database|linq|linq-to-sql|database-design|schema|
Let's say I've got Alpha things that may or may not *be* or be *related to* Bravo or Charlie things. These are one-to-one relationships: No Alpha will relate to more than one Bravo. And no Bravo will relate to more than one Alpha. I've got a few goals: - a system that's easy to learn and maintain. -...
You are looking for a no-cache directive: <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> If you've got a master page design going, this may be a little bit of a juggle, but I believe you can put this directive on a single page, without affecting the rest of your site (assuming that's what you want). If you'...
Deep copying can only be done with each class's consent. If you have control over the class hierarchy then you can implement the clonable interface and implement the Clone method. Otherwise doing a deep copy is impossible to do safely because the object may also be sharing non-data resources (e.g. database connections)...
Flickering during updates to Controls in WinForms (e.g. DataGridView)
|c#|.net|winforms|
In my application I have a DataGridView control that displays data for the selected object. When I select a different object (in a combobox above), I need to update the grid. Unfortunately different objects have completely different data, even different columns, so I need to clear all the existing data and columns, cre...
In my application I have a DataGridView control that displays data for the selected object. When I select a different object (in a combobox above), I need to update the grid. Unfortunately different objects have completely different data, even different columns, so I need to clear all the existing data and columns, cre...
Here are two possible **workarounds**: 1. You can place the databound field within the body of the report as a hidden textbox, and then in the header place another textbox with it's value pointed at the the one hidden within the body. 2. Try using report parameters to store the data, and use those parameters to a...
You can also use `<%= Class.Method() %>` And it will print the result, just as you can do in Ruby on Rails.
Scott Guthrie gives some great advice here on how to set up a User Control Library project, then use pre-build events to copy the user controls into multiple projects. It works really well. http://webproject.scottgu.com/CSharp/usercontrols/usercontrols.aspx
You can use the source indexing feature of the Debugging Tools for Windows, which will save references to the appropriate revisions of the files in your source repository as an alternate stream in the PDB file.
Why not something simple like this: (note this may / proabbly won't compile) but you get the idea... <pre> <code> private Rect* convert(const rectangle& src) { return new Rect(src.x,src.y,src.w,src.h); } int main() { rectangle r; r.x = 1; r.y = 2; r.w = 3; r.h = 4; Rect* fo...
What a gross DB structure. Anyway, I'd do something like this (note I prefer EXISTS to joins, but you can re-write them as joins if you like; most query analyzers will collapse them to the same query plan anyway). You may have to do some additional juggling one way or another to make it work... SELECT * ...
Should I be doing JSPX instead of JSP?
|jsp|jspx|
Using [JDeveloper][1], I started developing a set of web pages for a project at work. Since I didn't know much about JDev at the time, I ran over to Oracle to follow some tutorials. The JDev tutorials recommended doing [JSPX][2] instead of [JSP][3], but didn't really explain why. Are you developing JSPX pages? Why did ...
What is the best tool or utility to benchmark my JavaScript?
What is the best tool or benchmark my JavaScript?
|javascript|dom|
What is the best tool to benchmark my JavaScript?
|javascript|dom|
Re: [Chris's answer][1] Your implementation let's things like "1a" or "b2" through. How about this instead: def safeParse2(strToParse) if strToParse =~ /\A\d+\Z/ strToParse.to_i else raise Exception end end ["100", "1a", "b2", "t"].each do |number| beg...
Can XpsDocuments be serialized to XML for storage in a database?
|sql-server|xpsdocument|
And, if not, is the only other alternative a blob?
I'll try one more idea: Have your Data Access Object return their own AsyncTokens (or some other objects that encapsulate a pending call), instead of the AsyncToken that comes from the RPC call. So, in the DAO it would look something like this (this is very sketchy code): public function deleteThing( id : Str...
I like setting up a global class to handle references to classes that need to be accessed by any other class, not necessarily the child. The global class simply consists of static getters and setters like so: private static const class:Class; public static function setClass(_class:Class){ cl...
Have the logout operation be a `POST`. Then the browser will prompt for "Are you sure you want to re-post the form?" rather than show the page.
This one gives you the local time: $year = date('Y'); // 2008 And this one UTC: $year = gmdate('Y'); // 2008
The DVD menus that appear on a typical *movie* DVD are described in the DVD-Video standard: [wikipedia][1]. If you are trying to create this type of menu, there are many programs that will create these. I have had luck with [DVD Styler][2]. If you are creating an application that is distributed on a DVD, the cho...
Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { public void run() { // what you want to do } }));
You can add a shutdown hook to your application by doing the following: Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { public void run() { // what you want to do } })); This is basically equivalent to having a try {} finally {} block around your entire program, and ba...
You can add a shutdown hook to your application by doing the following: Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { public void run() { // what you want to do } })); This is basically equivalent to having a try {} finally {} block around your entire program, and ba...
This design is vulnerable to multithreading issues. I'd strongly suggest using Guids for your IDs (Guid.NewGuid()). If you absolutely must use ints, check out the [Interlocked][1] class. You can wrap all incrementing and Id logic up in a base class so that you're only accessing the ID generator in one location. ...
Are you resizing the console window? I've found that the ruby scripts (irb, etc) that use the readline library don't work correctly with resized console windows (in XP or Vista). Effectively I believe that the readline library expects the console window to be 80 characters wide, anything else and it goes bezerk. So ...
If you're locking on a object stored as a *static* then the lock should work for all threads in the same Application Domain, but perhaps you need to upload a code sample so we can have a look at the offending lines. That said, one thought would be to check if IIS is configured to run in [Web Garden][1] mode (i.e. mo...
For completeness a full example would look something like this. private static object ThisLock = new object(); object dataObject = Cache["globalData"]; if( dataObject == null ) { lock(ThisLock) { if( dataObject == null ) { //Get Data...
It sounds like you're using an incorrect address: > To access the Service I enter http://localhost/project/myService.svc/FileUpload Assuming you mean this is the URL address you give your client code then I suspect it should actually be: http://localhost/project/myService.svc
It sounds like you're using an incorrect address: > To access the Service I enter http://localhost/project/myService.svc/FileUpload Assuming you mean this is the address you give your client code then I suspect it should actually be: http://localhost/project/myService.svc
I go for a belt and braces appraoch here. I create a 32x32 icon in both the <code>.ico</code> and <code>.png</code> formats called <code>favicon.ico</code> and <code>favicon.png</code>. The name doesn't really matter unless you are dealing with older browsers. 1. Place <code>favicon.ico</code> at your site root to ...
Let's say I've got Alpha things that may or may not *be* or be *related to* Bravo or Charlie things. These are one-to-one relationships: No Alpha will relate to more than one Bravo. And no Bravo will relate to more than one Alpha. I've got a few goals: - a system that's easy to learn and maintain. -...
Personally, I've had lots of success with your second model, using a PK/FK on a single column. I have never had a situation where all Alphas were required to have a record in a Bravo or Charlie table. I've always dealt with 1 <-> 0..1, never 1 <-> 1. As for your last question, that's just that many more tables.
You could have a join table that specifies an Alpha and a related ID. You can then add another column specifing if it is an ID for Bravo, Charlie or whatever. Keeps the column creep down on Alpha but does add some complexity to joining queries.
For SVN, this will generally work as others have already stated. If you are copying between machines, you probably will run into trouble though. For example, if you are accessing your SVN repo using file:// repository URL, things will most likely break. Same applies to http:// or svn:// URLs where server access mi...
I don't know how to do it in ASP.NET but in PHP I would do something like: header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Cache-Control: no-cache"); header("Pragma: no-cache"); Which forces the browser to recheck that the item, so your authentication checking should be triggered, denying ...
Autoproxy configuration script parsing in .Net/C#
|c#|autoproxy|jscript.net|
In order for my application (.Net 1.1) to use the system configured proxy server (trough a proxy.pac script) I was using an interop calls to WinHTTP function WinHttpGetProxyForUrl, passing the proxy.pac url I got from the registry. Unfortunately, I hit a deployment scenario, where this does not work, as the proxy.pa...
Will [ROME](https://rome.dev.java.net/) do?
Also on Internet Explorer 7 is [IE7Pro][1]. It also provides some gadgets that aren't in the Developer Toolbar. I have both installed, and use both quite often. [1]: http://www.ie7pro.com/
With the `user.language`, `user.country` and `user.variant` properties. Example: `java -Duser.language=th -Duser.country=TH -Duser.variant=TH SomeClass`
You can use either [date][1] or [strftime][2]. In this case I'd say it doesn't matter as a year is a year, no matter what (unless there's a locale that formats the year differently?) On a side note, when formatting dates in PHP it matters when you want to format your date in a different locale than your default. If ...
IE has problems with the :hover pseudo-class on anything other than anchor elements so you need to change the element the hover is affecting to the anchor itself. So, if you added a class like "image" to your anchor and altered your markup to something like this: <div class="myImage"><a href="..." class="image"...
Replacing plain text password for app
|password|
We are currently storing plain text passwords for a web app that we have. I keep advocating moving to a password hash but another developer said that this would be less secure -- more passwords could match the hash and a dictionary/hash attack would be faster. Is there any truth to this argument?
|passwords|
Flash is a programming language rather similar to JavaScript but with support for static types. Flex is a flash library that is intended to help people program in Flash on a much higher level. It may be helpful to some to think about this as Flex over Flash being like MFC over C++.
@John: Then it complains about missing symbols. (gdb) p (NSUInteger)[(NSObject*)$esi retainCount] No symbol table is loaded. Use the "file" command. (gdb) p [(NSArray *)$esi count] No symbol "NSArray" in current context. I tried to load the symbols for Foundation: (gdb) add-symbol-fi...
@[John Calsbeek] Then it complains about missing symbols. (gdb) p (NSUInteger)[(NSObject*)$esi retainCount] No symbol table is loaded. Use the "file" command. (gdb) p [(NSArray *)$esi count] No symbol "NSArray" in current context. I tried to load the symbols for Foundation: (gdb) add...
SELECT * INTO < new_table > FROM < existing_table > WHERE < clause >
WMI QUery: "Select * from Win32_OperatingSystem"
WMI QUery: "Select * from Win32_OperatingSystem" EDIT: Actually better would be: "Select Version from Win32_OperatingSystem"
Since Outlook doesn't have the OnKey event, the easiest way is to assign a toolbar button to the macro and put an ampersand in its name somewhere. This only works if your shortcut letter doesn't conflict with an existing shortcut. You may also have luck with setting a global hotkey, but it's usually more pain then i...
The NeXTSTEP Objective-C framework used to use this pattern. It was discontinued in that framework once distributed objects (remote procedure calls, basically) were added to the language—a function that returned `self` had to be a synchronous invocation, since the distributed object system saw the return type and assum...
The overhead is very small. It is possible to write a hybrid array list that has fields for the first few items, and then falls back to using an array for longer list. You can avoid the overhead of the list object entirely by using an array. To go even further hardcore, you can declare the field as Object, and avoid...
<p>I think as a general policy, it simply doesn't make sense. Method chaining in this manner works with a properly defined interface but it's only appropriate if it makes semantic sense. </p> <p>Your example is a prime one where it's not appropriate, because it makes no semantic sense.</p> <p>Similarly, your syntacti...
Get CVS history for a particular user
|cvs|history|tortoisecvs|
How do I get the history of commits that have been made to the repository for a particular user? I am able to access CVS either through the command line or TortioseCVS, so a solution using either method is sufficient.
I'd go with option 1 unless I had a significant reason not to. It might not cost you as much space as you think, esp. if you are using varchars in Bravo. Don't forget that splitting it will cost you for foreign keys, secondary identity and needed indexes. <p>A place where you might run into trouble is if Bravo is unli...