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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
150,522 | 150,641 | Restlet - serving up static content | Using Restlet I needed to serve some simple static content in the same context as my web service. I've configured the component with a Directory, but in testing, I've found it will only serve 'index.html', everything else results in a 404. router.attach("/", new Directory(context, new Reference(baseRef, "./content")); ... | Well, I figured out the issue. Actually Restlet appears to route requests based on prefix, but does not handle longest matching prefix correctly, it also seems to ignore file extensions. So for example, if I had a resource attached to "/other"... and a directory on "/". And I request /other.html, what actually happens ... | Restlet - serving up static content Using Restlet I needed to serve some simple static content in the same context as my web service. I've configured the component with a Directory, but in testing, I've found it will only serve 'index.html', everything else results in a 404. router.attach("/", new Directory(context, ne... | TITLE:
Restlet - serving up static content
QUESTION:
Using Restlet I needed to serve some simple static content in the same context as my web service. I've configured the component with a Directory, but in testing, I've found it will only serve 'index.html', everything else results in a 404. router.attach("/", new Dir... | [
"configuration",
"restlet"
] | 3 | 2 | 3,927 | 2 | 0 | 2008-09-29T20:34:06.290000 | 2008-09-29T21:01:04.527000 |
150,532 | 150,584 | How Does One Read Bytes from File in Python | Similar to this question, I am trying to read in an ID3v2 tag header and am having trouble figuring out how to get individual bytes in python. I first read all ten bytes into a string. I then want to parse out the individual pieces of information. I can grab the two version number chars in the string, but then I have n... | If you have a string, with 2 bytes that you wish to interpret as a 16 bit integer, you can do so by: >>> s = '\0\x02' >>> struct.unpack('>H', s) (2,) Note that the > is for big-endian (the largest part of the integer comes first). This is the format id3 tags use. For other sizes of integer, you use different format cod... | How Does One Read Bytes from File in Python Similar to this question, I am trying to read in an ID3v2 tag header and am having trouble figuring out how to get individual bytes in python. I first read all ten bytes into a string. I then want to parse out the individual pieces of information. I can grab the two version n... | TITLE:
How Does One Read Bytes from File in Python
QUESTION:
Similar to this question, I am trying to read in an ID3v2 tag header and am having trouble figuring out how to get individual bytes in python. I first read all ten bytes into a string. I then want to parse out the individual pieces of information. I can grab... | [
"python",
"id3"
] | 8 | 16 | 8,134 | 4 | 0 | 2008-09-29T20:37:34.707000 | 2008-09-29T20:50:20.870000 |
150,535 | 150,617 | Jagged Button edges in Internet Explorer | How do you remove the jagged edges from a wide button in internet explorer? For example: | You can also eliminate Windows XP's styling of buttons (and every other version of Windows) by setting the background-color and/or border-color on your buttons. Try the following styles: background-color: black; color: white; border-color: red green blue yellow; You can of course make this much more pleasing to the eye... | Jagged Button edges in Internet Explorer How do you remove the jagged edges from a wide button in internet explorer? For example: | TITLE:
Jagged Button edges in Internet Explorer
QUESTION:
How do you remove the jagged edges from a wide button in internet explorer? For example:
ANSWER:
You can also eliminate Windows XP's styling of buttons (and every other version of Windows) by setting the background-color and/or border-color on your buttons. Tr... | [
"javascript",
"css",
"internet-explorer"
] | 5 | 5 | 1,313 | 5 | 0 | 2008-09-29T20:38:29.527000 | 2008-09-29T20:56:22.977000 |
150,543 | 150,616 | Forward an invocation of a variadic function in C | In C, is it possible to forward the invocation of a variadic function? As in, int my_printf(char *fmt,...) { fprintf(stderr, "Calling printf with fmt %s", fmt); return SOMEHOW_INVOKE_LIBC_PRINTF; } Forwarding the invocation in the manner above obviously isn't strictly necessary in this case (since you could log invocat... | If there is no function analogous to vfprintf that takes a va_list instead of a variable number of arguments, there is no way. Example: void myfun(const char *fmt, va_list argp) { vfprintf(stderr, fmt, argp); } | Forward an invocation of a variadic function in C In C, is it possible to forward the invocation of a variadic function? As in, int my_printf(char *fmt,...) { fprintf(stderr, "Calling printf with fmt %s", fmt); return SOMEHOW_INVOKE_LIBC_PRINTF; } Forwarding the invocation in the manner above obviously isn't strictly n... | TITLE:
Forward an invocation of a variadic function in C
QUESTION:
In C, is it possible to forward the invocation of a variadic function? As in, int my_printf(char *fmt,...) { fprintf(stderr, "Calling printf with fmt %s", fmt); return SOMEHOW_INVOKE_LIBC_PRINTF; } Forwarding the invocation in the manner above obviousl... | [
"c",
"variadic"
] | 244 | 176 | 93,920 | 13 | 0 | 2008-09-29T20:41:15.087000 | 2008-09-29T20:56:19 |
150,544 | 150,596 | Can you catch a native exception in C# code? | In C# code can you catch a native exception thrown from deep in some unmanaged library? If so do you need to do anything differently to catch it or does a standard try...catch get it? | You can use Win32Exception and use its NativeErrorCode property to handle it appropriately. // http://support.microsoft.com/kb/186550 const int ERROR_FILE_NOT_FOUND = 2; const int ERROR_ACCESS_DENIED = 5; const int ERROR_NO_APP_ASSOCIATED = 1155;
void OpenFile(string filePath) { Process process = new Process();
try {... | Can you catch a native exception in C# code? In C# code can you catch a native exception thrown from deep in some unmanaged library? If so do you need to do anything differently to catch it or does a standard try...catch get it? | TITLE:
Can you catch a native exception in C# code?
QUESTION:
In C# code can you catch a native exception thrown from deep in some unmanaged library? If so do you need to do anything differently to catch it or does a standard try...catch get it?
ANSWER:
You can use Win32Exception and use its NativeErrorCode property ... | [
"c#",
".net",
"exception"
] | 83 | 35 | 57,074 | 9 | 0 | 2008-09-29T20:41:17.630000 | 2008-09-29T20:51:35.797000 |
150,548 | 150,558 | In ActionScript (NaN==parseFloat(input.text)) warns that it will always be false. Why? | Despite the rather clear documentation which says that parseFloat() can return NaN as a value, when I write a block like: if ( NaN == parseFloat(input.text) ) { errorMessage.text = "Please enter a number." } I am warned that the comparison will always be false. And testing shows the warning to be correct. Where is the ... | Because comparing anything to NaN is always false. Use isNaN() instead. | In ActionScript (NaN==parseFloat(input.text)) warns that it will always be false. Why? Despite the rather clear documentation which says that parseFloat() can return NaN as a value, when I write a block like: if ( NaN == parseFloat(input.text) ) { errorMessage.text = "Please enter a number." } I am warned that the comp... | TITLE:
In ActionScript (NaN==parseFloat(input.text)) warns that it will always be false. Why?
QUESTION:
Despite the rather clear documentation which says that parseFloat() can return NaN as a value, when I write a block like: if ( NaN == parseFloat(input.text) ) { errorMessage.text = "Please enter a number." } I am wa... | [
"actionscript-3",
"nan"
] | 7 | 21 | 4,514 | 4 | 0 | 2008-09-29T20:42:49.763000 | 2008-09-29T20:45:00.023000 |
150,552 | 150,595 | Executing dynamic SQL in a SQLServer 2005 function | I will preface this question by saying, I do not think it is solvable. I also have a workaround, I can create a stored procedure with an OUTPUT to accomplish this, it is just easier to code the sections where I need this checksum using a function. This code will not work because of the Exec SP_ExecuteSQL @SQL calls. An... | It "ordinarily" can't be done as SQL Server treats functions as deterministic, which means that for a given set of inputs, it should always return the same outputs. A stored procedure or dynamic sql can be non-deterministic because it can change external state, such as a table, which is relied on. Given that in SQL ser... | Executing dynamic SQL in a SQLServer 2005 function I will preface this question by saying, I do not think it is solvable. I also have a workaround, I can create a stored procedure with an OUTPUT to accomplish this, it is just easier to code the sections where I need this checksum using a function. This code will not wo... | TITLE:
Executing dynamic SQL in a SQLServer 2005 function
QUESTION:
I will preface this question by saying, I do not think it is solvable. I also have a workaround, I can create a stored procedure with an OUTPUT to accomplish this, it is just easier to code the sections where I need this checksum using a function. Thi... | [
"sql-server-2005",
"function"
] | 23 | 17 | 99,736 | 5 | 0 | 2008-09-29T20:43:45.723000 | 2008-09-29T20:51:26.267000 |
150,554 | 150,657 | What is the minimum length number the luhn algorithm will work on? | Excluding the check digit, what is the minimum length number the luhn algorithm will work on? My thoughts are that it would work on any number greater than 2 digits (again, excluding the check digit). The reason I ask is this: if i iterates over all digits in the number from right to left. This causes i%2 == 0 (used to... | Luhn's algorithm would work on two digits. It will warn if a single digit is wrong and some (but not all) of the cases where digits are transposed. Heck, it would theoretically work with one digit, but that's not very useful. You can see for yourself by fixing one digit, then changing the other and verifying that each ... | What is the minimum length number the luhn algorithm will work on? Excluding the check digit, what is the minimum length number the luhn algorithm will work on? My thoughts are that it would work on any number greater than 2 digits (again, excluding the check digit). The reason I ask is this: if i iterates over all dig... | TITLE:
What is the minimum length number the luhn algorithm will work on?
QUESTION:
Excluding the check digit, what is the minimum length number the luhn algorithm will work on? My thoughts are that it would work on any number greater than 2 digits (again, excluding the check digit). The reason I ask is this: if i ite... | [
"java",
"algorithm"
] | 2 | 4 | 2,153 | 1 | 0 | 2008-09-29T20:44:29.527000 | 2008-09-29T21:04:02.880000 |
150,575 | 150,597 | How to find out if a Timer is running? | If I have an instance of a System.Timers.Timer that has a long interval - say 1 minute, how can I find out if it is started without waiting for the Tick? | System.Timer.Timer.Enabled should work, when you call "Start" it sets Enabled to TRUE, "Stop" sets it to FALSE. | How to find out if a Timer is running? If I have an instance of a System.Timers.Timer that has a long interval - say 1 minute, how can I find out if it is started without waiting for the Tick? | TITLE:
How to find out if a Timer is running?
QUESTION:
If I have an instance of a System.Timers.Timer that has a long interval - say 1 minute, how can I find out if it is started without waiting for the Tick?
ANSWER:
System.Timer.Timer.Enabled should work, when you call "Start" it sets Enabled to TRUE, "Stop" sets i... | [
".net",
"timer"
] | 70 | 136 | 95,912 | 5 | 0 | 2008-09-29T20:48:02.933000 | 2008-09-29T20:51:45.483000 |
150,577 | 150,593 | Which browser has the best support for HTML 5 currently? | Where can I test HTML 5 functionality today - is there any test build of any rendering engines which would allow testing, or is it to early? I'm aware that much of the spec hasn't been finalised, but some has, and it would be good to try it out! | Ones that are built using a recent webkit build, and Presto. Safari 3.1 for webkit Opera for Presto. I'm pretty sure firefox will start supporting html5 partially in 3.1 All support is extremely partial. Check here for information on what is supported. | Which browser has the best support for HTML 5 currently? Where can I test HTML 5 functionality today - is there any test build of any rendering engines which would allow testing, or is it to early? I'm aware that much of the spec hasn't been finalised, but some has, and it would be good to try it out! | TITLE:
Which browser has the best support for HTML 5 currently?
QUESTION:
Where can I test HTML 5 functionality today - is there any test build of any rendering engines which would allow testing, or is it to early? I'm aware that much of the spec hasn't been finalised, but some has, and it would be good to try it out!... | [
"html"
] | 31 | 14 | 106,173 | 8 | 0 | 2008-09-29T20:48:54.603000 | 2008-09-29T20:50:55.627000 |
150,588 | 150,620 | How much difference does BLOB or TEXT make in comparison with VARCHAR()? | If I don't know the length of a text entry (e.g. a blog post, description or other long text), what's the best way to store it in MYSQL? | TEXT would be the most appropriate for unknown size text. VARCHAR is limited to 65,535 characters from MYSQL 5.0.3 and 255 chararcters in previous versions, so if you can safely assume it will fit there it will be a better choice. BLOB is for binary data, so unless you expect your text to be in binary format it is the ... | How much difference does BLOB or TEXT make in comparison with VARCHAR()? If I don't know the length of a text entry (e.g. a blog post, description or other long text), what's the best way to store it in MYSQL? | TITLE:
How much difference does BLOB or TEXT make in comparison with VARCHAR()?
QUESTION:
If I don't know the length of a text entry (e.g. a blog post, description or other long text), what's the best way to store it in MYSQL?
ANSWER:
TEXT would be the most appropriate for unknown size text. VARCHAR is limited to 65,... | [
"sql",
"mysql"
] | 8 | 11 | 4,936 | 2 | 0 | 2008-09-29T20:50:31.617000 | 2008-09-29T20:56:39.310000 |
150,600 | 154,187 | Whats the best way to start using Mylyn? | I've heard a lot of good things about using Mylyn in eclipse. How could I set it up to give me a taste of how I could use it? | The seminal Developerworks article from the 2.0 release is a great introduction to Mylyn, and still relevant. Written by the Mik Kirsten who is the Mylyn project lead, it is a very clear explanation of something quite unique. Lots of pretty pictures showing it in action too. Mylyn Part one - Integrated Task Management ... | Whats the best way to start using Mylyn? I've heard a lot of good things about using Mylyn in eclipse. How could I set it up to give me a taste of how I could use it? | TITLE:
Whats the best way to start using Mylyn?
QUESTION:
I've heard a lot of good things about using Mylyn in eclipse. How could I set it up to give me a taste of how I could use it?
ANSWER:
The seminal Developerworks article from the 2.0 release is a great introduction to Mylyn, and still relevant. Written by the M... | [
"eclipse",
"mylyn"
] | 25 | 18 | 5,790 | 8 | 0 | 2008-09-29T20:52:34.717000 | 2008-09-30T17:49:25.210000 |
150,606 | 150,813 | JavaScript highlight table cell on tab in field | I have a website laid out in tables. (a long mortgage form) in each table cell is one HTML object. (text box, radio buttons, etc) What can I do so when each table cell is "tabbed" into it highlights the cell with a very light red (not to be obtrusive, but tell the user where they are)? | This is the table I tested my code on: Here is the code that worked: // here is a cross-browser compatible way of connecting // handlers to events, in case you don't have one function attachEventHandler(element, eventToHandle, eventHandler) { if(element.attachEvent) { element.attachEvent(eventToHandle, eventHandler); }... | JavaScript highlight table cell on tab in field I have a website laid out in tables. (a long mortgage form) in each table cell is one HTML object. (text box, radio buttons, etc) What can I do so when each table cell is "tabbed" into it highlights the cell with a very light red (not to be obtrusive, but tell the user wh... | TITLE:
JavaScript highlight table cell on tab in field
QUESTION:
I have a website laid out in tables. (a long mortgage form) in each table cell is one HTML object. (text box, radio buttons, etc) What can I do so when each table cell is "tabbed" into it highlights the cell with a very light red (not to be obtrusive, bu... | [
"javascript",
"html"
] | 1 | 2 | 6,668 | 3 | 0 | 2008-09-29T20:53:17.227000 | 2008-09-29T21:35:23.257000 |
150,610 | 150,842 | Selecting unique rows in a set of two possibilities | The problem itself is simple, but I can't figure out a solution that does it in one query, and here's my "abstraction" of the problem to allow for a simpler explanation: I will let my original explenation stand, but here's a set of sample data and the result i expect: Ok, so here's some sample data, i separated pairs b... | This is fairly similar to what you wrote, but should be fairly speedy as NOT EXISTS is more efficient, in this case, than NOT IN... mysql> select * from foo; +----+-----+ | id | col | +----+-----+ | 1 | Bar | | 1 | Foo | | 2 | Foo | | 3 | Bar | | 4 | Bar | | 4 | Foo | +----+-----+
SELECT id, col FROM foo f1 WHERE col ... | Selecting unique rows in a set of two possibilities The problem itself is simple, but I can't figure out a solution that does it in one query, and here's my "abstraction" of the problem to allow for a simpler explanation: I will let my original explenation stand, but here's a set of sample data and the result i expect:... | TITLE:
Selecting unique rows in a set of two possibilities
QUESTION:
The problem itself is simple, but I can't figure out a solution that does it in one query, and here's my "abstraction" of the problem to allow for a simpler explanation: I will let my original explenation stand, but here's a set of sample data and th... | [
"sql",
"mysql",
"sql-server",
"database",
"postgresql"
] | 3 | 4 | 3,543 | 9 | 0 | 2008-09-29T20:53:41.737000 | 2008-09-29T21:41:07.177000 |
150,622 | 150,628 | How to select from Varchar where where `Value` is not part of a group | I'm trying to do this SELECT `Name`,`Value` FROM `Constants` WHERE `Name` NOT IN ('Do not get this one'|'or this one'); But it doesn't seem to work. How do I get all the values, except for a select few, without doing this: SELECT `Name`,`Value` FROM `Constants` WHERE `Name`!= 'Do not get this one' AND `Name`!= 'or this... | You should put the constants in a table and then do a select statement from that table. If you absolutely don't want a permanent table you can use a temp table. And if don't want to do that, you can use the IN syntax: NOT IN ('one', 'two') | How to select from Varchar where where `Value` is not part of a group I'm trying to do this SELECT `Name`,`Value` FROM `Constants` WHERE `Name` NOT IN ('Do not get this one'|'or this one'); But it doesn't seem to work. How do I get all the values, except for a select few, without doing this: SELECT `Name`,`Value` FROM ... | TITLE:
How to select from Varchar where where `Value` is not part of a group
QUESTION:
I'm trying to do this SELECT `Name`,`Value` FROM `Constants` WHERE `Name` NOT IN ('Do not get this one'|'or this one'); But it doesn't seem to work. How do I get all the values, except for a select few, without doing this: SELECT `N... | [
"mysql"
] | 1 | 6 | 7,460 | 3 | 0 | 2008-09-29T20:56:53.427000 | 2008-09-29T20:58:09.353000 |
150,638 | 151,409 | Ruby off the rails | Sometimes it feels that my company is the only company in the world using Ruby but not Ruby on Rails, to the point that Rails has almost become synonymous with Ruby. I'm sure this isn't really true, but it'd be fun to hear some stories about non-Rails Ruby usage out there. | One of the huge benefits of Ruby is the ability to create DSLs very easily. Ruby allows you to create "business rules" in a natural language way that is usually easy enough for a business analyst to use. Many Ruby apps outside of web development exist for this purpose. I highly recommend Googling "ruby dsl" for some ex... | Ruby off the rails Sometimes it feels that my company is the only company in the world using Ruby but not Ruby on Rails, to the point that Rails has almost become synonymous with Ruby. I'm sure this isn't really true, but it'd be fun to hear some stories about non-Rails Ruby usage out there. | TITLE:
Ruby off the rails
QUESTION:
Sometimes it feels that my company is the only company in the world using Ruby but not Ruby on Rails, to the point that Rails has almost become synonymous with Ruby. I'm sure this isn't really true, but it'd be fun to hear some stories about non-Rails Ruby usage out there.
ANSWER:
... | [
"ruby"
] | 114 | 51 | 9,559 | 38 | 0 | 2008-09-29T21:00:38.990000 | 2008-09-30T01:24:28.060000 |
150,645 | 150,688 | When ThreadPool.QueueUserWorkItem returns false | The MSDN states that the method returns true if the method is successfully queued; NotSupportedException is thrown if the work item is not queued. For testing purposes how to get the method to return false? Or it is just a "suboptimal" class design? | In looking at the source code in Reflector, it seems the only part of the code that could return "false" is a call to the following: [MethodImpl(MethodImplOptions.InternalCall)] private static extern bool AdjustThreadsInPool(uint QueueLength); | When ThreadPool.QueueUserWorkItem returns false The MSDN states that the method returns true if the method is successfully queued; NotSupportedException is thrown if the work item is not queued. For testing purposes how to get the method to return false? Or it is just a "suboptimal" class design? | TITLE:
When ThreadPool.QueueUserWorkItem returns false
QUESTION:
The MSDN states that the method returns true if the method is successfully queued; NotSupportedException is thrown if the work item is not queued. For testing purposes how to get the method to return false? Or it is just a "suboptimal" class design?
ANS... | [
".net",
"multithreading",
"concurrency",
"threadpool"
] | 6 | 5 | 2,023 | 4 | 0 | 2008-09-29T21:01:47.737000 | 2008-09-29T21:10:12.803000 |
150,646 | 150,713 | How Do I Create a New Excel File Using JXL? | I'm trying to create a new Excel file using jxl, but am having a hard time finding examples in their API documentation and online. | After messing around awhile longer I finally found something that worked and saw there still wasn't a solution posted here yet, so here's what I found: try { String fileName = "file.xls"; WritableWorkbook workbook = Workbook.createWorkbook(new File(fileName)); workbook.createSheet("Sheet1", 0); workbook.createSheet("Sh... | How Do I Create a New Excel File Using JXL? I'm trying to create a new Excel file using jxl, but am having a hard time finding examples in their API documentation and online. | TITLE:
How Do I Create a New Excel File Using JXL?
QUESTION:
I'm trying to create a new Excel file using jxl, but am having a hard time finding examples in their API documentation and online.
ANSWER:
After messing around awhile longer I finally found something that worked and saw there still wasn't a solution posted ... | [
"java",
"jxl"
] | 10 | 11 | 29,839 | 5 | 0 | 2008-09-29T21:02:09.517000 | 2008-09-29T21:16:38.200000 |
150,653 | 157,218 | Java obfuscation - ProGuard/yGuard/other? | This is along similar lines as these recent questions: Best Java Obfuscation Application For Size Reduction Creating non-reverse-engineerable Java programs However, one ends up recommending yGuard and the other ProGuard but neither mention both. I wonder if we could get a comparison of each one and hear peoples experie... | Proguard is a better product; especially if you take the time to go through the settings for J2ME. Specifically for J2ME there is a far better (commercial) product called mBooster I've been getting around 25% improvement in size on my application after its been through Proguard. This is mainly to do with the better Zip... | Java obfuscation - ProGuard/yGuard/other? This is along similar lines as these recent questions: Best Java Obfuscation Application For Size Reduction Creating non-reverse-engineerable Java programs However, one ends up recommending yGuard and the other ProGuard but neither mention both. I wonder if we could get a compa... | TITLE:
Java obfuscation - ProGuard/yGuard/other?
QUESTION:
This is along similar lines as these recent questions: Best Java Obfuscation Application For Size Reduction Creating non-reverse-engineerable Java programs However, one ends up recommending yGuard and the other ProGuard but neither mention both. I wonder if we... | [
"java",
"java-me",
"obfuscation",
"proguard",
"yguard"
] | 19 | 6 | 19,083 | 3 | 0 | 2008-09-29T21:03:07.097000 | 2008-10-01T11:45:24.063000 |
150,666 | 474,750 | How to create a custom log filter in enterprise library 4.0? | I am using Enterprise Library 4.0 and I can't find any documentation on creating a custom logging filter. Has anyone done this or seen any good online documentation on this? | Using Custom Filters in the Enterprise Library Logging Block Great Article. | How to create a custom log filter in enterprise library 4.0? I am using Enterprise Library 4.0 and I can't find any documentation on creating a custom logging filter. Has anyone done this or seen any good online documentation on this? | TITLE:
How to create a custom log filter in enterprise library 4.0?
QUESTION:
I am using Enterprise Library 4.0 and I can't find any documentation on creating a custom logging filter. Has anyone done this or seen any good online documentation on this?
ANSWER:
Using Custom Filters in the Enterprise Library Logging Blo... | [
".net",
"logging",
"enterprise-library"
] | 2 | 5 | 1,888 | 2 | 0 | 2008-09-29T21:05:55.123000 | 2009-01-23T21:53:36.267000 |
150,669 | 150,734 | Do you use Microformats, RDF, Dublin Core or another type of semantic markup? | Do you use any of these technologies? Which ones are current and hence sensible to include in a site? Documentation on any seems to be relatively sparse, and usage of any of them limited, as search engines get better, are they even relevant any more? | I use microformats whenever I can. Usually it just makes sense anyway, as frequently when I have an address block, I may want to style some elements differently then other elements, and that makes it super easy. It's not like microformats are that hard to figure out. There has been a couple of instances where, because ... | Do you use Microformats, RDF, Dublin Core or another type of semantic markup? Do you use any of these technologies? Which ones are current and hence sensible to include in a site? Documentation on any seems to be relatively sparse, and usage of any of them limited, as search engines get better, are they even relevant a... | TITLE:
Do you use Microformats, RDF, Dublin Core or another type of semantic markup?
QUESTION:
Do you use any of these technologies? Which ones are current and hence sensible to include in a site? Documentation on any seems to be relatively sparse, and usage of any of them limited, as search engines get better, are th... | [
"rdf",
"semantic-web",
"microformats"
] | 6 | 6 | 859 | 6 | 0 | 2008-09-29T21:06:23.217000 | 2008-09-29T21:20:07.350000 |
150,690 | 150,729 | Find the prefix substring which gives best compression | Problem: Given a list of strings, find the substring which, if subtracted from the beginning of all strings where it matches and replaced by an escape byte, gives the shortest total length. Example: "foo", "fool", "bar" The result is: "foo" as the base string with the strings "\0", "\0l", "bar" and a total length of 9 ... | Use a forest of prefix trees (trie)... f_2 b_1 / | o_2 a_1 | | o_2 r_1 | l_1 then, we can find the best result, and guarantee it, by maximizing (depth * frequency) which will be replaced with your escape character. You can optimize the search by doing a branch and bound depth first search for the maximum. On the comple... | Find the prefix substring which gives best compression Problem: Given a list of strings, find the substring which, if subtracted from the beginning of all strings where it matches and replaced by an escape byte, gives the shortest total length. Example: "foo", "fool", "bar" The result is: "foo" as the base string with ... | TITLE:
Find the prefix substring which gives best compression
QUESTION:
Problem: Given a list of strings, find the substring which, if subtracted from the beginning of all strings where it matches and replaced by an escape byte, gives the shortest total length. Example: "foo", "fool", "bar" The result is: "foo" as the... | [
"algorithm",
"compression",
"puzzle"
] | 2 | 7 | 968 | 3 | 0 | 2008-09-29T21:10:29.807000 | 2008-09-29T21:19:26.620000 |
150,695 | 150,896 | Where are all the places Sql Reporting Server Logs Errors? | It seems like Sql Reporting Services Server logs information in several places including web server logs and logging tables in the database. Where are all the locations SSRS logs to, and what type of errors are logged in each place? | As far as I know SSRS logs to the Event Log, the filesystem and its own database. The database is typically the most easily available one. You just login to the ReportServer database and execute select * from executionlog This only logs the executions though. If you want more information you can go to the Trace Log fil... | Where are all the places Sql Reporting Server Logs Errors? It seems like Sql Reporting Services Server logs information in several places including web server logs and logging tables in the database. Where are all the locations SSRS logs to, and what type of errors are logged in each place? | TITLE:
Where are all the places Sql Reporting Server Logs Errors?
QUESTION:
It seems like Sql Reporting Services Server logs information in several places including web server logs and logging tables in the database. Where are all the locations SSRS logs to, and what type of errors are logged in each place?
ANSWER:
A... | [
"sql-server",
"reporting-services"
] | 12 | 20 | 34,199 | 2 | 0 | 2008-09-29T21:11:49.023000 | 2008-09-29T21:55:13.350000 |
150,705 | 150,732 | Is there any Visual Library alternative to wxPython that supports CSS/Style Sheets? | I've developed a program that extensively uses wxPython - the wxWindow port for python. Even though it is as mature library it is still very primitive and very programming oriented. Which is time consuming and not flexible at all. I would love to see if there is something like Flex/Action Script where all the visual di... | PyQt with Qt style sheets might be a good fit. Naturally, you'd need to re-write quite a bit of your GUI layer for the toolkit change. | Is there any Visual Library alternative to wxPython that supports CSS/Style Sheets? I've developed a program that extensively uses wxPython - the wxWindow port for python. Even though it is as mature library it is still very primitive and very programming oriented. Which is time consuming and not flexible at all. I wou... | TITLE:
Is there any Visual Library alternative to wxPython that supports CSS/Style Sheets?
QUESTION:
I've developed a program that extensively uses wxPython - the wxWindow port for python. Even though it is as mature library it is still very primitive and very programming oriented. Which is time consuming and not flex... | [
"python",
"wxpython"
] | 1 | 4 | 1,638 | 2 | 0 | 2008-09-29T21:15:09.377000 | 2008-09-29T21:19:38.490000 |
150,726 | 150,768 | C++ having cin read a return character | I was wondering how to use cin so that if the user does not enter in any value and just pushes ENTER that cin will recognize this as valid input. | You will probably want to try std::getline: #include #include std::string line; std::getline( std::cin, line ); if( line.empty() )... | C++ having cin read a return character I was wondering how to use cin so that if the user does not enter in any value and just pushes ENTER that cin will recognize this as valid input. | TITLE:
C++ having cin read a return character
QUESTION:
I was wondering how to use cin so that if the user does not enter in any value and just pushes ENTER that cin will recognize this as valid input.
ANSWER:
You will probably want to try std::getline: #include #include std::string line; std::getline( std::cin, line... | [
"c++",
"input",
"return",
"iostream",
"cin"
] | 13 | 15 | 16,947 | 5 | 0 | 2008-09-29T21:19:05.480000 | 2008-09-29T21:29:19.997000 |
150,731 | 150,745 | What is the best way to write to a file in Ruby? | I would like to write some data to a file in Ruby. What is the best way to do that? | File.open("a_file", "w") do |f| f.write "some data" end You can also use f << "some data" or f.puts "some data" according to personal taste/necessity to have newlines. Change the "w" to "a" if you want to append to the file instead of truncating with each open. | What is the best way to write to a file in Ruby? I would like to write some data to a file in Ruby. What is the best way to do that? | TITLE:
What is the best way to write to a file in Ruby?
QUESTION:
I would like to write some data to a file in Ruby. What is the best way to do that?
ANSWER:
File.open("a_file", "w") do |f| f.write "some data" end You can also use f << "some data" or f.puts "some data" according to personal taste/necessity to have ne... | [
"ruby",
"file-io"
] | 14 | 32 | 14,154 | 5 | 0 | 2008-09-29T21:19:34.077000 | 2008-09-29T21:23:15.207000 |
150,735 | 151,206 | Getting the GUID of a VS 2008 tool window | Does anybody have a short code sample that can be run in the VS macro editor on how to enumerate the tool windows in VS 2008 and show the GUID for each one? Or do you know another way to find this out? | You can enumerate the child keys under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\ToolWindows | Getting the GUID of a VS 2008 tool window Does anybody have a short code sample that can be run in the VS macro editor on how to enumerate the tool windows in VS 2008 and show the GUID for each one? Or do you know another way to find this out? | TITLE:
Getting the GUID of a VS 2008 tool window
QUESTION:
Does anybody have a short code sample that can be run in the VS macro editor on how to enumerate the tool windows in VS 2008 and show the GUID for each one? Or do you know another way to find this out?
ANSWER:
You can enumerate the child keys under HKEY_LOCAL... | [
"c#",
"vb.net",
"visual-studio-2008",
"macros"
] | 0 | 0 | 396 | 1 | 0 | 2008-09-29T21:20:13.870000 | 2008-09-29T23:40:00.230000 |
150,737 | 3,197,593 | How do you install an ssh server on qnx? | I'm working on a qnx device, and I want to be able to ssh into it. Does anyone have a primer on getting something like openSSH up and running? | Depending on whether it's 6.2, 6.3 or 6.4 you will actually go about it in a different manner. 6.2 has "Installer" or "Install Software from QNX" in Photon, a GUI program that lets you download and install it kind of like Fedora's Pup, YaST or the likes. The command-line equivalent is cl-installer. 6.3 does not have th... | How do you install an ssh server on qnx? I'm working on a qnx device, and I want to be able to ssh into it. Does anyone have a primer on getting something like openSSH up and running? | TITLE:
How do you install an ssh server on qnx?
QUESTION:
I'm working on a qnx device, and I want to be able to ssh into it. Does anyone have a primer on getting something like openSSH up and running?
ANSWER:
Depending on whether it's 6.2, 6.3 or 6.4 you will actually go about it in a different manner. 6.2 has "Insta... | [
"ssh",
"qnx"
] | 10 | 5 | 21,570 | 8 | 0 | 2008-09-29T21:21:19.470000 | 2010-07-07T18:10:36.450000 |
150,739 | 152,772 | How much Application session data can you actually hold? | I currently have an application that gets hit with over 20,000 users daily and they mostly look at one data table. This data table is filled with about 20 rows but is pulled from a "datatable" in a db with 200,000-600,000 records of information in the table. Edit: These 20 rows are "dynamic" and do change if the user e... | Technically, I believe what you want to do is possible, but I wouldn't reccomend it. There are several factors you have to consider before going down this path. Do you have the hardware to support it? If you don't have the memory for such a configuration and you have to page swap, then you'll probably lose most of spee... | How much Application session data can you actually hold? I currently have an application that gets hit with over 20,000 users daily and they mostly look at one data table. This data table is filled with about 20 rows but is pulled from a "datatable" in a db with 200,000-600,000 records of information in the table. Edit... | TITLE:
How much Application session data can you actually hold?
QUESTION:
I currently have an application that gets hit with over 20,000 users daily and they mostly look at one data table. This data table is filled with about 20 rows but is pulled from a "datatable" in a db with 200,000-600,000 records of information ... | [
"asp.net",
"caching",
"application-cache"
] | 6 | 2 | 1,892 | 4 | 0 | 2008-09-29T21:21:41.823000 | 2008-09-30T12:14:14.253000 |
150,741 | 150,823 | How do you generate a good ID in ATOM documents? | Apparently using the URL is no good - why is this the case, and how do you generate a good one? | Mark Pilgrim's article How to make a good ID in Atom is good. Here's part of it: Why you shouldn’t use your permalink as an Atom ID It’s valid to use your permalink URL as your, but I discourage it because it can create confusion about which element should be treated as the permalink. Developers who don’t read specs wi... | How do you generate a good ID in ATOM documents? Apparently using the URL is no good - why is this the case, and how do you generate a good one? | TITLE:
How do you generate a good ID in ATOM documents?
QUESTION:
Apparently using the URL is no good - why is this the case, and how do you generate a good one?
ANSWER:
Mark Pilgrim's article How to make a good ID in Atom is good. Here's part of it: Why you shouldn’t use your permalink as an Atom ID It’s valid to us... | [
"atom-feed"
] | 24 | 35 | 7,284 | 2 | 0 | 2008-09-29T21:22:52.680000 | 2008-09-29T21:36:20.197000 |
150,753 | 150,811 | How to avoid heap fragmentation? | I'm currently working on a project for medical image processing, that needs a huge amount of memory. Is there anything I can do to avoid heap fragmentation and to speed up access of image data that has already been loaded into memory? The application has been written in C++ and runs on Windows XP. EDIT: The application... | If you are doing medical image processing it is likely that you are allocating big blocks at a time (512x512, 2-byte per pixel images). Fragmentation will bite you if you allocate smaller objects between the allocations of image buffers. Writing a custom allocator is not necessarily hard for this particular use-case. Y... | How to avoid heap fragmentation? I'm currently working on a project for medical image processing, that needs a huge amount of memory. Is there anything I can do to avoid heap fragmentation and to speed up access of image data that has already been loaded into memory? The application has been written in C++ and runs on ... | TITLE:
How to avoid heap fragmentation?
QUESTION:
I'm currently working on a project for medical image processing, that needs a huge amount of memory. Is there anything I can do to avoid heap fragmentation and to speed up access of image data that has already been loaded into memory? The application has been written i... | [
"performance",
"memory-management",
"heap-memory",
"fragmentation"
] | 13 | 19 | 23,546 | 9 | 0 | 2008-09-29T21:24:59.303000 | 2008-09-29T21:35:17.533000 |
150,762 | 150,836 | How can I test if a list of files exist? | I have a file that lists filenames, each on it's own line, and I want to test if each exists in a particular directory. For example, some sample lines of the file might be mshta.dll foobar.dll somethingelse.dll The directory I'm interested in is X:\Windows\System32\, so I want to see if the following files exist: X:\Wi... | In cmd.exe, the FOR /F % variable IN ( filename ) DO command should give you what you want. This reads the contents of filename (and they could be more than one filenames) one line at a time, placing the line in %variable (more or less; do a HELP FOR in a command prompt). If no one else supplies a command script, I wil... | How can I test if a list of files exist? I have a file that lists filenames, each on it's own line, and I want to test if each exists in a particular directory. For example, some sample lines of the file might be mshta.dll foobar.dll somethingelse.dll The directory I'm interested in is X:\Windows\System32\, so I want t... | TITLE:
How can I test if a list of files exist?
QUESTION:
I have a file that lists filenames, each on it's own line, and I want to test if each exists in a particular directory. For example, some sample lines of the file might be mshta.dll foobar.dll somethingelse.dll The directory I'm interested in is X:\Windows\Syst... | [
"command-line",
"file",
"shell"
] | 8 | 10 | 33,917 | 6 | 0 | 2008-09-29T21:27:16.943000 | 2008-09-29T21:38:32.597000 |
150,764 | 150,799 | Are regexes really maintainable? | Any code I've seen that uses Regexes tends to use them as a black box: Put in string Magic Regex Get out string This doesn't seem a particularly good idea to use in production code, as even a small change can often result in a completely different regex. Apart from cases where the standard is permanent and unchanging, ... | If regexes are long and impenetrable, making them hard to maintain then they should be commented. A lot of regex implementations allow you to pad regexes with whitespace and comments. See https://www.regular-expressions.info/freespacing.html#parenscomment and Coding Horror: Regular Expressions: Now You Have Two Problem... | Are regexes really maintainable? Any code I've seen that uses Regexes tends to use them as a black box: Put in string Magic Regex Get out string This doesn't seem a particularly good idea to use in production code, as even a small change can often result in a completely different regex. Apart from cases where the stand... | TITLE:
Are regexes really maintainable?
QUESTION:
Any code I've seen that uses Regexes tends to use them as a black box: Put in string Magic Regex Get out string This doesn't seem a particularly good idea to use in production code, as even a small change can often result in a completely different regex. Apart from cas... | [
"regex",
"coding-style"
] | 18 | 27 | 2,712 | 20 | 0 | 2008-09-29T21:27:42.700000 | 2008-09-29T21:33:47.833000 |
150,781 | 150,922 | Porting Android's Java VM to the iPhone? | Does anyone know of any existing projects that aim to port Android's Java VM over to the iPhone? From what I understand, this wouldn't be too out of reach and would certainly make for some exciting developments. Edit: I should point out that I am aware this will not happen using the official iPhone SDK. However, a jail... | There isn't currently an effort to port Dalvik to iPhone because Google hasn't released the source yet. As soon as the source is released (assuming all of it will be) I would think this will happen. It's also likely to be seen on other homebrew platforms such as PSP, Pandora, openmoko, etc. | Porting Android's Java VM to the iPhone? Does anyone know of any existing projects that aim to port Android's Java VM over to the iPhone? From what I understand, this wouldn't be too out of reach and would certainly make for some exciting developments. Edit: I should point out that I am aware this will not happen using... | TITLE:
Porting Android's Java VM to the iPhone?
QUESTION:
Does anyone know of any existing projects that aim to port Android's Java VM over to the iPhone? From what I understand, this wouldn't be too out of reach and would certainly make for some exciting developments. Edit: I should point out that I am aware this wil... | [
"iphone",
"android",
"jvm"
] | 13 | 11 | 3,966 | 5 | 0 | 2008-09-29T21:31:18.010000 | 2008-09-29T22:04:52.733000 |
150,803 | 150,874 | Side effects of calling RegisterWindow multiple times with same window class? | I'm working on a little test application at the minute and I have multiple window objects floating around and they each call RegisterWindowEx with the same WNDCLASSEX structure (mainly because they are all an instance of the same class). The first one registers ok, then multiple ones fail, saying class already register... | You can test if the window class was previously registered calling GetClassInfoEx. If the function finds a matching class and successfully copies the data, the return value is nonzero. http://msdn.microsoft.com/en-us/library/ms633579(VS.85).aspx This way you can conditionally register the window class based on the retu... | Side effects of calling RegisterWindow multiple times with same window class? I'm working on a little test application at the minute and I have multiple window objects floating around and they each call RegisterWindowEx with the same WNDCLASSEX structure (mainly because they are all an instance of the same class). The ... | TITLE:
Side effects of calling RegisterWindow multiple times with same window class?
QUESTION:
I'm working on a little test application at the minute and I have multiple window objects floating around and they each call RegisterWindowEx with the same WNDCLASSEX structure (mainly because they are all an instance of the... | [
"c++",
"windows",
"winapi"
] | 4 | 3 | 4,014 | 5 | 0 | 2008-09-29T21:34:17.207000 | 2008-09-29T21:48:42.757000 |
150,805 | 150,826 | Best way to track down a memory leak (C#) only visible on one customer's box | What is the best way to track down a memory leak that is only found on one customer's test/release box, and no where else? | dotTrace3.1 (This question is kinda funny, cause I am tracking a mem leak that isn't present on my machine...) | Best way to track down a memory leak (C#) only visible on one customer's box What is the best way to track down a memory leak that is only found on one customer's test/release box, and no where else? | TITLE:
Best way to track down a memory leak (C#) only visible on one customer's box
QUESTION:
What is the best way to track down a memory leak that is only found on one customer's test/release box, and no where else?
ANSWER:
dotTrace3.1 (This question is kinda funny, cause I am tracking a mem leak that isn't present ... | [
"c#",
".net",
"memory",
"memory-leaks",
"garbage-collection"
] | 12 | 4 | 4,714 | 6 | 0 | 2008-09-29T21:34:23.243000 | 2008-09-29T21:36:40.463000 |
150,814 | 152,724 | How to handle an ActiveX event in Javascript | This is somewhat of a follow-up to an answer here. I have a custom ActiveX control that is raising an event ("ReceiveMessage" with a "msg" parameter) that needs to be handled by Javascript in the web browser. Historically we've been able to use the following IE-only syntax to accomplish this on different projects: func... | I was able to get this working using the following script block format, but I'm still curious if this is the best way: | How to handle an ActiveX event in Javascript This is somewhat of a follow-up to an answer here. I have a custom ActiveX control that is raising an event ("ReceiveMessage" with a "msg" parameter) that needs to be handled by Javascript in the web browser. Historically we've been able to use the following IE-only syntax t... | TITLE:
How to handle an ActiveX event in Javascript
QUESTION:
This is somewhat of a follow-up to an answer here. I have a custom ActiveX control that is raising an event ("ReceiveMessage" with a "msg" parameter) that needs to be handled by Javascript in the web browser. Historically we've been able to use the followin... | [
"javascript",
"events",
"activex"
] | 20 | 13 | 63,046 | 7 | 0 | 2008-09-29T21:35:23.600000 | 2008-09-30T11:58:46.507000 |
150,825 | 158,648 | Pentaho vs Microsoft BI Stack | My company is heavily invested in the MS BI Stack (SQL Server Reporting Services, -Analysis Services and -Integration Services), but I want to have a look at what the seemingly most talked about open-source alternative Pentaho is like. I've installed a version, and I got it up and running quite painlessly. So that's go... | I reviewed multiple Bi stacks while on a path to get off of Business Objects. A lot of my comments are preference. Both tool sets are excellent. Some things are how I prefer chocolate fudge brownie ice cream over plain chocolate. Pentaho has some really smart guys working with them but Microsoft has been on a well fund... | Pentaho vs Microsoft BI Stack My company is heavily invested in the MS BI Stack (SQL Server Reporting Services, -Analysis Services and -Integration Services), but I want to have a look at what the seemingly most talked about open-source alternative Pentaho is like. I've installed a version, and I got it up and running ... | TITLE:
Pentaho vs Microsoft BI Stack
QUESTION:
My company is heavily invested in the MS BI Stack (SQL Server Reporting Services, -Analysis Services and -Integration Services), but I want to have a look at what the seemingly most talked about open-source alternative Pentaho is like. I've installed a version, and I got ... | [
"sql-server",
"reporting-services",
"ssas",
"business-intelligence",
"pentaho"
] | 38 | 55 | 26,581 | 9 | 0 | 2008-09-29T21:36:38.327000 | 2008-10-01T17:01:10.013000 |
150,845 | 150,875 | How can I create this action link? | I'm having issues creating an ActionLink using Preview 5. All the docs I can find describe the older generic version. I'm constructing links on a list of jobs on the page /jobs. Each job has a guid, and I'd like to construct a link to /jobs/details/{guid} so I can show details about the job. My jobs controller has an I... | Give this a shot: <%= Html.ActionLink(job.Name, "Details", new { guid = job.JobId}); %> Where "guid" is the actual name of the parameter in your route. This instructs the routing engine that you want to place the value of the job.JobId property into the route definition's guid parameter. | How can I create this action link? I'm having issues creating an ActionLink using Preview 5. All the docs I can find describe the older generic version. I'm constructing links on a list of jobs on the page /jobs. Each job has a guid, and I'd like to construct a link to /jobs/details/{guid} so I can show details about t... | TITLE:
How can I create this action link?
QUESTION:
I'm having issues creating an ActionLink using Preview 5. All the docs I can find describe the older generic version. I'm constructing links on a list of jobs on the page /jobs. Each job has a guid, and I'd like to construct a link to /jobs/details/{guid} so I can sh... | [
"asp.net-mvc",
"actionlink"
] | 1 | 3 | 2,164 | 2 | 0 | 2008-09-29T21:42:39.417000 | 2008-09-29T21:48:46.313000 |
150,849 | 150,882 | How to get JRE/JDK with matching source? | I'd like to get at least one JRE/JDK level on my Windows machine where I have the JRE/JDK source that matches the exact level of the JRE/JDK. My purpose is to be able to go into the system classes while debugging. Any suggestions about how to do this? Thanks in advance. | Most of the useful source will be in the src.zip file in your JDK. You can get source up to jdk 6u3 from jdk6.dev.java.net. On Linux you can get OpenJDK source and packages from openjdk.java.net. | How to get JRE/JDK with matching source? I'd like to get at least one JRE/JDK level on my Windows machine where I have the JRE/JDK source that matches the exact level of the JRE/JDK. My purpose is to be able to go into the system classes while debugging. Any suggestions about how to do this? Thanks in advance. | TITLE:
How to get JRE/JDK with matching source?
QUESTION:
I'd like to get at least one JRE/JDK level on my Windows machine where I have the JRE/JDK source that matches the exact level of the JRE/JDK. My purpose is to be able to go into the system classes while debugging. Any suggestions about how to do this? Thanks in... | [
"java"
] | 10 | 9 | 9,071 | 5 | 0 | 2008-09-29T21:42:57.577000 | 2008-09-29T21:50:16.327000 |
150,876 | 150,907 | What IDEs and tools are available for C language development? | Looking at learning some C since i saw in another SO question that is good to learn for the language and for the historical experience. Wondering about what IDE's professionals use and what other tools are useful while programming in C? | I have always been fond of Code::Blocks It's a wonderful C/C++ IDE, with several helpful addons. As for a compiler I've always used MingW but I hear DigitalMars C/C++ compiler is good. | What IDEs and tools are available for C language development? Looking at learning some C since i saw in another SO question that is good to learn for the language and for the historical experience. Wondering about what IDE's professionals use and what other tools are useful while programming in C? | TITLE:
What IDEs and tools are available for C language development?
QUESTION:
Looking at learning some C since i saw in another SO question that is good to learn for the language and for the historical experience. Wondering about what IDE's professionals use and what other tools are useful while programming in C?
AN... | [
"c",
"ide",
"development-environment"
] | 3 | 4 | 8,559 | 8 | 0 | 2008-09-29T21:48:53.333000 | 2008-09-29T21:57:32.253000 |
150,881 | 150,915 | What can cause mutated Word document attachements? | We are sending out Word documents via email (automated system, not by hand). The email is sent to the user, and CC'd to me. We are getting reports that some users are having the attachments come through corrupted, though when we open the copy that is CC'd to me, it opens fine. When the user forwards us the copy they re... | The first 3 characters are missing in the corrupted one - compare // Your correct version 00000BC0 0D 0D 0D 41
// Their corrupted one 00000BC0 D0 D4 1... Either their mail server, mail program, anti-virus or some such program has removed the first few chars, which seems to be causing the confusion when Word tries to o... | What can cause mutated Word document attachements? We are sending out Word documents via email (automated system, not by hand). The email is sent to the user, and CC'd to me. We are getting reports that some users are having the attachments come through corrupted, though when we open the copy that is CC'd to me, it ope... | TITLE:
What can cause mutated Word document attachements?
QUESTION:
We are sending out Word documents via email (automated system, not by hand). The email is sent to the user, and CC'd to me. We are getting reports that some users are having the attachments come through corrupted, though when we open the copy that is ... | [
"email",
"ms-word",
"attachment"
] | 2 | 1 | 446 | 2 | 0 | 2008-09-29T21:50:12.397000 | 2008-09-29T22:00:32.073000 |
150,891 | 150,967 | Remove Duplicates with Caveats | I have a table with rowID, longitude, latitude, businessName, url, caption. This might look like: rowID | long | lat | businessName | url | caption
1 20 -20 Pizza Hut yum.com null How do I delete all of the duplicates, but only keep the one that has a URL (first priority), or keep the one that has a caption if the oth... | Here's my looping technique. This will probably get voted down for not being mainstream - and I'm cool with that. DECLARE @LoopVar int
DECLARE @long int, @lat int, @businessname varchar(30), @winner int
SET @LoopVar = (SELECT MIN(rowID) FROM Locations)
WHILE @LoopVar is not null BEGIN --initialize the variables. SEL... | Remove Duplicates with Caveats I have a table with rowID, longitude, latitude, businessName, url, caption. This might look like: rowID | long | lat | businessName | url | caption
1 20 -20 Pizza Hut yum.com null How do I delete all of the duplicates, but only keep the one that has a URL (first priority), or keep the on... | TITLE:
Remove Duplicates with Caveats
QUESTION:
I have a table with rowID, longitude, latitude, businessName, url, caption. This might look like: rowID | long | lat | businessName | url | caption
1 20 -20 Pizza Hut yum.com null How do I delete all of the duplicates, but only keep the one that has a URL (first priorit... | [
"sql",
"sql-server",
"duplicate-data"
] | 2 | 3 | 1,916 | 6 | 0 | 2008-09-29T21:53:18.020000 | 2008-09-29T22:13:07.473000 |
150,900 | 151,143 | Windows Forms UserControl overrides not being called | I am creating a Windows Forms control derived from UserControl to be embedded in a WPF app. I have generally followed the procedures given in this link. public ref class CTiledImgViewControl: public UserControl {...
virtual void OnPaint( PaintEventArgs^ e ) override;... }; And in my CPP file: void CTiledImgViewControl... | The OnPaint won't normally get called in a UserControl unless you set the appropriate style when it is constructed using the SetStyle method. You need to set the UserPaint style to true for the OnPaint to get called. SetStyle(ControlStyles::UserPaint, true); Update I recently encountered this issue myself and went digg... | Windows Forms UserControl overrides not being called I am creating a Windows Forms control derived from UserControl to be embedded in a WPF app. I have generally followed the procedures given in this link. public ref class CTiledImgViewControl: public UserControl {...
virtual void OnPaint( PaintEventArgs^ e ) override... | TITLE:
Windows Forms UserControl overrides not being called
QUESTION:
I am creating a Windows Forms control derived from UserControl to be embedded in a WPF app. I have generally followed the procedures given in this link. public ref class CTiledImgViewControl: public UserControl {...
virtual void OnPaint( PaintEvent... | [
"wpf",
"winforms",
"c++-cli",
"user-controls",
"onpaint"
] | 0 | 2 | 2,697 | 2 | 0 | 2008-09-29T21:56:10.820000 | 2008-09-29T23:13:26.097000 |
150,901 | 153,549 | .Net Regex ValidationExpression ASCII | Anyone know a good Regex expression to drop in the ValidationExpression to be sure that my users are only entering ASCII characters? | One thing you may want to watch out for is the lower part of the ASCII table has a lot of control characters which can cause funky results. Here's the expression I use to only allow "non-funky" characters: ^([^\x0d\x0a\x20-\x7e\t]*)$ | .Net Regex ValidationExpression ASCII Anyone know a good Regex expression to drop in the ValidationExpression to be sure that my users are only entering ASCII characters? | TITLE:
.Net Regex ValidationExpression ASCII
QUESTION:
Anyone know a good Regex expression to drop in the ValidationExpression to be sure that my users are only entering ASCII characters?
ANSWER:
One thing you may want to watch out for is the lower part of the ASCII table has a lot of control characters which can cau... | [
".net",
"regex",
"ascii"
] | 1 | 2 | 2,516 | 2 | 0 | 2008-09-29T21:56:11.897000 | 2008-09-30T15:27:02.167000 |
150,902 | 150,973 | Hibernate -- load an object based on a member object's field | How can an object be loaded via Hibernate based on a field value of a member object? For example, suppose the following classes existed, with a one-to-one relationship between bar and foo: Foo { Long id; }
Bar { Long id; Foo aMember; } How could one use Hibernate Criteria to load Bar if you only had the id of Foo? The... | You can absolutely use Criteria in an efficient manner to accomplish this: session.createCriteria(Bar.class). createAlias("aMember", "a"). add(Restrictions.eq("a.id", fooId)); ought to do the trick. | Hibernate -- load an object based on a member object's field How can an object be loaded via Hibernate based on a field value of a member object? For example, suppose the following classes existed, with a one-to-one relationship between bar and foo: Foo { Long id; }
Bar { Long id; Foo aMember; } How could one use Hibe... | TITLE:
Hibernate -- load an object based on a member object's field
QUESTION:
How can an object be loaded via Hibernate based on a field value of a member object? For example, suppose the following classes existed, with a one-to-one relationship between bar and foo: Foo { Long id; }
Bar { Long id; Foo aMember; } How ... | [
"hibernate",
"criteria"
] | 2 | 3 | 5,988 | 2 | 0 | 2008-09-29T21:56:20.320000 | 2008-09-29T22:15:49.247000 |
150,923 | 150,940 | How do I password protect IIS in a method analogous to Apache's AuthType / AuthUserFile mechanism? | I'm used to doing basic password protection for Apache w/ the following method in Apache config files: AuthType Basic AuthName "By Invitation Only" AuthUserFile /path/to/.htpasswd Require valid-user However, I've been asked to put some protection on a subdirectory of a site running ColdFusion on top of IIS6, and I'm un... | You can go into IIS 6 and the properties for your website's folder you want to protect. Click directory security tab and uncheck allow anonymous. Then you need to choose an authntication type. If its over SSL you can use basic, otherwise use another type. But since you mention basic, this may suffice regardless. Keep i... | How do I password protect IIS in a method analogous to Apache's AuthType / AuthUserFile mechanism? I'm used to doing basic password protection for Apache w/ the following method in Apache config files: AuthType Basic AuthName "By Invitation Only" AuthUserFile /path/to/.htpasswd Require valid-user However, I've been ask... | TITLE:
How do I password protect IIS in a method analogous to Apache's AuthType / AuthUserFile mechanism?
QUESTION:
I'm used to doing basic password protection for Apache w/ the following method in Apache config files: AuthType Basic AuthName "By Invitation Only" AuthUserFile /path/to/.htpasswd Require valid-user Howe... | [
"security",
"apache",
"iis",
"authentication"
] | 0 | 2 | 2,499 | 2 | 0 | 2008-09-29T22:05:00.847000 | 2008-09-29T22:08:36.953000 |
150,935 | 150,949 | What's the best way for a .NET windows forms application to update itself? | I use a home-grown system where the application updates itself from a web service. However, I seem to remember something in the original.NET sales pitch about auto-updating of components being a built-in feature of.NET. What are the best practices for having an application update itself and/or the assemblies it uses? | You may want to take a look at the Click-Once technology. Some great examples in these references. http://www.codeproject.com/KB/install/QuickClickOnceArticle.aspx http://msdn.microsoft.com/en-us/magazine/cc163973.aspx | What's the best way for a .NET windows forms application to update itself? I use a home-grown system where the application updates itself from a web service. However, I seem to remember something in the original.NET sales pitch about auto-updating of components being a built-in feature of.NET. What are the best practic... | TITLE:
What's the best way for a .NET windows forms application to update itself?
QUESTION:
I use a home-grown system where the application updates itself from a web service. However, I seem to remember something in the original.NET sales pitch about auto-updating of components being a built-in feature of.NET. What ar... | [
"c#",
".net",
"winforms",
"auto-update"
] | 3 | 6 | 3,077 | 2 | 0 | 2008-09-29T22:07:40.233000 | 2008-09-29T22:10:05.187000 |
150,937 | 5,759,712 | Computer Science text book way to do text/xml/whatever parsing | It's been ratling in my brain for a while. I've had some investigation on Compilers/Flex/Byson and stuff but I never found a good reference that talked in detail about the "parsing stack", or how to go about implementing one. Does anyone know of good references where I could catch up? Edit: I do appreciate all the comp... | This is in response to Dima's answer that you accepted as the correct answer. Although it is not a bad answer to state that parsing is related to automata theory, I feel that there is some misunderstanding here. Firstly, finite state automata are only able to recognize regular languages (e.g. regular expressions). In o... | Computer Science text book way to do text/xml/whatever parsing It's been ratling in my brain for a while. I've had some investigation on Compilers/Flex/Byson and stuff but I never found a good reference that talked in detail about the "parsing stack", or how to go about implementing one. Does anyone know of good refere... | TITLE:
Computer Science text book way to do text/xml/whatever parsing
QUESTION:
It's been ratling in my brain for a while. I've had some investigation on Compilers/Flex/Byson and stuff but I never found a good reference that talked in detail about the "parsing stack", or how to go about implementing one. Does anyone k... | [
"parsing",
"computer-science",
"theory"
] | 3 | 3 | 561 | 5 | 0 | 2008-09-29T22:07:57.627000 | 2011-04-22T20:23:39.837000 |
150,941 | 150,975 | How do you specify the port number in a oledb connection string to SQL server 2005? | Just found this out, so i am answering my own question:) Use a comma where you would normally use a colon. This can be a problem for named instances, as you seem to need to specify the port even if it is the default port 1433. Example: Provider=SQLOLEDB;Data Source=192.168.200.123,1433; Initial Catalog=Northwind; User ... | I always check out http://www.connectionstrings.com/. It is a brilliant resource for connection strings. | How do you specify the port number in a oledb connection string to SQL server 2005? Just found this out, so i am answering my own question:) Use a comma where you would normally use a colon. This can be a problem for named instances, as you seem to need to specify the port even if it is the default port 1433. Example: ... | TITLE:
How do you specify the port number in a oledb connection string to SQL server 2005?
QUESTION:
Just found this out, so i am answering my own question:) Use a comma where you would normally use a colon. This can be a problem for named instances, as you seem to need to specify the port even if it is the default po... | [
"sql-server",
"connection-string"
] | 6 | 9 | 20,994 | 2 | 0 | 2008-09-29T22:08:49.387000 | 2008-09-29T22:16:07.030000 |
150,953 | 150,976 | Error "set_paths: undefined method uid for nil:NilClass (NoMethodError)" while installing RubyGems on Vista | I get the following error when attempting to install RubyGems. I've tried Googling but have had no luck there. Has anybody encountered and resolved this issue before? C:\rubygems-1.3.0> ruby setup.rb.. install -c -m 0644 rubygems/validator.rb C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/validator.rb install -c -m 0644 rubyg... | I assume you're not trying to install under cygwin; that install is meant for unix-like operating systems. Edit: (Actually, from the log above it looks like there is some Windows-specific stuff being run... perhaps you're running into a UAC protection issue?) If you just use the Windows ruby one-click installer, it inc... | Error "set_paths: undefined method uid for nil:NilClass (NoMethodError)" while installing RubyGems on Vista I get the following error when attempting to install RubyGems. I've tried Googling but have had no luck there. Has anybody encountered and resolved this issue before? C:\rubygems-1.3.0> ruby setup.rb.. install -c... | TITLE:
Error "set_paths: undefined method uid for nil:NilClass (NoMethodError)" while installing RubyGems on Vista
QUESTION:
I get the following error when attempting to install RubyGems. I've tried Googling but have had no luck there. Has anybody encountered and resolved this issue before? C:\rubygems-1.3.0> ruby set... | [
"ruby",
"windows-vista",
"rubygems"
] | 0 | 3 | 2,335 | 4 | 0 | 2008-09-29T22:10:29.303000 | 2008-09-29T22:16:22.567000 |
150,977 | 151,072 | Perform regex (replace) in an SQL query | What is the best way to replace all '<' with < in a given database column? Basically perform s/<[^;]/</gi Notes: must work in MS SQL Server 2000 Must be repeatable (and not end up with <;;;;;;;;; ) | Some hacking required but we can do this with LIKE, PATINDEX, LEFT AND RIGHT and good old string concatenation. create table test ( id int identity(1, 1) not null, val varchar(25) not null )
insert into test values ('< <- ok, < <- nok')
while 1 = 1 begin update test set val = left(val, patindex('%<[^;]%', val) - 1) +... | Perform regex (replace) in an SQL query What is the best way to replace all '<' with < in a given database column? Basically perform s/<[^;]/</gi Notes: must work in MS SQL Server 2000 Must be repeatable (and not end up with <;;;;;;;;; ) | TITLE:
Perform regex (replace) in an SQL query
QUESTION:
What is the best way to replace all '<' with < in a given database column? Basically perform s/<[^;]/</gi Notes: must work in MS SQL Server 2000 Must be repeatable (and not end up with <;;;;;;;;; )
ANSWER:
Some hacking required but we can do this with LIKE, PAT... | [
"sql",
"sql-server",
"regex",
"sql-server-2000"
] | 18 | 18 | 114,288 | 5 | 0 | 2008-09-29T22:16:39.570000 | 2008-09-29T22:46:30.873000 |
150,994 | 151,020 | What's the best way for a .NET winforms application to update itself without using ClickOnce? | For technical reasons, I can't use ClickOnce to auto-update my.NET application and its assemblies. What is the best way to handle auto-updating in.NET? | I think the Updater Application Block was something of a precursor to ClickOnce. Might be worth investigating. Looking at its source code might be enough to spark some ideas. | What's the best way for a .NET winforms application to update itself without using ClickOnce? For technical reasons, I can't use ClickOnce to auto-update my.NET application and its assemblies. What is the best way to handle auto-updating in.NET? | TITLE:
What's the best way for a .NET winforms application to update itself without using ClickOnce?
QUESTION:
For technical reasons, I can't use ClickOnce to auto-update my.NET application and its assemblies. What is the best way to handle auto-updating in.NET?
ANSWER:
I think the Updater Application Block was somet... | [
"c#",
".net",
"winforms",
"compact-framework"
] | 23 | 9 | 7,867 | 9 | 0 | 2008-09-29T22:24:21.893000 | 2008-09-29T22:35:17.543000 |
150,998 | 151,108 | In my ActionScript3 class, can I have a property with a getter and setter? | In my ActionScript3 class, can I have a property with a getter and setter? | Ok, well you can just use the basic getter/setter syntax for any property of your AS3 class. For example package {
public class PropEG {
private var _prop:String;
public function get prop():String { return _prop; }
public function set prop(value:String):void { _prop = value; } } } | In my ActionScript3 class, can I have a property with a getter and setter? In my ActionScript3 class, can I have a property with a getter and setter? | TITLE:
In my ActionScript3 class, can I have a property with a getter and setter?
QUESTION:
In my ActionScript3 class, can I have a property with a getter and setter?
ANSWER:
Ok, well you can just use the basic getter/setter syntax for any property of your AS3 class. For example package {
public class PropEG {
priv... | [
"actionscript-3"
] | 4 | 20 | 9,793 | 3 | 0 | 2008-09-29T22:27:30.560000 | 2008-09-29T22:59:53.647000 |
151,000 | 152,086 | Finalizers and Dispose | I've got a class named BackgroundWorker that has a thread constantly running. To turn this thread off, an instance variable named stop to needs to be true. To make sure the thread is freed when the class is done being used, I've added IDisposable and a finalizer that invokes Dispose(). Assuming that stop = true does in... | Your code is fine, although locking in a finalizer is somewhat "scary" and I would avoid it - if you get a deadlock... I am not 100% certain what would happen but it would not be good. However, if you are safe this should not be a problem. Mostly. The internals of garbage collection are painful and I hope you never hav... | Finalizers and Dispose I've got a class named BackgroundWorker that has a thread constantly running. To turn this thread off, an instance variable named stop to needs to be true. To make sure the thread is freed when the class is done being used, I've added IDisposable and a finalizer that invokes Dispose(). Assuming t... | TITLE:
Finalizers and Dispose
QUESTION:
I've got a class named BackgroundWorker that has a thread constantly running. To turn this thread off, an instance variable named stop to needs to be true. To make sure the thread is freed when the class is done being used, I've added IDisposable and a finalizer that invokes Dis... | [
"c#",
"dispose",
"idisposable",
"finalizer",
"disposable"
] | 4 | 3 | 4,054 | 6 | 0 | 2008-09-29T22:28:27.063000 | 2008-09-30T07:30:46.667000 |
151,005 | 2,603,625 | How do I create an Excel (.XLS and .XLSX) file in C# without installing Microsoft Office? | How can I create an Excel spreadsheet with C# without requiring Excel to be installed on the machine that's running the code? | You can use a library called ExcelLibrary. It's a free, open source library posted on Google Code: ExcelLibrary This looks to be a port of the PHP ExcelWriter that you mentioned above. It will not write to the new.xlsx format yet, but they are working on adding that functionality in. It's very simple, small and easy to... | How do I create an Excel (.XLS and .XLSX) file in C# without installing Microsoft Office? How can I create an Excel spreadsheet with C# without requiring Excel to be installed on the machine that's running the code? | TITLE:
How do I create an Excel (.XLS and .XLSX) file in C# without installing Microsoft Office?
QUESTION:
How can I create an Excel spreadsheet with C# without requiring Excel to be installed on the machine that's running the code?
ANSWER:
You can use a library called ExcelLibrary. It's a free, open source library p... | [
"c#",
".net",
"excel",
"file-io"
] | 2,166 | 1,188 | 1,355,993 | 48 | 0 | 2008-09-29T22:30:28.680000 | 2010-04-08T21:36:03.573000 |
151,021 | 151,053 | Is it OK to use static variables to cache information in ASP.net? | At the moment I am working on a project admin application in C# 3.5 on ASP.net. In order to reduce hits to the database, I'm caching a lot of information using static variables. For example, a list of users is kept in memory in a static class. The class reads in all the information from the database on startup, and wil... | A pitfall: A static field is scoped per app domain, and increased load will make the server generate more app domains in the pool. This is not necessarily a problem if you only read from the statics, but you will get duplicate data in memory, and you will get a hit every time an app domain is created or recycled. Bette... | Is it OK to use static variables to cache information in ASP.net? At the moment I am working on a project admin application in C# 3.5 on ASP.net. In order to reduce hits to the database, I'm caching a lot of information using static variables. For example, a list of users is kept in memory in a static class. The class ... | TITLE:
Is it OK to use static variables to cache information in ASP.net?
QUESTION:
At the moment I am working on a project admin application in C# 3.5 on ASP.net. In order to reduce hits to the database, I'm caching a lot of information using static variables. For example, a list of users is kept in memory in a static... | [
"c#",
"asp.net",
"caching",
"static-variables"
] | 24 | 16 | 10,468 | 5 | 0 | 2008-09-29T22:35:40.023000 | 2008-09-29T22:42:08.073000 |
151,024 | 151,169 | How can I upgrade the *console* version of vim on OS X? | I'm sure this is a newbie question, but every time I've compiled/dl'ed a new version of vim for os x, running vim on the command-line opens up the gvim app. I just want to upgrade the console version (so I can, for example, have python compiled in to use omnicomplete). | You can also use MacPorts to handle the installation for you. Once you've installed it, run the /opt/local/bin/vim binary. I place this in my PATH before the system binary dirs (although be aware that this may cause problems for cmdline tools that rely on the versions of tools shipped with OS X). | How can I upgrade the *console* version of vim on OS X? I'm sure this is a newbie question, but every time I've compiled/dl'ed a new version of vim for os x, running vim on the command-line opens up the gvim app. I just want to upgrade the console version (so I can, for example, have python compiled in to use omnicompl... | TITLE:
How can I upgrade the *console* version of vim on OS X?
QUESTION:
I'm sure this is a newbie question, but every time I've compiled/dl'ed a new version of vim for os x, running vim on the command-line opens up the gvim app. I just want to upgrade the console version (so I can, for example, have python compiled i... | [
"macos",
"vim",
"console"
] | 15 | 5 | 2,138 | 5 | 0 | 2008-09-29T22:35:46.450000 | 2008-09-29T23:21:43.050000 |
151,026 | 3,481,134 | How do I unlock a SQLite database? | When I enter this query: sqlite> DELETE FROM mails WHERE ( id = 71); SQLite returns this error: SQL error: database is locked How do I unlock the database so this query will work? | In windows you can try this program http://www.nirsoft.net/utils/opened_files_view.html to find out the process is handling db file. Try closed that program for unlock database In Linux and macOS you can do something similar, for example, if your locked file is development.db: $ fuser development.db This command will s... | How do I unlock a SQLite database? When I enter this query: sqlite> DELETE FROM mails WHERE ( id = 71); SQLite returns this error: SQL error: database is locked How do I unlock the database so this query will work? | TITLE:
How do I unlock a SQLite database?
QUESTION:
When I enter this query: sqlite> DELETE FROM mails WHERE ( id = 71); SQLite returns this error: SQL error: database is locked How do I unlock the database so this query will work?
ANSWER:
In windows you can try this program http://www.nirsoft.net/utils/opened_files_... | [
"sqlite"
] | 329 | 328 | 598,252 | 38 | 0 | 2008-09-29T22:35:49.277000 | 2010-08-13T22:37:16.860000 |
151,030 | 1,161,163 | How can I call controller/view helper methods from the console in Ruby on Rails? | When I load script/console, sometimes I want to play with the output of a controller or a view helper method. Are there ways to: simulate a request? call methods from a controller instance on said request? test helper methods, either via said controller instance or another way? | To call helpers, use the helper object: $./script/console >> helper.number_to_currency('123.45') => "R$ 123,45" If you want to use a helper that's not included by default (say, because you removed helper:all from ApplicationController ), just include the helper. >> include BogusHelper >> helper.bogus => "bogus output" ... | How can I call controller/view helper methods from the console in Ruby on Rails? When I load script/console, sometimes I want to play with the output of a controller or a view helper method. Are there ways to: simulate a request? call methods from a controller instance on said request? test helper methods, either via s... | TITLE:
How can I call controller/view helper methods from the console in Ruby on Rails?
QUESTION:
When I load script/console, sometimes I want to play with the output of a controller or a view helper method. Are there ways to: simulate a request? call methods from a controller instance on said request? test helper met... | [
"ruby-on-rails",
"console"
] | 473 | 499 | 210,996 | 15 | 0 | 2008-09-29T22:36:21.910000 | 2009-07-21T19:15:06.960000 |
151,033 | 151,208 | How do you solicit testers for an open source project? | In order to improve my open source project, I need testers. I have created my project independently, so up to now I have been the sole coder and tester. I have tested the thing to death, but as we all know it is dangerous as a developer to test your own code. I'm looking for ideas on how I can get some other eyes to ex... | Are you looking for "testers" or "users"? There's a world of difference. A tester uses his time and energy to find your bugs. How many people are willing to do that? At a rough guess, I'd say zero. A user uses your software to solve his problems. He reports bugs to you because he thinks that you might fix them for him.... | How do you solicit testers for an open source project? In order to improve my open source project, I need testers. I have created my project independently, so up to now I have been the sole coder and tester. I have tested the thing to death, but as we all know it is dangerous as a developer to test your own code. I'm l... | TITLE:
How do you solicit testers for an open source project?
QUESTION:
In order to improve my open source project, I need testers. I have created my project independently, so up to now I have been the sole coder and tester. I have tested the thing to death, but as we all know it is dangerous as a developer to test yo... | [
"testing",
"open-source"
] | 1 | 4 | 542 | 3 | 0 | 2008-09-29T22:37:53.170000 | 2008-09-29T23:40:21.537000 |
151,034 | 151,134 | Does the Eclipse editor have an equivalent of Emacs's "align-regex"? | I've been using Eclipse pretty regularly for several years now, but I admit to not having explored all the esoterica it has to offer, particularly in the areas of what formatting features the editors offer. The main thing I miss from (X)emacs is the "align-regex" command, which let me take several lines into a region a... | You can set the formatter to do this: Preferences -> Java -> Code Style -> Formatter. Click 'Edit' on the profile (you may need to make a new one since you can't edit the default). In the indentation section select 'Align fields with columns'. Then, in your code CTRL + SHIFT + F will run that formatter. That will of co... | Does the Eclipse editor have an equivalent of Emacs's "align-regex"? I've been using Eclipse pretty regularly for several years now, but I admit to not having explored all the esoterica it has to offer, particularly in the areas of what formatting features the editors offer. The main thing I miss from (X)emacs is the "... | TITLE:
Does the Eclipse editor have an equivalent of Emacs's "align-regex"?
QUESTION:
I've been using Eclipse pretty regularly for several years now, but I admit to not having explored all the esoterica it has to offer, particularly in the areas of what formatting features the editors offer. The main thing I miss from... | [
"eclipse",
"emacs"
] | 16 | 10 | 5,482 | 5 | 0 | 2008-09-29T22:37:54.653000 | 2008-09-29T23:11:27.240000 |
151,046 | 151,078 | How can I detect the last iteration in a loop over std::map? | I'm trying to figure out the best way to determine whether I'm in the last iteration of a loop over a map in order to do something like the following: for (iter = someMap.begin(); iter!= someMap.end(); ++iter) { bool last_iteration; // do something for all iterations if (!last_iteration) { // do something for all but t... | Canonical? I can't claim that, but I'd suggest final_iter = someMap.end(); --final_iter; if (iter!= final_iter)... Edited to correct as suggested by KTC. (Thanks! Sometimes you go too quick and mess up on the simplest things...) | How can I detect the last iteration in a loop over std::map? I'm trying to figure out the best way to determine whether I'm in the last iteration of a loop over a map in order to do something like the following: for (iter = someMap.begin(); iter!= someMap.end(); ++iter) { bool last_iteration; // do something for all it... | TITLE:
How can I detect the last iteration in a loop over std::map?
QUESTION:
I'm trying to figure out the best way to determine whether I'm in the last iteration of a loop over a map in order to do something like the following: for (iter = someMap.begin(); iter!= someMap.end(); ++iter) { bool last_iteration; // do so... | [
"c++",
"stl",
"iterator",
"maps"
] | 29 | 28 | 30,032 | 15 | 0 | 2008-09-29T22:40:59.560000 | 2008-09-29T22:49:41.440000 |
151,051 | 151,244 | When should I use GC.SuppressFinalize()? | In.NET, under which circumstances should I use GC.SuppressFinalize()? What advantage(s) does using this method give me? | SuppressFinalize should only be called by a class that has a finalizer. It's informing the Garbage Collector (GC) that this object was cleaned up fully. The recommended IDisposable pattern when you have a finalizer is: public class MyClass: IDisposable { private bool disposed = false;
protected virtual void Dispose(bo... | When should I use GC.SuppressFinalize()? In.NET, under which circumstances should I use GC.SuppressFinalize()? What advantage(s) does using this method give me? | TITLE:
When should I use GC.SuppressFinalize()?
QUESTION:
In.NET, under which circumstances should I use GC.SuppressFinalize()? What advantage(s) does using this method give me?
ANSWER:
SuppressFinalize should only be called by a class that has a finalizer. It's informing the Garbage Collector (GC) that this object w... | [
"c#",
".net",
"garbage-collection",
"idisposable",
"suppressfinalize"
] | 392 | 392 | 162,572 | 5 | 0 | 2008-09-29T22:41:40.197000 | 2008-09-29T23:56:03.623000 |
151,066 | 157,469 | How do I implement Section-specific navigation in Ruby on Rails? | I have a Ruby/Rails app that has two or three main "sections". When a user visits that section, I wish to display some sub-navigation. All three sections use the same layout, so I can't "hard code" the navigation into the layout. I can think of a few different methods to do this. I guess in order to help people vote I'... | You can easily do this using partials, assuming each section has it's own controller. Let's say you have three sections called Posts, Users and Admin, each with it's own controller: PostsController, UsersController and AdminController. In each corresponding views directory, you declare a _subnav.html.erb partial: /app/... | How do I implement Section-specific navigation in Ruby on Rails? I have a Ruby/Rails app that has two or three main "sections". When a user visits that section, I wish to display some sub-navigation. All three sections use the same layout, so I can't "hard code" the navigation into the layout. I can think of a few diff... | TITLE:
How do I implement Section-specific navigation in Ruby on Rails?
QUESTION:
I have a Ruby/Rails app that has two or three main "sections". When a user visits that section, I wish to display some sub-navigation. All three sections use the same layout, so I can't "hard code" the navigation into the layout. I can t... | [
"ruby-on-rails",
"ruby",
"templates",
"actionview"
] | 12 | 9 | 5,388 | 9 | 0 | 2008-09-29T22:45:57.550000 | 2008-10-01T13:01:46.767000 |
151,079 | 669,145 | "name" web pdf for better default save filename in Acrobat? | My app generates PDFs for user consumption. The "Content-Disposition" http header is set as mentioned here. This is set to "inline; filename=foo.pdf", which should be enough for Acrobat to give "foo.pdf" as the filename when saving the pdf. However, upon clicking the "Save" button in the browser-embedded Acrobat, the d... | Part of the problem is that the relevant RFC 2183 doesn't really state what to do with a disposition type of "inline" and a filename. Also, as far as I can tell, the only UA that actually uses the filename for type=inline is Firefox (see test case ). Finally, it's not obvious that the plugin API actually makes that inf... | "name" web pdf for better default save filename in Acrobat? My app generates PDFs for user consumption. The "Content-Disposition" http header is set as mentioned here. This is set to "inline; filename=foo.pdf", which should be enough for Acrobat to give "foo.pdf" as the filename when saving the pdf. However, upon click... | TITLE:
"name" web pdf for better default save filename in Acrobat?
QUESTION:
My app generates PDFs for user consumption. The "Content-Disposition" http header is set as mentioned here. This is set to "inline; filename=foo.pdf", which should be enough for Acrobat to give "foo.pdf" as the filename when saving the pdf. H... | [
"http",
"pdf",
"content-type",
"acrobat"
] | 43 | 11 | 41,323 | 16 | 0 | 2008-09-29T22:49:44.640000 | 2009-03-21T11:20:48.147000 |
151,083 | 151,239 | How can I prevent link_to from escaping slashes in URL parameters in Rails? | Having this route: map.foo 'foo/*path',:controller => 'foo',:action => 'index' I have the following results for the link_to call link_to "Foo",:controller => 'foo',:path => 'bar/baz' # Foo Calling url_for or foo_url directly, even with:escape => false, give me the same url: foo_url(:path => 'bar/baz',:escape => false,:... | Instead of passing path a string, give it an array. link_to "Foo",:controller => 'foo',:path => %w(bar baz) # Foo If you didn't have the route in your routes file, this same link_to would instead create this: # Foo The only place I could find this documented is in this ticket. | How can I prevent link_to from escaping slashes in URL parameters in Rails? Having this route: map.foo 'foo/*path',:controller => 'foo',:action => 'index' I have the following results for the link_to call link_to "Foo",:controller => 'foo',:path => 'bar/baz' # Foo Calling url_for or foo_url directly, even with:escape =... | TITLE:
How can I prevent link_to from escaping slashes in URL parameters in Rails?
QUESTION:
Having this route: map.foo 'foo/*path',:controller => 'foo',:action => 'index' I have the following results for the link_to call link_to "Foo",:controller => 'foo',:path => 'bar/baz' # Foo Calling url_for or foo_url directly, ... | [
"ruby-on-rails"
] | 5 | 4 | 2,551 | 2 | 0 | 2008-09-29T22:52:18.487000 | 2008-09-29T23:54:22.580000 |
151,099 | 151,102 | How do I find records that are not joined? | I have two tables that are joined together. A has many B Normally you would do: select * from a,b where b.a_id = a.id To get all of the records from a that has a record in b. How do I get just the records in a that does not have anything in b? | select * from a where id not in (select a_id from b) Or like some other people on this thread says: select a.* from a left outer join b on a.id = b.a_id where b.a_id is null | How do I find records that are not joined? I have two tables that are joined together. A has many B Normally you would do: select * from a,b where b.a_id = a.id To get all of the records from a that has a record in b. How do I get just the records in a that does not have anything in b? | TITLE:
How do I find records that are not joined?
QUESTION:
I have two tables that are joined together. A has many B Normally you would do: select * from a,b where b.a_id = a.id To get all of the records from a that has a record in b. How do I get just the records in a that does not have anything in b?
ANSWER:
select... | [
"sql",
"select",
"join",
"anti-join"
] | 89 | 142 | 96,037 | 11 | 0 | 2008-09-29T22:56:45.340000 | 2008-09-29T22:57:50.423000 |
151,100 | 151,194 | How can I serve an image to the browser using Struts 2 + Hibernate 3? | I am developing a web application using Struts 2.1.2 and Hibernate 3.2.6.GA. I have an entity, User, which I have mapped to a table USERS in the DB using Hibernate. I want to have an image associated with this entity, which I plan to store as a BLOB in the DB. I also want to display the image on a webpage along with ot... | Yes your suggested solution will work. Given that you are working in a Java environment storing the images in the database is the best way to go. If you are running in a single server environment with an application server that will let you deploy in an exploded format technically you could store the images on disk but... | How can I serve an image to the browser using Struts 2 + Hibernate 3? I am developing a web application using Struts 2.1.2 and Hibernate 3.2.6.GA. I have an entity, User, which I have mapped to a table USERS in the DB using Hibernate. I want to have an image associated with this entity, which I plan to store as a BLOB ... | TITLE:
How can I serve an image to the browser using Struts 2 + Hibernate 3?
QUESTION:
I am developing a web application using Struts 2.1.2 and Hibernate 3.2.6.GA. I have an entity, User, which I have mapped to a table USERS in the DB using Hibernate. I want to have an image associated with this entity, which I plan t... | [
"hibernate",
"image",
"struts2"
] | 2 | 4 | 9,659 | 4 | 0 | 2008-09-29T22:57:18.177000 | 2008-09-29T23:34:58.837000 |
151,124 | 151,126 | Which is correct? catch (_com_error e) or catch (_com_error& e)? | Which one should I use? catch (_com_error e) or catch (_com_error& e) | The second. Here is my attempt at quoting Sutter "Throw by value, catch by reference" Learn to catch properly: Throw exceptions by value (not pointer) and catch them by reference (usually to const ). This is the combination that meshes best with exception semantics. When rethrowing the same exception, prefer just throw... | Which is correct? catch (_com_error e) or catch (_com_error& e)? Which one should I use? catch (_com_error e) or catch (_com_error& e) | TITLE:
Which is correct? catch (_com_error e) or catch (_com_error& e)?
QUESTION:
Which one should I use? catch (_com_error e) or catch (_com_error& e)
ANSWER:
The second. Here is my attempt at quoting Sutter "Throw by value, catch by reference" Learn to catch properly: Throw exceptions by value (not pointer) and cat... | [
"c++",
"exception",
"com"
] | 13 | 29 | 11,524 | 4 | 0 | 2008-09-29T23:07:56.123000 | 2008-09-29T23:09:02.580000 |
151,173 | 151,460 | Stopping MaskedEditExtender from validating input in asp.net | I have an asp.net textbox and a MaskedEditExtender control attached to it. The textbox is used for date input. The MaskedEditExtender has MaskType="Date" Mask="99/99/9999". When the form is submitted with an invalid date, the browser shows a Javascript error "... string was not recognized as a valid datetime". I know w... | on the text box you and set up a keypress function. Validate if the key pressed is a number String.fromCharCode(event.which) or event.keycode (ie or FF) Then can check that the text box is contains valid code and format. If invalid you can set to a default that is valid or just prevent the keypress by using preventDefa... | Stopping MaskedEditExtender from validating input in asp.net I have an asp.net textbox and a MaskedEditExtender control attached to it. The textbox is used for date input. The MaskedEditExtender has MaskType="Date" Mask="99/99/9999". When the form is submitted with an invalid date, the browser shows a Javascript error ... | TITLE:
Stopping MaskedEditExtender from validating input in asp.net
QUESTION:
I have an asp.net textbox and a MaskedEditExtender control attached to it. The textbox is used for date input. The MaskedEditExtender has MaskType="Date" Mask="99/99/9999". When the form is submitted with an invalid date, the browser shows a... | [
"asp.net",
"ajax"
] | 1 | 0 | 2,720 | 3 | 0 | 2008-09-29T23:24:22.870000 | 2008-09-30T01:54:37.190000 |
151,183 | 332,902 | Sidewinder x6 keyboard macro for Visual Studio? | the new keyboard from Microsoft, Sidewinder x6 can record in game macro. I was woundering if it could be used in Visual Studio (record key in application too)? (This could be very useful to press 1 key instead of Ctrl+M,M to Toggle Outline.) | YES IT CAN! Sure, why not? Okay, some reasoning behind my answer. Just create a "gaming profile" for devenv.exe instead of a game. BAM! There you go. | Sidewinder x6 keyboard macro for Visual Studio? the new keyboard from Microsoft, Sidewinder x6 can record in game macro. I was woundering if it could be used in Visual Studio (record key in application too)? (This could be very useful to press 1 key instead of Ctrl+M,M to Toggle Outline.) | TITLE:
Sidewinder x6 keyboard macro for Visual Studio?
QUESTION:
the new keyboard from Microsoft, Sidewinder x6 can record in game macro. I was woundering if it could be used in Visual Studio (record key in application too)? (This could be very useful to press 1 key instead of Ctrl+M,M to Toggle Outline.)
ANSWER:
YES... | [
"keyboard",
"hardware"
] | 3 | 2 | 831 | 3 | 0 | 2008-09-29T23:27:52.567000 | 2008-12-02T02:52:59.470000 |
151,190 | 151,227 | pl/sql dollar operator? | I encountered the following ddl in a pl/sql script this morning: create index genuser.idx$$_0bdd0011... My initial thought was that the index name was generated by a tool...but I'm also not a pl/sql superstar so I could very well be incorrect. Does the double dollar sign have any special significance in this statement? | Your initial thought seems to be correct. That would look to be an index name generated by a tool (but not assigned by Oracle because an index name wasn't specified). Dollar signs don't have any particular meaning other than being valid symbols that are rarely used by human developers and so are handy to reduce the ris... | pl/sql dollar operator? I encountered the following ddl in a pl/sql script this morning: create index genuser.idx$$_0bdd0011... My initial thought was that the index name was generated by a tool...but I'm also not a pl/sql superstar so I could very well be incorrect. Does the double dollar sign have any special signifi... | TITLE:
pl/sql dollar operator?
QUESTION:
I encountered the following ddl in a pl/sql script this morning: create index genuser.idx$$_0bdd0011... My initial thought was that the index name was generated by a tool...but I'm also not a pl/sql superstar so I could very well be incorrect. Does the double dollar sign have a... | [
"sql",
"database",
"oracle"
] | 3 | 2 | 6,815 | 3 | 0 | 2008-09-29T23:34:37.713000 | 2008-09-29T23:48:39.053000 |
151,195 | 151,343 | Possible to use SQL to sort by date but put null dates at the back of the results set? | I have a bunch of tasks in a MySQL database, and one of the fields is "deadline date". Not every task has to have to a deadline date. I'd like to use SQL to sort the tasks by deadline date, but put the ones without a deadline date in the back of the result set. As it is now, the null dates show up first, then the rest ... | Here's a solution using only standard SQL, not ISNULL(). That function is not standard SQL, and may not work on other brands of RDBMS. SELECT * FROM myTable WHERE... ORDER BY CASE WHEN myDate IS NULL THEN 1 ELSE 0 END, myDate; | Possible to use SQL to sort by date but put null dates at the back of the results set? I have a bunch of tasks in a MySQL database, and one of the fields is "deadline date". Not every task has to have to a deadline date. I'd like to use SQL to sort the tasks by deadline date, but put the ones without a deadline date in... | TITLE:
Possible to use SQL to sort by date but put null dates at the back of the results set?
QUESTION:
I have a bunch of tasks in a MySQL database, and one of the fields is "deadline date". Not every task has to have to a deadline date. I'd like to use SQL to sort the tasks by deadline date, but put the ones without ... | [
"sql",
"mysql"
] | 59 | 80 | 24,207 | 4 | 0 | 2008-09-29T23:35:08.587000 | 2008-09-30T00:46:15.310000 |
151,199 | 151,211 | How to calculate number of days between two given dates | If I have two dates (ex. '8/18/2008' and '9/26/2008' ), what is the best way to get the number of days between these two dates? | If you have two date objects, you can just subtract them, which computes a timedelta object. from datetime import date
d0 = date(2008, 8, 18) d1 = date(2008, 9, 26) delta = d1 - d0 print(delta.days) The relevant section of the docs: https://docs.python.org/library/datetime.html. See this answer for another example. | How to calculate number of days between two given dates If I have two dates (ex. '8/18/2008' and '9/26/2008' ), what is the best way to get the number of days between these two dates? | TITLE:
How to calculate number of days between two given dates
QUESTION:
If I have two dates (ex. '8/18/2008' and '9/26/2008' ), what is the best way to get the number of days between these two dates?
ANSWER:
If you have two date objects, you can just subtract them, which computes a timedelta object. from datetime im... | [
"python",
"date",
"datetime"
] | 773 | 1,200 | 1,067,333 | 16 | 0 | 2008-09-29T23:36:25.977000 | 2008-09-29T23:41:22.830000 |
151,228 | 151,229 | VMware Server 2.0 - The VMware Infrastructure Web Service not responding | After installing VMware Server I get the following error when I try to access the VMware web-based server manager: The VMware Infrastructure Web Service at " http://localhost:8222/sdk " is not responding | Go into the services manager and check that the 'VMware Host Agent' service is running. If not, then start it and then try browsing to the site again. | VMware Server 2.0 - The VMware Infrastructure Web Service not responding After installing VMware Server I get the following error when I try to access the VMware web-based server manager: The VMware Infrastructure Web Service at " http://localhost:8222/sdk " is not responding | TITLE:
VMware Server 2.0 - The VMware Infrastructure Web Service not responding
QUESTION:
After installing VMware Server I get the following error when I try to access the VMware web-based server manager: The VMware Infrastructure Web Service at " http://localhost:8222/sdk " is not responding
ANSWER:
Go into the serv... | [
"vmware",
"vmware-server"
] | 7 | 7 | 19,196 | 3 | 0 | 2008-09-29T23:50:11.657000 | 2008-09-29T23:51:11.310000 |
151,231 | 151,237 | How do I get the Local Network IP address of a computer programmatically? | I need to get the actual local network IP address of the computer (e.g. 192.168.0.220) from my program using C# and.NET 3.5. I can't just use 127.0.0.1 in this case. How can I accomplish this? | In How to get IP addresses in.NET with a host name by John Spano, it says to add the System.Net namespace, and use the following code: //To get the local IP address string sHostName = Dns.GetHostName (); IPHostEntry ipE = Dns.GetHostByName (sHostName); IPAddress [] IpA = ipE.AddressList; for (int i = 0; i < IpA.Length;... | How do I get the Local Network IP address of a computer programmatically? I need to get the actual local network IP address of the computer (e.g. 192.168.0.220) from my program using C# and.NET 3.5. I can't just use 127.0.0.1 in this case. How can I accomplish this? | TITLE:
How do I get the Local Network IP address of a computer programmatically?
QUESTION:
I need to get the actual local network IP address of the computer (e.g. 192.168.0.220) from my program using C# and.NET 3.5. I can't just use 127.0.0.1 in this case. How can I accomplish this?
ANSWER:
In How to get IP addresses... | [
"c#",
".net",
".net-3.5",
"ip-address"
] | 28 | 24 | 69,386 | 5 | 0 | 2008-09-29T23:51:24.023000 | 2008-09-29T23:53:52.707000 |
151,241 | 153,771 | ASP.NET AJAX nested updatePanel modalPopup funkiness | It seems that in some cases, if you end up with nested modalPopups wrapped with updatePanels (not ideal I know, and should probably be refactored, but that's what we're working with because of how some of the user controls we wanted to re-use were written), when you fire a postback that should open the nested modalPopu... | I have solved this problem! If you change the UpdatePanel's UpdateMode to "Conditional", the parent UpdatePanel doesn't post back when the child UpdatePanel posts back, and then nesting them is no issue at all! I'm not sure why UpdateMode="Always" is the default, but, lesson learned. | ASP.NET AJAX nested updatePanel modalPopup funkiness It seems that in some cases, if you end up with nested modalPopups wrapped with updatePanels (not ideal I know, and should probably be refactored, but that's what we're working with because of how some of the user controls we wanted to re-use were written), when you ... | TITLE:
ASP.NET AJAX nested updatePanel modalPopup funkiness
QUESTION:
It seems that in some cases, if you end up with nested modalPopups wrapped with updatePanels (not ideal I know, and should probably be refactored, but that's what we're working with because of how some of the user controls we wanted to re-use were w... | [
"asp.net-ajax",
"modalpopupextender"
] | 3 | 4 | 13,667 | 1 | 0 | 2008-09-29T23:54:54.140000 | 2008-09-30T16:10:35.853000 |
151,250 | 151,530 | How do I embed a File Version in an MSI file with Visual Studio? | I have a setup project for my C# program, and this setup project has a Version in its properties. I'd like for the MSI file that is generated to have this Version embedded in it, so I can mouse over it in explorer and see what version the file is. I'm using VS2008. How can I do this? | If you simply add the "Version: 1.5.0" text into the Description property of the Setup Project, the version number also shows on the MSI file like so: http://screencast.com/t/A499i6jS | How do I embed a File Version in an MSI file with Visual Studio? I have a setup project for my C# program, and this setup project has a Version in its properties. I'd like for the MSI file that is generated to have this Version embedded in it, so I can mouse over it in explorer and see what version the file is. I'm usi... | TITLE:
How do I embed a File Version in an MSI file with Visual Studio?
QUESTION:
I have a setup project for my C# program, and this setup project has a Version in its properties. I'd like for the MSI file that is generated to have this Version embedded in it, so I can mouse over it in explorer and see what version th... | [
"visual-studio",
"installation",
"versioning"
] | 4 | 9 | 7,839 | 5 | 0 | 2008-09-29T23:57:28.313000 | 2008-09-30T02:20:39.767000 |
151,272 | 151,283 | Given an IMDB movie id, how do I programmatically get its poster image? | movie id tt0438097 can be found at http://www.imdb.com/title/tt0438097/ What's the url for its poster image? | As I'm sure you know, the actual url for that image is http://ia.media-imdb.com/images/M/MV5BMTI0MDcxMzE3OF5BMl5BanBnXkFtZTcwODc3OTYzMQ@@._V1._SX100_SY133_.jpg You're going to be hard pressed to figure out how it's generated though and they don't seem to have a publicly available API. Screenscraping is probably your be... | Given an IMDB movie id, how do I programmatically get its poster image? movie id tt0438097 can be found at http://www.imdb.com/title/tt0438097/ What's the url for its poster image? | TITLE:
Given an IMDB movie id, how do I programmatically get its poster image?
QUESTION:
movie id tt0438097 can be found at http://www.imdb.com/title/tt0438097/ What's the url for its poster image?
ANSWER:
As I'm sure you know, the actual url for that image is http://ia.media-imdb.com/images/M/MV5BMTI0MDcxMzE3OF5BMl5... | [
"imdb"
] | 21 | 8 | 58,833 | 17 | 0 | 2008-09-30T00:11:38.280000 | 2008-09-30T00:17:50.153000 |
151,291 | 151,301 | Can I use "System.Currency" in .NET? | Is it possible to use system.currency. It says system.currency is inaccessible due to its protection level. what is the alternative of currency. | You have to use Decimal data type.. The decimal keyword indicates a 128-bit data type. Compared to floating-point types, the decimal type has more precision and a smaller range, which makes it appropriate for financial and monetary calculations. | Can I use "System.Currency" in .NET? Is it possible to use system.currency. It says system.currency is inaccessible due to its protection level. what is the alternative of currency. | TITLE:
Can I use "System.Currency" in .NET?
QUESTION:
Is it possible to use system.currency. It says system.currency is inaccessible due to its protection level. what is the alternative of currency.
ANSWER:
You have to use Decimal data type.. The decimal keyword indicates a 128-bit data type. Compared to floating-poi... | [
".net"
] | 12 | 13 | 8,942 | 4 | 0 | 2008-09-30T00:24:06.427000 | 2008-09-30T00:27:56.090000 |
151,298 | 151,640 | Is there a CLR that runs on the CLR? | I was wondering if there was a.NET-compatible CLR that was implemented using the CLI (common language infrastructure), e.g., using.NET itself, or at least if there were any resources that would help with building one. Basically, something like a.NET program that loads assemblies as MemoryStreams, parses the bytecode, c... | I don't think there are currently any standalone.net VMs that are self hosting but both Cosmos and SharpOS are.net runtimes written in C#. It may be possible to reuse some of their runtime code to extra a standalone runtime. Cosmos can be used to host a custom application on boot: http://www.codeproject.com/KB/system/C... | Is there a CLR that runs on the CLR? I was wondering if there was a.NET-compatible CLR that was implemented using the CLI (common language infrastructure), e.g., using.NET itself, or at least if there were any resources that would help with building one. Basically, something like a.NET program that loads assemblies as ... | TITLE:
Is there a CLR that runs on the CLR?
QUESTION:
I was wondering if there was a.NET-compatible CLR that was implemented using the CLI (common language infrastructure), e.g., using.NET itself, or at least if there were any resources that would help with building one. Basically, something like a.NET program that lo... | [
".net",
"clr",
"cil"
] | 10 | 5 | 961 | 6 | 0 | 2008-09-30T00:27:02.987000 | 2008-09-30T03:21:04.347000 |
151,299 | 151,445 | Embedding SVN Revision number at compile time in a Windows app | I'd like my.exe to have access to a resource string with my svn version. I can type this in by hand, but I'd prefer an automated way to embed this at compile time. Is there any such capability in Visual Studio 2008? | I wanted a similar availability and found $Rev$ to be insufficient because it was only updated for a file if that file's revision was changed (which meant it would have to be edited and committed very time: not something I wanted to do.) Instead, I wanted something that was based on the repository's revision number. Fo... | Embedding SVN Revision number at compile time in a Windows app I'd like my.exe to have access to a resource string with my svn version. I can type this in by hand, but I'd prefer an automated way to embed this at compile time. Is there any such capability in Visual Studio 2008? | TITLE:
Embedding SVN Revision number at compile time in a Windows app
QUESTION:
I'd like my.exe to have access to a resource string with my svn version. I can type this in by hand, but I'd prefer an automated way to embed this at compile time. Is there any such capability in Visual Studio 2008?
ANSWER:
I wanted a sim... | [
"c++",
"windows",
"visual-studio",
"svn"
] | 19 | 22 | 13,335 | 5 | 0 | 2008-09-30T00:27:51.783000 | 2008-09-30T01:47:34.383000 |
151,318 | 151,532 | VB.Net - how to support implicit type conversion as well as custom equality | Fixed: See notes at bottom I am implementing a generic class that supports two features, implicit type conversion and custom equality operators. Well, it supports IN-equality as well, if it does that. 1) if ( "value" = myInstance ) then... 2) Dim s As String = myInstance 3) Dim s As String = CType(myInstance,String) Th... | You should not override the = operator. If you have implicit conversions to types such as string or int, then let the default equality operator take over. As a general rule, if you need to customize equality for a class you should override the Equals(object) method. | VB.Net - how to support implicit type conversion as well as custom equality Fixed: See notes at bottom I am implementing a generic class that supports two features, implicit type conversion and custom equality operators. Well, it supports IN-equality as well, if it does that. 1) if ( "value" = myInstance ) then... 2) ... | TITLE:
VB.Net - how to support implicit type conversion as well as custom equality
QUESTION:
Fixed: See notes at bottom I am implementing a generic class that supports two features, implicit type conversion and custom equality operators. Well, it supports IN-equality as well, if it does that. 1) if ( "value" = myInst... | [
"vb.net",
"clr",
"type-conversion"
] | 3 | 2 | 3,259 | 1 | 0 | 2008-09-30T00:35:05.917000 | 2008-09-30T02:21:12.743000 |
151,327 | 151,381 | Sharing Files between VM and Host using Virtual PC 2007 | I know that I can share files using Shared Folders in Virtual PC, but this method seems to have pretty poor performance. Is there another method to share files that provides better performance? (Besides using something other than Virtual PC) | The best way to do it is probably set up proper bridge network connection between host machine and VM. | Sharing Files between VM and Host using Virtual PC 2007 I know that I can share files using Shared Folders in Virtual PC, but this method seems to have pretty poor performance. Is there another method to share files that provides better performance? (Besides using something other than Virtual PC) | TITLE:
Sharing Files between VM and Host using Virtual PC 2007
QUESTION:
I know that I can share files using Shared Folders in Virtual PC, but this method seems to have pretty poor performance. Is there another method to share files that provides better performance? (Besides using something other than Virtual PC)
ANS... | [
"virtual-machine",
"virtual-pc"
] | 4 | 3 | 4,651 | 2 | 0 | 2008-09-30T00:41:08.990000 | 2008-09-30T01:07:11.157000 |
151,335 | 151,352 | .NET Winforms Deployment | Is there anyway to combine all resources into a single exe file such as app.config and associated DLL's? Some applications seem to do this such as eMule. I don't want my app.config sitting there waiting to be edited. Thanks | Certainly, in the Solution Explorer (assuming Visual Studio here, since you don't mention) Right-click and Properties of the file(s) you want included. There should be an option there for Build Action which you can set to Embedded Resource. | .NET Winforms Deployment Is there anyway to combine all resources into a single exe file such as app.config and associated DLL's? Some applications seem to do this such as eMule. I don't want my app.config sitting there waiting to be edited. Thanks | TITLE:
.NET Winforms Deployment
QUESTION:
Is there anyway to combine all resources into a single exe file such as app.config and associated DLL's? Some applications seem to do this such as eMule. I don't want my app.config sitting there waiting to be edited. Thanks
ANSWER:
Certainly, in the Solution Explorer (assumin... | [
".net",
"winforms",
"deployment",
"embedding"
] | 2 | 5 | 1,518 | 8 | 0 | 2008-09-30T00:43:35.443000 | 2008-09-30T00:50:33.100000 |
151,337 | 151,383 | How to get a reference to the currently focused form field in JavaScript? | I'm looking for a cross-browser method - I know IE has something (I've already forgotten what), and the way to do it in Mozilla may have to do with a focusNode thing I found, that seems related to getting text selections. Methods involving jQuery or another common JS library are fine by me. Thanks! | Check out the extra selectors plugin for jQuery, it includes a:focus selector that answers your need. You can use just the implementation of that selector if you don't the rest. | How to get a reference to the currently focused form field in JavaScript? I'm looking for a cross-browser method - I know IE has something (I've already forgotten what), and the way to do it in Mozilla may have to do with a focusNode thing I found, that seems related to getting text selections. Methods involving jQuery... | TITLE:
How to get a reference to the currently focused form field in JavaScript?
QUESTION:
I'm looking for a cross-browser method - I know IE has something (I've already forgotten what), and the way to do it in Mozilla may have to do with a focusNode thing I found, that seems related to getting text selections. Method... | [
"javascript",
"forms",
"dom",
"cross-browser"
] | 5 | 4 | 943 | 2 | 0 | 2008-09-30T00:44:06.253000 | 2008-09-30T01:07:22.373000 |
151,338 | 151,359 | Adding an instance variable to a class in Ruby | How can I add an instance variable to a defined class at runtime, and later get and set its value from outside of the class? I'm looking for a metaprogramming solution that allows me to modify the class instance at runtime instead of modifying the source code that originally defined the class. A few of the solutions ex... | You can use attribute accessors: class Array attr_accessor:var end Now you can access it via: array = [] array.var = 123 puts array.var Note that you can also use attr_reader or attr_writer to define just getters or setters or you can define them manually as such: class Array attr_reader:getter_only_method attr_writer:... | Adding an instance variable to a class in Ruby How can I add an instance variable to a defined class at runtime, and later get and set its value from outside of the class? I'm looking for a metaprogramming solution that allows me to modify the class instance at runtime instead of modifying the source code that original... | TITLE:
Adding an instance variable to a class in Ruby
QUESTION:
How can I add an instance variable to a defined class at runtime, and later get and set its value from outside of the class? I'm looking for a metaprogramming solution that allows me to modify the class instance at runtime instead of modifying the source ... | [
"ruby",
"metaprogramming"
] | 40 | 17 | 41,164 | 8 | 0 | 2008-09-30T00:44:22.540000 | 2008-09-30T00:53:57.103000 |
151,350 | 151,363 | IDE's for C# development on Linux? | What are my options? I tried MonoDevelop over a year ago but it was extremely buggy. Is the latest version a stable development environment? | MonoDevelop 2.0 has been released, it now has a decent GUI Debugger, code completion, Intellisense C# 3.0 support (including linq), and a decent GTK# Visual Designer. In short, since the 2.0 release I have started using Mono Develop again and am very happy with it so far. Check out the MonoDevelop website for more info... | IDE's for C# development on Linux? What are my options? I tried MonoDevelop over a year ago but it was extremely buggy. Is the latest version a stable development environment? | TITLE:
IDE's for C# development on Linux?
QUESTION:
What are my options? I tried MonoDevelop over a year ago but it was extremely buggy. Is the latest version a stable development environment?
ANSWER:
MonoDevelop 2.0 has been released, it now has a decent GUI Debugger, code completion, Intellisense C# 3.0 support (in... | [
"c#",
"linux",
"ide",
"mono"
] | 71 | 52 | 107,630 | 9 | 0 | 2008-09-30T00:49:50.107000 | 2008-09-30T00:56:18.003000 |
151,362 | 151,404 | "Access is denied" error on accessing iframe document object | For posting AJAX forms in a form with many parameters, I am using a solution of creating an iframe, posting the form to it by POST, and then accessing the iframe 's content. specifically, I am accessing the content like this: $("some_iframe_id").get(0).contentWindow.document I tested it and it worked. On some of the pa... | Solved it by myself! The problem was, that even though the correct response was being sent (verified with Fiddler), it was being sent with an HTTP 500 error code (instead of 200). So it turns out, that if a response is sent with an error code, IE replaces the content of the iframe with an error message loaded from the ... | "Access is denied" error on accessing iframe document object For posting AJAX forms in a form with many parameters, I am using a solution of creating an iframe, posting the form to it by POST, and then accessing the iframe 's content. specifically, I am accessing the content like this: $("some_iframe_id").get(0).conten... | TITLE:
"Access is denied" error on accessing iframe document object
QUESTION:
For posting AJAX forms in a form with many parameters, I am using a solution of creating an iframe, posting the form to it by POST, and then accessing the iframe 's content. specifically, I am accessing the content like this: $("some_iframe_... | [
"javascript",
"ajax",
"iframe"
] | 26 | 52 | 83,058 | 7 | 0 | 2008-09-30T00:56:00.513000 | 2008-09-30T01:20:57.537000 |
151,369 | 151,580 | Tools for refactoring table-based HTML layouts to CSS? | Given an HTML page that has a complex table-based layout and many tags that are duplicated and wasteful, e.g.: td align="left" class="tableformat" width="65%" style="border-bottom:1px solid #ff9600; border-right:1px solid #ff9600; background-color:#FDD69E" nowrap etc. Are there tools to aide the task of refactoring the... | I agree with TimB in that automated tools are going to have trouble doing this, in particular making the relational jumps to combine and abstract CSS in the most efficient way. If you are presenting tabular data, it may be reasonable to attempt to refactor the inline CSS to reusable classes. If you have a lot of simila... | Tools for refactoring table-based HTML layouts to CSS? Given an HTML page that has a complex table-based layout and many tags that are duplicated and wasteful, e.g.: td align="left" class="tableformat" width="65%" style="border-bottom:1px solid #ff9600; border-right:1px solid #ff9600; background-color:#FDD69E" nowrap e... | TITLE:
Tools for refactoring table-based HTML layouts to CSS?
QUESTION:
Given an HTML page that has a complex table-based layout and many tags that are duplicated and wasteful, e.g.: td align="left" class="tableformat" width="65%" style="border-bottom:1px solid #ff9600; border-right:1px solid #ff9600; background-color... | [
"html",
"css",
"refactoring",
"css-tables"
] | 5 | 2 | 2,555 | 7 | 0 | 2008-09-30T01:01:58.003000 | 2008-09-30T02:49:04.860000 |
151,392 | 151,650 | How to stress-test video streaming server? | Does anyone know any good tool that I can use to perform stress tests on a video streaming server? I need to test how well my server handles 5,000+ connections. | One option is to use VLC. You can specify a url on the command line. (see here for details). You could then write a brief shell script to open up all 5000 connections. eg. the following perl script (very quick hack - check before running, might cause explosions etc.) $i = 0; $myurl = "udp://someurl"; @cmdline = ("/usr/... | How to stress-test video streaming server? Does anyone know any good tool that I can use to perform stress tests on a video streaming server? I need to test how well my server handles 5,000+ connections. | TITLE:
How to stress-test video streaming server?
QUESTION:
Does anyone know any good tool that I can use to perform stress tests on a video streaming server? I need to test how well my server handles 5,000+ connections.
ANSWER:
One option is to use VLC. You can specify a url on the command line. (see here for detail... | [
"testing",
"video",
"streaming"
] | 23 | 6 | 28,603 | 6 | 0 | 2008-09-30T01:14:07.927000 | 2008-09-30T03:27:06.440000 |
151,403 | 151,583 | What is a good free utility to create a self-extracting executable with an embedded file version? | According to the answers to this question, I cannot embed a file version in my.msi file. The installer that I give the client needs to have a file version. So, what I want to do is create a self-extracting executable containing the msi file and the setup.exe generated by Visual Studio, and put the file version on this ... | NSIS can do this. Part of our build environment is a script that outputs version information to a "header" file that our NSIS script sources. You should be able to use something similar to embed your version information and you can certainly get NSIS to run a file after extraction. In fact, as NSIS creates the installe... | What is a good free utility to create a self-extracting executable with an embedded file version? According to the answers to this question, I cannot embed a file version in my.msi file. The installer that I give the client needs to have a file version. So, what I want to do is create a self-extracting executable conta... | TITLE:
What is a good free utility to create a self-extracting executable with an embedded file version?
QUESTION:
According to the answers to this question, I cannot embed a file version in my.msi file. The installer that I give the client needs to have a file version. So, what I want to do is create a self-extractin... | [
"installation",
"versioning",
"self-extracting"
] | 5 | 5 | 11,899 | 9 | 0 | 2008-09-30T01:20:50.283000 | 2008-09-30T02:50:32.860000 |
151,407 | 151,542 | How to get an X11 Window from a Process ID? | Under Linux, my C++ application is using fork() and execv() to launch multiple instances of OpenOffice so as to view some powerpoint slide shows. This part works. Next I want to be able to move the OpenOffice windows to specific locations on the display. I can do that with the XMoveResizeWindow() function but I need to... | The only way I know to do this is to traverse the tree of windows until you find what you're looking for. Traversing isn't hard (just see what xwininfo -root -tree does by looking at xwininfo.c if you need an example). But how do you identify the window you are looking for? Some applications set a window property calle... | How to get an X11 Window from a Process ID? Under Linux, my C++ application is using fork() and execv() to launch multiple instances of OpenOffice so as to view some powerpoint slide shows. This part works. Next I want to be able to move the OpenOffice windows to specific locations on the display. I can do that with th... | TITLE:
How to get an X11 Window from a Process ID?
QUESTION:
Under Linux, my C++ application is using fork() and execv() to launch multiple instances of OpenOffice so as to view some powerpoint slide shows. This part works. Next I want to be able to move the OpenOffice windows to specific locations on the display. I c... | [
"x11"
] | 61 | 25 | 48,791 | 8 | 0 | 2008-09-30T01:23:59.777000 | 2008-09-30T02:27:54.990000 |
151,413 | 172,902 | How to solve HTTP status 405 "Method Not Allowed" when calling Web Services | I've got a siluation where i need to access a SOAP web service with WSE 2.0 security. I've got all the generated c# proxies (which are derived from Microsoft.Web.Services2.WebServicesClientProtocol), i'm applying the certificate but when i call a method i get an error: System.Net.WebException: The request failed with H... | Ok, found what the problem was. I was trying to call a.wsdl url instead of.asmx url. Doh! | How to solve HTTP status 405 "Method Not Allowed" when calling Web Services I've got a siluation where i need to access a SOAP web service with WSE 2.0 security. I've got all the generated c# proxies (which are derived from Microsoft.Web.Services2.WebServicesClientProtocol), i'm applying the certificate but when i call... | TITLE:
How to solve HTTP status 405 "Method Not Allowed" when calling Web Services
QUESTION:
I've got a siluation where i need to access a SOAP web service with WSE 2.0 security. I've got all the generated c# proxies (which are derived from Microsoft.Web.Services2.WebServicesClientProtocol), i'm applying the certifica... | [
"c#",
".net",
"web-services",
"wse2.0"
] | 20 | 20 | 104,315 | 7 | 0 | 2008-09-30T01:26:16.510000 | 2008-10-06T00:24:48.370000 |
151,414 | 151,463 | Explain the JVM Directory Layout on Mac OSX Leopard | Here is the directory layout that was installed with Leopard. What is the "A" directory and why the "Current" directory in addition to the "CurrentJDK"? It seems like you can easily switch the current JDK by move the CurrentJDK link, but then the contents under Current and A will be out of sync. lrwxr-xr-x 1 root wheel... | The ( A, Current symbolic-linked to A ) is part of the structure of a Mac OS X framework, which JavaVM.framework is. This framework may have C or Objective-C code in it, in addition to the actual JVM installations. Thus it could potentially be linked against from some C or Objective-C code in addition to containing the... | Explain the JVM Directory Layout on Mac OSX Leopard Here is the directory layout that was installed with Leopard. What is the "A" directory and why the "Current" directory in addition to the "CurrentJDK"? It seems like you can easily switch the current JDK by move the CurrentJDK link, but then the contents under Curren... | TITLE:
Explain the JVM Directory Layout on Mac OSX Leopard
QUESTION:
Here is the directory layout that was installed with Leopard. What is the "A" directory and why the "Current" directory in addition to the "CurrentJDK"? It seems like you can easily switch the current JDK by move the CurrentJDK link, but then the con... | [
"java",
"macos",
"jvm"
] | 8 | 6 | 6,196 | 3 | 0 | 2008-09-30T01:26:18.087000 | 2008-09-30T01:56:30.120000 |
151,418 | 151,758 | Calling a C++ function pointer on a specific object instance | I have a function pointer defined by: typedef void (*EventFunction)(int nEvent); Is there a way to handle that function with a specific instance of a C++ object? class A { private: EventFunction handler;
public: void SetEvent(EventFunction func) { handler = func; }
void EventOne() { handler(1); } };
class B { privat... | I highly recommend Don Clugston's excellent FastDelegate library. It provides all the things you'd expect of a real delegate and compiles down to a few ASM instructions in most cases. The accompanying article is a good read on member function pointers as well. http://www.codeproject.com/KB/cpp/FastDelegate.aspx | Calling a C++ function pointer on a specific object instance I have a function pointer defined by: typedef void (*EventFunction)(int nEvent); Is there a way to handle that function with a specific instance of a C++ object? class A { private: EventFunction handler;
public: void SetEvent(EventFunction func) { handler = ... | TITLE:
Calling a C++ function pointer on a specific object instance
QUESTION:
I have a function pointer defined by: typedef void (*EventFunction)(int nEvent); Is there a way to handle that function with a specific instance of a C++ object? class A { private: EventFunction handler;
public: void SetEvent(EventFunction ... | [
"c++",
"pointers",
"function"
] | 13 | 9 | 33,363 | 10 | 0 | 2008-09-30T01:29:46.877000 | 2008-09-30T04:29:56.427000 |
151,438 | 363,690 | Web "frameworks" for Haxe to deploy in a PHP environment? | Lately I've been taking a look at Haxe, to build an application to be deployed to Apache running PHP. Well, while it looks like it might suit my needs (deploying to PHP, but not using an awful language), I haven't found anything to make the actual application development easier than building a traditional non-MVC PHP a... | There is a port of PureMVC for Haxe: https://github.com/PureMVC/puremvc-haxe-standard-framework/wiki As far as I know this the only thing for Haxe, but there are discussions on the mailing list about creating a own framework, but this could take a while. | Web "frameworks" for Haxe to deploy in a PHP environment? Lately I've been taking a look at Haxe, to build an application to be deployed to Apache running PHP. Well, while it looks like it might suit my needs (deploying to PHP, but not using an awful language), I haven't found anything to make the actual application de... | TITLE:
Web "frameworks" for Haxe to deploy in a PHP environment?
QUESTION:
Lately I've been taking a look at Haxe, to build an application to be deployed to Apache running PHP. Well, while it looks like it might suit my needs (deploying to PHP, but not using an awful language), I haven't found anything to make the act... | [
"php",
"web-frameworks",
"haxe"
] | 7 | 6 | 3,165 | 8 | 0 | 2008-09-30T01:41:26.457000 | 2008-12-12T18:24:54.067000 |
151,448 | 151,592 | Response.Write vs <%= %> | Bearing in mind this is for classic asp Which is better, all HTML contained within Response.Write Statements or inserting variables into HTML via <%= %>. Eg Response.Write " " & vbCrlf Response.Write " " &vbCrLf Response.Write " " & someVariable & " " & vbCrLf Response.Write " " & vbCrLf Response.Write " " & vbCrLf VS ... | First, The most important factor you should be looking at is ease of maintenance. You could buy a server farm with the money and time you would otherwise waste by having to decipher a messy web site to maintain it. In any case, it doesn't matter. At the end of the day, all ASP does is just execute a script! The ASP par... | Response.Write vs <%= %> Bearing in mind this is for classic asp Which is better, all HTML contained within Response.Write Statements or inserting variables into HTML via <%= %>. Eg Response.Write " " & vbCrlf Response.Write " " &vbCrLf Response.Write " " & someVariable & " " & vbCrLf Response.Write " " & vbCrLf Respon... | TITLE:
Response.Write vs <%= %>
QUESTION:
Bearing in mind this is for classic asp Which is better, all HTML contained within Response.Write Statements or inserting variables into HTML via <%= %>. Eg Response.Write " " & vbCrlf Response.Write " " &vbCrLf Response.Write " " & someVariable & " " & vbCrLf Response.Write "... | [
"asp-classic",
"vbscript"
] | 28 | 44 | 80,196 | 15 | 0 | 2008-09-30T01:51:12.457000 | 2008-09-30T02:59:13.947000 |
151,472 | 151,481 | What is the difference between String.Empty and "" (empty string)? | In.NET, what is the difference between String.Empty and "", and are they interchangeable, or is there some underlying reference or Localization issues around equality that String.Empty will ensure are not a problem? | In.NET prior to version 2.0, "" creates an object while string.Empty creates no object ref, which makes string.Empty more efficient. In version 2.0 and later of.NET, all occurrences of "" refer to the same string literal, which means "" is equivalent to.Empty, but still not as fast as.Length == 0..Length == 0 is the fa... | What is the difference between String.Empty and "" (empty string)? In.NET, what is the difference between String.Empty and "", and are they interchangeable, or is there some underlying reference or Localization issues around equality that String.Empty will ensure are not a problem? | TITLE:
What is the difference between String.Empty and "" (empty string)?
QUESTION:
In.NET, what is the difference between String.Empty and "", and are they interchangeable, or is there some underlying reference or Localization issues around equality that String.Empty will ensure are not a problem?
ANSWER:
In.NET pri... | [
".net",
"double-quotes",
"string"
] | 350 | 360 | 123,262 | 18 | 0 | 2008-09-30T01:59:47.333000 | 2008-09-30T02:02:38.607000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.