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
64,833
64,913
Writing C# client to consume a Java web service that returns array of objects
I am writing a C# client that calls a web service written in Java (by another person). I have added a web reference to my client and I'm able to call methods in the web service ok. The service was changed to return an array of objects, and the client does not properly parse the returned SOAP message. MyResponse[] MyFun...
It has been a while, but I seem to remember having trouble with the slight differences in how default namespaces were handled between.Net and Java web services. Double check the generated c# proxy class and any namespaces declared within (especially the defaults xmlns=""), against what the Java service is expecting. Th...
Writing C# client to consume a Java web service that returns array of objects I am writing a C# client that calls a web service written in Java (by another person). I have added a web reference to my client and I'm able to call methods in the web service ok. The service was changed to return an array of objects, and th...
TITLE: Writing C# client to consume a Java web service that returns array of objects QUESTION: I am writing a C# client that calls a web service written in Java (by another person). I have added a web reference to my client and I'm able to call methods in the web service ok. The service was changed to return an array ...
[ "c#", "java", "web-services" ]
10
3
24,766
3
0
2008-09-15T17:15:58.947000
2008-09-15T17:27:10.793000
64,839
64,870
Visual Studio 2008: Is it worth the upgrade from 2005?
As of the fall of 2008 I'm about to embark on a new development cycle for a major product that has a winforms and an asp.net interface. We use Telerik, DevExpress and Infragistics components in it and all are going to have a release within a month or so which will be the one I target for our spring release of our produ...
If you have a release within a month, I'd suggest not upgrading. Make the upgrade to 2k8 part of the next major release... no reason you should risk something not working quite the same or some other complication if everything is working as is.
Visual Studio 2008: Is it worth the upgrade from 2005? As of the fall of 2008 I'm about to embark on a new development cycle for a major product that has a winforms and an asp.net interface. We use Telerik, DevExpress and Infragistics components in it and all are going to have a release within a month or so which will ...
TITLE: Visual Studio 2008: Is it worth the upgrade from 2005? QUESTION: As of the fall of 2008 I'm about to embark on a new development cycle for a major product that has a winforms and an asp.net interface. We use Telerik, DevExpress and Infragistics components in it and all are going to have a release within a month...
[ "visual-studio", "visual-studio-2008", "ide", "visual-studio-2005", "upgrade" ]
9
3
2,436
12
0
2008-09-15T17:16:54.327000
2008-09-15T17:22:44.343000
64,841
64,942
What do I need to manage XML files?
I believe I need a DTD to define the schema and an XSLT if I want to display it in a browser and have it look "pretty". But I'm not sure what else I would need to have a well-defined XML document that can be queried using XQuery and displayed in a web browser.
For a XML document to be queryable using XQquery you do not have to define a DTD or XSD. The purpose of DTD or XSD is to define the strict structure of a XML document and to allow validation before usage. Modern browsers interpret XML files very nicely and show a DOM tree. If enhanced formatting of XML for browser disp...
What do I need to manage XML files? I believe I need a DTD to define the schema and an XSLT if I want to display it in a browser and have it look "pretty". But I'm not sure what else I would need to have a well-defined XML document that can be queried using XQuery and displayed in a web browser.
TITLE: What do I need to manage XML files? QUESTION: I believe I need a DTD to define the schema and an XSLT if I want to display it in a browser and have it look "pretty". But I'm not sure what else I would need to have a well-defined XML document that can be queried using XQuery and displayed in a web browser. ANSW...
[ "xml", "xslt", "browser", "xquery", "dtd" ]
1
1
844
2
0
2008-09-15T17:17:34.590000
2008-09-15T17:30:04.997000
64,843
65,144
Write a Servlet that Talks to JMS (ActiveMQ) and OnMessage Update the Site
I am building a site that uses a simple AJAX Servlet to talk JMS (ActiveMQ) and when a message arrives from the topic to update the site. I have Javascript that creates an XMLHttpRequest for data. The Servlet processes the Get Request and sends back JSON. However I have no idea how to connect my Servlet into my ActiveM...
The problem with having a servlet implement MessageListener is that servlets are synchronous and MessageListeners are asynchronous. Instead you should create some other object to act as the MessageListener and update some state somewhere (possibly a database or a JMX MBean or a Stateful Session EJB) when messages come ...
Write a Servlet that Talks to JMS (ActiveMQ) and OnMessage Update the Site I am building a site that uses a simple AJAX Servlet to talk JMS (ActiveMQ) and when a message arrives from the topic to update the site. I have Javascript that creates an XMLHttpRequest for data. The Servlet processes the Get Request and sends ...
TITLE: Write a Servlet that Talks to JMS (ActiveMQ) and OnMessage Update the Site QUESTION: I am building a site that uses a simple AJAX Servlet to talk JMS (ActiveMQ) and when a message arrives from the topic to update the site. I have Javascript that creates an XMLHttpRequest for data. The Servlet processes the Get ...
[ "javascript", "servlets", "jms", "activemq-classic" ]
2
2
10,416
4
0
2008-09-15T17:18:06.790000
2008-09-15T17:56:07.417000
64,851
64,911
Macro to test whether an integer type is signed or unsigned
How would you write (in C/C++) a macro which tests if an integer type (given as a parameter) is signed or unsigned? #define is_this_type_signed (my_type)...
If what you want is a simple macro, this should do the trick: #define is_type_signed(my_type) (((my_type)-1) < 0)
Macro to test whether an integer type is signed or unsigned How would you write (in C/C++) a macro which tests if an integer type (given as a parameter) is signed or unsigned? #define is_this_type_signed (my_type)...
TITLE: Macro to test whether an integer type is signed or unsigned QUESTION: How would you write (in C/C++) a macro which tests if an integer type (given as a parameter) is signed or unsigned? #define is_this_type_signed (my_type)... ANSWER: If what you want is a simple macro, this should do the trick: #define is_typ...
[ "c++", "c" ]
19
28
7,783
11
0
2008-09-15T17:19:52.340000
2008-09-15T17:27:07.453000
64,875
64,967
How to replace a character programmatically in Oracle 8.x series
Due to repetitive errors with one of our Java applications: Engine engine_0: Error in application action. org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x13) was found in the element content of the document. I need to "fix" some Unicode character in an Oracle database, ideally in a programmatic fash...
Assuming the characters are present in a text field: update TABLE set COLUMN=REPLACE(convert(varchar(5000), COLUMN), 'searchstring', 'replacestring') (note that this will only work on a text field with no more than 5000 characters, for larger text fields increase the number in the query).
How to replace a character programmatically in Oracle 8.x series Due to repetitive errors with one of our Java applications: Engine engine_0: Error in application action. org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x13) was found in the element content of the document. I need to "fix" some Unicod...
TITLE: How to replace a character programmatically in Oracle 8.x series QUESTION: Due to repetitive errors with one of our Java applications: Engine engine_0: Error in application action. org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x13) was found in the element content of the document. I need to...
[ "java", "sql", "oracle", "exception", "unicode" ]
1
4
1,463
1
0
2008-09-15T17:23:13.673000
2008-09-15T17:33:01.653000
64,881
68,025
Why is my cocoa program getting EXC_BAD_ACCESS during startup?
During the load of my cocoa application, my program crashes with the messsage EXC_BAD_ACCESS. The stack trace is not helpful. Any clues to how I can find the problem?
I've seen times where this can happen when you are trying to access a object that you didn't retain properly so its either not pointing to a valid copy of your object or its pointing to an object of another type. Placing breakpoints early and analyzing the objects as you step through startup using po and print in gdb i...
Why is my cocoa program getting EXC_BAD_ACCESS during startup? During the load of my cocoa application, my program crashes with the messsage EXC_BAD_ACCESS. The stack trace is not helpful. Any clues to how I can find the problem?
TITLE: Why is my cocoa program getting EXC_BAD_ACCESS during startup? QUESTION: During the load of my cocoa application, my program crashes with the messsage EXC_BAD_ACCESS. The stack trace is not helpful. Any clues to how I can find the problem? ANSWER: I've seen times where this can happen when you are trying to ac...
[ "macos", "cocoa", "exc-bad-access" ]
3
5
10,537
6
0
2008-09-15T17:24:01.703000
2008-09-15T23:48:37.507000
64,904
65,177
parsings strings: extracting words and phrases [JavaScript]
I need to support exact phrases (enclosed in quotes) in an otherwise space-separated list of terms. Thus splitting the respective string by the space-character is not sufficient anymore. Example: input: 'foo bar "lorem ipsum" baz' output: ['foo', 'bar', 'lorem ipsum', 'baz'] I wonder whether this could be achieved with...
var str = 'foo bar "lorem ipsum" baz'; var results = str.match(/("[^"]+"|[^"\s]+)/g);... returns the array you're looking for. Note, however: Bounding quotes are included, so can be removed with replace(/^"([^"]+)"$/,"$1") on the results. Spaces between the quotes will stay intact. So, if there are three spaces between...
parsings strings: extracting words and phrases [JavaScript] I need to support exact phrases (enclosed in quotes) in an otherwise space-separated list of terms. Thus splitting the respective string by the space-character is not sufficient anymore. Example: input: 'foo bar "lorem ipsum" baz' output: ['foo', 'bar', 'lorem...
TITLE: parsings strings: extracting words and phrases [JavaScript] QUESTION: I need to support exact phrases (enclosed in quotes) in an otherwise space-separated list of terms. Thus splitting the respective string by the space-character is not sufficient anymore. Example: input: 'foo bar "lorem ipsum" baz' output: ['f...
[ "javascript", "regex", "parsing" ]
10
17
25,963
10
0
2008-09-15T17:26:19.080000
2008-09-15T17:59:11.137000
64,905
64,934
How do you create templates for SQL Server 2005 Reporting Services reports?
I want to create templates for base new reports on to have common designs. How do you do it?
The need to produce reports with a common starting design and format is key to any project involving clients and their reports. I have been working on reports for over 10 years now. This has not been the largest portion of my jobs through the years but it has been a very import one. The key to any report project is not...
How do you create templates for SQL Server 2005 Reporting Services reports? I want to create templates for base new reports on to have common designs. How do you do it?
TITLE: How do you create templates for SQL Server 2005 Reporting Services reports? QUESTION: I want to create templates for base new reports on to have common designs. How do you do it? ANSWER: The need to produce reports with a common starting design and format is key to any project involving clients and their repor...
[ "templates", "reporting-services" ]
8
15
6,107
2
0
2008-09-15T17:26:28.267000
2008-09-15T17:29:22.020000
64,933
66,263
exposition on arrows in haskell
What would be a good place to go to understand arrows? Ideally, I am just looking for some place with a concise definition with motivation from some good examples, something similar to Wadler's exposition on monads.
I found Hughes' original paper ("Generalizing Monads to Arrows") to be fairly accessible. You can read an older draft of it here. It has some differences from the original paper, which are noted on the bibliography page of Ross Patterson's own overview of Arrows.
exposition on arrows in haskell What would be a good place to go to understand arrows? Ideally, I am just looking for some place with a concise definition with motivation from some good examples, something similar to Wadler's exposition on monads.
TITLE: exposition on arrows in haskell QUESTION: What would be a good place to go to understand arrows? Ideally, I am just looking for some place with a concise definition with motivation from some good examples, something similar to Wadler's exposition on monads. ANSWER: I found Hughes' original paper ("Generalizing...
[ "haskell", "arrows" ]
11
3
1,397
3
0
2008-09-15T17:29:18.650000
2008-09-15T19:54:17.973000
64,951
125,023
Where can i find the XML schema (XSD-file) for the Glade markup language?
As stated in the title, i'm looking for an XML schema (XSD-file) for the Glade markup language? Wikipedia states that Glade is a schema based markup language ( list of schemas at wikipedia ). I tried to search the web, wikipedia and the glade website,but i couldn't find an XSD for Glade. Thx, Juve
There's nothing that will explicitly tie down the glade to an particular schema since it's all run-time based. You may find the.defs files generated by PyGTK useful. If you really need an XSD file, you should be able to create one from these files. This looks like the main one, there's more in that directory.
Where can i find the XML schema (XSD-file) for the Glade markup language? As stated in the title, i'm looking for an XML schema (XSD-file) for the Glade markup language? Wikipedia states that Glade is a schema based markup language ( list of schemas at wikipedia ). I tried to search the web, wikipedia and the glade web...
TITLE: Where can i find the XML schema (XSD-file) for the Glade markup language? QUESTION: As stated in the title, i'm looking for an XML schema (XSD-file) for the Glade markup language? Wikipedia states that Glade is a schema based markup language ( list of schemas at wikipedia ). I tried to search the web, wikipedia...
[ "xml", "xsd", "markup", "glade" ]
2
1
904
3
0
2008-09-15T17:30:42.423000
2008-09-24T02:11:46.710000
64,953
77,554
Anyone using Lisp for a MySQL-backended web app?
I keep hearing that Lisp is a really productive language, and I'm enjoying SICP. Still, I'm missing something useful that would let me replace PHP for server-side database interaction in web applications. Is there something like PHP's PDO library for Lisp or Arc or Scheme or one of the dialects?
newLisp has support for mysql5 and if you look at the mysql5 function calls, you'll see that it's close to PDO.
Anyone using Lisp for a MySQL-backended web app? I keep hearing that Lisp is a really productive language, and I'm enjoying SICP. Still, I'm missing something useful that would let me replace PHP for server-side database interaction in web applications. Is there something like PHP's PDO library for Lisp or Arc or Schem...
TITLE: Anyone using Lisp for a MySQL-backended web app? QUESTION: I keep hearing that Lisp is a really productive language, and I'm enjoying SICP. Still, I'm missing something useful that would let me replace PHP for server-side database interaction in web applications. Is there something like PHP's PDO library for Li...
[ "mysql", "database", "lisp" ]
6
4
5,353
9
0
2008-09-15T17:31:04.950000
2008-09-16T21:51:09.510000
64,958
65,424
What is the best way of preventing memory leaks in a yacc-based parser?
Yacc does not permit objects to be passed around. Because the %union can only contain POD types, complex objects must be new'd and passed around by pointer. If a syntax error occurs, the yacc parser just stops running, and references to all of those created objects are lost. The only solution I've come up with is that ...
I love Yacc, but the discriminating union stack does present a challenge. I don't know whether you are using C or C++. I've modified Yacc to generate C++ for my own purposes, but this solution can be adapted to C. My preferred solution is to pass an interface to the owner down the parse tree, rather than constructed ob...
What is the best way of preventing memory leaks in a yacc-based parser? Yacc does not permit objects to be passed around. Because the %union can only contain POD types, complex objects must be new'd and passed around by pointer. If a syntax error occurs, the yacc parser just stops running, and references to all of thos...
TITLE: What is the best way of preventing memory leaks in a yacc-based parser? QUESTION: Yacc does not permit objects to be passed around. Because the %union can only contain POD types, complex objects must be new'd and passed around by pointer. If a syntax error occurs, the yacc parser just stops running, and referen...
[ "c++", "yacc" ]
5
2
1,457
4
0
2008-09-15T17:31:44.760000
2008-09-15T18:26:43.490000
64,977
64,997
How do you create SQL Server 2005 stored procedure templates in SQL Server 2005 Management Studio?
How do you create SQL Server 2005 stored procedure templates in SQL Server 2005 Management Studio?
Another little nugget that I think will help people developing and being more productive in their database development. I am a fan of stored procedures and functions when I develop software solutions. I like my actual CRUD methods to be implemented at the database level. It allows me to balance out my work between the ...
How do you create SQL Server 2005 stored procedure templates in SQL Server 2005 Management Studio? How do you create SQL Server 2005 stored procedure templates in SQL Server 2005 Management Studio?
TITLE: How do you create SQL Server 2005 stored procedure templates in SQL Server 2005 Management Studio? QUESTION: How do you create SQL Server 2005 stored procedure templates in SQL Server 2005 Management Studio? ANSWER: Another little nugget that I think will help people developing and being more productive in the...
[ "sql-server", "sql-server-2005", "stored-procedures" ]
7
16
50,653
3
0
2008-09-15T17:34:27.763000
2008-09-15T17:38:07.333000
64,981
65,123
SQL Server 2005 How Create a Unique Constraint?
How do I create a unique constraint on an existing table in SQL Server 2005? I am looking for both the TSQL and how to do it in the Database Diagram.
The SQL command is: ALTER TABLE ADD CONSTRAINT UNIQUE NONCLUSTERED ( ) See the full syntax here. If you want to do it from a Database Diagram: right-click on the table and select 'Indexes/Keys' click the Add button to add a new index enter the necessary info in the Properties on the right hand side: the columns you wan...
SQL Server 2005 How Create a Unique Constraint? How do I create a unique constraint on an existing table in SQL Server 2005? I am looking for both the TSQL and how to do it in the Database Diagram.
TITLE: SQL Server 2005 How Create a Unique Constraint? QUESTION: How do I create a unique constraint on an existing table in SQL Server 2005? I am looking for both the TSQL and how to do it in the Database Diagram. ANSWER: The SQL command is: ALTER TABLE ADD CONSTRAINT UNIQUE NONCLUSTERED ( ) See the full syntax here...
[ "sql", "sql-server", "constraints" ]
181
273
183,896
10
0
2008-09-15T17:35:18.450000
2008-09-15T17:53:53.600000
65,008
69,390
.NET WCF faults generating incorrect SOAP 1.1 faultcode values
I am experimenting with using the FaultException and FaultException to determine the best usage pattern in our applications. We need to support WCF as well as non-WCF service consumers/clients, including SOAP 1.1 and SOAP 1.2 clients. FYI: using FaultExceptions with wsHttpBinding results in SOAP 1.2 semantics whereas u...
This is my current workaround: /// /// Replacement for the static methods on FaultCode to generate Sender and Receiver fault codes due /// to what seems like bugs in the implementation for basicHttpBinding (SOAP 1.1). wsHttpBinding /// (SOAP 1.2) seems to work just fine. /// /// The subCode parameter for FaultCode.Crea...
.NET WCF faults generating incorrect SOAP 1.1 faultcode values I am experimenting with using the FaultException and FaultException to determine the best usage pattern in our applications. We need to support WCF as well as non-WCF service consumers/clients, including SOAP 1.1 and SOAP 1.2 clients. FYI: using FaultExcept...
TITLE: .NET WCF faults generating incorrect SOAP 1.1 faultcode values QUESTION: I am experimenting with using the FaultException and FaultException to determine the best usage pattern in our applications. We need to support WCF as well as non-WCF service consumers/clients, including SOAP 1.1 and SOAP 1.2 clients. FYI:...
[ ".net", "wcf", "web-services", "soap" ]
9
8
13,165
2
0
2008-09-15T17:40:14.490000
2008-09-16T04:29:38.797000
65,010
65,065
Is GCJ (GNU Compiler for Java) a viable tool for publishing a webapp?
Is it really viable to use GCJ to publish server-side applications? Webapps? My boss is convinced that compiling our ( my ) webapp into a binary executable is a brilliant idea. (Then again, he likes nice, small simple things with blinky lights that he can understand.) He instinctively sees no issues with this, while I ...
FWIW: I have never had good luck with GCJ, I have had a lot of problems using it and have had some obscure issues pop up that took forever to diagnose to GCJ rather than me (I am always very very reluctant to blame things on external libraries). I will openly admit this happened several years ago and I have never wante...
Is GCJ (GNU Compiler for Java) a viable tool for publishing a webapp? Is it really viable to use GCJ to publish server-side applications? Webapps? My boss is convinced that compiling our ( my ) webapp into a binary executable is a brilliant idea. (Then again, he likes nice, small simple things with blinky lights that h...
TITLE: Is GCJ (GNU Compiler for Java) a viable tool for publishing a webapp? QUESTION: Is it really viable to use GCJ to publish server-side applications? Webapps? My boss is convinced that compiling our ( my ) webapp into a binary executable is a brilliant idea. (Then again, he likes nice, small simple things with bl...
[ "java", "gcj" ]
13
4
3,035
8
0
2008-09-15T17:40:35.987000
2008-09-15T17:47:03.460000
65,020
65,054
Is there a way to add global error handler in a visual basic 6.0 application?
VB 6.0 does not have any global handler.To catch runtime errors,we need to add a handler in each method where we feel an error can occur.But, still some places might be left out.So,we end up getting runtime errors.Adding error handler in all the methods of an application,the only way?
No there is no way to add a global error handler in VB6. However, you do not need to add an error handler in every method. You only really need to add an error handler in every event handler. E.g. Every click event,load event, etc
Is there a way to add global error handler in a visual basic 6.0 application? VB 6.0 does not have any global handler.To catch runtime errors,we need to add a handler in each method where we feel an error can occur.But, still some places might be left out.So,we end up getting runtime errors.Adding error handler in all ...
TITLE: Is there a way to add global error handler in a visual basic 6.0 application? QUESTION: VB 6.0 does not have any global handler.To catch runtime errors,we need to add a handler in each method where we feel an error can occur.But, still some places might be left out.So,we end up getting runtime errors.Adding err...
[ "vb6" ]
5
6
5,709
5
0
2008-09-15T17:41:56.920000
2008-09-15T17:45:58.097000
65,034
65,052
Remove border from IFrame
How would I remove the border from an iframe embedded in my web app? An example of the iframe is: Browser not compatible. I would like the transition from the content on my page to the contents of the iframe to be seamless, assuming the background colors are consistent. The target browser is IE6 only and unfortunately ...
Add the frameBorder attribute (note the capital ‘B’ ). So it would look like: Browser not compatible.
Remove border from IFrame How would I remove the border from an iframe embedded in my web app? An example of the iframe is: Browser not compatible. I would like the transition from the content on my page to the contents of the iframe to be seamless, assuming the background colors are consistent. The target browser is I...
TITLE: Remove border from IFrame QUESTION: How would I remove the border from an iframe embedded in my web app? An example of the iframe is: Browser not compatible. I would like the transition from the content on my page to the contents of the iframe to be seamless, assuming the background colors are consistent. The t...
[ "html", "css", "iframe", "internet-explorer-6", "noborder" ]
852
1,297
1,121,316
26
0
2008-09-15T17:43:53.263000
2008-09-15T17:45:47.487000
65,035
65,049
Does a finally block always get executed in Java?
Considering this code, can I be absolutely sure that the finally block always executes, no matter what something() is? try { something(); return success; } catch (Exception e) { return failure; } finally { System.out.println("I don't know if this will get printed out"); }
Yes, finally will be called after the execution of the try or catch code blocks. The only times finally won't be called are: If you invoke System.exit() If you invoke Runtime.getRuntime().halt(exitStatus) If the JVM crashes first If the JVM reaches an infinite loop (or some other non-interruptable, non-terminating stat...
Does a finally block always get executed in Java? Considering this code, can I be absolutely sure that the finally block always executes, no matter what something() is? try { something(); return success; } catch (Exception e) { return failure; } finally { System.out.println("I don't know if this will get printed out");...
TITLE: Does a finally block always get executed in Java? QUESTION: Considering this code, can I be absolutely sure that the finally block always executes, no matter what something() is? try { something(); return success; } catch (Exception e) { return failure; } finally { System.out.println("I don't know if this will ...
[ "java", "error-handling", "return", "try-catch-finally" ]
2,696
3,018
613,958
52
0
2008-09-15T17:43:54.513000
2008-09-15T17:45:39.203000
65,037
65,103
is there a way to write macros with a variable argument list in visual C++?
As far as I know, in gcc you can write something like: #define DBGPRINT(fmt...) printf(fmt); Is there a way to do that in VC++?
Yes but only since VC++ 2005. The syntax for your example would be: #define DBGPRINT(fmt,...) printf(fmt, __VA_ARGS__) A full reference is here.
is there a way to write macros with a variable argument list in visual C++? As far as I know, in gcc you can write something like: #define DBGPRINT(fmt...) printf(fmt); Is there a way to do that in VC++?
TITLE: is there a way to write macros with a variable argument list in visual C++? QUESTION: As far as I know, in gcc you can write something like: #define DBGPRINT(fmt...) printf(fmt); Is there a way to do that in VC++? ANSWER: Yes but only since VC++ 2005. The syntax for your example would be: #define DBGPRINT(fmt,...
[ "c++", "visual-c++", "c-preprocessor", "variadic-macros" ]
16
24
16,933
9
0
2008-09-15T17:43:59.690000
2008-09-15T17:51:32.450000
65,058
65,094
How to rewrite or convert C# code in Java code?
I start to write a client - server application using.net (C#) for both client and server side. Unfortunately, my company refuse to pay for Windows licence on server box meaning that I need to rewrite my code in Java, or go to the Mono way. Is there any good way to translate C# code in Java? The server application used ...
I'd suggest building for Mono. You'll run into some gray area, but overall it's great. However, if you want to build for Java, you might check out Grasshopper. It's a commercial product, but it claims to be able to translate CIL (the output of the C# compiler) to Java bytecodes.
How to rewrite or convert C# code in Java code? I start to write a client - server application using.net (C#) for both client and server side. Unfortunately, my company refuse to pay for Windows licence on server box meaning that I need to rewrite my code in Java, or go to the Mono way. Is there any good way to transla...
TITLE: How to rewrite or convert C# code in Java code? QUESTION: I start to write a client - server application using.net (C#) for both client and server side. Unfortunately, my company refuse to pay for Windows licence on server box meaning that I need to rewrite my code in Java, or go to the Mono way. Is there any g...
[ "java", "c#", ".net", "mono", "interop" ]
4
6
13,119
8
0
2008-09-15T17:46:30.857000
2008-09-15T17:50:24.667000
65,060
84,348
NHibernate, Sum Query
If i have a simple named query defined, the preforms a count function, on one column: select sum(Distance) from Activity How do I get the result of a sum or any query that dont return of one the mapped entities, with NHibernate using Either IQuery or ICriteria? Here is my attempt (im unable to test it right now), would...
Sorry! I actually wanted a sum, not a count, which explains alot. Iv edited the post accordingly This works fine: var criteria = session.CreateCriteria(typeof(Activity)).SetProjection(Projections.Sum("Distance")); return (double)criteria.UniqueResult(); The named query approach still dies, "Errors in named queries: {Ac...
NHibernate, Sum Query If i have a simple named query defined, the preforms a count function, on one column: select sum(Distance) from Activity How do I get the result of a sum or any query that dont return of one the mapped entities, with NHibernate using Either IQuery or ICriteria? Here is my attempt (im unable to tes...
TITLE: NHibernate, Sum Query QUESTION: If i have a simple named query defined, the preforms a count function, on one column: select sum(Distance) from Activity How do I get the result of a sum or any query that dont return of one the mapped entities, with NHibernate using Either IQuery or ICriteria? Here is my attempt...
[ "nhibernate", "hql", "querying" ]
2
2
9,370
3
0
2008-09-15T17:46:54.990000
2008-09-17T15:17:24.097000
65,074
65,923
C++ Unit Testing Legacy Code: How to handle #include?
I've just started writing unit tests for a legacy code module with large physical dependencies using the #include directive. I've been dealing with them a few ways that felt overly tedious (providing empty headers to break long #include dependency lists, and using #define to prevent classes from being compiled) and was...
The depression in the responses is overwhelming... But don't fear, we've got the holy book to exorcise the demons of legacy C++ code. Seriously just buy the book if you are in line for more than a week of jousting with legacy C++ code. Turn to page 127: The case of the horrible include dependencies. (Now I am not even ...
C++ Unit Testing Legacy Code: How to handle #include? I've just started writing unit tests for a legacy code module with large physical dependencies using the #include directive. I've been dealing with them a few ways that felt overly tedious (providing empty headers to break long #include dependency lists, and using #...
TITLE: C++ Unit Testing Legacy Code: How to handle #include? QUESTION: I've just started writing unit tests for a legacy code module with large physical dependencies using the #include directive. I've been dealing with them a few ways that felt overly tedious (providing empty headers to break long #include dependency ...
[ "c++", "unit-testing", "legacy" ]
19
10
4,175
6
0
2008-09-15T17:47:54.080000
2008-09-15T19:22:35.633000
65,078
65,354
What is the best way to create a web page thumbnail?
Is there some reasonably cross platform way to create a thumbnail image given a URL? I know there are thumbnail web services that will do this, but I want a piece of software or library that will do this locally. I guess in Linux I could always spawn a browser window using a headless X server, but what about Windows or...
You can use Firefox or XULRunner with some fairly simple XUL to create thumbnails as PNG dataURLs (that you could then write to file if needed). Robert O'Callahan has some excellent information on it here: http://weblogs.mozillazine.org/roc/archives/2005/05/rendering_web_p.html
What is the best way to create a web page thumbnail? Is there some reasonably cross platform way to create a thumbnail image given a URL? I know there are thumbnail web services that will do this, but I want a piece of software or library that will do this locally. I guess in Linux I could always spawn a browser window...
TITLE: What is the best way to create a web page thumbnail? QUESTION: Is there some reasonably cross platform way to create a thumbnail image given a URL? I know there are thumbnail web services that will do this, but I want a piece of software or library that will do this locally. I guess in Linux I could always spaw...
[ "image", "thumbnails" ]
8
3
3,590
3
0
2008-09-15T17:48:41.363000
2008-09-15T18:18:24.617000
65,091
65,136
Making a PHP object behave like an array?
I'd like to be able to write a PHP class that behaves like an array and uses normal array syntax for getting & setting. For example (where Foo is a PHP class of my making): $foo = new Foo(); $foo['fooKey'] = 'foo value'; echo $foo['fooKey']; I know that PHP has the _get and _set magic methods but those don't let you ...
If you extend ArrayObject or implement ArrayAccess then you can do what you want. ArrayObject ArrayAccess
Making a PHP object behave like an array? I'd like to be able to write a PHP class that behaves like an array and uses normal array syntax for getting & setting. For example (where Foo is a PHP class of my making): $foo = new Foo(); $foo['fooKey'] = 'foo value'; echo $foo['fooKey']; I know that PHP has the _get and _...
TITLE: Making a PHP object behave like an array? QUESTION: I'd like to be able to write a PHP class that behaves like an array and uses normal array syntax for getting & setting. For example (where Foo is a PHP class of my making): $foo = new Foo(); $foo['fooKey'] = 'foo value'; echo $foo['fooKey']; I know that PHP ...
[ "php", "arrays", "oop" ]
25
37
18,688
2
0
2008-09-15T17:50:04.590000
2008-09-15T17:54:56.060000
65,093
65,356
Best way to archive live MySQL database
We have a live MySQL database that is 99% INSERTs, around 100 per second. We want to archive the data each day so that we can run queries on it without affecting the main, live database. In addition, once the archive is completed, we want to clear the live database. What is the best way to do this without (if possible)...
http://www.maatkit.org/ has mk-archiver archives or purges rows from a table to another table and/or a file. It is designed to efficiently “nibble” data in very small chunks without interfering with critical online transaction processing (OLTP) queries. It accomplishes this with a non-backtracking query plan that keeps...
Best way to archive live MySQL database We have a live MySQL database that is 99% INSERTs, around 100 per second. We want to archive the data each day so that we can run queries on it without affecting the main, live database. In addition, once the archive is completed, we want to clear the live database. What is the b...
TITLE: Best way to archive live MySQL database QUESTION: We have a live MySQL database that is 99% INSERTs, around 100 per second. We want to archive the data each day so that we can run queries on it without affecting the main, live database. In addition, once the archive is completed, we want to clear the live datab...
[ "mysql", "database" ]
27
15
36,007
6
0
2008-09-15T17:50:23.780000
2008-09-15T18:18:42.773000
65,128
65,618
track down file handle
I have a huge ear that uses log4j and there is a single config file that is used to set it up. In this config file there is no mention of certain log files but, additional files apart from those specified in the config file get generated in the logs folder. I've searched for other combinations of (logger|log4j|log).(pr...
Try placing a breakpoint in the File class' constructors and the mkdir and createNewFile methods. Generally, code will use the File class to create its files or directories. You should have the Java source code for these classes included with your JVM.
track down file handle I have a huge ear that uses log4j and there is a single config file that is used to set it up. In this config file there is no mention of certain log files but, additional files apart from those specified in the config file get generated in the logs folder. I've searched for other combinations of...
TITLE: track down file handle QUESTION: I have a huge ear that uses log4j and there is a single config file that is used to set it up. In this config file there is no mention of certain log files but, additional files apart from those specified in the config file get generated in the logs folder. I've searched for oth...
[ "java", "logging", "file", "jakarta-ee", "websphere" ]
2
3
954
4
0
2008-09-15T17:54:04.613000
2008-09-15T18:49:00.237000
65,129
65,574
Any downsides to using ASP.Net AJAX and JQuery together
We are planning to use the jQuery library to augment our client side JavaScript needs. Are there any major issues in trying to use both ASP.Net AJAX and jQuery? Both libraries seem to use $ for special purposes. Are there any conflicts that we need to be aware of? We also use Telerik controls that use ASP.Net AJAX. TIA
We have used ASP.NET Ajax, jQuery and Telerik components on a large project for quite a while and haven't had any issues I would definitely recommend using jQuery
Any downsides to using ASP.Net AJAX and JQuery together We are planning to use the jQuery library to augment our client side JavaScript needs. Are there any major issues in trying to use both ASP.Net AJAX and jQuery? Both libraries seem to use $ for special purposes. Are there any conflicts that we need to be aware of?...
TITLE: Any downsides to using ASP.Net AJAX and JQuery together QUESTION: We are planning to use the jQuery library to augment our client side JavaScript needs. Are there any major issues in trying to use both ASP.Net AJAX and jQuery? Both libraries seem to use $ for special purposes. Are there any conflicts that we ne...
[ "jquery", "asp.net-ajax" ]
12
9
2,269
9
0
2008-09-15T17:54:10.040000
2008-09-15T18:45:12.883000
65,135
65,257
How can I speed up SVN updates?
We have a rather large SVN repository. Doing SVN updates are taking longer and longer the more we add code. We added svn:externals to folders that were repeated in some projects like the FCKeditor on various websites. This helped, but not that much. What is the best way to reduce update time and boost SVN speed?
If it's an older SVN repository (or even quite new, but wasn't setup optimally), it maybe using the older BDB style of repository database. http://svn.apache.org/repos/asf/subversion/trunk/notes/fsfs has notes on the new one. To change from one to another isn;t too hard - dump the entire history, re-initialise it with ...
How can I speed up SVN updates? We have a rather large SVN repository. Doing SVN updates are taking longer and longer the more we add code. We added svn:externals to folders that were repeated in some projects like the FCKeditor on various websites. This helped, but not that much. What is the best way to reduce update ...
TITLE: How can I speed up SVN updates? QUESTION: We have a rather large SVN repository. Doing SVN updates are taking longer and longer the more we add code. We added svn:externals to folders that were repeated in some projects like the FCKeditor on various websites. This helped, but not that much. What is the best way...
[ "svn", "tortoisesvn" ]
30
14
36,804
12
0
2008-09-15T17:54:55.327000
2008-09-15T18:09:32.250000
65,164
65,314
Best practices for DateTime serialization in .NET 3.5
Some 4 years back, I followed this MSDN article for DateTime usage best practices for building a.Net client on.Net 1.1 and ASMX web services (with SQL 2000 server as the backend). I still remember the serialization issues I had with DateTime and the testing effort it took for servers in different time zones. My questio...
I think the best way of doing this is to always pass the object as UTC, and convert to local time on the clients. By doing so, there is a common reference point for all clients. To convert to UTC, call ToUniversalTime on the DateTime object. Then, on the clients, call ToLocalTime to get it in their current time zone.
Best practices for DateTime serialization in .NET 3.5 Some 4 years back, I followed this MSDN article for DateTime usage best practices for building a.Net client on.Net 1.1 and ASMX web services (with SQL 2000 server as the backend). I still remember the serialization issues I had with DateTime and the testing effort i...
TITLE: Best practices for DateTime serialization in .NET 3.5 QUESTION: Some 4 years back, I followed this MSDN article for DateTime usage best practices for building a.Net client on.Net 1.1 and ASMX web services (with SQL 2000 server as the backend). I still remember the serialization issues I had with DateTime and th...
[ "wcf", "sql-server-2008", "datetime", "serialization", ".net-3.5" ]
22
19
50,862
6
0
2008-09-15T17:57:51.077000
2008-09-15T18:14:18.043000
65,200
65,291
How do you crash a JVM?
I was reading a book on programming skills wherein the author asks the interviewee, "How do you crash a JVM?" I thought that you could do so by writing an infinite for-loop that would eventually use up all the memory. Anybody has any idea?
The closest thing to a single "answer" is System.exit() which terminates the JVM immediately without proper cleanup. But apart from that, native code and resource exhaustion are the most likely answers. Alternatively you can go looking on Sun's bug tracker for bugs in your version of the JVM, some of which allow for re...
How do you crash a JVM? I was reading a book on programming skills wherein the author asks the interviewee, "How do you crash a JVM?" I thought that you could do so by writing an infinite for-loop that would eventually use up all the memory. Anybody has any idea?
TITLE: How do you crash a JVM? QUESTION: I was reading a book on programming skills wherein the author asks the interviewee, "How do you crash a JVM?" I thought that you could do so by writing an infinite for-loop that would eventually use up all the memory. Anybody has any idea? ANSWER: The closest thing to a single...
[ "java", "jvm" ]
158
8
78,981
27
0
2008-09-15T18:01:35.187000
2008-09-15T18:12:28.907000
65,205
65,238
Linked List in SQL
What's the best way to store a linked list in a MySQL database so that inserts are simple (i.e. you don't have to re-index a bunch of stuff every time) and such that the list can easily be pulled out in order?
Store an integer column in your table called 'position'. Record a 0 for the first item in your list, a 1 for the second item, etc. Index that column in your database, and when you want to pull your values out, sort by that column. alter table linked_list add column position integer not null default 0; alter table linke...
Linked List in SQL What's the best way to store a linked list in a MySQL database so that inserts are simple (i.e. you don't have to re-index a bunch of stuff every time) and such that the list can easily be pulled out in order?
TITLE: Linked List in SQL QUESTION: What's the best way to store a linked list in a MySQL database so that inserts are simple (i.e. you don't have to re-index a bunch of stuff every time) and such that the list can easily be pulled out in order? ANSWER: Store an integer column in your table called 'position'. Record ...
[ "sql", "data-structures" ]
75
15
63,892
14
0
2008-09-15T18:02:01.503000
2008-09-15T18:06:31.790000
65,209
65,938
Work with PSDs in PHP
I was recently asked to come up with a script that will allow the end user to upload a PSD (Photoshop) file, and split it up and create images from each of the layers. I would love to stay with PHP for this, but I am open to Python or Perl as well. Any ideas would be greatly appreciated.
Using GraphicsMagick or ImageMagick along with Magick++, you can then use imagick. imagick has all of the calls necessary to convert PSDs from layers, including doing masks.
Work with PSDs in PHP I was recently asked to come up with a script that will allow the end user to upload a PSD (Photoshop) file, and split it up and create images from each of the layers. I would love to stay with PHP for this, but I am open to Python or Perl as well. Any ideas would be greatly appreciated.
TITLE: Work with PSDs in PHP QUESTION: I was recently asked to come up with a script that will allow the end user to upload a PSD (Photoshop) file, and split it up and create images from each of the layers. I would love to stay with PHP for this, but I am open to Python or Perl as well. Any ideas would be greatly appr...
[ "php", "psd" ]
2
1
707
2
0
2008-09-15T18:02:15.233000
2008-09-15T19:25:29.150000
65,243
70,261
SQLite UDF - VBA Callback
Has anybody attempted to pass a VBA (or VB6) function (via AddressOf?) to the SQLite create a UDF function ( http://www.sqlite.org/c3ref/create_function.html ). How would the resulting callback arguments be handled by VBA? The function to be called would have the following signature... void ( xFunc)(sqlite3_context,int...
Unfortunately, you can't use a VB6/VBA function as a callback directly as VB6 only generates stdcall functions rather than the cdecl functions SQLite expects. You will need to write a C dll to proxy the calls back and forth or recompile SQLite to to support your own custom extension. After recompiling your dll to expor...
SQLite UDF - VBA Callback Has anybody attempted to pass a VBA (or VB6) function (via AddressOf?) to the SQLite create a UDF function ( http://www.sqlite.org/c3ref/create_function.html ). How would the resulting callback arguments be handled by VBA? The function to be called would have the following signature... void ( ...
TITLE: SQLite UDF - VBA Callback QUESTION: Has anybody attempted to pass a VBA (or VB6) function (via AddressOf?) to the SQLite create a UDF function ( http://www.sqlite.org/c3ref/create_function.html ). How would the resulting callback arguments be handled by VBA? The function to be called would have the following si...
[ "vba", "sqlite", "vb6" ]
4
6
1,943
1
0
2008-09-15T18:07:16.547000
2008-09-16T08:07:23.703000
65,250
69,804
Convert a .doc or .pdf to an image and display a thumbnail in Ruby?
Convert a.doc or.pdf to an image and display a thumbnail in Ruby? Does anyone know how to generate document thumbnails in Ruby (or C, python...)
A simple RMagick example to convert a PDF to a PNG would be: require 'RMagick' pdf = Magick::ImageList.new("doc.pdf") thumb = pdf.scale(300, 300) thumb.write "doc.png" To convert a MS Word document, it won't be as easy. Your best option may be to first convert it to a PDF before generating the thumbnail. Your options f...
Convert a .doc or .pdf to an image and display a thumbnail in Ruby? Convert a.doc or.pdf to an image and display a thumbnail in Ruby? Does anyone know how to generate document thumbnails in Ruby (or C, python...)
TITLE: Convert a .doc or .pdf to an image and display a thumbnail in Ruby? QUESTION: Convert a.doc or.pdf to an image and display a thumbnail in Ruby? Does anyone know how to generate document thumbnails in Ruby (or C, python...) ANSWER: A simple RMagick example to convert a PDF to a PNG would be: require 'RMagick' p...
[ "ruby", "pdf", "doc" ]
11
22
17,467
7
0
2008-09-15T18:08:11.117000
2008-09-16T06:27:29.513000
65,262
65,312
Does Server Core 2008 support asp.net?
Does Server Core 2008 support asp.net? I see references online saying that it isn't supported, but they are all old references from CTPs.
No. Answer here: http://www.microsoft.com/windowsserver2008/en/us/compare-core-installation.aspx "ASP.NET is not available with Server Core installation option in any edition"
Does Server Core 2008 support asp.net? Does Server Core 2008 support asp.net? I see references online saying that it isn't supported, but they are all old references from CTPs.
TITLE: Does Server Core 2008 support asp.net? QUESTION: Does Server Core 2008 support asp.net? I see references online saying that it isn't supported, but they are all old references from CTPs. ANSWER: No. Answer here: http://www.microsoft.com/windowsserver2008/en/us/compare-core-installation.aspx "ASP.NET is not ava...
[ "asp.net", "server-core" ]
1
4
1,369
5
0
2008-09-15T18:09:52.140000
2008-09-15T18:13:59.963000
65,266
65,440
Caching compiled regex objects in Python?
Each time a python file is imported that contains a large quantity of static regular expressions, cpu cycles are spent compiling the strings into their representative state machines in memory. a = re.compile("a.*b") b = re.compile("c.*d")... Question: Is it possible to store these regular expressions in a cache on disk...
Is it possible to store these regular expressions in a cache on disk in a pre-compiled manner to avoid having to execute the regex compilations on each import? Not easily. You'd have to write a custom serializer that hooks into the C sre implementation of the Python regex engine. Any performance benefits would be vastl...
Caching compiled regex objects in Python? Each time a python file is imported that contains a large quantity of static regular expressions, cpu cycles are spent compiling the strings into their representative state machines in memory. a = re.compile("a.*b") b = re.compile("c.*d")... Question: Is it possible to store th...
TITLE: Caching compiled regex objects in Python? QUESTION: Each time a python file is imported that contains a large quantity of static regular expressions, cpu cycles are spent compiling the strings into their representative state machines in memory. a = re.compile("a.*b") b = re.compile("c.*d")... Question: Is it po...
[ "python", "regex", "caching" ]
21
13
4,123
6
0
2008-09-15T18:10:35.273000
2008-09-15T18:29:51.187000
65,296
65,966
Does anyone still believe in the Capability Maturity Model for Software?
Ten years ago when I first encountered the CMM for software I was, I suppose like many, struck by how accurately it seemed to describe the chaotic "level one" state of software development in many businesses, particularly with its reference to reliance on heroes. It also seemed to provide realistic guidance for an orga...
For a typical CMM level 1 programming shop, making the effort to get to level 2 is worthwhile; this means that you need to think about you processes and write them down. Naturally, this will meet resistance from cowboy programmers who feel limited by standards, documentation, and test cases. The effort to get from leve...
Does anyone still believe in the Capability Maturity Model for Software? Ten years ago when I first encountered the CMM for software I was, I suppose like many, struck by how accurately it seemed to describe the chaotic "level one" state of software development in many businesses, particularly with its reference to rel...
TITLE: Does anyone still believe in the Capability Maturity Model for Software? QUESTION: Ten years ago when I first encountered the CMM for software I was, I suppose like many, struck by how accurately it seemed to describe the chaotic "level one" state of software development in many businesses, particularly with it...
[ "process-management", "cmmi" ]
22
10
4,744
22
0
2008-09-15T18:12:57.267000
2008-09-15T19:29:04.370000
65,310
179,414
Apache Axis ConfigurationException
I am using Apache Axis to connect my Java app to a web server. I used wsdl2java to create the stubs for me, but when I try to use the stubs, I get the following exception: org.apache.axis.ConfigurationException: No service named ` ` is available What is happening?
Just a guess, but it looks like that error message is reporting that you've left the service name blank. I imagine the code that generates that error message looks like this: throw new ConfigurationException("No service named" + serviceName + " is available");
Apache Axis ConfigurationException I am using Apache Axis to connect my Java app to a web server. I used wsdl2java to create the stubs for me, but when I try to use the stubs, I get the following exception: org.apache.axis.ConfigurationException: No service named ` ` is available What is happening?
TITLE: Apache Axis ConfigurationException QUESTION: I am using Apache Axis to connect my Java app to a web server. I used wsdl2java to create the stubs for me, but when I try to use the stubs, I get the following exception: org.apache.axis.ConfigurationException: No service named ` ` is available What is happening? A...
[ "java", "apache", "apache-axis" ]
16
2
32,719
5
0
2008-09-15T18:13:53.037000
2008-10-07T16:56:16.947000
65,343
65,471
How can I post a Cocoa "sheet" on another program's window?
Using the Apple OS X Cocoa framework, how can I post a sheet (slide-down modal dialog) on the window of another process? Edit: Clarified a bit: My application is a Finder extension to do Subversion version control ( http://scplugin.tigris.org/ ). Part of my application is a plug-in (a Contextual Menu Item for Finder); ...
Really, it sounds like you're trying to have your inter-process communication happen at the view level, which isn't really how Cocoa generally works. Things will be much easier if you separate your layers a bit more than that. Why don't you want to put the sheet code into the other process? It's view code, and view cod...
How can I post a Cocoa "sheet" on another program's window? Using the Apple OS X Cocoa framework, how can I post a sheet (slide-down modal dialog) on the window of another process? Edit: Clarified a bit: My application is a Finder extension to do Subversion version control ( http://scplugin.tigris.org/ ). Part of my ap...
TITLE: How can I post a Cocoa "sheet" on another program's window? QUESTION: Using the Apple OS X Cocoa framework, how can I post a sheet (slide-down modal dialog) on the window of another process? Edit: Clarified a bit: My application is a Finder extension to do Subversion version control ( http://scplugin.tigris.org...
[ "cocoa", "modal-dialog", "daemon", "interprocess", "interaction" ]
2
5
981
4
0
2008-09-15T18:17:11.530000
2008-09-15T18:34:32.940000
65,351
864,860
Null or default comparison of generic argument in C#
I have a generic method defined like this: public void MyMethod (T myArgument) The first thing I want to do is check if the value of myArgument is the default value for that type, something like this: if (myArgument == default(T)) But this doesn't compile because I haven't guaranteed that T will implement the == operat...
To avoid boxing, the best way to compare generics for equality is with EqualityComparer.Default. This respects IEquatable (without boxing) as well as object.Equals, and handles all the Nullable "lifted" nuances. Hence: if(EqualityComparer.Default.Equals(obj, default(T))) { return obj; } This will match: null for classe...
Null or default comparison of generic argument in C# I have a generic method defined like this: public void MyMethod (T myArgument) The first thing I want to do is check if the value of myArgument is the default value for that type, something like this: if (myArgument == default(T)) But this doesn't compile because I h...
TITLE: Null or default comparison of generic argument in C# QUESTION: I have a generic method defined like this: public void MyMethod (T myArgument) The first thing I want to do is check if the value of myArgument is the default value for that type, something like this: if (myArgument == default(T)) But this doesn't c...
[ "c#", "generics" ]
356
734
123,116
14
0
2008-09-15T18:17:59.190000
2009-05-14T18:11:23.613000
65,364
69,618
How to publish wmi classes in .net?
I've created a seperate assembly with a class that is intended to be published through wmi. Then I've created a windows forms app that references that assembly and attempts to publish the class. When I try to publish the class, I get an exception of type System.Management.Instrumentation.WmiProviderInstallationExceptio...
I used gacutil - installutil to to test your class (as a dll). The gacutil part worked, but installutil (actually mofcomp) complained about a syntax error:... error SYNTAX 0X80044014: Unexpected character in class name (must be an identifier) Compiler returned error 0x80044014... So I changed the class name to 'MyInter...
How to publish wmi classes in .net? I've created a seperate assembly with a class that is intended to be published through wmi. Then I've created a windows forms app that references that assembly and attempts to publish the class. When I try to publish the class, I get an exception of type System.Management.Instrumenta...
TITLE: How to publish wmi classes in .net? QUESTION: I've created a seperate assembly with a class that is intended to be published through wmi. Then I've created a windows forms app that references that assembly and attempts to publish the class. When I try to publish the class, I get an exception of type System.Mana...
[ "c#", ".net", ".net-3.5", ".net-2.0", "wmi" ]
2
0
5,781
2
0
2008-09-15T18:20:07.373000
2008-09-16T05:34:30.187000
65,400
65,716
How to add method using metaclass
How do I add an instance method to a class using a metaclass (yes I do need to use a metaclass)? The following kind of works, but the func_name will still be "foo": def bar(self): print "bar" class MetaFoo(type): def __new__(cls, name, bases, dict): dict["foobar"] = bar return type(name, bases, dict) class Foo(object...
Try dynamically extending the bases that way you can take advantage of the mro and the methods are actual methods: python 3: class Parent(object): def bar(self): print("bar") class MetaFoo(type): def __new__(cls, name, bases, dict): return type(name, (Parent,) + bases, dict) class Foo(metaclass=MetaFoo):... f = Foo(...
How to add method using metaclass How do I add an instance method to a class using a metaclass (yes I do need to use a metaclass)? The following kind of works, but the func_name will still be "foo": def bar(self): print "bar" class MetaFoo(type): def __new__(cls, name, bases, dict): dict["foobar"] = bar return type(na...
TITLE: How to add method using metaclass QUESTION: How do I add an instance method to a class using a metaclass (yes I do need to use a metaclass)? The following kind of works, but the func_name will still be "foo": def bar(self): print "bar" class MetaFoo(type): def __new__(cls, name, bases, dict): dict["foobar"] = ...
[ "python", "metaclass" ]
10
17
6,291
2
0
2008-09-15T18:24:14.557000
2008-09-15T19:01:27.850000
65,406
70,549
How do I estimate the size of a Lucene index?
Is there a known math formula that I can use to estimate the size of a new Lucene index? I know how many fields I want to have indexed, and the size of each field. And, I know how many items will be indexed. So, once these are processed by Lucene, how does it translate into bytes?
Here is the lucene index format documentation. The major file is the compound index (.cfs file). If you have term statistics, you can probably get an estimate for the.cfs file size, Note that this varies greatly based on the Analyzer you use, and on the field types you define.
How do I estimate the size of a Lucene index? Is there a known math formula that I can use to estimate the size of a new Lucene index? I know how many fields I want to have indexed, and the size of each field. And, I know how many items will be indexed. So, once these are processed by Lucene, how does it translate into...
TITLE: How do I estimate the size of a Lucene index? QUESTION: Is there a known math formula that I can use to estimate the size of a new Lucene index? I know how many fields I want to have indexed, and the size of each field. And, I know how many items will be indexed. So, once these are processed by Lucene, how does...
[ "lucene" ]
8
2
10,638
4
0
2008-09-15T18:24:46.660000
2008-09-16T09:03:14.910000
65,427
65,483
How does the NSAutoreleasePool autorelease pool work?
As I understand it, anything created with an alloc, new, or copy needs to be manually released. For example: int main(void) { NSString *string; string = [[NSString alloc] init]; /* use the string */ [string release]; } My question, though, is wouldn't this be just as valid?: int main(void) { NSAutoreleasePool *pool; po...
Yes, your second code snippit is perfectly valid. Every time -autorelease is sent to an object, it is added to the inner-most autorelease pool. When the pool is drained, it simply sends -release to all the objects in the pool. Autorelease pools are simply a convenience that allows you to defer sending -release until "l...
How does the NSAutoreleasePool autorelease pool work? As I understand it, anything created with an alloc, new, or copy needs to be manually released. For example: int main(void) { NSString *string; string = [[NSString alloc] init]; /* use the string */ [string release]; } My question, though, is wouldn't this be just a...
TITLE: How does the NSAutoreleasePool autorelease pool work? QUESTION: As I understand it, anything created with an alloc, new, or copy needs to be manually released. For example: int main(void) { NSString *string; string = [[NSString alloc] init]; /* use the string */ [string release]; } My question, though, is would...
[ "objective-c", "memory-management", "nsautoreleasepool", "foundationkit" ]
96
69
87,854
7
0
2008-09-15T18:27:33.847000
2008-09-15T18:36:18.457000
65,434
65,527
Getting notified when the page DOM has loaded (but before window.onload)
I know there are some ways to get notified when the page body has loaded (before all the images and 3rd party resources load which fires the window.onload event), but it's different for every browser. Is there a definitive way to do this on all the browsers? So far I know of: DOMContentLoaded: On Mozilla, Opera 9 and n...
There's no cross-browser method for checking when the DOM is ready -- this is why libraries like jQuery exist, to abstract away nasty little bits of incompatibility. Mozilla, Opera, and modern WebKit support the DOMContentLoaded event. IE and Safari need weird hacks like scrolling the window or checking stylesheets. Th...
Getting notified when the page DOM has loaded (but before window.onload) I know there are some ways to get notified when the page body has loaded (before all the images and 3rd party resources load which fires the window.onload event), but it's different for every browser. Is there a definitive way to do this on all th...
TITLE: Getting notified when the page DOM has loaded (but before window.onload) QUESTION: I know there are some ways to get notified when the page body has loaded (before all the images and 3rd party resources load which fires the window.onload event), but it's different for every browser. Is there a definitive way to...
[ "javascript", "dom" ]
7
8
9,092
9
0
2008-09-15T18:28:43.860000
2008-09-15T18:40:52.987000
65,447
65,568
Getting data from an oracle database as a CSV file (or any other custom text format)
A sample perl script that connects to an oracle database, does a simple SELECT query, and spits the results to stdout in CSV format would be great. Python or any other language available in a typical unix distribution would be fine too. Note that I'm starting from scratch with nothing but a username/password for a remo...
In perl you could do something like this, leaving out all the my local variable declarations and... or die "failmessage" error handling for brevity. use DBI; use DBD::Oracle; $dbh = DBI->connect( "dbi:Oracle:host=127.0.0.1;sid=XE", "username", "password" ); # some settings that you usually want for oracle 10 $dbh->{L...
Getting data from an oracle database as a CSV file (or any other custom text format) A sample perl script that connects to an oracle database, does a simple SELECT query, and spits the results to stdout in CSV format would be great. Python or any other language available in a typical unix distribution would be fine too...
TITLE: Getting data from an oracle database as a CSV file (or any other custom text format) QUESTION: A sample perl script that connects to an oracle database, does a simple SELECT query, and spits the results to stdout in CSV format would be great. Python or any other language available in a typical unix distribution...
[ "database", "oracle" ]
3
3
7,036
7
0
2008-09-15T18:31:14.163000
2008-09-15T18:44:33.850000
65,452
65,511
Error Serializing String in WebService call
This morning I ran into an issue with returning back a text string as result from a Web Service call. the Error I was getting is below ************** Exception Text ************** System.ServiceModel.CommunicationException: Error in deserializing body of reply message for operation 'GetFilingTreeXML'. ---> System.Inval...
Try this blog post here. You can modify the MaxStringContentLength property in the Binding configuration.
Error Serializing String in WebService call This morning I ran into an issue with returning back a text string as result from a Web Service call. the Error I was getting is below ************** Exception Text ************** System.ServiceModel.CommunicationException: Error in deserializing body of reply message for ope...
TITLE: Error Serializing String in WebService call QUESTION: This morning I ran into an issue with returning back a text string as result from a Web Service call. the Error I was getting is below ************** Exception Text ************** System.ServiceModel.CommunicationException: Error in deserializing body of rep...
[ "web-services", "xmlreader", "maxstringcontentlength" ]
14
29
29,377
2
0
2008-09-15T18:31:58.670000
2008-09-15T18:38:42.540000
65,456
164,864
Are there CScope-style source browsers for other languages besides C/C++ on Windows?
I'm specifically interested in tools that can be plugged into Vim to allow CScope-style source browsing (1-2 keystroke commands to locate function definitions, callers, global symbols and so on) for languages besides C/C++ such as Java and C# (since Vim and Cscope already integrate very well for browsing C/C++). I'm no...
CScope does work for Java. From http://cscope.sourceforge.net/cscope_vim_tutorial.html: Although Cscope was originally intended only for use with C code, it's actually a very flexible tool that works well with languages like C++ and Java. You can think of it as a generic 'grep' database, with the ability to recognize c...
Are there CScope-style source browsers for other languages besides C/C++ on Windows? I'm specifically interested in tools that can be plugged into Vim to allow CScope-style source browsing (1-2 keystroke commands to locate function definitions, callers, global symbols and so on) for languages besides C/C++ such as Java...
TITLE: Are there CScope-style source browsers for other languages besides C/C++ on Windows? QUESTION: I'm specifically interested in tools that can be plugged into Vim to allow CScope-style source browsing (1-2 keystroke commands to locate function definitions, callers, global symbols and so on) for languages besides ...
[ "vim" ]
14
4
8,189
5
0
2008-09-15T18:32:25.487000
2008-10-02T22:17:04.630000
65,475
65,490
Valid characters in a Java class name
What characters are valid in a Java class name? What other rules govern Java class names (for instance, Java class names cannot begin with a number)?
You can have almost any character, including most Unicode characters! The exact definition is in the Java Language Specification under section 3.8: Identifiers. An identifier is an unlimited-length sequence of Java letters and Java digits, the first of which must be a Java letter.... Letters and digits may be drawn fro...
Valid characters in a Java class name What characters are valid in a Java class name? What other rules govern Java class names (for instance, Java class names cannot begin with a number)?
TITLE: Valid characters in a Java class name QUESTION: What characters are valid in a Java class name? What other rules govern Java class names (for instance, Java class names cannot begin with a number)? ANSWER: You can have almost any character, including most Unicode characters! The exact definition is in the Java...
[ "java", "class", "unicode", "naming-conventions", "invalid-characters" ]
79
66
167,781
8
0
2008-09-15T18:35:04.187000
2008-09-15T18:37:06.583000
65,491
66,436
What is the best method to reduce the size of my Javascript and CSS files?
When working with large and/or many Javascript and CSS files, what's the best way to reduce the file sizes?
In addition to using server side compression, using intelligent coding is the best way to keep bandwidth costs low. You can always use tools like Dean Edward's Javascript Packer, but for CSS, take the time to learn CSS Shorthand. E.g. use: background: #fff url(image.gif) no-repeat top left;...instead of: background-col...
What is the best method to reduce the size of my Javascript and CSS files? When working with large and/or many Javascript and CSS files, what's the best way to reduce the file sizes?
TITLE: What is the best method to reduce the size of my Javascript and CSS files? QUESTION: When working with large and/or many Javascript and CSS files, what's the best way to reduce the file sizes? ANSWER: In addition to using server side compression, using intelligent coding is the best way to keep bandwidth costs...
[ "javascript", "css", "jscompress" ]
24
21
27,359
18
0
2008-09-15T18:37:09.843000
2008-09-15T20:08:36.753000
65,512
65,532
Which is faster/best? SELECT * or SELECT column1, colum2, column3, etc
I've heard that SELECT * is generally bad practice to use when writing SQL commands because it is more efficient to SELECT columns you specifically need. If I need to SELECT every column in a table, should I use SELECT * FROM TABLE or SELECT column1, colum2, column3, etc. FROM TABLE Does the efficiency really matter in...
One reason that selecting specific columns is better is that it raises the probability that SQL Server can access the data from indexes rather than querying the table data. Here's a post I wrote about it: The real reason select queries are bad index coverage It's also less fragile to change, since any code that consume...
Which is faster/best? SELECT * or SELECT column1, colum2, column3, etc I've heard that SELECT * is generally bad practice to use when writing SQL commands because it is more efficient to SELECT columns you specifically need. If I need to SELECT every column in a table, should I use SELECT * FROM TABLE or SELECT column1...
TITLE: Which is faster/best? SELECT * or SELECT column1, colum2, column3, etc QUESTION: I've heard that SELECT * is generally bad practice to use when writing SQL commands because it is more efficient to SELECT columns you specifically need. If I need to SELECT every column in a table, should I use SELECT * FROM TABLE...
[ "sql", "database", "performance", "select", "sqlperformance" ]
218
199
113,338
49
0
2008-09-15T18:38:49.450000
2008-09-15T18:41:23.110000
65,515
65,523
How to find broken links on a website
What techniques or tools are recommended for finding broken links on a website? I have access to the logfiles, so could conceivably parse these looking for 404 errors, but would like something automated which will follow (or attempt to follow) all links on a site.
For Chrome Extension there is hexometer See LinkChecker for Firefox. For Mac OS there is a tool Integrity which can check URLs for broken links. For Windows there is Xenu's Link Sleuth.
How to find broken links on a website What techniques or tools are recommended for finding broken links on a website? I have access to the logfiles, so could conceivably parse these looking for 404 errors, but would like something automated which will follow (or attempt to follow) all links on a site.
TITLE: How to find broken links on a website QUESTION: What techniques or tools are recommended for finding broken links on a website? I have access to the logfiles, so could conceivably parse these looking for 404 errors, but would like something automated which will follow (or attempt to follow) all links on a site....
[ "html" ]
45
37
39,588
10
0
2008-09-15T18:39:29.700000
2008-09-15T18:40:39.930000
65,524
65,589
Generating a Unique ID in c++
What is the best way to generate a Unique ID from two (or more) short ints in C++? I am trying to uniquely identify vertices in a graph. The vertices contain two to four short ints as data, and ideally the ID would be some kind of a hash of them. Prefer portability and uniqueness over speed or ease. There are a lot of ...
A simple solution is to use a 64 bit integer where the lower 16 bits is the first vertex coordinate, next 16 bits is the second, and so on. This will be unique for all your vertices, though not very compact. So here's some half-assed code to do this. Hopefully I got the casts right. uint64_t generateId( uint16_t v1, ui...
Generating a Unique ID in c++ What is the best way to generate a Unique ID from two (or more) short ints in C++? I am trying to uniquely identify vertices in a graph. The vertices contain two to four short ints as data, and ideally the ID would be some kind of a hash of them. Prefer portability and uniqueness over spee...
TITLE: Generating a Unique ID in c++ QUESTION: What is the best way to generate a Unique ID from two (or more) short ints in C++? I am trying to uniquely identify vertices in a graph. The vertices contain two to four short ints as data, and ideally the ID would be some kind of a hash of them. Prefer portability and un...
[ "c++", "hash" ]
9
5
33,876
11
0
2008-09-15T18:40:42.533000
2008-09-15T18:46:18.183000
65,530
65,656
In Tomcat how can my servlet determine what connectors are configured?
In Tomcat 5.5 the server.xml can have many connectors, typically port only 8080, but for my application a user might configure their servlet.xml to also have other ports open (say 8081-8088). I would like for my servlet to figure out what socket connections ports will be vaild (During the Servlet.init() tomcat has not ...
In Tomcat 6.0 it should be something like: org.apache.catalina.ServerFactory.getServer().getServices to get the services. After that you might use Service.findConnectors which returns a Connector which finally has the method Connector.getPort See the JavaDocs for the details.
In Tomcat how can my servlet determine what connectors are configured? In Tomcat 5.5 the server.xml can have many connectors, typically port only 8080, but for my application a user might configure their servlet.xml to also have other ports open (say 8081-8088). I would like for my servlet to figure out what socket con...
TITLE: In Tomcat how can my servlet determine what connectors are configured? QUESTION: In Tomcat 5.5 the server.xml can have many connectors, typically port only 8080, but for my application a user might configure their servlet.xml to also have other ports open (say 8081-8088). I would like for my servlet to figure o...
[ "tomcat" ]
1
4
2,422
3
0
2008-09-15T18:40:57.480000
2008-09-15T18:54:15.700000
65,536
65,600
How to put text in the upper right, or lower right corner of a "box" using css
How would I get the here and and here to be on the right, on the same lines as the lorem ipsums? See the following: Lorem Ipsum etc........here blah....................... blah blah.................. blah....................... lorem ipsums.......and here
here and here Lorem Ipsum etc blah blah blah blah lorem ipsums Gets you pretty close, although you may need to tweak the "top" and "bottom" values.
How to put text in the upper right, or lower right corner of a "box" using css How would I get the here and and here to be on the right, on the same lines as the lorem ipsums? See the following: Lorem Ipsum etc........here blah....................... blah blah.................. blah....................... lorem ipsums....
TITLE: How to put text in the upper right, or lower right corner of a "box" using css QUESTION: How would I get the here and and here to be on the right, on the same lines as the lorem ipsums? See the following: Lorem Ipsum etc........here blah....................... blah blah.................. blah......................
[ "css", "layout" ]
21
42
201,104
9
0
2008-09-15T18:41:36.060000
2008-09-15T18:47:32.893000
65,566
66,698
Handling empty values with ADO.NET and AddWithValue()
I have a control that, upon postback, saves form results back to the database. It populates the values to be saved by iterating through the querystring. So, for the following SQL statement (vastly simplified for the sake of discussion)... UPDATE MyTable SET MyVal1 = @val1, MyVal2 = @val2 WHERE @id = @id...it would cycl...
After struggling to find a simpler solution, I gave up and wrote a routine to parse my SQL query for variable names: Dim FieldRegEx As New Regex("@([A-Z_]+)", RegexOptions.IgnoreCase) Dim Fields As Match = FieldRegEx.Match(Query) Dim Processed As New ArrayList While Fields.Success Dim Key As String = Fields.Groups(1)....
Handling empty values with ADO.NET and AddWithValue() I have a control that, upon postback, saves form results back to the database. It populates the values to be saved by iterating through the querystring. So, for the following SQL statement (vastly simplified for the sake of discussion)... UPDATE MyTable SET MyVal1 =...
TITLE: Handling empty values with ADO.NET and AddWithValue() QUESTION: I have a control that, upon postback, saves form results back to the database. It populates the values to be saved by iterating through the querystring. So, for the following SQL statement (vastly simplified for the sake of discussion)... UPDATE My...
[ "sql", "vb.net", "ado.net" ]
3
0
9,313
4
0
2008-09-15T18:44:22.167000
2008-09-15T20:37:23.067000
65,585
65,603
Is there a tool for finding unreferenced functions (dead, obsolete code) in a C# app?
I want to delete foo() if foo() isn't called from anywhere.
Gendarme will detect private methods with no upstream callers. It is available cross platform, and the latest version handles " AvoidUncalledPrivateCodeRule ". FxCop will detect public/protected methods with no upstream callers. However, FxCop does not detect all methods without upstream callers, as it is meant to chec...
Is there a tool for finding unreferenced functions (dead, obsolete code) in a C# app? I want to delete foo() if foo() isn't called from anywhere.
TITLE: Is there a tool for finding unreferenced functions (dead, obsolete code) in a C# app? QUESTION: I want to delete foo() if foo() isn't called from anywhere. ANSWER: Gendarme will detect private methods with no upstream callers. It is available cross platform, and the latest version handles " AvoidUncalledPrivat...
[ "c#", ".net", "code-analysis" ]
18
21
10,451
7
0
2008-09-15T18:46:07.577000
2008-09-15T18:47:50.473000
65,607
65,641
Writing a ++ macro in Common Lisp
I've been attempting to write a Lisp macro that would perfom the equivalent of ++ in other programming languages for semantic reasons. I've attempted to do this in several different ways, but none of them seem to work, and all are accepted by the interpreter, so I don't know if I have the correct syntax or not. My idea...
Remember that a macro returns an expression to be evaluated. In order to do this, you have to backquote: (defmacro ++ (variable) `(incf,variable))
Writing a ++ macro in Common Lisp I've been attempting to write a Lisp macro that would perfom the equivalent of ++ in other programming languages for semantic reasons. I've attempted to do this in several different ways, but none of them seem to work, and all are accepted by the interpreter, so I don't know if I have ...
TITLE: Writing a ++ macro in Common Lisp QUESTION: I've been attempting to write a Lisp macro that would perfom the equivalent of ++ in other programming languages for semantic reasons. I've attempted to do this in several different ways, but none of them seem to work, and all are accepted by the interpreter, so I don...
[ "macros", "lisp", "common-lisp" ]
6
17
2,615
8
0
2008-09-15T18:47:57.820000
2008-09-15T18:52:25.160000
65,627
69,156
Can you return a String from a summaryObjectFunction
In a Flex AdvancedDatGrid, we're doing a lot of grouping. Most of the columns are the same for the parents and for the children, so I'd like to show the first value of the group as the summary rather than the MAX, MIN or AVG This code works on numerical but not textual values (without the commented line you get NaN's):...
It looks like the summaryFunction has to return a number. According to the Adobe bug tracker, it is a bug in the documentation: Comment from Sameer Bhatt: In the documentation it is mentioned that - The built-in summary functions for SUM, MIN, MAX, AVG, and COUNT all return a Number containing the summary data. So peop...
Can you return a String from a summaryObjectFunction In a Flex AdvancedDatGrid, we're doing a lot of grouping. Most of the columns are the same for the parents and for the children, so I'd like to show the first value of the group as the summary rather than the MAX, MIN or AVG This code works on numerical but not textu...
TITLE: Can you return a String from a summaryObjectFunction QUESTION: In a Flex AdvancedDatGrid, we're doing a lot of grouping. Most of the columns are the same for the parents and for the children, so I'd like to show the first value of the group as the summary rather than the MAX, MIN or AVG This code works on numer...
[ "apache-flex", "advanceddatagrid" ]
4
1
2,267
2
0
2008-09-15T18:50:07.317000
2008-09-16T03:25:16.503000
65,651
65,814
Directory layout for PHPUnit tests?
I'm a longtime Java programmer working on a PHP project, and I'm trying to get PHPUnit up and working. When unit testing in Java, it's common to put test case classes and regular classes into separate directories, like this - /src MyClass.java /test MyClassTest.java and so on. When unit testing with PHPUnit, is it com...
I think it's a good idea to keep your files separate. I normally use a folder structure like this: /myapp/src/ <- my classes /myapp/tests/ <- my tests for the classes /myapp/public/ <- document root In your case, for including the class in your test file, why not just pass the the whole path to the include method? incl...
Directory layout for PHPUnit tests? I'm a longtime Java programmer working on a PHP project, and I'm trying to get PHPUnit up and working. When unit testing in Java, it's common to put test case classes and regular classes into separate directories, like this - /src MyClass.java /test MyClassTest.java and so on. When ...
TITLE: Directory layout for PHPUnit tests? QUESTION: I'm a longtime Java programmer working on a PHP project, and I'm trying to get PHPUnit up and working. When unit testing in Java, it's common to put test case classes and regular classes into separate directories, like this - /src MyClass.java /test MyClassTest.jav...
[ "php", "unit-testing", "phpunit" ]
14
11
5,051
4
0
2008-09-15T18:53:24.203000
2008-09-15T19:11:38.577000
65,662
65,665
Output parameters not readable when used with a DataReader
When using a DataReader object to access data from a database (such as SQL Server) through stored procedures, any output parameter added to the Command object before executing are not being filled after reading. I can read row data just fine, as well as all input parameters, but not output ones.
This is due to the "by design" nature of DataReaders. Any parameters marked as ParameterDirection.Output won't be "filled" until the DataReader has been closed. While still open, all Output parameters will more than likely just come back null. The full Microsoft KB article concerning this can be viewed here.
Output parameters not readable when used with a DataReader When using a DataReader object to access data from a database (such as SQL Server) through stored procedures, any output parameter added to the Command object before executing are not being filled after reading. I can read row data just fine, as well as all inp...
TITLE: Output parameters not readable when used with a DataReader QUESTION: When using a DataReader object to access data from a database (such as SQL Server) through stored procedures, any output parameter added to the Command object before executing are not being filled after reading. I can read row data just fine, ...
[ ".net", "stored-procedures", "ado.net", "parameters", "datareader" ]
10
16
6,514
1
0
2008-09-15T18:55:13.827000
2008-09-15T18:55:33.420000
65,673
69,319
Comet implementation for ASP.NET?
I've been looking at ways to implement gmail-like messaging inside a browser, and arrived at the Comet concept. However, I haven't been able to find a good.NET implementation that allows me to do this within IIS (our application is written in ASP.NET 2.0). The solutions I found (or could think of, for that matter) requ...
Comet is challenging to scale with IIS because of comet's persistent connectivity, but there is a team looking at Comet scenarios now. Also look at Aaron Lerch's blog as I believe he's done some early Comet work in ASP.NET.
Comet implementation for ASP.NET? I've been looking at ways to implement gmail-like messaging inside a browser, and arrived at the Comet concept. However, I haven't been able to find a good.NET implementation that allows me to do this within IIS (our application is written in ASP.NET 2.0). The solutions I found (or cou...
TITLE: Comet implementation for ASP.NET? QUESTION: I've been looking at ways to implement gmail-like messaging inside a browser, and arrived at the Comet concept. However, I haven't been able to find a good.NET implementation that allows me to do this within IIS (our application is written in ASP.NET 2.0). The solutio...
[ "asp.net", "iis", "comet" ]
104
44
40,460
8
0
2008-09-15T18:56:59.437000
2008-09-16T04:08:26.303000
65,687
640,230
Get path geometry from FlowDocument object
Can someone tell me how to get path geometry from a WPF FlowDocument object? Please note that I do not want to use FormattedText. Thanks.
A FlowDocument can be viewed in any number of ways, but a Path is a fixed shape. I think maybe you really want some simplified, visual-only form of a FlowDocument 's contents. In that case you might try converting the FlowDocument to an XPS FixedDocument - the FixedPage s have Canvas es containing a bunch of Path s and...
Get path geometry from FlowDocument object Can someone tell me how to get path geometry from a WPF FlowDocument object? Please note that I do not want to use FormattedText. Thanks.
TITLE: Get path geometry from FlowDocument object QUESTION: Can someone tell me how to get path geometry from a WPF FlowDocument object? Please note that I do not want to use FormattedText. Thanks. ANSWER: A FlowDocument can be viewed in any number of ways, but a Path is a fixed shape. I think maybe you really want s...
[ "c#", "wpf" ]
2
1
1,370
3
0
2008-09-15T18:58:07.127000
2009-03-12T19:58:05.537000
65,694
65,758
So which is faster truly? Flash, Silverlight or Animated gifs?
I am trying to develop a multimedia site and I am leaning heavily toward Silverlight however Flash is always a main player. I am a Speed and performance type developer. Which Technology will load fastest in the given scenarios? 56k, DSL and Cable?
It all depends on what you're doing: animation, video, calculation, etc? There are some tests that show Silverlight being faster for raw computation, while Flash's graphics engine is farther along (GPU utilization, 3D, etc.). If you're talking about load time, there are definitely things you can do in Silverlight to ma...
So which is faster truly? Flash, Silverlight or Animated gifs? I am trying to develop a multimedia site and I am leaning heavily toward Silverlight however Flash is always a main player. I am a Speed and performance type developer. Which Technology will load fastest in the given scenarios? 56k, DSL and Cable?
TITLE: So which is faster truly? Flash, Silverlight or Animated gifs? QUESTION: I am trying to develop a multimedia site and I am leaning heavily toward Silverlight however Flash is always a main player. I am a Speed and performance type developer. Which Technology will load fastest in the given scenarios? 56k, DSL an...
[ "flash", "silverlight", "animated-gif" ]
2
3
1,877
5
0
2008-09-15T18:58:45.020000
2008-09-15T19:05:12.913000
65,718
65,750
What do the numbers in a version typically represent (i.e. v1.9.0.1)?
I've always assumed each number delineated by a period represented a single component of the software. If that's true, do they ever represent something different? How should a version number be structured to start assigning versions to the different builds of my software? As an aside, my software has five distinct comp...
In version 1.9.0.1: 1: Major revision (new UI, lots of new features, conceptual change, etc.) 9: Minor revision (maybe a change to a search box, 1 feature added, collection of bug fixes) 0: Bug fix release 1: Build number (if used)—that's why you see the.NET framework using something like 2.0.4.2709 You won't find a lo...
What do the numbers in a version typically represent (i.e. v1.9.0.1)? I've always assumed each number delineated by a period represented a single component of the software. If that's true, do they ever represent something different? How should a version number be structured to start assigning versions to the different ...
TITLE: What do the numbers in a version typically represent (i.e. v1.9.0.1)? QUESTION: I've always assumed each number delineated by a period represented a single component of the software. If that's true, do they ever represent something different? How should a version number be structured to start assigning versions...
[ "version" ]
187
279
163,661
29
0
2008-09-15T19:01:49.177000
2008-09-15T19:04:42.213000
65,724
66,036
Uninitialized memory blocks in VC++
As everyone knows, the Visual C++ runtime marks uninitialized or just freed memory blocks with special non-zero markers. Is there any way to disable this behavior entirely without manually setting all uninitialized memory to zeros? It's causing havoc with my valid not null checks, since 0xFEEEFEEE!= 0. Hrm, perhaps I s...
It is not the responsibility of delete to reset all the pointers to the object to NULL. Also you shouldn't change the default memory fill for the windows DEBUG runtime and you should use some thing like boost::shared_ptr<> for pointers any way. That said, if you really want to shoot your self in the foot you can. You c...
Uninitialized memory blocks in VC++ As everyone knows, the Visual C++ runtime marks uninitialized or just freed memory blocks with special non-zero markers. Is there any way to disable this behavior entirely without manually setting all uninitialized memory to zeros? It's causing havoc with my valid not null checks, si...
TITLE: Uninitialized memory blocks in VC++ QUESTION: As everyone knows, the Visual C++ runtime marks uninitialized or just freed memory blocks with special non-zero markers. Is there any way to disable this behavior entirely without manually setting all uninitialized memory to zeros? It's causing havoc with my valid n...
[ "c++", "memory", "allocation" ]
6
7
11,694
15
0
2008-09-15T19:02:36.477000
2008-09-15T19:37:08.797000
65,734
65,808
How do use fckEditor safely, without risk of cross site scripting?
This link describes an exploit into my app using fckEditor: http://knitinr.blogspot.com/2008/07/script-exploit-via-fckeditor.html How do I make my app secure while still using fckEditor? Is it an fckEditor configuration? Is it some processing I'm supposed to do server-side after I grab the text from fckEditor? It's a p...
Sanitize html server-side, no other choice. For PHP it would be HTML Purifier, for.NET I don't know. It's tricky to sanitize HTML - it's not sufficient to strip script tags, you also have to watch out for on* event handlers and even more, thanks to stupidities of IE for example. Also with custom html and css it's easy ...
How do use fckEditor safely, without risk of cross site scripting? This link describes an exploit into my app using fckEditor: http://knitinr.blogspot.com/2008/07/script-exploit-via-fckeditor.html How do I make my app secure while still using fckEditor? Is it an fckEditor configuration? Is it some processing I'm suppos...
TITLE: How do use fckEditor safely, without risk of cross site scripting? QUESTION: This link describes an exploit into my app using fckEditor: http://knitinr.blogspot.com/2008/07/script-exploit-via-fckeditor.html How do I make my app secure while still using fckEditor? Is it an fckEditor configuration? Is it some pro...
[ "xss", "fckeditor" ]
3
7
6,040
7
0
2008-09-15T19:03:23.213000
2008-09-15T19:11:08.827000
65,749
65,826
What is the deployment rate of the .NET framework?
I've been looking for this information for my commercial desktop product, with no avail. Specifically, what I'm look for, is deployment statistics of the.NET framework for end-users (both granny "I'm just browsing the internet" XP, and high-end users, if possible), and in the commercial/business sector. Edit: Other tha...
Some statistics from 2005 I found at Scott Wiltamuth's blog (you can be sure these numbers are much higher now): More than 120M copies of the.NET Framework have been downloaded and installed using either Microsoft downloads or Windows Update More than 85% of new consumer PCs sold in 2004 had the.NET Framework installed...
What is the deployment rate of the .NET framework? I've been looking for this information for my commercial desktop product, with no avail. Specifically, what I'm look for, is deployment statistics of the.NET framework for end-users (both granny "I'm just browsing the internet" XP, and high-end users, if possible), and...
TITLE: What is the deployment rate of the .NET framework? QUESTION: I've been looking for this information for my commercial desktop product, with no avail. Specifically, what I'm look for, is deployment statistics of the.NET framework for end-users (both granny "I'm just browsing the internet" XP, and high-end users,...
[ "c#", ".net", "deployment", "statistics" ]
3
4
1,549
4
0
2008-09-15T19:04:37.453000
2008-09-15T19:12:33.690000
65,809
65,902
How stable are Cisco IOS OIDs for querying data with SNMP across different model devices?
I'm querying a bunch of information from cisco switches using SNMP. For instance, I'm pulling information on neighbors detected using CDP by doing an snmpwalk on.1.3.6.1.4.1.9.9.23 Can I use this OID across different cisco models? What pitfalls should I be aware of? To me, I'm a little uneasy about using numeric OIDs -...
Once a MIB has been published it won't move to a new OID. Doing so would break network management tools and cause support calls, which nobody wants. To continue your example, the CDP MIB has been published at Cisco's SNMP Object Navigator. For general code cleanliness it would be good to define the OIDs in a central pl...
How stable are Cisco IOS OIDs for querying data with SNMP across different model devices? I'm querying a bunch of information from cisco switches using SNMP. For instance, I'm pulling information on neighbors detected using CDP by doing an snmpwalk on.1.3.6.1.4.1.9.9.23 Can I use this OID across different cisco models?...
TITLE: How stable are Cisco IOS OIDs for querying data with SNMP across different model devices? QUESTION: I'm querying a bunch of information from cisco switches using SNMP. For instance, I'm pulling information on neighbors detected using CDP by doing an snmpwalk on.1.3.6.1.4.1.9.9.23 Can I use this OID across diffe...
[ "snmp", "oid", "cisco-ios" ]
1
3
6,283
6
0
2008-09-15T19:11:11.853000
2008-09-15T19:19:57.760000
65,820
65,845
Unit Testing C Code
I worked on an embedded system this summer written in straight C. It was an existing project that the company I work for had taken over. I have become quite accustomed to writing unit tests in Java using JUnit but was at a loss as to the best way to write unit tests for existing code (which needed refactoring) as well ...
One unit testing framework in C is Check; a list of unit testing frameworks in C can be found here and is reproduced below. Depending on how many standard library functions your runtime has, you may or not be able to use one of those. AceUnit AceUnit (Advanced C and Embedded Unit) bills itself as a comfortable C code u...
Unit Testing C Code I worked on an embedded system this summer written in straight C. It was an existing project that the company I work for had taken over. I have become quite accustomed to writing unit tests in Java using JUnit but was at a loss as to the best way to write unit tests for existing code (which needed r...
TITLE: Unit Testing C Code QUESTION: I worked on an embedded system this summer written in straight C. It was an existing project that the company I work for had taken over. I have become quite accustomed to writing unit tests in Java using JUnit but was at a loss as to the best way to write unit tests for existing co...
[ "c", "unit-testing", "testing", "embedded" ]
960
561
547,746
31
0
2008-09-15T19:12:00.383000
2008-09-15T19:14:36.837000
65,849
65,950
How to insert line breaks in HTML documents using CSS
I'm writing a web service, and I want to return the data as XHTML. Because it's data, not markup, I want to keep it very clean - no extra s or s. However, as a convenience to developers, I'd also like to make the returned data reasonably readable in a browser. To do so, I'm thinking a good way to go about it would be t...
It'd be best to wrap all of your elements in label elements, then apply css to the labels. The:before and:after pseudo classes are not completely supported in a consistent way. Label tags have a lot of advantages including increased accessibility (on multiple levels) and more. Thingy one:; then use CSS on your label el...
How to insert line breaks in HTML documents using CSS I'm writing a web service, and I want to return the data as XHTML. Because it's data, not markup, I want to keep it very clean - no extra s or s. However, as a convenience to developers, I'd also like to make the returned data reasonably readable in a browser. To do...
TITLE: How to insert line breaks in HTML documents using CSS QUESTION: I'm writing a web service, and I want to return the data as XHTML. Because it's data, not markup, I want to keep it very clean - no extra s or s. However, as a convenience to developers, I'd also like to make the returned data reasonably readable i...
[ "html", "css" ]
40
54
80,912
12
0
2008-09-15T19:14:42.873000
2008-09-15T19:26:49.803000
65,856
1,094,142
How can I perform HTTP PUT uploads to a VMware ESX Server in PowerShell?
VMware ESX, ESXi, and VirtualCenter are supposed to be able to support HTTP PUT uploads since version 3.5. I know how to do downloads, that's easy. I've never done PUT before. Background information on the topic is here: http://communities.vmware.com/thread/117504
In the VI Toolkit Extensions use Copy-TkeDatastoreFile. It will work with binaries.
How can I perform HTTP PUT uploads to a VMware ESX Server in PowerShell? VMware ESX, ESXi, and VirtualCenter are supposed to be able to support HTTP PUT uploads since version 3.5. I know how to do downloads, that's easy. I've never done PUT before. Background information on the topic is here: http://communities.vmware....
TITLE: How can I perform HTTP PUT uploads to a VMware ESX Server in PowerShell? QUESTION: VMware ESX, ESXi, and VirtualCenter are supposed to be able to support HTTP PUT uploads since version 3.5. I know how to do downloads, that's easy. I've never done PUT before. Background information on the topic is here: http://c...
[ "http", "powershell", "vmware", "esx" ]
2
2
978
2
0
2008-09-15T19:14:56.883000
2009-07-07T18:56:34.577000
65,865
65,883
What's the easiest way to install a missing Perl module?
I get this error: Can't locate Foo.pm in @INC Is there an easier way to install it than downloading, untarring, making, etc?
On Unix: usually you start cpan in your shell: $ cpan and type install Chocolate::Belgian or in short form: cpan Chocolate::Belgian On Windows: If you're using ActivePerl on Windows, the PPM (Perl Package Manager) has much of the same functionality as CPAN.pm. Example: $ ppm ppm> search net-smtp ppm> install Net-SMTP-M...
What's the easiest way to install a missing Perl module? I get this error: Can't locate Foo.pm in @INC Is there an easier way to install it than downloading, untarring, making, etc?
TITLE: What's the easiest way to install a missing Perl module? QUESTION: I get this error: Can't locate Foo.pm in @INC Is there an easier way to install it than downloading, untarring, making, etc? ANSWER: On Unix: usually you start cpan in your shell: $ cpan and type install Chocolate::Belgian or in short form: cpa...
[ "perl", "module", "cpan" ]
243
277
376,428
24
0
2008-09-15T19:16:07.910000
2008-09-15T19:17:52.553000
65,879
65,894
Should I use an initialization vector (IV) along with my encryption?
Is it recommended that I use an initialization vector to encrypt/decrypt my data? Will it make things more secure? Is it one of those things that need to be evaluated on a case by case basis? To put this into actual context, the Win32 Cryptography function, CryptSetKeyParam allows for the setting of an initialization v...
An IV is essential when the same key might ever be used to encrypt more than one message. The reason is because, under most encryption modes, two messages encrypted with the same key can be analyzed together. In a simple stream cipher, for instance, XORing two ciphertexts encrypted with the same key results in the XOR ...
Should I use an initialization vector (IV) along with my encryption? Is it recommended that I use an initialization vector to encrypt/decrypt my data? Will it make things more secure? Is it one of those things that need to be evaluated on a case by case basis? To put this into actual context, the Win32 Cryptography fun...
TITLE: Should I use an initialization vector (IV) along with my encryption? QUESTION: Is it recommended that I use an initialization vector to encrypt/decrypt my data? Will it make things more secure? Is it one of those things that need to be evaluated on a case by case basis? To put this into actual context, the Win3...
[ "encryption", "cryptography" ]
40
28
25,667
7
0
2008-09-15T19:17:30.887000
2008-09-15T19:19:03.317000
65,889
65,974
Detecting COMCTL32 version in .NET
How do I determine which version of comctl32.dll is being used by a C#.NET application? The answers I've seen to this question usually involve getting version info from the physical file in Windows\System, but that isn't necessarily the version that's actually in use due to side-by-side considerations.
System.Diagnostics.Process.GetCurrentProcess.Modules gives you all the modules loaded in the current process. This also includes the unmanaged win32 dlls. You can search through the collection and check the FileVersionInfo property for the loaded version.
Detecting COMCTL32 version in .NET How do I determine which version of comctl32.dll is being used by a C#.NET application? The answers I've seen to this question usually involve getting version info from the physical file in Windows\System, but that isn't necessarily the version that's actually in use due to side-by-si...
TITLE: Detecting COMCTL32 version in .NET QUESTION: How do I determine which version of comctl32.dll is being used by a C#.NET application? The answers I've seen to this question usually involve getting version info from the physical file in Windows\System, but that isn't necessarily the version that's actually in use...
[ "c#", ".net", "comctl32" ]
1
2
720
1
0
2008-09-15T19:18:26.250000
2008-09-15T19:29:49.030000
65,926
66,017
Is it possible to pass a parameter to XSLT through a URL when using a browser to transform XML?
When using a browser to transform XML (Google Chrome or IE7) is it possible to pass a parameter to the XSLT stylesheet through the URL? example: data.xml John Doe Jane Doe sample.xsl List of
You can generate the XSLT server-side, even if the transformation is client-side. This allows you to use a dynamic script to handle the parameter. For example, you might specify: And then in myscript.cfm you would output the XSL file, but with dynamic script handling the query string parameter (this would vary dependin...
Is it possible to pass a parameter to XSLT through a URL when using a browser to transform XML? When using a browser to transform XML (Google Chrome or IE7) is it possible to pass a parameter to the XSLT stylesheet through the URL? example: data.xml John Doe Jane Doe sample.xsl List of
TITLE: Is it possible to pass a parameter to XSLT through a URL when using a browser to transform XML? QUESTION: When using a browser to transform XML (Google Chrome or IE7) is it possible to pass a parameter to the XSLT stylesheet through the URL? example: data.xml John Doe Jane Doe sample.xsl List of ANSWER: You ca...
[ "xml", "xslt", "browser", "transform", "param" ]
16
4
12,801
3
0
2008-09-15T19:23:04.133000
2008-09-15T19:34:24.793000
65,936
66,030
What's the best library for reading Outlook .msg files in Java?
I would like to read the text and binary attachments in a saved Outlook message (.msg file) from a Java application, without resorting to native code (JNI, Java Native Interface). Apache POI-HSMF seems to be in the right direction, but it's in very early stages of development...
You could use Apache POIFS, which seems to be a little more mature, but that would appear to duplicate the efforts of POI-HSMF. You could use POI-HSMF and contribute changes to get the features you need working. That's often how FOSS projects like that expand. You could use com4j, j-Interop, or some other COM-level int...
What's the best library for reading Outlook .msg files in Java? I would like to read the text and binary attachments in a saved Outlook message (.msg file) from a Java application, without resorting to native code (JNI, Java Native Interface). Apache POI-HSMF seems to be in the right direction, but it's in very early s...
TITLE: What's the best library for reading Outlook .msg files in Java? QUESTION: I would like to read the text and binary attachments in a saved Outlook message (.msg file) from a Java application, without resorting to native code (JNI, Java Native Interface). Apache POI-HSMF seems to be in the right direction, but it...
[ "java", "outlook", "msg" ]
6
3
21,421
4
0
2008-09-15T19:25:16.030000
2008-09-15T19:36:12.590000
65,956
66,020
When would I use Server.Transfer over PostBackURL?
Or vice versa. Update: Hmm, let's assume I have a shopping cart app, the user clicks on the Checkout button. The next thing I want to do is send the user to a Invoice.aspx page (or similar). When the user hits checkout, I could Button.PostBackURL = "Invoice.aspx" or I could do Server.Transfer("Invoice.aspx") (I also ch...
Server.TransferURL will not result in a roundtrip of HTTP request/response. The address bar will not update, as far as the browser knows it has received only one document. Server.Transfer also retains execution context, so the script "keeps going" as opposed to "starts anew". PostbackURL ensures an HTTP request, result...
When would I use Server.Transfer over PostBackURL? Or vice versa. Update: Hmm, let's assume I have a shopping cart app, the user clicks on the Checkout button. The next thing I want to do is send the user to a Invoice.aspx page (or similar). When the user hits checkout, I could Button.PostBackURL = "Invoice.aspx" or I ...
TITLE: When would I use Server.Transfer over PostBackURL? QUESTION: Or vice versa. Update: Hmm, let's assume I have a shopping cart app, the user clicks on the Checkout button. The next thing I want to do is send the user to a Invoice.aspx page (or similar). When the user hits checkout, I could Button.PostBackURL = "I...
[ "asp.net" ]
3
6
3,535
3
0
2008-09-15T19:27:22.657000
2008-09-15T19:34:34.823000
65,969
65,989
What are the C# documentation tags?
In C# documentation tags allow you to produce output similar to MSDN. What are a list of allowable tags for use inside the /// (triple slash) comment area above classes, methods, and properties?
Check out Great documentation on the various C# XML documentation tags. (Go to the bottom to see the tags)
What are the C# documentation tags? In C# documentation tags allow you to produce output similar to MSDN. What are a list of allowable tags for use inside the /// (triple slash) comment area above classes, methods, and properties?
TITLE: What are the C# documentation tags? QUESTION: In C# documentation tags allow you to produce output similar to MSDN. What are a list of allowable tags for use inside the /// (triple slash) comment area above classes, methods, and properties? ANSWER: Check out Great documentation on the various C# XML documentat...
[ "c#", "xml", "documentation" ]
36
8
31,582
7
0
2008-09-15T19:29:37.660000
2008-09-15T19:31:37.950000
65,976
77,406
report generation on php?
one of the most frequent requests I get is to create XY report for YZ App. These apps are normally built on PHP, so far I have manually created most of this reports, and while I enjoy the freedom of building it as I want, it usually becomes pretty tedious to calculate subtotals, averages, exporting to different formats...
The problem you're facing is solved by so-called Business Intelligence software. This software tends to be bloated and expensive, but if you know your way around them you will be able to crank out such reports in no time at all. I'm only familiar with one particular proprietary solution, which isn't too great either. B...
report generation on php? one of the most frequent requests I get is to create XY report for YZ App. These apps are normally built on PHP, so far I have manually created most of this reports, and while I enjoy the freedom of building it as I want, it usually becomes pretty tedious to calculate subtotals, averages, expo...
TITLE: report generation on php? QUESTION: one of the most frequent requests I get is to create XY report for YZ App. These apps are normally built on PHP, so far I have manually created most of this reports, and while I enjoy the freedom of building it as I want, it usually becomes pretty tedious to calculate subtota...
[ "php", "reporting" ]
0
1
1,146
3
0
2008-09-15T19:29:57.783000
2008-09-16T21:38:06.890000
65,990
66,127
Anyone know of a list of delegates already built into the framework?
I find myself writing delegates occasionally for really simple functions (take no arguments and return void for example) and am wondering if anyone knows someplace that has compiled a list of all the predefined delegates already available in the.NET framework so I can reuse them? To be clear I am looking for something ...
Just look in the msdn database for (T) delegate. Here you got a direct link: List of delegates That should get you started.
Anyone know of a list of delegates already built into the framework? I find myself writing delegates occasionally for really simple functions (take no arguments and return void for example) and am wondering if anyone knows someplace that has compiled a list of all the predefined delegates already available in the.NET f...
TITLE: Anyone know of a list of delegates already built into the framework? QUESTION: I find myself writing delegates occasionally for really simple functions (take no arguments and return void for example) and am wondering if anyone knows someplace that has compiled a list of all the predefined delegates already avai...
[ ".net" ]
6
7
2,767
5
0
2008-09-15T19:31:42.037000
2008-09-15T19:44:23.443000
65,998
66,029
Apps that support both DirectX 9 and 10
I have a noobish question for any graphics programmer. I am confused how some games (like Crysis) can support both DirectX 9 (in XP) and 10 (in Vista)? What I understand so far is that if you write a DX10 app, then it can only runs in Vista. Maybe they have 2 code bases -- one written in DX9 and another in DX10? But is...
They have two rendering pipelines, one using DX9 calls and one using DX10 calls. The APIs are not compatible, though a majority of any game engine can be reused for either. If you want some Open Source examples of how different rendering pipelines are done, look at something like Ogre3d, which supports OpenGL, DX9, and...
Apps that support both DirectX 9 and 10 I have a noobish question for any graphics programmer. I am confused how some games (like Crysis) can support both DirectX 9 (in XP) and 10 (in Vista)? What I understand so far is that if you write a DX10 app, then it can only runs in Vista. Maybe they have 2 code bases -- one wr...
TITLE: Apps that support both DirectX 9 and 10 QUESTION: I have a noobish question for any graphics programmer. I am confused how some games (like Crysis) can support both DirectX 9 (in XP) and 10 (in Vista)? What I understand so far is that if you write a DX10 app, then it can only runs in Vista. Maybe they have 2 co...
[ "graphics", "directx", "compatibility" ]
3
5
558
3
0
2008-09-15T19:32:17.573000
2008-09-15T19:35:56.177000
66,006
74,836
JavaScript in client-side XSL processing?
Is it possible to have XML-embedded JavaScript executed to assist in client-side (browser-based) XSL transformations? How is it done and how official is it? Microsoft's XML DOM objects allow this on the server-side (i.e. in ASP/ASP.NET). Clarification: I do not mean HTML DOM scripting performed after the document is tr...
To embed JavaScript for the aid of transformation you can use, but it is limited to Microsoft's XML objects implementation. Here's an example: scripted.xml: ding dong scripted.xsl: function Title() { return "Scripted"; } function Body(text) { return "/" + text + "/"; } Title() Body(nodeTypedValue) The result in Intern...
JavaScript in client-side XSL processing? Is it possible to have XML-embedded JavaScript executed to assist in client-side (browser-based) XSL transformations? How is it done and how official is it? Microsoft's XML DOM objects allow this on the server-side (i.e. in ASP/ASP.NET). Clarification: I do not mean HTML DOM sc...
TITLE: JavaScript in client-side XSL processing? QUESTION: Is it possible to have XML-embedded JavaScript executed to assist in client-side (browser-based) XSL transformations? How is it done and how official is it? Microsoft's XML DOM objects allow this on the server-side (i.e. in ASP/ASP.NET). Clarification: I do no...
[ "javascript", "xslt", "browser" ]
2
4
14,359
4
0
2008-09-15T19:33:39.693000
2008-09-16T17:31:36.607000
66,007
66,384
Auto-updating in Corporate Environments (C#)
I have a three-tier application which is installed in corporate environments. With every server version update, all clients have to be updated, too. Currently, I provide an MSI package which is automatically deployed via Active Directory, however my customers (mostly with 20-300 users each) seem to hate the MSI solutio...
You can somewhat replicate what ClickOnce does, just adjust it for your needs. Create a lightweight executable that checks a network/web location for updates. If there are updates, it copies them locally and replaces the "real" application files. It runs the "real" application. The location for the application files sh...
Auto-updating in Corporate Environments (C#) I have a three-tier application which is installed in corporate environments. With every server version update, all clients have to be updated, too. Currently, I provide an MSI package which is automatically deployed via Active Directory, however my customers (mostly with 20...
TITLE: Auto-updating in Corporate Environments (C#) QUESTION: I have a three-tier application which is installed in corporate environments. With every server version update, all clients have to be updated, too. Currently, I provide an MSI package which is automatically deployed via Active Directory, however my custome...
[ "c#", ".net", "auto-update" ]
4
4
2,473
4
0
2008-09-15T19:33:42.517000
2008-09-15T20:04:50.757000
66,009
67,644
How would you implement a breadcrumb helper in asp.net mvc?
I know you could make a helper pretty easily given the data. So, if possible, please only submit answers that also include getting the data.
We are using an action filter for this.... public override void OnActionExecuting(ActionExecutingContext filterContext) { var controller = (Controller) filterContext.Controller; Breadcrumb[] breadcrumbs = _breadcrumbManager.PushBreadcrumb(_breadcrumbLinkText); controller.ViewData.Add(breadcrumbs); } before you mention ...
How would you implement a breadcrumb helper in asp.net mvc? I know you could make a helper pretty easily given the data. So, if possible, please only submit answers that also include getting the data.
TITLE: How would you implement a breadcrumb helper in asp.net mvc? QUESTION: I know you could make a helper pretty easily given the data. So, if possible, please only submit answers that also include getting the data. ANSWER: We are using an action filter for this.... public override void OnActionExecuting(ActionExec...
[ "asp.net-mvc", "navigation" ]
24
12
13,237
2
0
2008-09-15T19:33:50.630000
2008-09-15T22:32:19.060000
66,016
66,125
What is the best implementation of an exception mechanism?
Most program languages have some kind of exception handling; some languages have return codes, others have try/catch, or rescue/retry, etc., each with its own pecularities in readability, robustness, and practical effectiveness in a large group development effort. Which one is the best and why?
I would say that depends on the nature of your problem. Different problem domains could require almost arbitrary error messages, while other trivial tasks just can return NULL or -1 on error. The problem with error return codes is that you're polluting/masking the error since it can be ignored (sometimes without the AP...
What is the best implementation of an exception mechanism? Most program languages have some kind of exception handling; some languages have return codes, others have try/catch, or rescue/retry, etc., each with its own pecularities in readability, robustness, and practical effectiveness in a large group development effo...
TITLE: What is the best implementation of an exception mechanism? QUESTION: Most program languages have some kind of exception handling; some languages have return codes, others have try/catch, or rescue/retry, etc., each with its own pecularities in readability, robustness, and practical effectiveness in a large grou...
[ "language-agnostic", "exception" ]
2
2
310
5
0
2008-09-15T19:34:21.220000
2008-09-15T19:44:18.107000
66,032
66,116
Order of DOM NodeList returned by getChildNodes()
The DOM method getChildNodes() returns a NodeList of the children of the current Node. Whilst a NodeList is ordered, is the list guaranteed to be in document order? For example, given is a.getChildNodes() guaranteed to return a NodeList with b, c and d in that order? The javadoc isn't clear on this.
In my experience, yes. The DOM spec isn't any clearer. If you're paranoid, try something like current = node.firstChild; while(null!= current) {... current = current.nextSibling; }
Order of DOM NodeList returned by getChildNodes() The DOM method getChildNodes() returns a NodeList of the children of the current Node. Whilst a NodeList is ordered, is the list guaranteed to be in document order? For example, given is a.getChildNodes() guaranteed to return a NodeList with b, c and d in that order? Th...
TITLE: Order of DOM NodeList returned by getChildNodes() QUESTION: The DOM method getChildNodes() returns a NodeList of the children of the current Node. Whilst a NodeList is ordered, is the list guaranteed to be in document order? For example, given is a.getChildNodes() guaranteed to return a NodeList with b, c and d...
[ "java", "xml", "dom" ]
8
5
15,599
6
0
2008-09-15T19:36:44.770000
2008-09-15T19:43:42.057000
66,041
66,732
How to sort by Lucene.Net field and ignore common stop words such as 'a' and 'the'?
I've found how to sort query results by a given field in a Lucene.Net index instead of by score; all it takes is a field that is indexed but not tokenized. However, what I haven't been able to figure out is how to sort that field while ignoring stop words such as "a" and "the", so that the following book titles, for ex...
I wrap the results returned by Lucene into my own collection of custom objects. Then I can populate it with extra info/context information (and use things like the highlighter class to pull out a snippet of the matches), plus add paging. If you took a similar route you could create a "result" class/object, add somethin...
How to sort by Lucene.Net field and ignore common stop words such as 'a' and 'the'? I've found how to sort query results by a given field in a Lucene.Net index instead of by score; all it takes is a field that is indexed but not tokenized. However, what I haven't been able to figure out is how to sort that field while ...
TITLE: How to sort by Lucene.Net field and ignore common stop words such as 'a' and 'the'? QUESTION: I've found how to sort query results by a given field in a Lucene.Net index instead of by score; all it takes is a field that is indexed but not tokenized. However, what I haven't been able to figure out is how to sort...
[ "lucene", "lucene.net" ]
1
1
2,870
5
0
2008-09-15T19:37:20.153000
2008-09-15T20:42:07.890000
66,066
66,076
What is the best way to implement constants in Java?
I've seen examples like this: public class MaxSeconds { public static final int MAX_SECONDS = 25; } and supposed that I could have a Constants class to wrap constants in, declaring them static final. I know practically no Java at all and am wondering if this is the best way to create constants.
That is perfectly acceptable, probably even the standard. (public/private) static final TYPE NAME = VALUE; where TYPE is the type, NAME is the name in all caps with underscores for spaces, and VALUE is the constant value; I highly recommend NOT putting your constants in their own classes or interfaces. As a side note: ...
What is the best way to implement constants in Java? I've seen examples like this: public class MaxSeconds { public static final int MAX_SECONDS = 25; } and supposed that I could have a Constants class to wrap constants in, declaring them static final. I know practically no Java at all and am wondering if this is the b...
TITLE: What is the best way to implement constants in Java? QUESTION: I've seen examples like this: public class MaxSeconds { public static final int MAX_SECONDS = 25; } and supposed that I could have a Constants class to wrap constants in, declaring them static final. I know practically no Java at all and am wonderin...
[ "java", "constants" ]
370
402
892,207
28
0
2008-09-15T19:39:15.937000
2008-09-15T19:39:48.023000
66,094
84,141
.NET 3.5 Linq Datasource and Joins
Have been trying out the new Dynamic Data site create tool that shipped with.NET 3.5. The tool uses LINQ Datasources to get the data from the database using a.dmbl context file for a reference. I am interseted in customizing a data grid but I need to show data from more than one table. Does anyone know how to do this u...
If the tables are connected by a foreign key, you can easily reference both tables as they will be joined by linq automatically (you can see easily if you look in your dbml and there is an arrow connecting the tables) - if not, see if you can add one. To do that, you can just use something like this: <%# Bind("unit1.un...
.NET 3.5 Linq Datasource and Joins Have been trying out the new Dynamic Data site create tool that shipped with.NET 3.5. The tool uses LINQ Datasources to get the data from the database using a.dmbl context file for a reference. I am interseted in customizing a data grid but I need to show data from more than one table...
TITLE: .NET 3.5 Linq Datasource and Joins QUESTION: Have been trying out the new Dynamic Data site create tool that shipped with.NET 3.5. The tool uses LINQ Datasources to get the data from the database using a.dmbl context file for a reference. I am interseted in customizing a data grid but I need to show data from m...
[ "linq", "linq-to-sql", ".net-3.5", "dynamic-data" ]
3
2
5,560
4
0
2008-09-15T19:41:18.053000
2008-09-17T14:58:15.610000
66,104
66,168
Why does Tomcat 5.5 (with Java 1.4, running on Windows XP 32-bit) suddenly hang?
I've been running Tomcat 5.5 with Java 1.4 for a while now with a huge webapp. Most of the time it runs fine, but sometimes it will just hang, with no exception generated, and no apparant way of getting it to run again other than re-starting Tomcat. The tomcat instance is allowed a gigabyte of memory on the heap, but r...
For any jvm process, force a thread dump. In windows, this can be done with CTRL-BREAK, I believe, in the console window. In *nix, it is almost always "kill -3 jvm-pid". This may show if you have threads waiting on db connection pool/thread pool, etc. Another thing to check out is how many connections you have currentl...
Why does Tomcat 5.5 (with Java 1.4, running on Windows XP 32-bit) suddenly hang? I've been running Tomcat 5.5 with Java 1.4 for a while now with a huge webapp. Most of the time it runs fine, but sometimes it will just hang, with no exception generated, and no apparant way of getting it to run again other than re-starti...
TITLE: Why does Tomcat 5.5 (with Java 1.4, running on Windows XP 32-bit) suddenly hang? QUESTION: I've been running Tomcat 5.5 with Java 1.4 for a while now with a huge webapp. Most of the time it runs fine, but sometimes it will just hang, with no exception generated, and no apparant way of getting it to run again ot...
[ "java", "windows", "tomcat" ]
0
3
1,822
4
0
2008-09-15T19:42:36.457000
2008-09-15T19:47:31.830000
66,111
68,302
XWindow ignores multiple ClentMessage's sent during same second
I've encountered an interesting problem while developing for our legacy XWindows application. For reasons that don't bear explaining, I am sending ClientMessage from a comand-line utility to a GUI app.Most of the messages end up having the same contents, as the message's purpose is to trigger a synchronous communicatio...
The X server should never compress client messages that I'm aware of, but perhaps some X toolkits (Motif, Xaw, etc.) do compress them. That's the first thing I would look for - perhaps the GUI app receiving the message is compressing somewhere inside the toolkit, before the application code sees it. Then again, both vn...
XWindow ignores multiple ClentMessage's sent during same second I've encountered an interesting problem while developing for our legacy XWindows application. For reasons that don't bear explaining, I am sending ClientMessage from a comand-line utility to a GUI app.Most of the messages end up having the same contents, a...
TITLE: XWindow ignores multiple ClentMessage's sent during same second QUESTION: I've encountered an interesting problem while developing for our legacy XWindows application. For reasons that don't bear explaining, I am sending ClientMessage from a comand-line utility to a GUI app.Most of the messages end up having th...
[ "x11" ]
0
0
110
1
0
2008-09-15T19:43:07.173000
2008-09-16T00:43:56.593000
66,164
73,846
How to write an SQL query to find out which logins have been granted which rights in Sql Server 2005?
I'm responsible for some test database servers. Historically, too many other poeple have access to them. They run on SQL Server 2005. I've been writing queries and wrapping them in scripts so I can run a regular audit of rights. Finding out which users had Administrator rights on the server itself was fine, as was find...
Here's how to do this. I ended up finding reference to a sproc in the MSDN docs. I pulled this from the sproc and wrapped it in a loop of all the databases known to the instance. select DbRole = g.name, MemberName = u.name from @NAME.sys.database_principals u, @NAME.sys.database_principals g, @NAME.sys.database_role_me...
How to write an SQL query to find out which logins have been granted which rights in Sql Server 2005? I'm responsible for some test database servers. Historically, too many other poeple have access to them. They run on SQL Server 2005. I've been writing queries and wrapping them in scripts so I can run a regular audit ...
TITLE: How to write an SQL query to find out which logins have been granted which rights in Sql Server 2005? QUESTION: I'm responsible for some test database servers. Historically, too many other poeple have access to them. They run on SQL Server 2005. I've been writing queries and wrapping them in scripts so I can ru...
[ "sql", "database" ]
2
1
6,179
3
0
2008-09-15T19:47:17.990000
2008-09-16T15:51:58.470000
66,166
66,239
C++ web service framework
We are looking for a C++ Soap web services framework that support RPC, preferably open source. Any recommendations?
WSO2 Web Services Framework for C++ (WSO2 WSF/C++), a binding of WSO2 WSF/C into C++ is a C++ extension for consuming Web Services in C++. http://wso2.org/projects/wsf/cpp Apache Axis is an open source, XML based Web service framework. It consists of a Java and a C++ implementation of the SOAP server, and various utili...
C++ web service framework We are looking for a C++ Soap web services framework that support RPC, preferably open source. Any recommendations?
TITLE: C++ web service framework QUESTION: We are looking for a C++ Soap web services framework that support RPC, preferably open source. Any recommendations? ANSWER: WSO2 Web Services Framework for C++ (WSO2 WSF/C++), a binding of WSO2 WSF/C into C++ is a C++ extension for consuming Web Services in C++. http://wso2....
[ "c++", "xml", "web-services", "frameworks", "xsd" ]
3
10
15,232
12
0
2008-09-15T19:47:25.963000
2008-09-15T19:52:22.847000
66,172
66,367
Krypton Controls anyone?
I found the ad on this site to Krypton controls ( and here's another one! ) and was wondering if any of you using vs.net 05 or 08 are using them and how that's working out. If you're answering, please specify which parts you're using (free, ribbons, tabs) and which vs.net you're on, which language(s) you use, along wit...
I have been using the Krypton Controls ToolKit for over 3 years with Visual Studio 2005 and 2008 in.NET 2.0, 3.0, 3.5, and 3.5 SP1. I have only used the free ToolKit and not the Ribbon or Tab controls. I have used it only in C #. Pros: Free Easy to Use - It adds all of the components to the Toolbox so it's very easy to...
Krypton Controls anyone? I found the ad on this site to Krypton controls ( and here's another one! ) and was wondering if any of you using vs.net 05 or 08 are using them and how that's working out. If you're answering, please specify which parts you're using (free, ribbons, tabs) and which vs.net you're on, which langu...
TITLE: Krypton Controls anyone? QUESTION: I found the ad on this site to Krypton controls ( and here's another one! ) and was wondering if any of you using vs.net 05 or 08 are using them and how that's working out. If you're answering, please specify which parts you're using (free, ribbons, tabs) and which vs.net you'...
[ "winforms", "visual-studio-2008", "visual-studio-2005" ]
5
10
6,806
4
0
2008-09-15T19:47:43.870000
2008-09-15T20:02:44.710000
66,288
66,334
Lightweight REST library for Java
I'm looking for a light version of REST for a Java web application I'm developing. I've looked at RESTlet (www.restlet.org) and the REST plugin for Struts 2, but I haven't made up my mind. I'm leaning towards RESTlet, as it seems to be lighter. Has anyone implemented a RESTful layer without any of the the frameworks or...
Well, I've used Enunciate quite a bit. It uses simple annotations to provide either REST and/or SOAP endpoints. http://enunciate.codehaus.org Plus, Ryan Heaton has always provided top-notch support for things, too.
Lightweight REST library for Java I'm looking for a light version of REST for a Java web application I'm developing. I've looked at RESTlet (www.restlet.org) and the REST plugin for Struts 2, but I haven't made up my mind. I'm leaning towards RESTlet, as it seems to be lighter. Has anyone implemented a RESTful layer wi...
TITLE: Lightweight REST library for Java QUESTION: I'm looking for a light version of REST for a Java web application I'm developing. I've looked at RESTlet (www.restlet.org) and the REST plugin for Struts 2, but I haven't made up my mind. I'm leaning towards RESTlet, as it seems to be lighter. Has anyone implemented ...
[ "java", "rest" ]
15
3
8,267
6
0
2008-09-15T19:56:29.903000
2008-09-15T19:59:51.923000
66,361
66,763
What are the first tasks for implementing Unit Testing in Brownfield Applications?
Do you refactor your SQL first? Your architecture? or your code base? Do you change languages? Do you throw everything away and start from scratch? [Not refactoring]
I'm adding unit testing to a large, legacy spaghetti codebase. My approach is, when asked to solve a problem, I try to create a new wrapper around the part of the code-base which is relevant to my current task. This new wrapper is developed using TTD (writing the test first). Some of the time calling into the non-unit ...
What are the first tasks for implementing Unit Testing in Brownfield Applications? Do you refactor your SQL first? Your architecture? or your code base? Do you change languages? Do you throw everything away and start from scratch? [Not refactoring]
TITLE: What are the first tasks for implementing Unit Testing in Brownfield Applications? QUESTION: Do you refactor your SQL first? Your architecture? or your code base? Do you change languages? Do you throw everything away and start from scratch? [Not refactoring] ANSWER: I'm adding unit testing to a large, legacy s...
[ "sql", "language-agnostic", "programming-languages", "testing-strategies" ]
4
5
531
2
0
2008-09-15T20:02:08.907000
2008-09-15T20:45:35.543000
66,363
1,319,527
Get external IP address over remoting in C#
I need to find out the external IP of the computer a C# application is running on. In the application I have a connection (via.NET remoting) to a server. Is there a good way to get the address of the client on the server side? (I have edited the question, to be a little more clear. I'm apologize to all kind people who ...
I found a way that worked great for me. By implementing a custom IServerChannelSinkProvider and IServerChannelSink where I have access to CommonTransportKeys.IPAddress, it's easy to add the client ip on the CallContext. public ServerProcessing ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestmessage, I...
Get external IP address over remoting in C# I need to find out the external IP of the computer a C# application is running on. In the application I have a connection (via.NET remoting) to a server. Is there a good way to get the address of the client on the server side? (I have edited the question, to be a little more ...
TITLE: Get external IP address over remoting in C# QUESTION: I need to find out the external IP of the computer a C# application is running on. In the application I have a connection (via.NET remoting) to a server. Is there a good way to get the address of the client on the server side? (I have edited the question, to...
[ "c#", ".net", "remoting" ]
21
6
42,276
12
0
2008-09-15T20:02:29.170000
2009-08-23T20:53:17.653000