question_id
int64
4
6.31M
answer_id
int64
7
6.31M
title
stringlengths
9
150
question_body
stringlengths
0
28.8k
answer_body
stringlengths
60
27.2k
question_text
stringlengths
40
28.9k
combined_text
stringlengths
124
39.6k
tags
listlengths
1
6
question_score
int64
0
26.3k
answer_score
int64
0
28.8k
view_count
int64
15
14M
answer_count
int64
0
182
favorite_count
int64
0
32
question_creation_date
stringdate
2008-07-31 21:42:52
2011-06-10 18:12:18
answer_creation_date
stringdate
2008-07-31 22:17:57
2011-06-10 18:14:17
99,271
322,281
C# COM Office Automation - RPC_E_SYS_CALL_FAILED
I'm writing a C# program that acts as a PowerPoint 2007 plugin. On some machines, some calls to the PowerPoint object model throw a COMException with the message RPC_E_SYS_CALL_FAILED. I couldn't find any specific advice on what to do regarding this error, or how to avoid it. From Googling it looks like something to do...
I don't know it is related to your problem, but all your COM calls must come from within the same thread your add-in was created on. If you created new threads you must take special care. Details are described in these two articles: Implementing IMessageFilter in an Office add-in and Why your COMAddIn.Object should der...
C# COM Office Automation - RPC_E_SYS_CALL_FAILED I'm writing a C# program that acts as a PowerPoint 2007 plugin. On some machines, some calls to the PowerPoint object model throw a COMException with the message RPC_E_SYS_CALL_FAILED. I couldn't find any specific advice on what to do regarding this error, or how to avoi...
TITLE: C# COM Office Automation - RPC_E_SYS_CALL_FAILED QUESTION: I'm writing a C# program that acts as a PowerPoint 2007 plugin. On some machines, some calls to the PowerPoint object model throw a COMException with the message RPC_E_SYS_CALL_FAILED. I couldn't find any specific advice on what to do regarding this err...
[ "c#", "com", "ms-office" ]
5
5
11,784
4
0
2008-09-19T03:24:15.030000
2008-11-26T21:48:11.380000
99,279
163,795
How do you parse a web page and extract all the href links?
I want to parse a web page in Groovy and extract all of the href links and the associated text with it. If the page contained these links: Google Apple the output would be: Google, http://www.google.com Apple, http://www.apple.com I'm looking for a Groovy answer. AKA. The easy way!
Assuming well-formed XHTML, slurp the xml, collect up all the tags, find the 'a' tags, and print out the href and text. input = """ John Google StackOverflow """ doc = new XmlSlurper().parseText(input) doc.depthFirst().collect { it }.findAll { it.name() == "a" }.each { println "${it.text()}, ${it.@href.text()}" }
How do you parse a web page and extract all the href links? I want to parse a web page in Groovy and extract all of the href links and the associated text with it. If the page contained these links: Google Apple the output would be: Google, http://www.google.com Apple, http://www.apple.com I'm looking for a Groovy answ...
TITLE: How do you parse a web page and extract all the href links? QUESTION: I want to parse a web page in Groovy and extract all of the href links and the associated text with it. If the page contained these links: Google Apple the output would be: Google, http://www.google.com Apple, http://www.apple.com I'm looking...
[ "html", "parsing", "groovy" ]
15
17
17,635
7
0
2008-09-19T03:26:35.960000
2008-10-02T18:18:55.827000
99,297
99,341
How are virtual functions and vtable implemented?
We all know what virtual functions are in C++, but how are they implemented at a deep level? Can the vtable be modified or even directly accessed at runtime? Does the vtable exist for all classes, or only those that have at least one virtual function? Do abstract classes simply have a NULL for the function pointer of a...
How are virtual functions implemented at a deep level? From "Virtual Functions in C++": Whenever a program has a virtual function declared, a v - table is constructed for the class. The v-table consists of addresses to the virtual functions for classes that contain one or more virtual functions. The object of the class...
How are virtual functions and vtable implemented? We all know what virtual functions are in C++, but how are they implemented at a deep level? Can the vtable be modified or even directly accessed at runtime? Does the vtable exist for all classes, or only those that have at least one virtual function? Do abstract classe...
TITLE: How are virtual functions and vtable implemented? QUESTION: We all know what virtual functions are in C++, but how are they implemented at a deep level? Can the vtable be modified or even directly accessed at runtime? Does the vtable exist for all classes, or only those that have at least one virtual function? ...
[ "c++", "polymorphism", "virtual-functions", "vtable" ]
138
143
71,938
12
0
2008-09-19T03:29:44.873000
2008-09-19T03:36:24.610000
99,299
99,349
Is there any downside to redundant qualifiers? Any benefit?
For example, referencing something as System.Data.Datagrid as opposed to just Datagrid. Please provide examples and explanation. Thanks.
The benefit is that you don't need to add an import for everything you use, especially if it's the only thing you use from a particular namespace, it also prevents collisions. The downside, of course, is that the code balloons out in size and gets harder to read the more you use specific qualifiers. Personally I tend t...
Is there any downside to redundant qualifiers? Any benefit? For example, referencing something as System.Data.Datagrid as opposed to just Datagrid. Please provide examples and explanation. Thanks.
TITLE: Is there any downside to redundant qualifiers? Any benefit? QUESTION: For example, referencing something as System.Data.Datagrid as opposed to just Datagrid. Please provide examples and explanation. Thanks. ANSWER: The benefit is that you don't need to add an import for everything you use, especially if it's t...
[ "performance", "duplicates", "qualifiers" ]
2
2
2,162
7
0
2008-09-19T03:29:50.070000
2008-09-19T03:38:53.980000
99,318
99,336
Understanding [ClassOne, ClassTwo].each(&:my_method)
Possible Duplicate: What does map(&:name) mean in Ruby? I was watching a railscast and saw this code. [Category, Product].(&:delete_all) In regards to clearing a database. I asked about the line in IRC and was told (&:delete_all) was a shortcut for {|model| model.delete_all} I tested this with the following class Class...
This relies upon a Ruby 1.9 extension that can be done in 1.8 by including the following: class Symbol def to_proc proc { |obj, *args| obj.send(self, *args) } end end I believe Rails defines this in ActiveSupport.
Understanding [ClassOne, ClassTwo].each(&:my_method) Possible Duplicate: What does map(&:name) mean in Ruby? I was watching a railscast and saw this code. [Category, Product].(&:delete_all) In regards to clearing a database. I asked about the line in IRC and was told (&:delete_all) was a shortcut for {|model| model.del...
TITLE: Understanding [ClassOne, ClassTwo].each(&:my_method) QUESTION: Possible Duplicate: What does map(&:name) mean in Ruby? I was watching a railscast and saw this code. [Category, Product].(&:delete_all) In regards to clearing a database. I asked about the line in IRC and was told (&:delete_all) was a shortcut for ...
[ "ruby" ]
14
20
3,986
2
0
2008-09-19T03:33:05.990000
2008-09-19T03:36:00.820000
99,319
101,434
Grab a ProgressEvent from a POST upload in as3
Is there any way to track the status of a posted upload in AS3? There is a ProgressEvent, but it gives data back about the response, not the actual POST upload. I'm posting binary data for an image, so it's usually in the 50-100kb range. The image data was generated inside Flash itself, so I can't use the upload method...
Perhaps you can use a function at the server side to send progress events to the flash object?
Grab a ProgressEvent from a POST upload in as3 Is there any way to track the status of a posted upload in AS3? There is a ProgressEvent, but it gives data back about the response, not the actual POST upload. I'm posting binary data for an image, so it's usually in the 50-100kb range. The image data was generated inside...
TITLE: Grab a ProgressEvent from a POST upload in as3 QUESTION: Is there any way to track the status of a posted upload in AS3? There is a ProgressEvent, but it gives data back about the response, not the actual POST upload. I'm posting binary data for an image, so it's usually in the 50-100kb range. The image data wa...
[ "flash", "actionscript-3", "actionscript" ]
7
1
3,161
3
0
2008-09-19T03:33:11.327000
2008-09-19T12:30:14.457000
99,348
99,763
How do I change the colors displayed in cygwin rxvt?
When I print "\[\e[34m\]sometext" I get some text in blue, but can I specify the shade of blue somewhere?
You're using an ANSI escape sequence, which has very limited color options. I use an.Xdefaults file (explained in this tutorial ). These options won't make your shell prompt all colorful, but is used by editors such as vim. Be aware that.Xdefaults can be picky about UNIX (CR) vs Windows (CRLF) line endings. Use d2u or ...
How do I change the colors displayed in cygwin rxvt? When I print "\[\e[34m\]sometext" I get some text in blue, but can I specify the shade of blue somewhere?
TITLE: How do I change the colors displayed in cygwin rxvt? QUESTION: When I print "\[\e[34m\]sometext" I get some text in blue, but can I specify the shade of blue somewhere? ANSWER: You're using an ANSI escape sequence, which has very limited color options. I use an.Xdefaults file (explained in this tutorial ). The...
[ "bash", "cygwin", "rxvt" ]
2
1
3,601
2
0
2008-09-19T03:38:29.410000
2008-09-19T04:59:54.800000
99,350
1,243,839
Passing PHP associative arrays to and from XML
Is there an easy way to marshal a PHP associative array to and from XML? For example, I have the following array: $items = array("1", "2", array( "item3.1" => "3.1", "item3.2" => "3.2" "isawesome" => true ) ); How would I turn it into something similar to the following XML in as few lines as possible, then back again? ...
For those of you not using the PEAR packages, but you've got PHP5 installed. This worked for me: /** * Build A XML Data Set * * @param array $data Associative Array containing values to be parsed into an XML Data Set(s) * @param string $startElement Root Opening Tag, default fx_request * @param string $xml_version XML ...
Passing PHP associative arrays to and from XML Is there an easy way to marshal a PHP associative array to and from XML? For example, I have the following array: $items = array("1", "2", array( "item3.1" => "3.1", "item3.2" => "3.2" "isawesome" => true ) ); How would I turn it into something similar to the following XML...
TITLE: Passing PHP associative arrays to and from XML QUESTION: Is there an easy way to marshal a PHP associative array to and from XML? For example, I have the following array: $items = array("1", "2", array( "item3.1" => "3.1", "item3.2" => "3.2" "isawesome" => true ) ); How would I turn it into something similar to...
[ "php", "xml", "xml-serialization" ]
18
6
30,242
15
0
2008-09-19T03:39:11.200000
2009-08-07T09:32:31.677000
99,389
99,404
Is there a good reference on how java executes bytecode?
I'm interested in how java organizes memory and executes code (like what gets put in the stack or the heap), from the start of main, to assigning variables, calling functions, passing parameters, returning values, instantiating objects, etc. Has anyone found a good, beginner-friendly article/reference on it?
The canonical reference is the JVM spec. However, different JVMs can implement the spec in different ways. You can also check out the open source Java platform implementation, OpenJDK.
Is there a good reference on how java executes bytecode? I'm interested in how java organizes memory and executes code (like what gets put in the stack or the heap), from the start of main, to assigning variables, calling functions, passing parameters, returning values, instantiating objects, etc. Has anyone found a go...
TITLE: Is there a good reference on how java executes bytecode? QUESTION: I'm interested in how java organizes memory and executes code (like what gets put in the stack or the heap), from the start of main, to assigning variables, calling functions, passing parameters, returning values, instantiating objects, etc. Has...
[ "java", "bytecode" ]
0
3
931
2
0
2008-09-19T03:46:32.713000
2008-09-19T03:48:58.930000
99,391
99,413
How do I fix this Subversion MKCOL error?
When I commit I get this error from Subversion: bash-2.05b$ svn commit -m "testing subversion, still" Adding baz svn: Commit failed (details follow): svn: MKCOL of '/viper/!svn/wrk/6b9bcd38-b2fe-0310-95ff-9d1a44098866/sandboxes/ohammersmith/trunk/baz': 405 Method Not Allowed (http://svn.example.com)
This happens when you have added a directory that someone else has also added and already committed. The error message on a commit is really confusing, but if you do an svn up instead you'll see this message: bash-2.05b$ svn up svn: Failed to add directory 'baz': object of the same name already exists To resolve the is...
How do I fix this Subversion MKCOL error? When I commit I get this error from Subversion: bash-2.05b$ svn commit -m "testing subversion, still" Adding baz svn: Commit failed (details follow): svn: MKCOL of '/viper/!svn/wrk/6b9bcd38-b2fe-0310-95ff-9d1a44098866/sandboxes/ohammersmith/trunk/baz': 405 Method Not Allowed (h...
TITLE: How do I fix this Subversion MKCOL error? QUESTION: When I commit I get this error from Subversion: bash-2.05b$ svn commit -m "testing subversion, still" Adding baz svn: Commit failed (details follow): svn: MKCOL of '/viper/!svn/wrk/6b9bcd38-b2fe-0310-95ff-9d1a44098866/sandboxes/ohammersmith/trunk/baz': 405 Met...
[ "svn" ]
76
112
97,258
3
0
2008-09-19T03:46:59.887000
2008-09-19T03:50:18.290000
99,395
99,438
How to check if a folder exists in Cocoa & Objective-C?
How to check if a folder (directory) exists in Cocoa using Objective-C?
Use NSFileManager 's fileExistsAtPath:isDirectory: method. See Apple's docs here.
How to check if a folder exists in Cocoa & Objective-C? How to check if a folder (directory) exists in Cocoa using Objective-C?
TITLE: How to check if a folder exists in Cocoa & Objective-C? QUESTION: How to check if a folder (directory) exists in Cocoa using Objective-C? ANSWER: Use NSFileManager 's fileExistsAtPath:isDirectory: method. See Apple's docs here.
[ "objective-c", "cocoa" ]
46
73
43,480
5
0
2008-09-19T03:47:45.580000
2008-09-19T03:52:50.310000
99,406
620,737
What is the easiest FLV player for embedding video on a website?
I have video that I've converted to FLV format. I'd rather host it on my own site than use a service like YouTube. What is the easiest player to use? I'd like to just put the.swf file of the player somewhere on my server, and give it the video as a parameter.
I haven't tried yet Flowplayer which seems well documented it is featured on arctic startup and only restriction to use it with opensource licence is to have their logo displayed
What is the easiest FLV player for embedding video on a website? I have video that I've converted to FLV format. I'd rather host it on my own site than use a service like YouTube. What is the easiest player to use? I'd like to just put the.swf file of the player somewhere on my server, and give it the video as a parame...
TITLE: What is the easiest FLV player for embedding video on a website? QUESTION: I have video that I've converted to FLV format. I'd rather host it on my own site than use a service like YouTube. What is the easiest player to use? I'd like to just put the.swf file of the player somewhere on my server, and give it the...
[ "flash", "video", "flv" ]
35
9
45,964
10
0
2008-09-19T03:49:16.700000
2009-03-06T22:41:29.513000
99,419
99,462
What is the best way to store software documentation?
An obvious answer is "an internal wiki". What are the pros and cons of a wiki used for software documentation? Any other suggestions? What are you using for your software documentation? Loren Segal - Unfortunately we don't have support for any doc tool to compile information from the source code comments but I agree it...
That's a very open ended question, and depends on many factors. Generally speaking, if you use a language that has good documentation generation tools (javadoc, doxygen, MS's C# stuff), you should write your documentation above your methods and have your tools generate the pages. The advantage is that you keep the sour...
What is the best way to store software documentation? An obvious answer is "an internal wiki". What are the pros and cons of a wiki used for software documentation? Any other suggestions? What are you using for your software documentation? Loren Segal - Unfortunately we don't have support for any doc tool to compile in...
TITLE: What is the best way to store software documentation? QUESTION: An obvious answer is "an internal wiki". What are the pros and cons of a wiki used for software documentation? Any other suggestions? What are you using for your software documentation? Loren Segal - Unfortunately we don't have support for any doc ...
[ "documentation" ]
4
7
8,321
8
0
2008-09-19T03:51:03.873000
2008-09-19T03:55:29.337000
99,460
99,466
Does writing and speaking on software make you a better programmer?
Do you think that writing about software (i.e. having a blog) and speaking on software (and concepts) make you a better programmer?
Statistically speaking yes. You only retain about 20% of what you read and hear, but 80% of what you teach. By writing about something or teaching about it, you force yourself to understand the concepts on a much deeper level. UPDATE: I wanted to update this with some links to more concrete data to support the statisti...
Does writing and speaking on software make you a better programmer? Do you think that writing about software (i.e. having a blog) and speaking on software (and concepts) make you a better programmer?
TITLE: Does writing and speaking on software make you a better programmer? QUESTION: Do you think that writing about software (i.e. having a blog) and speaking on software (and concepts) make you a better programmer? ANSWER: Statistically speaking yes. You only retain about 20% of what you read and hear, but 80% of w...
[ "blogs" ]
8
15
493
14
0
2008-09-19T03:55:26
2008-09-19T03:56:43.983000
99,474
99,503
how to handle code that is deemed dangerous to change, but stable?
What is the best way to handle a big team that has access to a stable but no so pretty code, that is easy to introduce bugs into? I'm looking for something along the lines of SVN locking the file(s).
Write unit tests if you don't have them already. Then start refactoring, and keep doing regression tests upon every commit.
how to handle code that is deemed dangerous to change, but stable? What is the best way to handle a big team that has access to a stable but no so pretty code, that is easy to introduce bugs into? I'm looking for something along the lines of SVN locking the file(s).
TITLE: how to handle code that is deemed dangerous to change, but stable? QUESTION: What is the best way to handle a big team that has access to a stable but no so pretty code, that is easy to introduce bugs into? I'm looking for something along the lines of SVN locking the file(s). ANSWER: Write unit tests if you do...
[ "c++", "svn", "refactoring" ]
2
13
313
10
0
2008-09-19T03:57:34.497000
2008-09-19T04:01:01.773000
99,479
99,485
Visual C++/Studio: Application configuration incorrect?
My C(++) program, written and compiled using Visual C(++)/Visual Studio, runs fine on my own machine, but refuses to run on another machine. The error message I get is "This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem."
If you write a C++ program, it links dynamically to the C Runtime Library, or CRT for short. This library contains your printf, your malloc, your strtok, etcetera. The library is contained in the file called MSVCR80.DLL. This file is not by default installed on a Windows system, hence the application cannot run. The so...
Visual C++/Studio: Application configuration incorrect? My C(++) program, written and compiled using Visual C(++)/Visual Studio, runs fine on my own machine, but refuses to run on another machine. The error message I get is "This application has failed to start because the application configuration is incorrect. Reinst...
TITLE: Visual C++/Studio: Application configuration incorrect? QUESTION: My C(++) program, written and compiled using Visual C(++)/Visual Studio, runs fine on my own machine, but refuses to run on another machine. The error message I get is "This application has failed to start because the application configuration is...
[ "c++", "c", "visual-studio", "visual-c++" ]
3
5
13,771
10
0
2008-09-19T03:58:17.410000
2008-09-19T03:58:55.303000
99,488
100,266
How do I change the colors of an arbitrary widget in GTK+?
If I'm writing an application that wants to communicate some information through the use of color, how can I change the background and foreground colors of a given widget? I would like to know how to do this in glade if it's possible, as well as programmatically (to a computed color). I want to know how to do this to a...
Example program: #include static void on_destroy(GtkWidget* widget, gpointer data) { gtk_main_quit (); } int main (int argc, char* argv[]) { GtkWidget* window; GtkWidget* button; gtk_init(&argc, &argv); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); g_signal_connect(G_OBJECT (window), "destroy", G_CALLBACK (on_destroy...
How do I change the colors of an arbitrary widget in GTK+? If I'm writing an application that wants to communicate some information through the use of color, how can I change the background and foreground colors of a given widget? I would like to know how to do this in glade if it's possible, as well as programmaticall...
TITLE: How do I change the colors of an arbitrary widget in GTK+? QUESTION: If I'm writing an application that wants to communicate some information through the use of color, how can I change the background and foreground colors of a given widget? I would like to know how to do this in glade if it's possible, as well ...
[ "gtk" ]
4
8
15,210
4
0
2008-09-19T03:59:01.090000
2008-09-19T07:33:26.507000
99,497
429,703
What are some different ways of implementing a plugin system?
I'm not looking so much for language-specific answers, just general models for implementing a plugin system (if you want to know, I'm using Python). I have my own idea (register callbacks, and that's about it), but I know others exist. What's normally used, and what else is reasonable? What do you mean by a plugin syst...
There is a very good episode of Software Engineering Radio, which you may be interested in. For future reference, I have reproduced here the " Rules for Enablers " ( alternative link ) given in the excellent Contributing to Eclipse by Erich Gamma, Kent Beck. Invitation Rule - Whenever possible, let others contribute to...
What are some different ways of implementing a plugin system? I'm not looking so much for language-specific answers, just general models for implementing a plugin system (if you want to know, I'm using Python). I have my own idea (register callbacks, and that's about it), but I know others exist. What's normally used, ...
TITLE: What are some different ways of implementing a plugin system? QUESTION: I'm not looking so much for language-specific answers, just general models for implementing a plugin system (if you want to know, I'm using Python). I have my own idea (register callbacks, and that's about it), but I know others exist. What...
[ "language-agnostic", "plugins" ]
6
1
662
4
0
2008-09-19T04:00:09.280000
2009-01-09T20:53:47.110000
99,510
99,532
Does several levels of base classes slow down a class/struct in c++?
Does having several levels of base classes slow down a class? A derives B derives C derives D derives F derives G,... Does multiple inheritance slow down a class?
Non-virtual function-calls have absolutely no performance hit at run-time, in accordance with the c++ mantra that you shouldn't pay for what you don't use. In a virtual function call, you generally pay for an extra pointer lookup, no matter how many levels of inheritance, or number of base classes you have. Of course t...
Does several levels of base classes slow down a class/struct in c++? Does having several levels of base classes slow down a class? A derives B derives C derives D derives F derives G,... Does multiple inheritance slow down a class?
TITLE: Does several levels of base classes slow down a class/struct in c++? QUESTION: Does having several levels of base classes slow down a class? A derives B derives C derives D derives F derives G,... Does multiple inheritance slow down a class? ANSWER: Non-virtual function-calls have absolutely no performance hit...
[ "c++", "oop" ]
19
30
6,253
12
0
2008-09-19T04:01:59.073000
2008-09-19T04:06:07.440000
99,520
148,618
Is it possible to get Code Coverage Analysis on an Interop Assembly?
I've asked this question over on the MSDN forums also and haven't found a resolution: http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=3686852&SiteID=1 The basic problem here as I see it is that an interop assembly doesn't actually contain any IL that can be instrumented (except for maybe a few delegates). So, alt...
To answer your question - it's not possible to instrument interop assemblies for code coverage. They contain only metadata, and no executable code as you mention yourself. Besides, I don't see much point in trying to code coverage the interop assembly. You should be measuring the code coverage of code you write. From t...
Is it possible to get Code Coverage Analysis on an Interop Assembly? I've asked this question over on the MSDN forums also and haven't found a resolution: http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=3686852&SiteID=1 The basic problem here as I see it is that an interop assembly doesn't actually contain any IL...
TITLE: Is it possible to get Code Coverage Analysis on an Interop Assembly? QUESTION: I've asked this question over on the MSDN forums also and haven't found a resolution: http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=3686852&SiteID=1 The basic problem here as I see it is that an interop assembly doesn't actua...
[ "interop", "com-interop", "instrumentation" ]
4
1
312
2
0
2008-09-19T04:04:07.133000
2008-09-29T13:19:13.217000
99,528
99,543
What is a good PHP library to handle file uploads?
I am looking to use a PHP library for uploading pictures to a web server so that I can use something that has been tested and hopefully not have to design one myself. Does anyone know of such a library? Edit: I am aware that file uploads are built into PHP, I am looking for a library that may make the process simpler a...
I personally use HTTP_Upload from PEAR. It works pretty well for our purposes (uplaoding media files into a development system and uploading arbitrary files for an educational system)
What is a good PHP library to handle file uploads? I am looking to use a PHP library for uploading pictures to a web server so that I can use something that has been tested and hopefully not have to design one myself. Does anyone know of such a library? Edit: I am aware that file uploads are built into PHP, I am lookin...
TITLE: What is a good PHP library to handle file uploads? QUESTION: I am looking to use a PHP library for uploading pictures to a web server so that I can use something that has been tested and hopefully not have to design one myself. Does anyone know of such a library? Edit: I am aware that file uploads are built int...
[ "php", "file-upload" ]
18
6
12,222
4
0
2008-09-19T04:05:27.737000
2008-09-19T04:07:37.937000
99,535
99,556
What tools do you use for Automated Builds / Automated Deployments? Why?
What tools do you use for Automated Builds / Automated Deployments? Why? What tools do you recommend?
Hudson for automated builds. I chose it because it was the easiest to setup and demo. A system that's too complex and isn't slick-looking won't impress management enough to get them on-board for automated builds. Especially in a project that has a lot of inertia.
What tools do you use for Automated Builds / Automated Deployments? Why? What tools do you use for Automated Builds / Automated Deployments? Why? What tools do you recommend?
TITLE: What tools do you use for Automated Builds / Automated Deployments? Why? QUESTION: What tools do you use for Automated Builds / Automated Deployments? Why? What tools do you recommend? ANSWER: Hudson for automated builds. I chose it because it was the easiest to setup and demo. A system that's too complex and ...
[ "deployment", "build-automation" ]
11
9
16,300
20
0
2008-09-19T04:06:42.540000
2008-09-19T04:10:09.350000
99,542
563,136
Point-Triangle Collision Detection in 3D
How do I correct for floating point error in the following physical simulation: Original point (x, y, z), Desired point (x', y', z') after forces are applied. Two triangles (A, B, C) and (B, C, D), who share edge BC I am using this method for collision detection: For each Triangle If the original point is in front of t...
This is an inevitable problem when shooting a single ray against some geometry with edges and vertices. It's amazing how physical simulations seem to seek out the smallest of numerical inaccuracies! Some of the explanations and solutions proposed by other respondents will not work. In particular: Numerical inaccuracy r...
Point-Triangle Collision Detection in 3D How do I correct for floating point error in the following physical simulation: Original point (x, y, z), Desired point (x', y', z') after forces are applied. Two triangles (A, B, C) and (B, C, D), who share edge BC I am using this method for collision detection: For each Triang...
TITLE: Point-Triangle Collision Detection in 3D QUESTION: How do I correct for floating point error in the following physical simulation: Original point (x, y, z), Desired point (x', y', z') after forces are applied. Two triangles (A, B, C) and (B, C, D), who share edge BC I am using this method for collision detectio...
[ "math", "3d", "collision-detection" ]
5
10
7,351
5
0
2008-09-19T04:07:31.523000
2009-02-18T22:27:19.350000
99,548
115,247
Has anybody compared WCF and ZeroC ICE?
ZeroC's ICE (www.zeroc.com) looks interesting and I am interested in looking at it and comparing it to our existing software that uses WCF. In particular, our WCF app uses server callbacks (via HTTP). Anybody who's compared them? How did it go? I'm particularly interested in the performance aspect, since interoperabili...
I did a very terse review of ICE a few years ago, and although I haven't compared them directly before, having reasonable knowledge of WCF my thoughts might have some relevance. Firstly, it's not entierely fair to compare WCF with ICE as WCF as ICE is a specific remote communication mechanism and WCF is a higher level ...
Has anybody compared WCF and ZeroC ICE? ZeroC's ICE (www.zeroc.com) looks interesting and I am interested in looking at it and comparing it to our existing software that uses WCF. In particular, our WCF app uses server callbacks (via HTTP). Anybody who's compared them? How did it go? I'm particularly interested in the ...
TITLE: Has anybody compared WCF and ZeroC ICE? QUESTION: ZeroC's ICE (www.zeroc.com) looks interesting and I am interested in looking at it and comparing it to our existing software that uses WCF. In particular, our WCF app uses server callbacks (via HTTP). Anybody who's compared them? How did it go? I'm particularly ...
[ "wcf", "callback", "ice" ]
17
14
7,673
5
0
2008-09-19T04:08:26.373000
2008-09-22T14:45:24.920000
99,552
99,575
Where do "pure virtual function call" crashes come from?
I sometimes notice programs that crash on my computer with the error: "pure virtual function call". How do these programs even compile when an object cannot be created of an abstract class?
They can result if you try to make a virtual function call from a constructor or destructor. Since you can't make a virtual function call from a constructor or destructor (the derived class object hasn't been constructed or has already been destroyed), it calls the base class version, which in the case of a pure virtua...
Where do "pure virtual function call" crashes come from? I sometimes notice programs that crash on my computer with the error: "pure virtual function call". How do these programs even compile when an object cannot be created of an abstract class?
TITLE: Where do "pure virtual function call" crashes come from? QUESTION: I sometimes notice programs that crash on my computer with the error: "pure virtual function call". How do these programs even compile when an object cannot be created of an abstract class? ANSWER: They can result if you try to make a virtual f...
[ "c++", "polymorphism", "virtual-functions", "pure-virtual" ]
129
127
126,186
8
0
2008-09-19T04:09:28.883000
2008-09-19T04:12:49.747000
99,553
788,676
Can you Distribute a Ruby on Rails Application without Source?
I'm wondering if it's possible to distribute a RoR app for production use without source code? I've seen this post on SO, but my situation is a little different. This would be an app administered by people with some clue, so I'm cool with still requiring an Apache/Mongrel/MySQL setup on the customer end. All I really w...
Your best option right now is to use JRuby. A little bit of background: My company ( BitRock ) works with many proprietary and commercial open source vendors. We help them package their server software, which is typically based on PHP, Java or Ruby together with a web server or application server (Apache, Tomcat), the ...
Can you Distribute a Ruby on Rails Application without Source? I'm wondering if it's possible to distribute a RoR app for production use without source code? I've seen this post on SO, but my situation is a little different. This would be an app administered by people with some clue, so I'm cool with still requiring an...
TITLE: Can you Distribute a Ruby on Rails Application without Source? QUESTION: I'm wondering if it's possible to distribute a RoR app for production use without source code? I've seen this post on SO, but my situation is a little different. This would be an app administered by people with some clue, so I'm cool with ...
[ "ruby-on-rails", "ruby", "encoding", "obfuscation" ]
26
28
9,955
7
0
2008-09-19T04:09:29.413000
2009-04-25T10:42:52.490000
99,557
99,578
Does Ajax detoriate performance?
Does excess use of AJAX affects performance? In context of big size web-applications, how do you handle AJAX requests to control asynchronous requests?
excess use of anything degrades performance; using AJAX where necessary will improve performance, especially if the alternative is a complete full-page round-trip to the server [a 'postback' in asp.net terminology]
Does Ajax detoriate performance? Does excess use of AJAX affects performance? In context of big size web-applications, how do you handle AJAX requests to control asynchronous requests?
TITLE: Does Ajax detoriate performance? QUESTION: Does excess use of AJAX affects performance? In context of big size web-applications, how do you handle AJAX requests to control asynchronous requests? ANSWER: excess use of anything degrades performance; using AJAX where necessary will improve performance, especially...
[ "ajax", "web-applications" ]
2
9
2,756
9
0
2008-09-19T04:10:13.420000
2008-09-19T04:13:31.667000
99,560
99,942
When is it appropriate to use Time#utc in Rails 2.1?
I am working on a Rails application that needs to handle dates and times in users' time zones. We have recently migrated it to Rails 2.1 and added time zone support, but there are numerous situations in which we use Time#utc and then compare against that time. Wouldn't that be the same as comparing against the original...
If you've set: config.time_zone = 'UTC' In your environment.rb (it's there by default), then times will automagically get converted into UTC when ActiveRecord stores them. Then if you set Time.zone (in a before_filter on application.rb is the usual place) to the user's Time Zone, all the times will be automagically con...
When is it appropriate to use Time#utc in Rails 2.1? I am working on a Rails application that needs to handle dates and times in users' time zones. We have recently migrated it to Rails 2.1 and added time zone support, but there are numerous situations in which we use Time#utc and then compare against that time. Wouldn...
TITLE: When is it appropriate to use Time#utc in Rails 2.1? QUESTION: I am working on a Rails application that needs to handle dates and times in users' time zones. We have recently migrated it to Rails 2.1 and added time zone support, but there are numerous situations in which we use Time#utc and then compare against...
[ "ruby-on-rails", "ruby" ]
6
7
836
2
0
2008-09-19T04:10:24.527000
2008-09-19T05:47:23.233000
99,623
99,787
How to draw in the nonclient area?
I'd like to be able to do some drawing to the right of the menu bar, in the nonclient area of a window. Is this possible, using C++ / MFC?
Charlie hit on the answer with WM_NCPAINT. If you're using MFC, the code would look something like this: // in the message map ON_WM_NCPAINT() //... void CMainFrame::OnNcPaint() { // still want the menu to be drawn, so trigger default handler first Default(); // get menu bar bounds MENUBARINFO menuInfo = {sizeof(MEN...
How to draw in the nonclient area? I'd like to be able to do some drawing to the right of the menu bar, in the nonclient area of a window. Is this possible, using C++ / MFC?
TITLE: How to draw in the nonclient area? QUESTION: I'd like to be able to do some drawing to the right of the menu bar, in the nonclient area of a window. Is this possible, using C++ / MFC? ANSWER: Charlie hit on the answer with WM_NCPAINT. If you're using MFC, the code would look something like this: // in the mess...
[ "c++", "mfc", "drawing", "nonclient" ]
9
11
17,827
4
0
2008-09-19T04:23:26.273000
2008-09-19T05:05:33.740000
99,626
105,625
What's the definitive Java Swing starter guide and reference?
Obviously the Java API reference, but what else is there that you all use? I've been doing web development my entire career. Lately I've been messing around a lot with Groovy and I've decided to do a small application in Griffon just to experiment more with Groovy and also break some ground in desktop development. The ...
The Swing Tutorial is very good. Apart from that, the Swing API is obviously the reference, however it's also a treasure trove of fairly good source code! Add the API source to your IDE and you can jump directly to the implementation to all the Swing classes. This is a great way to explore the functionality, see how va...
What's the definitive Java Swing starter guide and reference? Obviously the Java API reference, but what else is there that you all use? I've been doing web development my entire career. Lately I've been messing around a lot with Groovy and I've decided to do a small application in Griffon just to experiment more with ...
TITLE: What's the definitive Java Swing starter guide and reference? QUESTION: Obviously the Java API reference, but what else is there that you all use? I've been doing web development my entire career. Lately I've been messing around a lot with Groovy and I've decided to do a small application in Griffon just to exp...
[ "java", "swing", "groovy", "griffon" ]
8
6
4,379
5
0
2008-09-19T04:24:04.073000
2008-09-19T21:06:08.570000
99,640
100,456
How can I create a Netflix-style iframe overlay without a huge javascript library?
I'm trying to use a link to open an overlay instead of in a separate popup window. This overlay should consist of a semi-transparent div layer that blocks the whole screen from being clicked on. I also aim to disable scrolling at this point. Not matter where you are on the main page, when the link is clicked, the overl...
You might want to check out an old JS lib I wrote, called SubModal. Easy to understand and modify. Go to town;) Once you've modded it, use Minify in combination with gzip on your server. The lib size will be teeny tiny.
How can I create a Netflix-style iframe overlay without a huge javascript library? I'm trying to use a link to open an overlay instead of in a separate popup window. This overlay should consist of a semi-transparent div layer that blocks the whole screen from being clicked on. I also aim to disable scrolling at this po...
TITLE: How can I create a Netflix-style iframe overlay without a huge javascript library? QUESTION: I'm trying to use a link to open an overlay instead of in a separate popup window. This overlay should consist of a semi-transparent div layer that blocks the whole screen from being clicked on. I also aim to disable sc...
[ "javascript", "css", "overlay" ]
2
1
6,980
6
0
2008-09-19T04:27:12.147000
2008-09-19T08:18:06.693000
99,642
99,647
ResourceManager and Unit Testing
I was curious if anyone had any problems creating unit tests around using the ResourceManager. I am using Visual Studio test edition and it appears that the satellite assemblies don't get loaded during the test. When I try to get a resource for another culture, the test always fails and the resource manager always fall...
I've had similar problems in the past with satellite assemblies. Try adding the satellite assemblies to the unit projects dependecies. In Visual Studio Test -- Edit Test Run configuration. Select Deployment and add the files here. On executing all applications, dlls, etc are copied to a special directory. Strong named ...
ResourceManager and Unit Testing I was curious if anyone had any problems creating unit tests around using the ResourceManager. I am using Visual Studio test edition and it appears that the satellite assemblies don't get loaded during the test. When I try to get a resource for another culture, the test always fails and...
TITLE: ResourceManager and Unit Testing QUESTION: I was curious if anyone had any problems creating unit tests around using the ResourceManager. I am using Visual Studio test edition and it appears that the satellite assemblies don't get loaded during the test. When I try to get a resource for another culture, the tes...
[ "c#", "asp.net", "asp.net-mvc", "resources" ]
5
0
2,927
3
0
2008-09-19T04:27:41.990000
2008-09-19T04:30:55.837000
99,651
99,675
Scalable socket event queue processing
My C# class must be able to process a high volume of events received via a tcp stream style socket connection. The volume of event messages received from the tcp server by the class's socket is completely variable. For instance, sometimes it will only receive one event message in a period of ten seconds and at other ti...
I would not call 60 events per second high volume. At that low level of activity any socket processing method at all with be fine. I've handled 5,000 events per second on a single thread using hardware that's much less capable than current machines, just using select. I will say that if you are looking to scale, handin...
Scalable socket event queue processing My C# class must be able to process a high volume of events received via a tcp stream style socket connection. The volume of event messages received from the tcp server by the class's socket is completely variable. For instance, sometimes it will only receive one event message in ...
TITLE: Scalable socket event queue processing QUESTION: My C# class must be able to process a high volume of events received via a tcp stream style socket connection. The volume of event messages received from the tcp server by the class's socket is completely variable. For instance, sometimes it will only receive one...
[ "c#", "sockets", "networking", "tcp", "stream" ]
4
5
1,707
1
0
2008-09-19T04:31:40.343000
2008-09-19T04:38:26.410000
99,683
111,213
Which, and why, do you prefer Exceptions or Return codes?
My question is what do most developers prefer for error handling, Exceptions or Error Return Codes. Please be language(or language family) specific and why you prefer one over the other. I'm asking this out of curiosity. Personally I prefer Error Return Codes since they are less explosive and don't force user code to p...
For some languages (i.e. C++) Resources leak should not be a reason C++ is based on RAII. If you have code that could fail, return or throw (that is, most normal code), then you should have your pointer wrapped inside a smart pointer (assuming you have a very good reason to not have your object created on stack). Retur...
Which, and why, do you prefer Exceptions or Return codes? My question is what do most developers prefer for error handling, Exceptions or Error Return Codes. Please be language(or language family) specific and why you prefer one over the other. I'm asking this out of curiosity. Personally I prefer Error Return Codes si...
TITLE: Which, and why, do you prefer Exceptions or Return codes? QUESTION: My question is what do most developers prefer for error handling, Exceptions or Error Return Codes. Please be language(or language family) specific and why you prefer one over the other. I'm asking this out of curiosity. Personally I prefer Err...
[ "language-agnostic", "exception" ]
106
122
35,866
26
0
2008-09-19T04:43:14.853000
2008-09-21T15:20:36.230000
99,684
99,821
Message passing between objects - How to refer to the target object?
The most basic task in an object oriented environment is executing a method on an object. To do this, you have to have a reference to the object on which you are invoking the method. Is the proper way to establish this reference to pass the object as a parameter to the constructor (or initializer method) of the calling...
Generally dependency injection is the way to go. If you're just talking about two objects communicating then pass an instance of one in as a paramter to the other, as in your first example. Passing in the constructor ensure the reference is always valid. Otherwise you'd have to test to ensure register had been called. ...
Message passing between objects - How to refer to the target object? The most basic task in an object oriented environment is executing a method on an object. To do this, you have to have a reference to the object on which you are invoking the method. Is the proper way to establish this reference to pass the object as ...
TITLE: Message passing between objects - How to refer to the target object? QUESTION: The most basic task in an object oriented environment is executing a method on an object. To do this, you have to have a reference to the object on which you are invoking the method. Is the proper way to establish this reference to p...
[ "oop", "message-passing" ]
2
2
2,545
5
0
2008-09-19T04:43:25.743000
2008-09-19T05:11:55.783000
99,686
99,704
Why do C# and VB have Generics? What benefit do they provide? Generics, FTW
From Wikipedia: Generic programming is a style of computer programming in which algorithms are written in terms of to-be-specified-later types that are then instantiated when needed for specific types provided as parameters and was pioneered by Ada which appeared in 1983. This approach permits writing common functions ...
C# and VB have generics to take advantage of generics support in the underlying CLR (or is the other way around?). They allow you to write code ina statically-typed language that can apply to more than one kind of type without rewriting the code for each type you use them for (the runtime will do that for you) or other...
Why do C# and VB have Generics? What benefit do they provide? Generics, FTW From Wikipedia: Generic programming is a style of computer programming in which algorithms are written in terms of to-be-specified-later types that are then instantiated when needed for specific types provided as parameters and was pioneered by...
TITLE: Why do C# and VB have Generics? What benefit do they provide? Generics, FTW QUESTION: From Wikipedia: Generic programming is a style of computer programming in which algorithms are written in terms of to-be-specified-later types that are then instantiated when needed for specific types provided as parameters an...
[ "c#", ".net", "vb.net", "generics" ]
6
7
2,106
15
0
2008-09-19T04:43:43.683000
2008-09-19T04:47:55.623000
99,688
99,729
Private vs. Public members in practice (how important is encapsulation?)
One of the biggest advantages of object-oriented programming is encapsulation, and one of the "truths" we've (or, at least, I've) been taught is that members should always be made private and made available via accessor and mutator methods, thus ensuring the ability to verify and validate the changes. I'm curious, thou...
It depends. This is one of those issues that must be decided pragmatically. Suppose I had a class for representing a point. I could have getters and setters for the X and Y coordinates, or I could just make them both public and allow free read/write access to the data. In my opinion, this is OK because the class is act...
Private vs. Public members in practice (how important is encapsulation?) One of the biggest advantages of object-oriented programming is encapsulation, and one of the "truths" we've (or, at least, I've) been taught is that members should always be made private and made available via accessor and mutator methods, thus e...
TITLE: Private vs. Public members in practice (how important is encapsulation?) QUESTION: One of the biggest advantages of object-oriented programming is encapsulation, and one of the "truths" we've (or, at least, I've) been taught is that members should always be made private and made available via accessor and mutat...
[ "language-agnostic", "encapsulation" ]
22
16
4,881
22
0
2008-09-19T04:44:32.293000
2008-09-19T04:52:13.147000
99,732
99,744
What is the difference between, IsAssignableFrom and GetInterface?
Using reflection in.Net, what is the differnce between: if (foo.IsAssignableFrom(typeof(IBar))) And if (foo.GetInterface(typeof(IBar).FullName)!= null) Which is more appropriate, why? When could one or the other fail?
If you just want to see if a type implements a given interface, either is fine, though GetInterface() is probably faster since IsAssignableFrom() does more internal checks than GetInterface(). It'll probably even faster to check the results of Type.GetInterfaces() which returns the same internal list that both of the o...
What is the difference between, IsAssignableFrom and GetInterface? Using reflection in.Net, what is the differnce between: if (foo.IsAssignableFrom(typeof(IBar))) And if (foo.GetInterface(typeof(IBar).FullName)!= null) Which is more appropriate, why? When could one or the other fail?
TITLE: What is the difference between, IsAssignableFrom and GetInterface? QUESTION: Using reflection in.Net, what is the differnce between: if (foo.IsAssignableFrom(typeof(IBar))) And if (foo.GetInterface(typeof(IBar).FullName)!= null) Which is more appropriate, why? When could one or the other fail? ANSWER: If you j...
[ "c#", ".net", "reflection" ]
19
14
6,662
2
0
2008-09-19T04:53:39.323000
2008-09-19T04:55:40.223000
99,748
99,786
How important do you think Progressive Enhancement is?
Progressive Enhancement is a web development methodology that not only allows greater portability and accessibility but in my opinion, makes the development process easier. What I want is to know what the rest of the community think of this approach. In particular: What do you believe is the minimum set of technologies...
If it remains usable in a text-only browser (without CSS and Javascript, of course) and also in a screen-reader, you're on the right track. But these are about the highest standards that you'll find:)
How important do you think Progressive Enhancement is? Progressive Enhancement is a web development methodology that not only allows greater portability and accessibility but in my opinion, makes the development process easier. What I want is to know what the rest of the community think of this approach. In particular:...
TITLE: How important do you think Progressive Enhancement is? QUESTION: Progressive Enhancement is a web development methodology that not only allows greater portability and accessibility but in my opinion, makes the development process easier. What I want is to know what the rest of the community think of this approa...
[ "ajax", "unobtrusive-javascript", "graceful-degradation", "progressive-enhancement" ]
4
4
488
5
0
2008-09-19T04:56:52.030000
2008-09-19T05:05:25.223000
99,781
99,810
How can I create a directory listing of a subversion repository
I have a client that is asking me to give them a listing of every file and folder in the source code (and then a brief explanation of the source tree). Is there an easy way to create some sort of decently formatted list like this from a subversion repository?
You'll want the list command. Assuming you're using the command line client svn list -R http://example.com/path/to/repos This will give you a full recursive list of everything that's in the repository. Redirect it to a text file svn list -R http://example.com/path/to/repos > file.txt and then format to your heart's con...
How can I create a directory listing of a subversion repository I have a client that is asking me to give them a listing of every file and folder in the source code (and then a brief explanation of the source tree). Is there an easy way to create some sort of decently formatted list like this from a subversion reposito...
TITLE: How can I create a directory listing of a subversion repository QUESTION: I have a client that is asking me to give them a listing of every file and folder in the source code (and then a brief explanation of the source tree). Is there an easy way to create some sort of decently formatted list like this from a s...
[ "svn" ]
6
9
3,396
6
0
2008-09-19T05:04:28.610000
2008-09-19T05:10:07.490000
99,785
100,019
What JavaScript Repository should I use?
Many languages have standard repositories where people donate useful libraries that they want others to have access to. For instance Perl has CPAN, PHP has PEAR, Ruby has RubyGems, and so on. What is the best option for JavaScript? I ask because a few months ago I ported Statistics::Distributions from Perl to JavaScrip...
AFAIK, there is no central JavaScript repository, but you might have success promoting it on Snipplr or as a project on Google Code.
What JavaScript Repository should I use? Many languages have standard repositories where people donate useful libraries that they want others to have access to. For instance Perl has CPAN, PHP has PEAR, Ruby has RubyGems, and so on. What is the best option for JavaScript? I ask because a few months ago I ported Statist...
TITLE: What JavaScript Repository should I use? QUESTION: Many languages have standard repositories where people donate useful libraries that they want others to have access to. For instance Perl has CPAN, PHP has PEAR, Ruby has RubyGems, and so on. What is the best option for JavaScript? I ask because a few months ag...
[ "javascript", "open-source" ]
7
2
3,970
6
0
2008-09-19T05:05:21.290000
2008-09-19T06:20:09.723000
99,790
100,719
Is it safe to add delegates to events with keyword new?
One thing I am concerned with is that I discovered two ways of registering delegates to events. OnStuff += this.Handle; OnStuff += new StuffEventHandler(this.Handle); The first one is clean, and it makes sense doing "OnStuff -= this.Handle;" to unregister from the event... But with the latter case, should I do "OnStuff...
You don't need to worry about keeping a reference to the originally registered delegate, and you will not start a "nasty memory pool". When you call "OnStuff -= new StuffEventHandler(this.Handle);" the removal code does not compare the delegate you are removing by reference: it checks for equality by comparing referenc...
Is it safe to add delegates to events with keyword new? One thing I am concerned with is that I discovered two ways of registering delegates to events. OnStuff += this.Handle; OnStuff += new StuffEventHandler(this.Handle); The first one is clean, and it makes sense doing "OnStuff -= this.Handle;" to unregister from the...
TITLE: Is it safe to add delegates to events with keyword new? QUESTION: One thing I am concerned with is that I discovered two ways of registering delegates to events. OnStuff += this.Handle; OnStuff += new StuffEventHandler(this.Handle); The first one is clean, and it makes sense doing "OnStuff -= this.Handle;" to u...
[ "c#", ".net", "events", "delegates" ]
6
6
632
4
0
2008-09-19T05:06:30.743000
2008-09-19T09:26:25.877000
99,796
100,873
When to use Binary Space Partitioning, Quadtree, Octree?
I have recently learned about binary space partitioning trees and their application to 3d graphics and collision detection. I have also briefly perused material relating to quadtrees and octrees. When would you use quadtrees over bsp trees, or vice versa? Are they interchangeable? I would be satisfied if I had enough i...
There is no clear answer to your question. It depends entirely how your data is organized. Something to keep in mind: Quadtrees work best for data that is mostly two dimensional like map-rendering in navigation systems. In this case it's faster than octrees because it adapts better to the geometry and keeps the node-st...
When to use Binary Space Partitioning, Quadtree, Octree? I have recently learned about binary space partitioning trees and their application to 3d graphics and collision detection. I have also briefly perused material relating to quadtrees and octrees. When would you use quadtrees over bsp trees, or vice versa? Are the...
TITLE: When to use Binary Space Partitioning, Quadtree, Octree? QUESTION: I have recently learned about binary space partitioning trees and their application to 3d graphics and collision detection. I have also briefly perused material relating to quadtrees and octrees. When would you use quadtrees over bsp trees, or v...
[ "3d", "tree", "quadtree", "octree", "space-partitioning" ]
86
79
49,523
8
0
2008-09-19T05:08:25.170000
2008-09-19T10:07:04.623000
99,802
99,851
Convert/extract phpinfo() into php.ini
I am thinking along the lines of replicating a web hosts PHP setup environment for offline local development. The idea is to parse the output of phpinfo() and write any setup values it contains into a local php.ini. I would imagine everything ism included in phpinfo and that certain things would only be specific to the...
You will probably get more usable results from ini_get_all() http://us.php.net/manual/en/function.ini-get-all.php You could then traverse the associated array to reconstruct an ini file without the hassle of interpreting the output of phpinfo()
Convert/extract phpinfo() into php.ini I am thinking along the lines of replicating a web hosts PHP setup environment for offline local development. The idea is to parse the output of phpinfo() and write any setup values it contains into a local php.ini. I would imagine everything ism included in phpinfo and that certa...
TITLE: Convert/extract phpinfo() into php.ini QUESTION: I am thinking along the lines of replicating a web hosts PHP setup environment for offline local development. The idea is to parse the output of phpinfo() and write any setup values it contains into a local php.ini. I would imagine everything ism included in phpi...
[ "php" ]
4
4
3,260
2
0
2008-09-19T05:09:25.977000
2008-09-19T05:20:36.997000
99,807
99,967
What are some useful TextMate shortcuts?
Macs are renowned (or bemoaned) for having an extensive number of shortcuts. However, OS X itself pales in comparison to the shortcut lists in TextMate and its bundles. What are some useful keyboard shortcuts you use?
These are my favorite shortcuts: cmd + t Start typing name of a file to open it ctrl + w Select word cmd + r Run the ruby or php-script that is open cmd + opt + m Define a new macro cmd + shift + m Run the macro opt Switch to vertical selection mode cmd + opt + a Edit ends of selected lines
What are some useful TextMate shortcuts? Macs are renowned (or bemoaned) for having an extensive number of shortcuts. However, OS X itself pales in comparison to the shortcut lists in TextMate and its bundles. What are some useful keyboard shortcuts you use?
TITLE: What are some useful TextMate shortcuts? QUESTION: Macs are renowned (or bemoaned) for having an extensive number of shortcuts. However, OS X itself pales in comparison to the shortcut lists in TextMate and its bundles. What are some useful keyboard shortcuts you use? ANSWER: These are my favorite shortcuts: c...
[ "macos", "keyboard-shortcuts", "textmate", "textmatebundles" ]
43
42
22,400
30
0
2008-09-19T05:10:00.813000
2008-09-19T05:54:01.207000
99,827
103,483
Attaching an ID/Label to LINQ to SQL generated code?
I'm interested in tracing database calls made by LINQ to SQL back to the.NET code that generated the call. For instance, a DBA might have a concern that a particular cached execution plan is doing poorly. If for example a DBA were to tell a developer to address the following code... exec sp_executesql N'SELECT [t0].[Cu...
There is no public way to modify the underlying SQL that LINQ to SQL generates to implement such a tagging facility. You could implement the Log property in such a way it writes out a text log file with some call stack information to show which methods generated which SQL statements for reference.
Attaching an ID/Label to LINQ to SQL generated code? I'm interested in tracing database calls made by LINQ to SQL back to the.NET code that generated the call. For instance, a DBA might have a concern that a particular cached execution plan is doing poorly. If for example a DBA were to tell a developer to address the f...
TITLE: Attaching an ID/Label to LINQ to SQL generated code? QUESTION: I'm interested in tracing database calls made by LINQ to SQL back to the.NET code that generated the call. For instance, a DBA might have a concern that a particular cached execution plan is doing poorly. If for example a DBA were to tell a develope...
[ "sql-server", "linq-to-sql" ]
0
1
353
2
0
2008-09-19T05:12:54.270000
2008-09-19T16:30:00.090000
99,866
99,977
Biggest GWT Pitfalls?
I'm at the beginning/middle of a project that we chose to implement using GWT. Has anyone encountered any major pitfalls in using GWT (and GWT-EXT) that were unable to be overcome? How about from a performance perspective? A couple things that we've seen/heard already include: Google not being able to index content CSS...
I'll start by saying that I'm a massive GWT fan, but yes there are many pitfalls, but most if not all we were able to overcome: Problem: Long compile times, as your project grows so does the amount of time it takes to compile it. I've heard of reports of 20 minute compiles, but mine are on average about 1 minute. Solut...
Biggest GWT Pitfalls? I'm at the beginning/middle of a project that we chose to implement using GWT. Has anyone encountered any major pitfalls in using GWT (and GWT-EXT) that were unable to be overcome? How about from a performance perspective? A couple things that we've seen/heard already include: Google not being abl...
TITLE: Biggest GWT Pitfalls? QUESTION: I'm at the beginning/middle of a project that we chose to implement using GWT. Has anyone encountered any major pitfalls in using GWT (and GWT-EXT) that were unable to be overcome? How about from a performance perspective? A couple things that we've seen/heard already include: Go...
[ "java", "ajax", "gwt", "gwt-ext" ]
190
232
31,024
24
0
2008-09-19T05:23:57.597000
2008-09-19T05:59:45.217000
99,876
99,965
Selenium Critique
I just wanted some opinions from people that have run Selenium ( http://selenium.openqa.org ) I have had a lot of experience with WaTiN and even wrote a recording suite for it. I had it producing some well-structured code but being only maintained by me it seems my company all but abandoned it. If you have run selenium...
If you are using Selenium IDE to generate code, then you just get a list of every action that selenium will execute. To me, Selenium IDE is a good way to start or do a fast "try and see" test. But, when you think about maintainability and more readable code, you must write your own code. A good way to achieve good sele...
Selenium Critique I just wanted some opinions from people that have run Selenium ( http://selenium.openqa.org ) I have had a lot of experience with WaTiN and even wrote a recording suite for it. I had it producing some well-structured code but being only maintained by me it seems my company all but abandoned it. If you...
TITLE: Selenium Critique QUESTION: I just wanted some opinions from people that have run Selenium ( http://selenium.openqa.org ) I have had a lot of experience with WaTiN and even wrote a recording suite for it. I had it producing some well-structured code but being only maintained by me it seems my company all but ab...
[ "unit-testing", "selenium", "automated-tests", "ui-testing" ]
16
27
3,703
5
0
2008-09-19T05:29:11.030000
2008-09-19T05:53:30.800000
99,880
114,949
Generating a unique machine id
I need to write a function that generates an id that is unique for a given machine running a Windows OS. Currently, I'm using WMI to query various hardware parameters and concatenate them together and hash them to derive the unique id. My question is, what are the suggested parameters I should use? Currently, I'm using...
Parse the SMBIOS yourself and hash it to an arbitrary length. See the PDF specification for all SMBIOS structures available. To query the SMBIOS info from Windows you could use EnumSystemFirmwareEntries, EnumSystemFirmwareTables and GetSystemFirmwareTable. IIRC, the "unique id" from the CPUID instruction is deprecated ...
Generating a unique machine id I need to write a function that generates an id that is unique for a given machine running a Windows OS. Currently, I'm using WMI to query various hardware parameters and concatenate them together and hash them to derive the unique id. My question is, what are the suggested parameters I s...
TITLE: Generating a unique machine id QUESTION: I need to write a function that generates an id that is unique for a given machine running a Windows OS. Currently, I'm using WMI to query various hardware parameters and concatenate them together and hash them to derive the unique id. My question is, what are the sugges...
[ "windows", "winapi", "wmi", "uniqueidentifier" ]
113
27
119,474
13
0
2008-09-19T05:30:03.603000
2008-09-22T13:48:52.980000
99,906
99,948
Count image similarity on GPU [OpenGL/OcclusionQuery]
OpenGL. Let's say I've drawn one image and then the second one using XOR. Now I've got black buffer with non-black pixels somewhere, I've read that I can use shaders to count black [ rgb(0,0,0) ] pixels ON GPU? I've also read that it has to do something with OcclusionQuery. http://oss.sgi.com/projects/ogl-sample/regist...
I'm not sure how you do the XOR bit (at least it should be slow; I don't think any of current GPUs accelerate that), but here's my idea: have two input images turn on occlusion query. draw the two images to the screen (i.e. full screen quad with two textures set up), with a fragment shader that computes abs(texel1-texe...
Count image similarity on GPU [OpenGL/OcclusionQuery] OpenGL. Let's say I've drawn one image and then the second one using XOR. Now I've got black buffer with non-black pixels somewhere, I've read that I can use shaders to count black [ rgb(0,0,0) ] pixels ON GPU? I've also read that it has to do something with Occlusi...
TITLE: Count image similarity on GPU [OpenGL/OcclusionQuery] QUESTION: OpenGL. Let's say I've drawn one image and then the second one using XOR. Now I've got black buffer with non-black pixels somewhere, I've read that I can use shaders to count black [ rgb(0,0,0) ] pixels ON GPU? I've also read that it has to do some...
[ "opengl", "shader", "pyopengl", "occlusion" ]
2
2
1,647
1
0
2008-09-19T05:36:09.097000
2008-09-19T05:49:11.013000
99,927
101,089
OO Javascript : Definitive explanation of variable scope
Can someone provide an explanation of variable scope in JS as it applies to objects, functions and closures?
Global variables Every variable in Javascript is a named attribute of an object. For example:- var x = 1; x is added to the global object. The global object is provided by the script context and may already have a set of attributes. For example in a browser the global object is window. An equivalent to the above line i...
OO Javascript : Definitive explanation of variable scope Can someone provide an explanation of variable scope in JS as it applies to objects, functions and closures?
TITLE: OO Javascript : Definitive explanation of variable scope QUESTION: Can someone provide an explanation of variable scope in JS as it applies to objects, functions and closures? ANSWER: Global variables Every variable in Javascript is a named attribute of an object. For example:- var x = 1; x is added to the glo...
[ "javascript", "oop" ]
19
35
3,478
3
0
2008-09-19T05:40:28.413000
2008-09-19T10:57:50.103000
99,934
99,952
General Binary Data Viewer for Windows Vista
I'm looking for recommendations for a good program for 32-bit Windows Vista that will load any arbitrary binary file and display textual information or graphical visualization relevant to identifying what actual data the bits are supposed to represent. Is ther anything better than a hex editor for this kind of thing? O...
Try HxD: HxD is a carefully designed and fast hex editor which, additionally to raw disk editing and modifying of main memory (RAM), handles files of any size. The easy to use interface offers features such as searching and replacing, exporting, checksums/digests, insertion of byte patterns, a file shredder, concatenat...
General Binary Data Viewer for Windows Vista I'm looking for recommendations for a good program for 32-bit Windows Vista that will load any arbitrary binary file and display textual information or graphical visualization relevant to identifying what actual data the bits are supposed to represent. Is ther anything bette...
TITLE: General Binary Data Viewer for Windows Vista QUESTION: I'm looking for recommendations for a good program for 32-bit Windows Vista that will load any arbitrary binary file and display textual information or graphical visualization relevant to identifying what actual data the bits are supposed to represent. Is t...
[ "file-format", "devtools", "hex-editors" ]
2
15
5,764
8
0
2008-09-19T05:43:53.447000
2008-09-19T05:50:18.377000
99,980
148,171
What tools do you use to implement SOA/Messaging?
NServiceBus and MassTransit are two tools that can be used to implement messaging with MSMQ and other message queues. I find that once you start using messaging to have applications talk to each other, you don't really want to go back to the old RPC style. My question is, what other tools are out there? What tools do y...
Apache ActiveMQ is probably the most popular and powerful open source message broker out there with the most active open source community behind it as well as commercial support, training and tooling if you need it. One of the more interesting aspects of ActiveMQ is its wide support for a large number of different lang...
What tools do you use to implement SOA/Messaging? NServiceBus and MassTransit are two tools that can be used to implement messaging with MSMQ and other message queues. I find that once you start using messaging to have applications talk to each other, you don't really want to go back to the old RPC style. My question i...
TITLE: What tools do you use to implement SOA/Messaging? QUESTION: NServiceBus and MassTransit are two tools that can be used to implement messaging with MSMQ and other message queues. I find that once you start using messaging to have applications talk to each other, you don't really want to go back to the old RPC st...
[ "soa", "nservicebus", "masstransit" ]
1
3
1,687
7
0
2008-09-19T06:01:57.990000
2008-09-29T10:13:36.830000
99,999
100,060
Self validating binaries?
My question is pretty straightforward: You are an executable file that outputs "Access granted" or "Access denied" and evil persons try to understand your algorithm or patch your innards in order to make you say "Access granted" all the time. After this introduction, you might be heavily wondering what I am doing. Is h...
You're getting into "Anti-reversing techniques". And it's an art basically. Worse is that even if you stomp newbies, there are "anti-anti reversing plugins" for olly and IDA Pro that they can download and bypass much of your countermeasures. Counter measures include debugger detection by trap Debugger APIs, or detectin...
Self validating binaries? My question is pretty straightforward: You are an executable file that outputs "Access granted" or "Access denied" and evil persons try to understand your algorithm or patch your innards in order to make you say "Access granted" all the time. After this introduction, you might be heavily wonde...
TITLE: Self validating binaries? QUESTION: My question is pretty straightforward: You are an executable file that outputs "Access granted" or "Access denied" and evil persons try to understand your algorithm or patch your innards in order to make you say "Access granted" all the time. After this introduction, you migh...
[ "security", "binary" ]
9
6
1,335
6
0
2008-09-19T06:09:01.763000
2008-09-19T06:33:15.107000
100,003
100,146
What are metaclasses in Python?
What are metaclasses? What are they used for?
A metaclass is the class of a class. A class defines how an instance of the class (i.e. an object) behaves while a metaclass defines how a class behaves. A class is an instance of a metaclass. While in Python you can use arbitrary callables for metaclasses (like Jerub shows), the better approach is to make it an actual...
What are metaclasses in Python? What are metaclasses? What are they used for?
TITLE: What are metaclasses in Python? QUESTION: What are metaclasses? What are they used for? ANSWER: A metaclass is the class of a class. A class defines how an instance of the class (i.e. an object) behaves while a metaclass defines how a class behaves. A class is an instance of a metaclass. While in Python you ca...
[ "python", "oop", "metaclass", "python-class", "python-datamodel" ]
7,368
3,429
1,166,115
25
0
2008-09-19T06:10:46.830000
2008-09-19T07:01:58.623000
100,007
100,961
Logging Application Block - Logging the caller
When logging with Log4Net it's very easy to put class that called the log into the log file. I've found in the past that this makes it very easy to trace through the code and see the flow through the classes. In Log4Net I use the %logger property in the conversion pattern like so: And this gives me the output I want: 2...
Add the calling method to the LogEntry's ExtendedProperties dictionary; assuming you haven't removed the ExtendedProperties tokens from the formatter template, of course. Put something like this in a logging wrapper: public void LogSomething(string msg) { LogEntry le = new LogEntry { Message = msg }; le.ExtendedPropert...
Logging Application Block - Logging the caller When logging with Log4Net it's very easy to put class that called the log into the log file. I've found in the past that this makes it very easy to trace through the code and see the flow through the classes. In Log4Net I use the %logger property in the conversion pattern ...
TITLE: Logging Application Block - Logging the caller QUESTION: When logging with Log4Net it's very easy to put class that called the log into the log file. I've found in the past that this makes it very easy to trace through the code and see the flow through the classes. In Log4Net I use the %logger property in the c...
[ "c#", "logging", "enterprise-library", "application-blocks" ]
2
5
1,927
2
0
2008-09-19T06:12:37.777000
2008-09-19T10:24:25.330000
100,045
100,066
Regular expressions in C# for file name validation
What is a good regular expression that can validate a text string to make sure it is a valid Windows filename? (AKA not have \/:*?"<>| characters). I'd like to use it like the following: // Return true if string is invalid. if (Regex.IsMatch(szFileName, " ")) { // Tell user to reformat their filename. }
As answered already, GetInvalidFileNameChars should do it for you, and you don't even need the overhead of regular expressions: if (proposedFilename.IndexOfAny(System.IO.Path.GetInvalidFileNameChars())!= -1) { MessageBox.Show("The filename is invalid"); return; }
Regular expressions in C# for file name validation What is a good regular expression that can validate a text string to make sure it is a valid Windows filename? (AKA not have \/:*?"<>| characters). I'd like to use it like the following: // Return true if string is invalid. if (Regex.IsMatch(szFileName, " ")) { // Tell...
TITLE: Regular expressions in C# for file name validation QUESTION: What is a good regular expression that can validate a text string to make sure it is a valid Windows filename? (AKA not have \/:*?"<>| characters). I'd like to use it like the following: // Return true if string is invalid. if (Regex.IsMatch(szFileNam...
[ "c#", "regex" ]
19
50
37,573
4
0
2008-09-19T06:28:45.677000
2008-09-19T06:34:58.377000
100,048
100,109
I need to join two lists, sort them and remove duplicates. Is there a better way to do this?
I have two unsorted lists and I need to produce another list which is sorted and where all the elements are unique. The elements can occur multiple times in both lists and they are originally unsorted. My function looks like this: (defun merge-lists (list-a list-b sort-fn) "Merges two lists of (x, y) coordinates sortin...
Our neighbourhood friendly Lisp guru pointed out the remove-duplicates function. He also provided the following snippet: (defun merge-lists (list-a list-b sort-fn test-fn) (sort (remove-duplicates (append list-a list-b):test test-fn) sort-fn))
I need to join two lists, sort them and remove duplicates. Is there a better way to do this? I have two unsorted lists and I need to produce another list which is sorted and where all the elements are unique. The elements can occur multiple times in both lists and they are originally unsorted. My function looks like th...
TITLE: I need to join two lists, sort them and remove duplicates. Is there a better way to do this? QUESTION: I have two unsorted lists and I need to produce another list which is sorted and where all the elements are unique. The elements can occur multiple times in both lists and they are originally unsorted. My func...
[ "algorithm", "sorting", "lisp", "list" ]
6
11
3,616
6
0
2008-09-19T06:29:18.797000
2008-09-19T06:49:24.113000
100,068
100,496
LINQ to SQL insert-if-non-existent
I'd like to know if there's an easier way to insert a record if it doesn't already exist in a table. I'm still trying to build my LINQ to SQL skills. Here's what I've got, but it seems like there should be an easier way. public static TEntity InsertIfNotExists ( DataContext db, Table table, Func where, TEntity record )...
public static void InsertIfNotExists (this Table table, TEntity entity, Expression > predicate) where TEntity: class { if (!table.Any(predicate)) { table.InsertOnSubmit(record); table.Context.SubmitChanges(); } } table.InsertIfNotExists(entity, e=>e.BooleanProperty);
LINQ to SQL insert-if-non-existent I'd like to know if there's an easier way to insert a record if it doesn't already exist in a table. I'm still trying to build my LINQ to SQL skills. Here's what I've got, but it seems like there should be an easier way. public static TEntity InsertIfNotExists ( DataContext db, Table ...
TITLE: LINQ to SQL insert-if-non-existent QUESTION: I'd like to know if there's an easier way to insert a record if it doesn't already exist in a table. I'm still trying to build my LINQ to SQL skills. Here's what I've got, but it seems like there should be an easier way. public static TEntity InsertIfNotExists ( Data...
[ "c#", "linq-to-sql" ]
12
14
22,729
4
0
2008-09-19T06:35:08.330000
2008-09-19T08:30:35.650000
100,074
101,560
Winsock - 10038 Error - Win2K3 Server - baffling behaviour
Attempt to send a message through a socket failed with WinSock error 10038. After around 40 seconds, messages are received successfully from the same socket and subsequently the send() is also succeeding in the same socket. This behaviour has been witnessed in Windows Server 2003. Is this any known behaviour with WinSo...
Winsock error 10038 means "An operation was attempted on something that is not a socket". Little trick to find info about error codes (usefull for all sorts of windows error codes): Open a command prompt Type "net helpmsg 10038" What language is your application written in? If it's C/C++, could it be that you are using...
Winsock - 10038 Error - Win2K3 Server - baffling behaviour Attempt to send a message through a socket failed with WinSock error 10038. After around 40 seconds, messages are received successfully from the same socket and subsequently the send() is also succeeding in the same socket. This behaviour has been witnessed in ...
TITLE: Winsock - 10038 Error - Win2K3 Server - baffling behaviour QUESTION: Attempt to send a message through a socket failed with WinSock error 10038. After around 40 seconds, messages are received successfully from the same socket and subsequently the send() is also succeeding in the same socket. This behaviour has ...
[ "windows-server-2003", "winsock" ]
0
4
13,119
3
0
2008-09-19T06:37:32.490000
2008-09-19T12:46:49.627000
100,104
262,839
How to have silverlight get its data from MySQL
I've written a small hello world test app in Silverlight which i want to host on a Linux/Apache2 server. I want the data to come from MySQL (or some other linux compatible db) so that I can databind to things in the db. I've managed to get it working by using the MySQL Connector/.NET: MySqlConnection conn = new MySqlCo...
The easiest way to do what you want (having read through your edits now:)) will be to expose services that can be consumed. The pattern that Microsoft is REALLY pushing right now is to expose WCF services, but the truth is that your Silverlight client can use WCF to consume a lot of different types of services. What ma...
How to have silverlight get its data from MySQL I've written a small hello world test app in Silverlight which i want to host on a Linux/Apache2 server. I want the data to come from MySQL (or some other linux compatible db) so that I can databind to things in the db. I've managed to get it working by using the MySQL Co...
TITLE: How to have silverlight get its data from MySQL QUESTION: I've written a small hello world test app in Silverlight which i want to host on a Linux/Apache2 server. I want the data to come from MySQL (or some other linux compatible db) so that I can databind to things in the db. I've managed to get it working by ...
[ "c#", ".net", "mysql", "silverlight", "data-binding" ]
1
4
24,238
6
0
2008-09-19T06:48:44.617000
2008-11-04T18:26:40.037000
100,106
147,456
Obfuscation Puzzle: Can you figure out what this Perl function does?
sub foo {[$#{$_[!$||$|]}*@{$_[!!$_^!$_]}?@{$_[!$..!!$.]}[$_[@--@+]% @{$_[$==~/(?=)//!$`]}..$#{$_[$??!!$?:!$?]},($)?!$):!!$))..$_[$--$-]%@{ $_[$]/$]]}-(!!$++!$+)]:@{$_[!!$^^^!$^^]}]} update: I thought the word "puzzle" would imply this, but: I know what it does - I wrote it. If the puzzle doesn't interest you, please do...
Here is how you figure out how to de-obfuscate this subroutine. Sorry for the length First let's tidy up the code, and add useful comments. sub foo { [ ( # ($#{$_[1]}) $#{ $_[! ( $| | $| ) # $OUTPUT_AUTOFLUSH === $| # $| is usually 0 #! ( $| | $| ) #! ( 0 | 0 ) #! ( 0 ) # 1 ] } * # @{$_[1]} @{ $_[!!$_ ^!$_ #!! 1 ^! ...
Obfuscation Puzzle: Can you figure out what this Perl function does? sub foo {[$#{$_[!$||$|]}*@{$_[!!$_^!$_]}?@{$_[!$..!!$.]}[$_[@--@+]% @{$_[$==~/(?=)//!$`]}..$#{$_[$??!!$?:!$?]},($)?!$):!!$))..$_[$--$-]%@{ $_[$]/$]]}-(!!$++!$+)]:@{$_[!!$^^^!$^^]}]} update: I thought the word "puzzle" would imply this, but: I know wha...
TITLE: Obfuscation Puzzle: Can you figure out what this Perl function does? QUESTION: sub foo {[$#{$_[!$||$|]}*@{$_[!!$_^!$_]}?@{$_[!$..!!$.]}[$_[@--@+]% @{$_[$==~/(?=)//!$`]}..$#{$_[$??!!$?:!$?]},($)?!$):!!$))..$_[$--$-]%@{ $_[$]/$]]}-(!!$++!$+)]:@{$_[!!$^^^!$^^]}]} update: I thought the word "puzzle" would imply thi...
[ "perl", "obfuscation", "puzzle" ]
5
19
1,545
3
0
2008-09-19T06:49:14.427000
2008-09-29T03:56:15.923000
100,107
2,518,002
Causes of getting a java.lang.VerifyError
I'm investigating the following java.lang.VerifyError: java.lang.VerifyError: (class: be/post/ehr/wfm/application/serviceorganization/report/DisplayReportServlet, method: getMonthData signature: (IILjava/util/Collection;Ljava/util/Collection;Ljava/util/HashMap;Ljava/util/Collection;Ljava/util/Locale;Lorg/apache/struts/...
java.lang.VerifyError can be the result when you have compiled against a different library than you are using at runtime. For example, this happened to me when trying to run a program that was compiled against Xerces 1, but Xerces 2 was found on the classpath. The required classes (in org.apache.* namespace) were found...
Causes of getting a java.lang.VerifyError I'm investigating the following java.lang.VerifyError: java.lang.VerifyError: (class: be/post/ehr/wfm/application/serviceorganization/report/DisplayReportServlet, method: getMonthData signature: (IILjava/util/Collection;Ljava/util/Collection;Ljava/util/HashMap;Ljava/util/Collec...
TITLE: Causes of getting a java.lang.VerifyError QUESTION: I'm investigating the following java.lang.VerifyError: java.lang.VerifyError: (class: be/post/ehr/wfm/application/serviceorganization/report/DisplayReportServlet, method: getMonthData signature: (IILjava/util/Collection;Ljava/util/Collection;Ljava/util/HashMap...
[ "java", "exception", "deployment", "runtime-error", "verifyerror" ]
206
203
331,231
27
0
2008-09-19T06:49:17.813000
2010-03-25T17:40:48.603000
100,123
100,138
Application wide keyboard shortcut - Java Swing
I would like to create an application wide keyboard shortcut for a Java Swing application. Looping over all components and adding the shortcut on each, has focus related side effects, and seems like a brute force solution. Anyone has a cleaner solution?
Install a custom KeyEventDispatcher. The KeyboardFocusManager class is also a good place for this functionality. KeyEventDispatcher
Application wide keyboard shortcut - Java Swing I would like to create an application wide keyboard shortcut for a Java Swing application. Looping over all components and adding the shortcut on each, has focus related side effects, and seems like a brute force solution. Anyone has a cleaner solution?
TITLE: Application wide keyboard shortcut - Java Swing QUESTION: I would like to create an application wide keyboard shortcut for a Java Swing application. Looping over all components and adding the shortcut on each, has focus related side effects, and seems like a brute force solution. Anyone has a cleaner solution? ...
[ "java", "swing", "shortcut", "keystroke" ]
34
21
35,547
6
0
2008-09-19T06:54:03.887000
2008-09-19T06:58:36.543000
100,170
100,200
Is there a way to check if there are symbolic links pointing to a directory?
I have a folder on my server to which I had a number of symbolic links pointing. I've since created a new folder and I want to change all those symbolic links to point to the new folder. I'd considered replacing the original folder with a symlink to the new folder, but it seems that if I continued with that practice it...
I'd use the find command. find. -lname /particular/folder That will recursively search the current directory for symlinks to /particular/folder. Note that it will only find absolute symlinks. A similar command can be used to search for all symlinks pointing at objects called "folder": find. -lname '*folder' From there ...
Is there a way to check if there are symbolic links pointing to a directory? I have a folder on my server to which I had a number of symbolic links pointing. I've since created a new folder and I want to change all those symbolic links to point to the new folder. I'd considered replacing the original folder with a syml...
TITLE: Is there a way to check if there are symbolic links pointing to a directory? QUESTION: I have a folder on my server to which I had a number of symbolic links pointing. I've since created a new folder and I want to change all those symbolic links to point to the new folder. I'd considered replacing the original ...
[ "linux", "symlink" ]
76
94
75,079
9
0
2008-09-19T07:08:42.447000
2008-09-19T07:15:09.810000
100,174
100,213
What tool/format do you use for writing your specifications?
I would like to know what kind of tool you use for writing your specifications. I think it's essential to use a tool that supports some kind of plain text format so that one can control the specification with a source control system like SVN. For the specification as for the code as well, it's important to have a histo...
DocBook edited with XXE, translated to pdf with xslt when needed to be sent to clients. Best change ever, so much easier to write, so much easier to merge, and when it's converted it doesn't look so godawfully unprofessional as MSWord. Plus the structured document style is already there, unlike bloody word which you ha...
What tool/format do you use for writing your specifications? I would like to know what kind of tool you use for writing your specifications. I think it's essential to use a tool that supports some kind of plain text format so that one can control the specification with a source control system like SVN. For the specific...
TITLE: What tool/format do you use for writing your specifications? QUESTION: I would like to know what kind of tool you use for writing your specifications. I think it's essential to use a tool that supports some kind of plain text format so that one can control the specification with a source control system like SVN...
[ "specifications" ]
6
4
1,451
6
0
2008-09-19T07:09:48.683000
2008-09-19T07:19:51.233000
100,187
100,274
Adding a classic ASP webapplication to VS 2008
is there a way to add an existing classic ASP webapp into a solution in VS? The application is around 4000 files large and currently maintained outisde Visual Studio.
You can't do this with Visual Studio 2008 out of the box, but you can if you install Service Pack 1 - see S cott Guthrie's blog post for more info. Edit: To clarify, whilst you can create a project out of the box, there is no intellisense or debugging unless you install SP1
Adding a classic ASP webapplication to VS 2008 is there a way to add an existing classic ASP webapp into a solution in VS? The application is around 4000 files large and currently maintained outisde Visual Studio.
TITLE: Adding a classic ASP webapplication to VS 2008 QUESTION: is there a way to add an existing classic ASP webapp into a solution in VS? The application is around 4000 files large and currently maintained outisde Visual Studio. ANSWER: You can't do this with Visual Studio 2008 out of the box, but you can if you in...
[ "visual-studio-2008", "asp-classic", "solution" ]
2
1
2,820
3
0
2008-09-19T07:13:32.717000
2008-09-19T07:34:52.897000
100,196
100,206
.NET List<T> Concat vs AddRange
What is the difference between the AddRange and Concat functions on a generic List? Is one recommended over the other?
They have totally different semantics. AddRange modifies the list by adding the other items to it. Concat returns a new sequence containing the list and the other items, without modifying the list. Choose whichever one has the semantics you want.
.NET List<T> Concat vs AddRange What is the difference between the AddRange and Concat functions on a generic List? Is one recommended over the other?
TITLE: .NET List<T> Concat vs AddRange QUESTION: What is the difference between the AddRange and Concat functions on a generic List? Is one recommended over the other? ANSWER: They have totally different semantics. AddRange modifies the list by adding the other items to it. Concat returns a new sequence containing th...
[ ".net", "linq", "list", "extension-methods" ]
124
151
62,421
3
0
2008-09-19T07:14:48.640000
2008-09-19T07:17:46.153000
100,209
202,158
How can I do offline reasoning with Pellet?
I have an OWL ontology and I am using Pellet to do reasoning over it. Like most ontologies it starts by including various standard ontologies: I know that some reasoners have these standard ontologies 'built-in', but Pellet doesn't. Is there any way I can continue to use Pellet when I am offline & can't access them? (O...
Pellet recognizes all of these namespaces when loading and should not attempt to dereference the URIs. If it does, it suggests the application using Pellet is doing something incorrectly. You may find more help on the pellet-users mailing list.
How can I do offline reasoning with Pellet? I have an OWL ontology and I am using Pellet to do reasoning over it. Like most ontologies it starts by including various standard ontologies: I know that some reasoners have these standard ontologies 'built-in', but Pellet doesn't. Is there any way I can continue to use Pell...
TITLE: How can I do offline reasoning with Pellet? QUESTION: I have an OWL ontology and I am using Pellet to do reasoning over it. Like most ontologies it starts by including various standard ontologies: I know that some reasoners have these standard ontologies 'built-in', but Pellet doesn't. Is there any way I can co...
[ "semantic-web", "owl", "rdfs", "pellet", "semweb" ]
2
3
422
3
0
2008-09-19T07:19:22.343000
2008-10-14T17:55:33.850000
100,210
100,345
What is the standard way to add N seconds to datetime.time in Python?
Given a datetime.time value in Python, is there a standard way to add an integer number of seconds to it, so that 11:34:59 + 3 = 11:35:02, for example? These obvious ideas don't work: >>> datetime.time(11, 34, 59) + 3 TypeError: unsupported operand type(s) for +: 'datetime.time' and 'int' >>> datetime.time(11, 34, 59) ...
You can use full datetime variables with timedelta, and by providing a dummy date then using time to just get the time value. For example: import datetime a = datetime.datetime(100,1,1,11,34,59) b = a + datetime.timedelta(0,3) # days, seconds, then other fields. print(a.time()) print(b.time()) results in the two values...
What is the standard way to add N seconds to datetime.time in Python? Given a datetime.time value in Python, is there a standard way to add an integer number of seconds to it, so that 11:34:59 + 3 = 11:35:02, for example? These obvious ideas don't work: >>> datetime.time(11, 34, 59) + 3 TypeError: unsupported operand t...
TITLE: What is the standard way to add N seconds to datetime.time in Python? QUESTION: Given a datetime.time value in Python, is there a standard way to add an integer number of seconds to it, so that 11:34:59 + 3 = 11:35:02, for example? These obvious ideas don't work: >>> datetime.time(11, 34, 59) + 3 TypeError: uns...
[ "python", "datetime", "time", "math" ]
532
716
561,234
11
0
2008-09-19T07:19:36.320000
2008-09-19T07:54:39.683000
100,211
100,396
How to retrieve params from GET HTTP method using javax.ws.rs.* and Glassfish?
I just installed Glassfish V2 on my local machine just to play around with it. I was wondering if there is a way to retrieve a param passed in by the GET HTTP method. For instance, http://localhost:8080/HelloWorld/resources/helloWorld?name=ABC How do I retrieve the "name" param in my Java code?
Like this: @Path("/helloWorld") @Consumes({"application/xml", "application/json"}) @Produces({"application/xml", "application/json"}) @Singleton public class MyService { @GET public String getRequest(@QueryParam("name") String name) { return "Name was " + name; } }
How to retrieve params from GET HTTP method using javax.ws.rs.* and Glassfish? I just installed Glassfish V2 on my local machine just to play around with it. I was wondering if there is a way to retrieve a param passed in by the GET HTTP method. For instance, http://localhost:8080/HelloWorld/resources/helloWorld?name=A...
TITLE: How to retrieve params from GET HTTP method using javax.ws.rs.* and Glassfish? QUESTION: I just installed Glassfish V2 on my local machine just to play around with it. I was wondering if there is a way to retrieve a param passed in by the GET HTTP method. For instance, http://localhost:8080/HelloWorld/resources...
[ "java", "jakarta-ee", "glassfish" ]
1
2
727
2
0
2008-09-19T07:19:38.677000
2008-09-19T08:06:30.920000
100,216
100,647
Start seleniumRC from Fitnesse
I'm trying to integrate running Fitnesse tests from MSBuild im my nightly build on TFS. In an attempt to make it self contained I would like to start the seleniumRC server only when it's needed from fitness. I've seen that there is a "Command Line Fixture" but it's written in java can I use that?
I think you might be able to. You can call any process easily in MSBuild using the task. However, the problem with doing this is that the exec task will wait for the Selinium process to finish before continuing, which is not the bahaviour you want. You want to run the process, keep it running during your build and then...
Start seleniumRC from Fitnesse I'm trying to integrate running Fitnesse tests from MSBuild im my nightly build on TFS. In an attempt to make it self contained I would like to start the seleniumRC server only when it's needed from fitness. I've seen that there is a "Command Line Fixture" but it's written in java can I u...
TITLE: Start seleniumRC from Fitnesse QUESTION: I'm trying to integrate running Fitnesse tests from MSBuild im my nightly build on TFS. In an attempt to make it self contained I would like to start the seleniumRC server only when it's needed from fitness. I've seen that there is a "Command Line Fixture" but it's writt...
[ "selenium", "tfs", "selenium-rc", "fitnesse", "fit-framework" ]
1
1
863
3
0
2008-09-19T07:20:08.457000
2008-09-19T09:09:11.237000
100,221
100,530
Tools for finding unused function declarations?
Whilst refactoring some old code I realised that a particular header file was full of function declarations for functions long since removed from the.cpp file. Does anyone know of a tool that could find (and strip) these automatically?
You could if possible make a test.cpp file to call them all, the linker will flag the ones that have no code as unresolved, this way your test code only need compile and not worry about actually running.
Tools for finding unused function declarations? Whilst refactoring some old code I realised that a particular header file was full of function declarations for functions long since removed from the.cpp file. Does anyone know of a tool that could find (and strip) these automatically?
TITLE: Tools for finding unused function declarations? QUESTION: Whilst refactoring some old code I realised that a particular header file was full of function declarations for functions long since removed from the.cpp file. Does anyone know of a tool that could find (and strip) these automatically? ANSWER: You could...
[ "c++", "function", "header" ]
3
2
3,069
7
0
2008-09-19T07:22:06.580000
2008-09-19T08:40:01.633000
100,228
100,313
XML schema construct for "any one or more of these elements but must be at least one"
I'm trying to set up part of a schema that's like a "Sequence" where all child elements are optional, but at least one of the elements must be present, and there could be more than one of them. I tried doing the following, but XMLSpy complains that "The content model contains the elements and which cannot be uniquely d...
Try this: Doing so, you force either to choose the first element and then the rest is optional, either the second element and the rest is optional, either the third element. This should do what you want, I hope. Of course, you could place the sub-sequences into groups, to avoid to duplicate an element in each sequence ...
XML schema construct for "any one or more of these elements but must be at least one" I'm trying to set up part of a schema that's like a "Sequence" where all child elements are optional, but at least one of the elements must be present, and there could be more than one of them. I tried doing the following, but XMLSpy ...
TITLE: XML schema construct for "any one or more of these elements but must be at least one" QUESTION: I'm trying to set up part of a schema that's like a "Sequence" where all child elements are optional, but at least one of the elements must be present, and there could be more than one of them. I tried doing the foll...
[ "xml", "xsd", "schema" ]
25
26
25,010
3
0
2008-09-19T07:24:10.223000
2008-09-19T07:45:28.410000
100,235
482,984
Looking for a simple standalone persistent dictionary implementation in C#
For an open source project I am looking for a good, simple implementation of a Dictionary that is backed by a file. Meaning, if an application crashes or restarts the dictionary will keep its state. I would like it to update the underlying file every time the dictionary is touched. (Add a value or remove a value). A Fi...
bplustreedotnet The bplusdotnet package is a library of cross compatible data structure implementations in C#, java, and Python which are useful for applications which need to store and retrieve persistent information. The bplusdotnet data structures make it easy to store string keys associated with values permanently....
Looking for a simple standalone persistent dictionary implementation in C# For an open source project I am looking for a good, simple implementation of a Dictionary that is backed by a file. Meaning, if an application crashes or restarts the dictionary will keep its state. I would like it to update the underlying file ...
TITLE: Looking for a simple standalone persistent dictionary implementation in C# QUESTION: For an open source project I am looking for a good, simple implementation of a Dictionary that is backed by a file. Meaning, if an application crashes or restarts the dictionary will keep its state. I would like it to update th...
[ "c#", ".net" ]
28
24
24,189
13
0
2008-09-19T07:25:32.250000
2009-01-27T11:00:10.460000
100,236
100,244
C# String ASCII representation
How can I insert ASCII special characters (e.g. with the ASCII value 0x01) into a string? I ask because I am using the following: str.Replace( " ", Convert.ToChar(0x01).ToString() ); and I feel that there must be a better way than this. Any Ideas? Update: Also If I use this methodology, do I need to worry about unicode...
I believe you can use \uXXXX to insert specified codes into your string. ETA: I just tested it and it works.:-) using System; class Uxxxx { public static void Main() { Console.WriteLine("\u20AC"); } }
C# String ASCII representation How can I insert ASCII special characters (e.g. with the ASCII value 0x01) into a string? I ask because I am using the following: str.Replace( " ", Convert.ToChar(0x01).ToString() ); and I feel that there must be a better way than this. Any Ideas? Update: Also If I use this methodology, d...
TITLE: C# String ASCII representation QUESTION: How can I insert ASCII special characters (e.g. with the ASCII value 0x01) into a string? I ask because I am using the following: str.Replace( " ", Convert.ToChar(0x01).ToString() ); and I feel that there must be a better way than this. Any Ideas? Update: Also If I use t...
[ "c#", "regex", "string", "ascii" ]
2
6
5,231
3
0
2008-09-19T07:25:46.320000
2008-09-19T07:27:33.150000
100,242
170,102
How do I create a "select folder OR file dialog window" in REALbasic?
You can use SelectFolder() to get a folder or GetOpenFolderitem(filter as string) to get files but can you select either a folder or file? ( or for that matter selecting multiple files )
The MonkeyBread plugin allows this in the OpenDialogMBS class. http://www.monkeybreadsoftware.net/pluginhelp/navigation-opendialogmbs.shtml OpenDialogMBS.AllowFolderSelection as Boolean property, Navigation, MBS Util Plugin (OpenDialog), class OpenDialogMBS, Plugin version: 7.5, Mac OS X: Works, Windows: Does nothing, ...
How do I create a "select folder OR file dialog window" in REALbasic? You can use SelectFolder() to get a folder or GetOpenFolderitem(filter as string) to get files but can you select either a folder or file? ( or for that matter selecting multiple files )
TITLE: How do I create a "select folder OR file dialog window" in REALbasic? QUESTION: You can use SelectFolder() to get a folder or GetOpenFolderitem(filter as string) to get files but can you select either a folder or file? ( or for that matter selecting multiple files ) ANSWER: The MonkeyBread plugin allows this i...
[ "realbasic" ]
3
5
2,745
4
0
2008-09-19T07:27:12.480000
2008-10-04T10:38:36.947000
100,243
142,029
Java Frameworks War: Spring and Hibernate
My developers are waging a civil war. In one camp, they've embraced Hibernate and Spring. In the other camp, they've denounced frameworks - they're considering Hibernate though. The question is: Are there any nasty surprises, weaknesses or pit-falls that newbie Hibernate-Spring converts are likely to stumble on? PS: We...
I've used Hibernate a number of times in the past. Each time I've run into edge cases where determining the syntax devolved into a scavenger hunt through the documentation, Google, and old versions. It is a powerful tool but poorly documented (last I looked). As for Spring, just about every job I've interviewed for or ...
Java Frameworks War: Spring and Hibernate My developers are waging a civil war. In one camp, they've embraced Hibernate and Spring. In the other camp, they've denounced frameworks - they're considering Hibernate though. The question is: Are there any nasty surprises, weaknesses or pit-falls that newbie Hibernate-Spring...
TITLE: Java Frameworks War: Spring and Hibernate QUESTION: My developers are waging a civil war. In one camp, they've embraced Hibernate and Spring. In the other camp, they've denounced frameworks - they're considering Hibernate though. The question is: Are there any nasty surprises, weaknesses or pit-falls that newbi...
[ "java", "hibernate", "spring" ]
28
28
7,029
18
0
2008-09-19T07:27:22.293000
2008-09-26T21:16:45.387000
100,246
734,316
Test planning/documentation/management tools
I'm looking for a good, preferably free, test planning and documentation tool. Ideally something that will keep track of which tests have been run against which software version, with reporting ability. There's a whole bunch of tools listed here but are there any others, and which ones have you had the best experience ...
I've used QualityCenter/TestDirectory for a long time. I'm now using testlink and I must say that I prefer QualityCenter/TestDirectory by far, even if it based on some buggy ActiveX control. QualityCenter/TestDirectory is more easier to use and the interface is quite better. TestLink and QualityCenter/TestDirectory are...
Test planning/documentation/management tools I'm looking for a good, preferably free, test planning and documentation tool. Ideally something that will keep track of which tests have been run against which software version, with reporting ability. There's a whole bunch of tools listed here but are there any others, and...
TITLE: Test planning/documentation/management tools QUESTION: I'm looking for a good, preferably free, test planning and documentation tool. Ideally something that will keep track of which tests have been run against which software version, with reporting ability. There's a whole bunch of tools listed here but are the...
[ "testing", "test-plan" ]
14
2
5,989
11
0
2008-09-19T07:28:25.987000
2009-04-09T13:47:23.187000
100,247
100,293
Reading a PNG image file in .Net 2.0
I'm using C# in.Net 2.0, and I want to read in a PNG image file and check for the first row and first column that has non-transparent pixels. What assembly and/or class should I use?
Bitmap class from System.Drawing.dll assembly: Bitmap bitmap = new Bitmap(@"C:\image.png"); Color clr = bitmap.GetPixel(0, 0);
Reading a PNG image file in .Net 2.0 I'm using C# in.Net 2.0, and I want to read in a PNG image file and check for the first row and first column that has non-transparent pixels. What assembly and/or class should I use?
TITLE: Reading a PNG image file in .Net 2.0 QUESTION: I'm using C# in.Net 2.0, and I want to read in a PNG image file and check for the first row and first column that has non-transparent pixels. What assembly and/or class should I use? ANSWER: Bitmap class from System.Drawing.dll assembly: Bitmap bitmap = new Bitmap...
[ "c#", ".net" ]
15
23
39,818
3
0
2008-09-19T07:28:27.623000
2008-09-19T07:39:41.793000
100,248
100,261
Where can I get good answers to my Perl-related questions?
AFAIK one of the objectives of Stack Overflow is to make sure anyone can come here and find good answers to her Perl related questions. Certainly beginners would ask what is the best online source to learn Perl but others might just want to ask a question. Probably the friendliest place is the Monastery of Perl Monks. ...
It's worth noting that http://perlmonks.org, in addition to the fora, has the Chatterbox, where simple questions can be answered immediately in conversation with other users. It requires setting up an account and logging in before using the Chatterbox, though.
Where can I get good answers to my Perl-related questions? AFAIK one of the objectives of Stack Overflow is to make sure anyone can come here and find good answers to her Perl related questions. Certainly beginners would ask what is the best online source to learn Perl but others might just want to ask a question. Prob...
TITLE: Where can I get good answers to my Perl-related questions? QUESTION: AFAIK one of the objectives of Stack Overflow is to make sure anyone can come here and find good answers to her Perl related questions. Certainly beginners would ask what is the best online source to learn Perl but others might just want to as...
[ "perl", "resources", "forums" ]
20
25
1,235
15
0
2008-09-19T07:28:56.483000
2008-09-19T07:32:31.047000
100,264
131,739
Is there an OpenFileOrFolderDialog object in .NET?
Is it possible to use the OpenFileDialog class select a file OR folder? It appears only to allow the selection of a file, if you select a folder and then choose open it will navigate to that folder. If the OpenFileDialog can not be used for this is there another object I should be using? EDIT: The scenario is that I ha...
This is the solution I have been looking for, this article provides code and describes how to create a dialog that meets my needs. CodeProject: Full Implementation of IShellBrowser
Is there an OpenFileOrFolderDialog object in .NET? Is it possible to use the OpenFileDialog class select a file OR folder? It appears only to allow the selection of a file, if you select a folder and then choose open it will navigate to that folder. If the OpenFileDialog can not be used for this is there another object...
TITLE: Is there an OpenFileOrFolderDialog object in .NET? QUESTION: Is it possible to use the OpenFileDialog class select a file OR folder? It appears only to allow the selection of a file, if you select a folder and then choose open it will navigate to that folder. If the OpenFileDialog can not be used for this is th...
[ "c#", ".net", "filedialog" ]
7
5
2,418
6
0
2008-09-19T07:32:35.493000
2008-09-25T06:37:31.667000
100,280
100,288
Connecting to IMDB
Has any one done this before? It would seem to me that there should be a webservice but i can't find one. I am writing an application for personal use that would just show basic info from IMDB.
There is no webservice available. But there are enough html scrapers written in every language to suit your needs! I've used the.NET 3.5 Imdb Services opensource project in a few personal projects. 1 minute google results: Perl: IMDB-Film Ruby: libimdb-ruby Python: IMDbPY
Connecting to IMDB Has any one done this before? It would seem to me that there should be a webservice but i can't find one. I am writing an application for personal use that would just show basic info from IMDB.
TITLE: Connecting to IMDB QUESTION: Has any one done this before? It would seem to me that there should be a webservice but i can't find one. I am writing an application for personal use that would just show basic info from IMDB. ANSWER: There is no webservice available. But there are enough html scrapers written in ...
[ "web-services", "imdb" ]
23
14
40,816
10
0
2008-09-19T07:36:36.637000
2008-09-19T07:38:33.903000
100,284
193,208
How do I check if the scanner is plugged in (C#, .NET TWAIN)
I'm using the.NET TWAIN code from http://www.codeproject.com/KB/dotnet/twaindotnet.aspx?msg=1007385#xx1007385xx in my application. When I try to scan an image when the scanner is not plugged in, the application freezes. How can I check if the device is plugged in, using the TWAIN driver?
Maybe I'm taking the question too literally, but using the TWAIN API, it is not possible to check if a device is plugged in i.e. connected and powered on. The TWAIN standard does define a capability for this purpose called CAP_DEVICEONLINE, but this feature is so poorly conceived and so few drivers implement it correct...
How do I check if the scanner is plugged in (C#, .NET TWAIN) I'm using the.NET TWAIN code from http://www.codeproject.com/KB/dotnet/twaindotnet.aspx?msg=1007385#xx1007385xx in my application. When I try to scan an image when the scanner is not plugged in, the application freezes. How can I check if the device is plugge...
TITLE: How do I check if the scanner is plugged in (C#, .NET TWAIN) QUESTION: I'm using the.NET TWAIN code from http://www.codeproject.com/KB/dotnet/twaindotnet.aspx?msg=1007385#xx1007385xx in my application. When I try to scan an image when the scanner is not plugged in, the application freezes. How can I check if th...
[ "c#", "twain" ]
8
12
14,950
5
0
2008-09-19T07:37:40.007000
2008-10-10T22:12:19.277000
100,291
100,307
Speed up loop using multithreading in C# (Question)
Imagine I have an function which goes through one million/billion strings and checks smth in them. f.ex: foreach (String item in ListOfStrings) { result.add(CalculateSmth(item)); } it consumes lot's of time, because CalculateSmth is very time consuming function. I want to ask: how to integrate multithreading in this ki...
You could try the Parallel extensions (part of.NET 4.0) These allow you to write something like: Parallel.Foreach (ListOfStrings, (item) => result.add(CalculateSmth(item)); ); Of course result.add would need to be thread safe.
Speed up loop using multithreading in C# (Question) Imagine I have an function which goes through one million/billion strings and checks smth in them. f.ex: foreach (String item in ListOfStrings) { result.add(CalculateSmth(item)); } it consumes lot's of time, because CalculateSmth is very time consuming function. I wan...
TITLE: Speed up loop using multithreading in C# (Question) QUESTION: Imagine I have an function which goes through one million/billion strings and checks smth in them. f.ex: foreach (String item in ListOfStrings) { result.add(CalculateSmth(item)); } it consumes lot's of time, because CalculateSmth is very time consumi...
[ "c#", "multithreading", ".net-2.0" ]
16
19
21,464
6
0
2008-09-19T07:39:01.140000
2008-09-19T07:42:38.917000
100,295
104,069
How's the ActionScript2 -> ActionScript3 learning curve?
I knew ActionScript and ActionScript2 inside out, but I've been away from Flash for a couple years. What's the magnitude of becoming fluent in ActionScript3 and the new Flash functionality? From Colin Moock's blog, I heard that some of the fundamental movieclip methods have changed...
You've probably already seen the as2 -> as3 migration doc? Sure, some syntax has changed but if you know as2 well writing as3 won't be a problem at all. Some weird things may come up in the beginning with the syntax, but that's just checking the documentation for the new way of doing it. If you're hacking yourself thro...
How's the ActionScript2 -> ActionScript3 learning curve? I knew ActionScript and ActionScript2 inside out, but I've been away from Flash for a couple years. What's the magnitude of becoming fluent in ActionScript3 and the new Flash functionality? From Colin Moock's blog, I heard that some of the fundamental movieclip m...
TITLE: How's the ActionScript2 -> ActionScript3 learning curve? QUESTION: I knew ActionScript and ActionScript2 inside out, but I've been away from Flash for a couple years. What's the magnitude of becoming fluent in ActionScript3 and the new Flash functionality? From Colin Moock's blog, I heard that some of the funda...
[ "flash", "actionscript-3" ]
1
5
613
5
0
2008-09-19T07:39:58.893000
2008-09-19T17:51:33.997000
100,298
105,473
How can I analyze Python code to identify problematic areas?
I have a large source repository split across multiple projects. I would like to produce a report about the health of the source code, identifying problem areas that need to be addressed. Specifically, I'd like to call out routines with a high cyclomatic complexity, identify repetition, and perhaps run some lint-like s...
For measuring cyclomatic complexity, there's a nice tool available at traceback.org. The page also gives a good overview of how to interpret the results. +1 for pylint. It is great at verifying adherence to coding standards (be it PEP8 or your own organization's variant), which can in the end help to reduce cyclomatic ...
How can I analyze Python code to identify problematic areas? I have a large source repository split across multiple projects. I would like to produce a report about the health of the source code, identifying problem areas that need to be addressed. Specifically, I'd like to call out routines with a high cyclomatic comp...
TITLE: How can I analyze Python code to identify problematic areas? QUESTION: I have a large source repository split across multiple projects. I would like to produce a report about the health of the source code, identifying problem areas that need to be addressed. Specifically, I'd like to call out routines with a hi...
[ "python", "static-analysis", "cyclomatic-complexity" ]
100
36
42,323
8
0
2008-09-19T07:40:22.010000
2008-09-19T20:44:22.040000
100,324
100,827
XSL code coverage tool
Are there any tools that can tell me what percentage of a XSL document get actually executed during tests? UPDATE I could not find anything better than Oxygen's XSL debugger and profiler, so I'm accepting Mladen's answer.
Not sure about code coverage itself, but you can find an XML debugger and profiler from Oxygen which might help you out.
XSL code coverage tool Are there any tools that can tell me what percentage of a XSL document get actually executed during tests? UPDATE I could not find anything better than Oxygen's XSL debugger and profiler, so I'm accepting Mladen's answer.
TITLE: XSL code coverage tool QUESTION: Are there any tools that can tell me what percentage of a XSL document get actually executed during tests? UPDATE I could not find anything better than Oxygen's XSL debugger and profiler, so I'm accepting Mladen's answer. ANSWER: Not sure about code coverage itself, but you can...
[ "xslt", "code-coverage" ]
7
2
1,926
3
0
2008-09-19T07:49:11.053000
2008-09-19T09:53:02.473000
100,325
100,804
Groovy: Correct Syntax for XMLSlurper to find elements with a given attribute
Given a HTML file with the structure html -> body -> a bunch of divs what is the correct groovy statement to find all of the divs with a non blank tags attribute? The following is not working: def nodes = html.body.div.findAll { it.@tags!= null } because it finds all the nodes.
Try the following (Groovy 1.5.6): def doc = """ test1 test2 test3 test4 """ def html = new XmlSlurper().parseText( doc) html.body.div.findAll { it.@tags.text()}.each { div -> println div.text() } This outputs: test1 test4
Groovy: Correct Syntax for XMLSlurper to find elements with a given attribute Given a HTML file with the structure html -> body -> a bunch of divs what is the correct groovy statement to find all of the divs with a non blank tags attribute? The following is not working: def nodes = html.body.div.findAll { it.@tags!= nu...
TITLE: Groovy: Correct Syntax for XMLSlurper to find elements with a given attribute QUESTION: Given a HTML file with the structure html -> body -> a bunch of divs what is the correct groovy statement to find all of the divs with a non blank tags attribute? The following is not working: def nodes = html.body.div.findA...
[ "groovy", "xmlslurper" ]
9
18
13,661
1
0
2008-09-19T07:49:26.933000
2008-09-19T09:47:29.647000
100,365
106,985
Disable Cakephp's Auto Model "feature"
In cake 1.2 there is a feature that allows the developer to no have to create models, but rather have cake do the detective work at run time and create the model for you. This process happens each time and is neat but in my case very hazardous. I read about this somewhere and now I'm experiencing the bad side of this. ...
Cake 1.2 It's a hack and it's ugly cus you need to edit core cake files but this is how i do it: \cake\libs\class_registry.php: line 127ish if (App::import($type, $plugin. $class)) { ${$class} =& new $class($options); } elseif ($type === 'Model') { /* Print out whatever debug info we have then exit */ pr($objects); die...
Disable Cakephp's Auto Model "feature" In cake 1.2 there is a feature that allows the developer to no have to create models, but rather have cake do the detective work at run time and create the model for you. This process happens each time and is neat but in my case very hazardous. I read about this somewhere and now ...
TITLE: Disable Cakephp's Auto Model "feature" QUESTION: In cake 1.2 there is a feature that allows the developer to no have to create models, but rather have cake do the detective work at run time and create the model for you. This process happens each time and is neat but in my case very hazardous. I read about this ...
[ "php", "cakephp", "model", "cakephp-1.2" ]
2
3
2,972
5
0
2008-09-19T07:59:32.933000
2008-09-20T03:36:02.847000
100,376
100,417
How to do picture overlay in HTML (something like marker on top of google map)?
Anyone know how to do picture overlay or appear on top of each other in HTML? The effect will be something like the marker/icon appear on Google Map where the user can specify the coordinate of the second picture appear on the first picture. Thanks.
You can use containers to seperate content into multiple layers. Therefore the div containers have to be positioned absolutely and marked with a z-index. for instance: This is in background This is in foreground Of course the content also can contains images, etc.
How to do picture overlay in HTML (something like marker on top of google map)? Anyone know how to do picture overlay or appear on top of each other in HTML? The effect will be something like the marker/icon appear on Google Map where the user can specify the coordinate of the second picture appear on the first picture...
TITLE: How to do picture overlay in HTML (something like marker on top of google map)? QUESTION: Anyone know how to do picture overlay or appear on top of each other in HTML? The effect will be something like the marker/icon appear on Google Map where the user can specify the coordinate of the second picture appear on...
[ "html", "overlay", "image" ]
22
31
87,490
2
0
2008-09-19T08:02:01.023000
2008-09-19T08:10:23.950000
100,388
100,414
Tabs and spaces conversion
I would like to automatically convert between tabs and spaces for indentation when I commit/update code to/from our repository. I have found the AnyEdit plugin for eclipse, which can convert directories of files. Not bad for a start, but does anybody have more expierience on how to handle this? Or maybe know of an Ant ...
Why not just use the code formatter and/or cleanup function? It has settings that take care of that stuff for you. You can even have it run automatically on save. Edit: As Peter Perháč points out in the comments, this only answers half the question. I don't have any practical experience, but you could try the Maven Ecl...
Tabs and spaces conversion I would like to automatically convert between tabs and spaces for indentation when I commit/update code to/from our repository. I have found the AnyEdit plugin for eclipse, which can convert directories of files. Not bad for a start, but does anybody have more expierience on how to handle thi...
TITLE: Tabs and spaces conversion QUESTION: I would like to automatically convert between tabs and spaces for indentation when I commit/update code to/from our repository. I have found the AnyEdit plugin for eclipse, which can convert directories of files. Not bad for a start, but does anybody have more expierience on...
[ "eclipse", "formatting" ]
32
15
38,718
7
0
2008-09-19T08:05:18.830000
2008-09-19T08:10:13.670000
100,411
100,429
Hiding a queryString in an ASP.NET Webapplication
I have two webapplication, one is a simple authenticationsite which can authenticate the logged in user and redirects him then to another site. Therefore I have to pass ther userId (GUID) to the second application. Currently this is done via the URL but i would like to hide this id. Has anybody an idea how to do this p...
Pass the GUID through a session, best way. http://www.w3schools.com/ASP/asp_sessions.asp OR, since it's 2 different servers, pass the information by POST method: http://www.w3schools.com/aspnet/aspnet_forms.asp The other possibility is to store the session state in a database on the local server, and remotely access th...
Hiding a queryString in an ASP.NET Webapplication I have two webapplication, one is a simple authenticationsite which can authenticate the logged in user and redirects him then to another site. Therefore I have to pass ther userId (GUID) to the second application. Currently this is done via the URL but i would like to ...
TITLE: Hiding a queryString in an ASP.NET Webapplication QUESTION: I have two webapplication, one is a simple authenticationsite which can authenticate the logged in user and redirects him then to another site. Therefore I have to pass ther userId (GUID) to the second application. Currently this is done via the URL bu...
[ "c#", "asp.net", "web-services" ]
1
0
3,547
8
0
2008-09-19T08:09:49.413000
2008-09-19T08:12:09.907000
100,415
900,463
open source syntax highlighter tool?
I'm looking for an open source, cross platform (Windows & Linux at least) command line tool to take some code (C++, but multiple languages would be sweet), and spit out valid a XHTML representation of that code, with syntax highlighting included. Ideally the XHTML should just wrap the code with and tags with different ...
I can recommend Pygments. It's easy to work with and supports a lot of languages. It does what you want, i.e., it wraps the code in tags: from pygments import highlight from pygments.lexers import PythonLexer from pygments.formatters import HtmlFormatter code = 'print "Hello World"' print highlight(code, PythonLexer()...
open source syntax highlighter tool? I'm looking for an open source, cross platform (Windows & Linux at least) command line tool to take some code (C++, but multiple languages would be sweet), and spit out valid a XHTML representation of that code, with syntax highlighting included. Ideally the XHTML should just wrap t...
TITLE: open source syntax highlighter tool? QUESTION: I'm looking for an open source, cross platform (Windows & Linux at least) command line tool to take some code (C++, but multiple languages would be sweet), and spit out valid a XHTML representation of that code, with syntax highlighting included. Ideally the XHTML ...
[ "open-source", "syntax-highlighting" ]
3
9
3,108
8
0
2008-09-19T08:10:14.810000
2009-05-22T23:51:33.680000
100,416
100,563
Force default value when adding column to table - SQL Server
In SQL Server 2000/2005, Is it possible to force the default value to be written to already existing rows when adding a new column to a table without using NOT NULL on the new column?
You need two statements. First create the column with not null. Then change the not null constraint to nullable alter table mytable add mycolumn varchar(10) not null default ('a value') alter table mytable alter column mycolumn varchar(10) null
Force default value when adding column to table - SQL Server In SQL Server 2000/2005, Is it possible to force the default value to be written to already existing rows when adding a new column to a table without using NOT NULL on the new column?
TITLE: Force default value when adding column to table - SQL Server QUESTION: In SQL Server 2000/2005, Is it possible to force the default value to be written to already existing rows when adding a new column to a table without using NOT NULL on the new column? ANSWER: You need two statements. First create the column...
[ "sql-server", "database" ]
5
10
11,307
4
0
2008-09-19T08:10:17.010000
2008-09-19T08:50:29.627000
100,435
101,374
How can I use multiple sitemap file without multiple root nodes
I'm using a ASP.NET menu control. I'd like the menu to look like this, where link 1 through 10 are in one sitemap file and link 11 through 20 in another. root --link 1 (...) --link 10 --link 11 (...) --link 20 However, sitemap file MUST have a root which I cannot seem to suppress. Any thoughts? -Edoode
Is there any reason that you can't add a dummy root node and then subclass the ASP.NET menu control to ignore your dummy "root" node? You should be able to tell your SiteMapProvider to use different site maps for the menu. The other question I have is what's the purpose of having multiple sitemap files? I'm sure you ha...
How can I use multiple sitemap file without multiple root nodes I'm using a ASP.NET menu control. I'd like the menu to look like this, where link 1 through 10 are in one sitemap file and link 11 through 20 in another. root --link 1 (...) --link 10 --link 11 (...) --link 20 However, sitemap file MUST have a root which I...
TITLE: How can I use multiple sitemap file without multiple root nodes QUESTION: I'm using a ASP.NET menu control. I'd like the menu to look like this, where link 1 through 10 are in one sitemap file and link 11 through 20 in another. root --link 1 (...) --link 10 --link 11 (...) --link 20 However, sitemap file MUST h...
[ "asp.net", "sitemap", "menu" ]
1
1
2,004
2
0
2008-09-19T08:13:24.257000
2008-09-19T12:16:20.840000
100,444
100,501
How to set breakpoints on future shared libraries with a command flag
I'm trying to automate a gdb session using the --command flag. I'm trying to set a breakpoint on a function in a shared library (the Unix equivalent of a DLL). My cmds.gdb looks like this: set args /home/shlomi/conf/bugs/kde/font-break.txt b IA__FcFontMatch r However, I'm getting the following: shlomi:~/progs/bugs-exte...
Replying to myself, I'd like to give the answer that someone gave me on IRC: (gdb) apropos pending actions -- Specify the actions to be taken at a tracepoint set breakpoint -- Breakpoint specific settings set breakpoint pending -- Set debugger's behavior regarding pending breakpoints show breakpoint -- Breakpoint speci...
How to set breakpoints on future shared libraries with a command flag I'm trying to automate a gdb session using the --command flag. I'm trying to set a breakpoint on a function in a shared library (the Unix equivalent of a DLL). My cmds.gdb looks like this: set args /home/shlomi/conf/bugs/kde/font-break.txt b IA__FcFo...
TITLE: How to set breakpoints on future shared libraries with a command flag QUESTION: I'm trying to automate a gdb session using the --command flag. I'm trying to set a breakpoint on a function in a shared library (the Unix equivalent of a DLL). My cmds.gdb looks like this: set args /home/shlomi/conf/bugs/kde/font-br...
[ "c++", "c", "linux", "unix", "gdb" ]
108
180
69,381
3
0
2008-09-19T08:15:45.577000
2008-09-19T08:32:20.933000
100,454
105,343
Why is the DataSourceSelectArguments sealed?
Does anybody know the logic behind making DataSourceSelectArguments sealed? I've implemented a custom DataSource (and related classes) for some custom business objects and custom WebControls. When thinking in filters (like in a grid) I discovered that the DataSourceSelectArguments is sealed. Surely, I'm missing somethi...
My guess is because the class is a dumb data transfer object merely used to pass arguments to a method. This class itself doesn't have any operations defined on it, thus what sort of polymorphism would you expect? For example, the existing methods will only know about the properties of this class, which are all settabl...
Why is the DataSourceSelectArguments sealed? Does anybody know the logic behind making DataSourceSelectArguments sealed? I've implemented a custom DataSource (and related classes) for some custom business objects and custom WebControls. When thinking in filters (like in a grid) I discovered that the DataSourceSelectArg...
TITLE: Why is the DataSourceSelectArguments sealed? QUESTION: Does anybody know the logic behind making DataSourceSelectArguments sealed? I've implemented a custom DataSource (and related classes) for some custom business objects and custom WebControls. When thinking in filters (like in a grid) I discovered that the D...
[ "asp.net", "database" ]
0
0
1,084
2
0
2008-09-19T08:17:52.840000
2008-09-19T20:31:56.017000
100,460
100,539
SSO in webpages
I would like to know what's the best technique to do single sign-on in web sites. It means that if you enter in more than one website, you will be authenticated in a "transparent" way. I'm using php + curl to set the cookies for the different sites, but i really would like to know if does exist a standard way to do it.
For a standard secure way you need: an authentication server an authentication filter on each site that need SSO The mechanism is a little bit complex, it involves http redirects and secure authentication tickets. You will find detailled explanation on the CAS website (a popular java SSO server). I recommend to read th...
SSO in webpages I would like to know what's the best technique to do single sign-on in web sites. It means that if you enter in more than one website, you will be authenticated in a "transparent" way. I'm using php + curl to set the cookies for the different sites, but i really would like to know if does exist a standa...
TITLE: SSO in webpages QUESTION: I would like to know what's the best technique to do single sign-on in web sites. It means that if you enter in more than one website, you will be authenticated in a "transparent" way. I'm using php + curl to set the cookies for the different sites, but i really would like to know if d...
[ "web-applications", "single-sign-on" ]
2
7
1,305
3
0
2008-09-19T08:19:55.053000
2008-09-19T08:43:05.510000
100,469
100,479
Neural Network example in .NET
Any good tutorial with source that will demonstrate how to develop neural network (step bay step for dummies;-))
Here is good example: Brainnet 1 - A Neural Netwok Project - With Illustration And Code - Learn Neural Network Programming Step By Step And Develop a Simple Handwriting Detection System that will demonstrate some practical uses of neural network programming.
Neural Network example in .NET Any good tutorial with source that will demonstrate how to develop neural network (step bay step for dummies;-))
TITLE: Neural Network example in .NET QUESTION: Any good tutorial with source that will demonstrate how to develop neural network (step bay step for dummies;-)) ANSWER: Here is good example: Brainnet 1 - A Neural Netwok Project - With Illustration And Code - Learn Neural Network Programming Step By Step And Develop a...
[ ".net", "artificial-intelligence", "neural-network" ]
46
15
28,178
5
0
2008-09-19T08:23:47.040000
2008-09-19T08:26:09.873000