Id int64 4 8.51M | PostTypeId int64 1 7 | AcceptedAnswerId int64 7 75.5M ⌀ | ParentId int64 4 41.8M ⌀ | Score int64 -208 27.7k | ViewCount int64 11 12.4M ⌀ | Body stringlengths 0 45k | Title stringlengths 2 150 ⌀ | ContentLicense stringclasses 3
values | FavoriteCount int64 0 225 ⌀ | CreationDate stringdate 2008-07-31 21:42:52 2011-12-14 18:48:47 | LastActivityDate stringdate 2008-08-01 12:19:17 2023-03-05 04:40:26 | LastEditDate stringdate 2008-08-01 13:54:25 2023-03-05 03:12:45 ⌀ | LastEditorUserId int64 -1 21.3M ⌀ | OwnerUserId int64 -1 21.1M ⌀ | Tags listlengths 1 6 ⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6,790 | 2 | null | 3,224 | 6 | null | When you release a new version of your CSS or JS libraries, cause the following to occur:
1. modify the filename to include a unique version string
2. modify the HTML files which reference the library to point at the versioned file
(this is usually a pretty simple matter for a release script)
Now you can set the ... | null | CC BY-SA 2.5 | null | 2008-08-09T14:37:46.130 | 2008-08-09T14:37:46.130 | null | null | 11,944 | null |
6,795 | 2 | null | 6,547 | 2 | null | Drop the first marble at floor 10, 20, 30, etc. until it breaks then jump back to the last known floor and start dropping marbles from there one floor at a time. Worst case is 99 being the Magic Floor and you can always find it in 19 drops or less.
| null | CC BY-SA 2.5 | null | 2008-08-09T14:46:21.137 | 2008-08-09T14:46:21.137 | null | null | 358 | null |
6,799 | 2 | null | 6,719 | 0 | null | I echo other voices in here. I have used Master Pages in 2.0 and the feature have been great to me. I have been embedding banners, standardized background, captures from Active Dir and other JavaScript features on it for use throughout the app, maintaining the look and feel consistency and without the need to duplicat... | null | CC BY-SA 2.5 | null | 2008-08-09T15:01:41.417 | 2008-08-09T15:01:41.417 | null | null | 1,525,924 | null |
6,785 | 1 | 6,824 | null | 163 | 72,017 | Suppose I have a stringbuilder in C# that does this:
```
StringBuilder sb = new StringBuilder();
string cat = "cat";
sb.Append("the ").Append(cat).(" in the hat");
string s = sb.ToString();
```
would that be as efficient or any more efficient as having:
```
string cat = "cat";
string s = String.Format("The {0} in t... | Is String.Format as efficient as StringBuilder | CC BY-SA 4.0 | 0 | 2008-08-09T14:24:05.703 | 2020-12-13T15:34:02.840 | 2019-01-20T13:57:05.123 | 567,854 | 493 | [
"c#",
"vb.net",
"performance",
"stringbuilder",
"string.format"
] |
6,796 | 2 | null | 6,729 | 1 | null | But why on earth do you think you need to make icons to make your interfaces look good? Icon driven interfaces are the bane of UI these days. Look at a screenshot of Komodo IDE or Eclipse for example. These are horrendously badly designed interfaces. It's impossible to tell what the buttons do until you hover over them... | null | CC BY-SA 2.5 | null | 2008-08-09T14:52:41.590 | 2008-08-09T14:52:41.590 | null | null | 137 | null |
6,813 | 2 | null | 6,475 | 1 | null | If your data file contains all your records (i.e. it includes records that do not have dupicate ids within the file) you could pre-process it and produce a file that only contains records that have duplicate (ids).
If this is the case that would reduce the size of file you need to process with your AWK program.
| null | CC BY-SA 2.5 | null | 2008-08-09T15:25:29.980 | 2008-08-09T15:29:58.583 | 2008-08-09T15:29:58.583 | 381 | 381 | null |
6,805 | 2 | null | 5,966 | 0 | null | I have done something similar in the past and used an in-memory XML document as a quick and dirty hierarchical database for storage. You can store each show/season/episode as an element (nested appropriately) and attributes of these things as xml attributes on the elements. Then you can use XQuery to get info back out.... | null | CC BY-SA 4.0 | null | 2008-08-09T15:13:14.293 | 2021-10-25T12:24:20.477 | 2021-10-25T12:24:20.477 | 17,169,050 | 358 | null |
6,812 | 1 | 6,821 | null | 3 | 5,489 | I have a Microsoft keyboard with a series of non-standard buttons such as "Mail", "Search" , "Web/Home" etc.
It would be nice to be able to bind these keys so they execute arbitrary programs.
Does anybody know how to do this in Debian Etch?
| Mapping my custom keys in Debian | CC BY-SA 3.0 | null | 2008-08-09T15:23:13.620 | 2015-08-20T22:11:38.693 | 2011-06-28T19:01:31.813 | 142,162 | 854 | [
"linux",
"keyboard",
"debian"
] |
6,817 | 1 | 6,929 | null | 6 | 1,529 | I'm working on a project were we need more performance. Over time we've continued to evolve the design to work more in parallel(both threaded and distributed). Then latest step has been to move part of it onto a new machine with 16 cores. I'm finding that we need to rethink how we do things to scale to that many cores ... | Scaling multithreaded applications on multicored machines | CC BY-SA 2.5 | 0 | 2008-08-09T15:42:17.840 | 2008-09-26T12:07:21.557 | 2008-09-26T12:06:30.687 | 7,671 | 852 | [
"performance",
"multithreading",
"scalability",
"malloc"
] |
6,826 | 2 | null | 6,729 | 0 | null | I try to keep my applications very simple. Simplicity and usability can be a good design in-and-of itself if done intelligently.
Take all of the buttons for Stackoverflow for example. It shouldn't be very difficult to implement something similar in your own application. They are simple and they get the job done.
| null | CC BY-SA 2.5 | null | 2008-08-09T15:58:44.420 | 2008-08-09T15:58:44.420 | null | null | 506 | null |
6,825 | 2 | null | 6,811 | 0 | null | Different implementations of the gzip algorithm will always produce slightly different but still correct files, also the compression level of the original file may be different then what you are running it at.
| null | CC BY-SA 2.5 | null | 2008-08-09T15:57:40.617 | 2008-08-09T15:57:40.617 | null | null | 200 | null |
6,821 | 2 | null | 6,812 | 2 | null | I can't say for certain because I'm not using Debian but if you're using Gnome the easiest way is to run gnome-keybinding-properties (System > Preferences > Keyboard Shortcuts)
Instead of typing a shortcut such as +, hit the button on your keyboard.
If you would prefer to do this via command line or with a different ... | null | CC BY-SA 3.0 | null | 2008-08-09T15:52:39.443 | 2015-08-20T22:11:38.693 | 2015-08-20T22:11:38.693 | 7,226 | 840 | null |
6,838 | 2 | null | 6,785 | 0 | null | > In both cases above I want to inject one or more strings into the middle of a predefined template string.
In which case, I would suggest String.Format is the quickest because it is design for that exact purpose.
| null | CC BY-SA 2.5 | null | 2008-08-09T16:29:55.513 | 2008-08-09T16:29:55.513 | null | null | 383 | null |
6,836 | 2 | null | 3,088 | 1 | null | Robert Read wrote a useful guide, [How to be a Programmer](http://samizdat.mines.edu/howto/HowToBeAProgrammer.html), which covers a wide area of programming issues that a beginner would find helpful.
| null | CC BY-SA 2.5 | null | 2008-08-09T16:28:05.737 | 2008-08-09T16:28:05.737 | null | null | 381 | null |
6,840 | 2 | null | 6,816 | 62 | null | Two more general-purpose mechanisms for fixing some of Eclipse's idiosyncrasies:
- -
Failing that, [bugs.eclipse.org](https://bugs.eclipse.org/bugs/buglist.cgi?query_format=specific&order=relevance+desc&bug_status=__all__&product=JDT&content=Class+file+name+must+end+with+.class) might provide the answer.
If the wor... | null | CC BY-SA 2.5 | null | 2008-08-09T16:31:32.623 | 2008-08-09T16:31:32.623 | null | null | 304 | null |
6,845 | 2 | null | 6,811 | 2 | null | As far as I know you cannot find the compression level of an already compressed file. When you are compressing the file you can specify the compression level with -# where the # is from 1 to 9 (1 being the fastest compression and 9 being the most compressed file). In practice you should never compare a compressed file ... | null | CC BY-SA 2.5 | null | 2008-08-09T16:56:56.737 | 2008-08-09T16:56:56.737 | null | null | 200 | null |
6,811 | 1 | null | null | 4 | 6,602 | Before reading anything else, please take time to read the [original thread](https://stackoverflow.com/questions/1615/how-can-i-modify-xfdl-files-update-1).
Overview: a .xfdl file is a gzipped .xml file which has then been encoded in base64. I wish to de-encode the .xfdl into xml which I can then modify and then re-... | How can I encode xml files to xfdl (base64-gzip)? | CC BY-SA 3.0 | 0 | 2008-08-09T15:20:45.090 | 2016-02-07T17:58:52.390 | 2017-05-23T12:13:37.900 | -1 | 25 | [
"unix",
"compression",
"gzip",
"base64"
] |
6,847 | 1 | 6,862 | null | 11 | 2,680 | When writing code do you consciously program defensively to ensure high program quality and to avoid the possibility of your code being exploited maliciously, e.g. through buffer overflow exploits or code injection ?
What's the "minimum" level of quality you'll always apply to your code ?
| Defensive programming | CC BY-SA 2.5 | 0 | 2008-08-09T17:02:56.663 | 2013-11-14T22:00:56.750 | 2013-11-14T22:00:56.750 | null | 381 | [
"security",
"defensive-programming"
] |
6,846 | 2 | null | 6,817 | 3 | null | You might want to check out [Google's Performance Tools](http://code.google.com/p/google-perftools/wiki/GooglePerformanceTools). They've released their version of malloc they use for multi-threaded applications. It also includes a nice set of profiling tools.
| null | CC BY-SA 2.5 | null | 2008-08-09T16:59:53.190 | 2008-08-09T16:59:53.190 | null | null | 200 | null |
6,824 | 2 | null | 6,785 | 148 | null | This answer was written when .NET 2.0 was the current version. This may no longer apply to later versions.
`String.Format` uses a `StringBuilder` internally:
```
public static string Format(IFormatProvider provider, string format, params object[] args)
{
if ((format == null) || (args == null))
{
thro... | null | CC BY-SA 4.0 | null | 2008-08-09T15:57:15.970 | 2019-03-07T17:19:48.673 | 2019-03-07T17:19:48.673 | 419 | 419 | null |
6,857 | 2 | null | 6,847 | 0 | null | Well, there is a certain set of best practices for security. At a minimum, for database applications, you need to watch out for SQL Injection.
Other stuff like hashing passwords, encrypting connection strings, etc. are also a standard.
From here on, it depends on the actual application.
Luckily, if you are working w... | null | CC BY-SA 2.5 | null | 2008-08-09T17:47:10.223 | 2008-08-09T17:47:10.223 | null | null | 380 | null |
6,850 | 2 | null | 6,847 | 0 | null | I always work to prevent things like injection attacks. However, when you work on an internal intranet site, most of the security features feel like wasted effort. I still do them, maybe just not as well.
| null | CC BY-SA 2.5 | null | 2008-08-09T17:09:25.853 | 2008-08-09T17:09:25.853 | null | null | 106 | null |
6,816 | 1 | 6,840 | null | 67 | 26,322 | I was hoping someone could help me out with a problem I'm having using the java search function in Eclipse on a particular project.
When using the java search on one particular project, I get an error message saying `Class file name must end with .class` (see stack trace below). This does not seem to be happening on a... | Class file name must end with .class exception in Java Search | CC BY-SA 3.0 | 0 | 2008-08-09T15:40:30.357 | 2013-12-23T08:14:44.977 | 2013-12-23T08:14:44.977 | 814,074 | 797 | [
"java",
"eclipse",
"search"
] |
6,849 | 2 | null | 6,785 | 10 | null | I would expect to be slower - it has to parse the string and concatenate it.
Couple of notes:
- -
| null | CC BY-SA 2.5 | null | 2008-08-09T17:09:10.880 | 2008-08-09T17:09:10.880 | null | null | 304 | null |
6,861 | 2 | null | 6,847 | 0 | null | You have to always program defensively I would say even for internal apps, simply because users could just through sheer luck write something that breaks your app. Granted you probably don't have to worry about trying to cheat you out of money but still. Always program defensively and assume the app will fail.
| null | CC BY-SA 2.5 | null | 2008-08-09T17:54:50.303 | 2008-08-09T17:54:50.303 | null | null | 657 | null |
6,853 | 2 | null | 6,817 | 2 | null | Jeffrey Richter is into threading a lot. He has a few chapters on threading in his books and check out his blog:
[http://www.wintellect.com/cs/blogs/jeffreyr/default.aspx](http://www.wintellect.com/cs/blogs/jeffreyr/default.aspx).
| null | CC BY-SA 2.5 | null | 2008-08-09T17:19:00.610 | 2008-08-09T23:55:47.097 | 2008-08-09T23:55:47.097 | 116 | 578 | null |
6,859 | 1 | 6,863 | null | 18 | 2,403 | As a long time World of Warcraft player, and a passionate developer I have decided that I would like to combine the two and set about developing some addins. Not only to improve my gameplay experience but as a great opportunity to learn something new.
Does anyone have any advice on how to go about starting out?
Is t... | Developing addins for World of Warcraft - Getting started? | CC BY-SA 3.0 | 0 | 2008-08-09T17:51:09.313 | 2014-10-07T12:46:53.220 | 2013-01-09T06:01:54.717 | 1,471,203 | 770 | [
"plugins",
"lua",
"add-on",
"world-of-warcraft"
] |
6,862 | 2 | null | 6,847 | 12 | null | In my line of work, our code has to be top quality.
So, we focus on two main things:
1. Testing
2. Code reviews
Those bring home the money.
| null | CC BY-SA 3.0 | null | 2008-08-09T18:00:26.907 | 2011-08-31T23:00:50.507 | 2011-08-31T23:00:50.507 | 7,734 | 573 | null |
6,852 | 2 | null | 6,811 | 0 | null | Interesting, I'll give it a shot. The variations aren't slight, however. The newly encoded file is longer and when comparing the binary of the before and after, the data hardly matches up at all.
Before (the first three lines)
```
H4sIAAAAAAAAC+19eZOiyNb3/34K3r4RT/WEU40ssvTtrhuIuKK44Bo3YoJdFAFZ3D79C6hVVhUq
dsnUVN/q... | null | CC BY-SA 3.0 | null | 2008-08-09T17:10:48.380 | 2016-02-07T17:58:52.390 | 2016-02-07T17:58:52.390 | 2,921,691 | 25 | null |
6,869 | 2 | null | 6,475 | 1 | null | How is the input file sorted? Like, cat file|sort, or sorted via a single specific field, or multiple fields? If multiple fields, what fields and what order? It appears the hour fields are a 24 hour clock, not 12, right? Are all the date/time fields zero-padded (would 9am be "9" or "09"?)
Without taking into accou... | null | CC BY-SA 2.5 | null | 2008-08-09T18:41:47.977 | 2008-08-09T18:41:47.977 | null | null | 430 | null |
6,870 | 2 | null | 4,689 | 1 | null | Another vote for Consolas for code editing, and [Dina](http://www.donationcoder.com/Software/Jibz/Dina/index.html) for console output.
| null | CC BY-SA 2.5 | null | 2008-08-09T18:43:59.393 | 2008-08-09T18:43:59.393 | null | null | 382,494 | null |
6,866 | 2 | null | 6,847 | 4 | null | Similar to abyx, in the team I am on developers always use unit testing and code reviews. In addition to that, I also aim to make sure that I don't incorporate code that people use - I tend to write code only for the basic set of methods required for the object at hand to function as has been spec'd out. I've found th... | null | CC BY-SA 2.5 | null | 2008-08-09T18:05:09.363 | 2009-11-23T23:51:15.073 | 2009-11-23T23:51:15.073 | 573 | 20 | null |
6,868 | 2 | null | 6,441 | 6 | null | To get FF to mimic IE's behavior when using the keyboard, you can use the keyup event on the select box. In your example (I am not a fan of attaching event handlers this way, but that's another topic), it would be like this:
```
<select name="user" id="selUser" onchange="javascript:SetLocationOptions()" onkeyup="javas... | null | CC BY-SA 2.5 | null | 2008-08-09T18:15:12.900 | 2008-11-02T02:35:27.477 | null | null | 653 | null |
6,875 | 2 | null | 6,623 | 0 | null | I've not seen this particular problem, but recently for us a "C1001: An internal error has occurred in the compiler" type crash from cl.exe was fixed after installing some random and unrelated (or so we thought) Windows security updates.
We knew the code didn't crash the compiler on other machines using the same versi... | null | CC BY-SA 2.5 | null | 2008-08-09T18:58:49.643 | 2008-08-09T18:58:49.643 | null | null | 755 | null |
6,882 | 2 | null | 6,859 | 10 | null | Another useful tools you might like is [WarcraftAddOnStudio](http://www.codeplex.com/WarcraftAddOnStudio) which lets you make plugins in the visual studio environment.
| null | CC BY-SA 2.5 | null | 2008-08-09T19:25:25.487 | 2008-08-09T19:25:25.487 | null | null | null | null |
6,873 | 2 | null | 6,817 | 1 | null | The allocator in FreeBSD recently got an update for FreeBSD 7. The new one is called [jemaloc](http://people.freebsd.org/~jasone/jemalloc/bsdcan2006/jemalloc.pdf) and is apparently much more scaleable with respect to multiple threads.
You didn't mention which platform you are using, so perhaps this allocator is avail... | null | CC BY-SA 2.5 | null | 2008-08-09T18:51:36.803 | 2008-08-09T18:51:36.803 | null | null | 755 | null |
6,884 | 2 | null | 6,785 | 12 | null | I ran some quick performance benchmarks, and for 100,000 operations averaged over 10 runs, the first method (String Builder) takes almost half the time of the second (String Format).
So, if this is infrequent, it doesn't matter. But if it is a common operation, then you may want to use the first method.
| null | CC BY-SA 2.5 | null | 2008-08-09T19:34:51.567 | 2008-08-09T19:34:51.567 | null | null | 380 | null |
6,888 | 2 | null | 6,785 | 3 | null | Oh also, the fastest would be:
```
string cat = "cat";
string s = "The " + cat + " in the hat";
```
| null | CC BY-SA 2.5 | null | 2008-08-09T19:51:24.607 | 2008-08-09T19:51:24.607 | null | null | 380 | null |
6,863 | 2 | null | 6,859 | 28 | null | [This article](http://www.wowwiki.com/Getting_started_with_writing_addons) explains how to start pretty well.
Your first bookmark is possibly the US Interface Forum, especially the Stickies for that:
[http://us.battle.net/wow/en/forum/1011693/](http://us.battle.net/wow/en/forum/1011693/)
Then, grab some simple addon... | null | CC BY-SA 3.0 | null | 2008-08-09T18:01:57.497 | 2014-07-12T15:58:12.670 | 2014-07-12T15:58:12.670 | 903,163 | 91 | null |
6,902 | 2 | null | 6,765 | 8 | null | I've worked on a project using MSQL Server in conjunction with a Java Stack. It works very well and as long, since JDBC shouldn't really care about your database. We used ehcache together with Hibernate and had problems with the MS JDBC Driver, so we switched to jtds and it works really good.
It's quite a while ago, s... | null | CC BY-SA 2.5 | null | 2008-08-09T20:18:15.240 | 2008-08-09T20:18:15.240 | null | null | 198 | null |
6,890 | 1 | 7,101 | null | 13 | 18,227 | I have some code for starting a thread on the .NET CF 2.0:
```
ThreadStart tStart = new ThreadStart(MyMethod);
Thread t = new Thread(tStart);
t.Start();
```
If I call this inside a loop the items completely out of order. How do introduce a wait after `t.Start()`, so that the work on the thread completes before the c... | How to wait for thread complete before continuing? | CC BY-SA 4.0 | null | 2008-08-09T20:00:37.647 | 2019-01-20T13:56:56.200 | 2019-01-20T13:56:56.200 | 567,854 | 636 | [
"c#",
"multithreading",
"compact-framework"
] |
6,910 | 2 | null | 6,891 | 0 | null | The throw in your first example has the overhead of the creation of a new CustomException object.
The re-throw in your second example will throw an exception of type Exception.
The re-throw in your third example will throw an exception of the same type that was thrown by your "some code".
So the second and third exa... | null | CC BY-SA 2.5 | null | 2008-08-09T20:50:35.503 | 2008-08-09T20:59:47.327 | 2008-08-09T20:59:47.327 | 381 | 381 | null |
6,911 | 2 | null | 6,891 | 2 | null | Like David, I suppose that the second and third perform better. But would any one of the three perform poorly enough to spend any time worrying about it? I think there are larger problems than performance to worry about.
FxCop always recommends the third approach over the second so that the original stack trace is n... | null | CC BY-SA 2.5 | null | 2008-08-09T20:58:21.243 | 2008-08-09T21:33:28.257 | 2008-08-09T21:33:28.257 | 308 | 308 | null |
6,891 | 1 | 6,916 | null | 9 | 2,099 | I have come across the following type of code many a times, and I wonder if this is a good practice (from Performance perspective) or not:
```
try
{
... // some code
}
catch (Exception ex)
{
... // Do something
throw new CustomException(ex);
}
```
Basically, what the coder is doing is that they are encom... | Performance Considerations for throwing Exceptions | CC BY-SA 3.0 | 0 | 2008-08-09T20:01:09.050 | 2013-01-09T06:01:43.297 | 2013-01-09T06:01:43.297 | 1,471,203 | 380 | [
".net",
"exception",
"optimization",
"performance"
] |
6,906 | 2 | null | 5,507 | 11 | null | On the assumption that you're building apps targeted at Windows:
- - - - - - -
On the assumption that you're building apps for the "Web 2.0" world, or that would be just as useful/beneficial to *NIX & MacOS users:
- - -
| null | CC BY-SA 2.5 | null | 2008-08-09T20:27:00.980 | 2008-08-09T20:27:00.980 | null | null | 452,120 | null |
6,916 | 2 | null | 6,891 | 11 | null | @Brad Tutterow
The exception is not being lost in the first case, it is being passed in to the constructor. I will agree with you on the rest though, the second approach is a very bad idea because of the loss of stack trace. When I worked with .NET, I ran into many cases where other programmers did just that, and it... | null | CC BY-SA 2.5 | null | 2008-08-09T21:17:35.057 | 2008-08-09T21:17:35.057 | null | null | 122 | null |
6,913 | 1 | 6,981 | null | 6 | 618 | Is there a good way to create a form in VB6 that can easily be embedded inside other forms?
On a few occasions recently, I've wanted to design and code a Form object that I could plug into several other "parent" forms. My goal is to create a centralized piece of code for managing several UI components in a particular... | How do I best share an embeddable form in VB6? | CC BY-SA 2.5 | null | 2008-08-09T21:05:40.027 | 2015-01-01T23:04:26.233 | 2015-01-01T23:04:26.233 | 3,576,214 | 863 | [
"forms",
"vb6",
"code-reuse"
] |
6,899 | 1 | 6,980 | null | 210 | 165,663 | To illustrate, assume that I have two tables as follows:
```
VehicleID Name
1 Chuck
2 Larry
LocationID VehicleID City
1 1 New York
2 1 Seattle
3 1 Vancouver
4 2 Los Angeles
5 2 Houston
```
I want to write a query to... | How to create a SQL Server function to "join" multiple rows from a subquery into a single delimited field? | CC BY-SA 3.0 | 0 | 2008-08-09T20:11:18.467 | 2021-11-17T16:27:03.643 | 2018-04-02T11:34:57.890 | 3,876,565 | 799 | [
"sql",
"sql-server",
"string-concatenation"
] |
6,904 | 1 | 2,401,184 | null | 4 | 1,869 | I'm trying to use the CoreCon API in Visual Studio 2008 to programmatically launch device emulators. When I call `device.Connect()`, I inexplicably get a DirectoryNotFoundException. I get it if I try it in PowerShell or in C# Console Application. Here's the code I'm using:
```
static void Main(string[] args)
{
Da... | Getting DirectoryNotFoundException when trying to Connect to Device with CoreCon API | CC BY-SA 3.0 | null | 2008-08-09T20:22:19.490 | 2016-02-07T17:56:38.603 | 2016-02-07T17:56:38.603 | 2,921,691 | 631 | [
"c#",
"visual-studio",
"windows-mobile",
"compact-framework",
"corecon"
] |
6,926 | 1 | 7,039 | null | 19 | 5,830 | I want to get started doing some game development using Microsoft's XNA. Part of that is Shader development, but I have no idea how to get started. I know that [nVidia's FX Composer](http://developer.nvidia.com/object/fx_composer_home.html) is a great tool to develop shaders, but I did not find much useful and updated ... | Beginning Shader Development | CC BY-SA 2.5 | 0 | 2008-08-09T21:57:07.427 | 2008-12-09T06:49:07.850 | null | null | 91 | [
"shader"
] |
6,928 | 2 | null | 6,904 | 0 | null | I tried this and it works ok. Can you paste in the whole exception and stack trace?
Strangely I can't find that interop assy on my machine either other than under the c:\windows\assembly\GAC_MSIL folders.
Why not fire up SysInternals FileMon or Process Monitor, it'd save some guesswork.
| null | CC BY-SA 2.5 | null | 2008-08-09T22:04:42.217 | 2008-08-09T23:23:27.800 | 2008-08-09T23:23:27.800 | 419 | 419 | null |
6,912 | 2 | null | 6,891 | 2 | null | Obviously you incur in the penalty of creating new objects (the new Exception) so, exactly as you do with every line of code that you append to your program, you must to decide if the better categorization of exceptions pays for the extra work.
As a piece of advice to make that decision, if your new objects are not c... | null | CC BY-SA 2.5 | null | 2008-08-09T21:01:14.187 | 2008-08-09T21:06:33.503 | 2008-08-09T21:06:33.503 | 527 | 527 | null |
6,934 | 2 | null | 6,904 | 0 | null | I suspect there is a problem with my Microsoft.VisualStudio.DeviceConnectivity.Interop assembly. There is no copy of that on disk that I can find. It's in the GAC only. I tried to inspect in Reflector, but it needs that Interop assembly also. Since ConManServerClass is obviously COM, maybe there's a COM library that ha... | null | CC BY-SA 2.5 | null | 2008-08-09T22:29:38.127 | 2008-08-09T22:29:38.127 | null | null | 631 | null |
6,938 | 2 | null | 6,937 | 2 | null | For GUI debugging is awesome being able to run the app into one screen and having the debugger in another screen. That's one of the most practical uses..
But really, depends on which kind of application you're developing, i.e., if you need to monitor open file handles, logs, etc.
| null | CC BY-SA 2.5 | null | 2008-08-09T22:58:52.653 | 2008-08-09T22:58:52.653 | null | null | null | null |
6,932 | 1 | 3,011,043 | null | 4 | 2,676 | What is the best way to transcode audio and video to show on the web?
I need to do it programmatically. I'd like to do something like YouTube or Google Video where users can upload whatever format they want, and I encode it to flv, mp3, and/or mp4. I could do it on our server, but I would rather use an EC2 instanc... | Transcoding audio and video | CC BY-SA 2.5 | 0 | 2008-08-09T22:19:59.580 | 2020-06-01T10:32:42.920 | 2012-03-22T02:12:26.260 | 3 | 571 | [
"audio",
"video",
"mp3",
"flv",
"mp4"
] |
6,935 | 2 | null | 6,890 | 4 | null | If I'm reading this properly, you're starting work items on bunch of threads but you're concerned that the threads are completing out of order, and, would prefer to wait until each thread completes in the order they were started ?
If this is the case then I'm not sure why you're creating a thread per work item. Maybe... | null | CC BY-SA 3.0 | null | 2008-08-09T22:32:07.840 | 2013-11-24T07:38:55.190 | 2013-11-24T07:38:55.190 | 419 | 419 | null |
6,937 | 1 | 6,940 | null | 47 | 86,330 | [Ultramon](http://www.realtimesoft.com/ultramon/) is a great program for dual monitors (stretching screen across monitors), but I was wondering if there is any way do to something in Visual Studio like have one tab of code open on one monitor and a second tab of code open on the second monitor with only one instance of... | Visual Studio and dual/multiple monitors: how do I get optimized use out of my monitors? | CC BY-SA 2.5 | 0 | 2008-08-09T22:55:26.857 | 2014-12-04T20:11:50.940 | 2014-12-04T20:11:50.940 | 334,849 | 396 | [
"visual-studio",
"monitor",
"multiple-monitors"
] |
6,929 | 2 | null | 6,817 | 6 | null | A couple of other books that are going to be helpful are:
- [Synchronization Algorithms and Concurrent Programming](https://rads.stackoverflow.com/amzn/click/com/0131972596)- [Patterns for Parallel Programming](https://rads.stackoverflow.com/amzn/click/com/0321228111)- [Communicating Sequential Processes](http://www.u... | null | CC BY-SA 2.5 | null | 2008-08-09T22:13:12.233 | 2008-08-09T22:13:12.233 | null | null | 714 | null |
6,915 | 1 | 6,955 | null | 38 | 27,180 | Is there a way to implement a singleton object in C++ that is:
1. Lazily constructed in a thread safe manner (two threads might simultaneously be the first user of the singleton - it should still only be constructed once).
2. Doesn't rely on static variables being constructed beforehand (so the singleton object is it... | Thread safe lazy construction of a singleton in C++ | CC BY-SA 3.0 | 0 | 2008-08-09T21:16:29.193 | 2012-07-03T14:56:23.780 | 2011-10-20T07:35:25.127 | 889,260 | 755 | [
"c++",
"multithreading",
"singleton",
"construction",
"lazy-initialization"
] |
6,941 | 2 | null | 6,937 | 3 | null | When I first got two monitors I wanted to do the same as you, use all the space for visual studio, but I think that you come to realize that it's best to keep VS on one monitor and use the second monitor for documentation, external resources etc. You wouldn't think it at first, but all the little touches like just bein... | null | CC BY-SA 2.5 | null | 2008-08-09T23:00:51.607 | 2008-08-09T23:00:51.607 | null | null | 398 | null |
6,940 | 2 | null | 6,937 | 60 | null | Personally, I have my windows set up so that one my main monitor, I have the main visual studio monitor, so therefore my code window, maximized, with only the toolbox docked, on the left. This means the code window takes up as much space as possible, while keeping the left hand edge of the code close to the middle of t... | null | CC BY-SA 2.5 | null | 2008-08-09T23:00:20.670 | 2008-08-09T23:09:20.903 | 2008-08-09T23:09:20.903 | 489 | 489 | null |
6,958 | 2 | null | 6,937 | 2 | null | I have VS in my left monitor and the GUI/running window in the right. However, if you want to have to code tabs open on each monitor, you could use UltraMon's option to expand a window across both monitors, then drag a code page over such that it puts up a divider. Then, you align that divider with the break in your mo... | null | CC BY-SA 2.5 | null | 2008-08-10T00:02:26.020 | 2008-08-10T00:02:26.020 | null | null | 106 | null |
6,950 | 2 | null | 6,937 | 9 | null | I have three monitors, so I usually run with this configuration:
- - -
This usually works pretty well, and since the monitors are fairly big I rarely need to use the test application in full-screen, so there's plenty of room for my tail -f windows.
I also use AutoHotkey to assign hotkeys that flip to the most impor... | null | CC BY-SA 2.5 | null | 2008-08-09T23:39:42.650 | 2008-08-09T23:39:42.650 | null | null | 291 | null |
6,949 | 2 | null | 6,642 | 2 | null | You can use HTML to specify the favicon, but that will only work on pages that have this HTML. A better way to do this is by adding the following to your httpd.conf (Apache):
```
AddType image/x-icon .ico
```
| null | CC BY-SA 2.5 | null | 2008-08-09T23:32:05.193 | 2008-08-09T23:32:05.193 | null | null | 795 | null |
6,947 | 2 | null | 6,817 | 2 | null | As monty python would say "and now for something completely different" - you could try a language/environment that doesn't use threads, but processes and messaging (no shared state). One of the most mature ones is erlang (and this excellent and fun book: [http://www.pragprog.com/titles/jaerlang/programming-erlang](http... | null | CC BY-SA 2.5 | null | 2008-08-09T23:26:30.570 | 2008-08-09T23:56:46.657 | 2008-08-09T23:56:46.657 | 116 | 699 | null |
6,957 | 1 | 7,458 | null | 5 | 1,727 | Looking for feedback on :
[http://code.google.com/p/google-perftools/wiki/GooglePerformanceTools](http://code.google.com/p/google-perftools/wiki/GooglePerformanceTools)
| Has anybody used Google Performance Tools? | CC BY-SA 2.5 | 0 | 2008-08-10T00:01:18.770 | 2020-06-23T14:44:11.287 | 2009-10-11T12:48:22.640 | 61,342 | 116 | [
"performance",
"multithreading",
"malloc",
"google-perftools"
] |
6,961 | 2 | null | 6,899 | 48 | null | I don't belive there's a way to do it within one query, but you can play tricks like this with a temporary variable:
```
declare @s varchar(max)
set @s = ''
select @s = @s + City + ',' from Locations
select @s
```
It's definitely less code than walking over a cursor, and probably more efficient.
| null | CC BY-SA 2.5 | null | 2008-08-10T00:12:25.953 | 2008-08-10T00:12:25.953 | null | null | 615 | null |
6,969 | 2 | null | 6,932 | 2 | null | ffmpeg can do it, its a command-line tool that uses the libavcodec. Can handle conversion of most video formats. Its license is LPGL, if that suits your needs. You can utilize it as a separate process programmatically, or if you're feeling hardcore, you can use the libavcodec library yourself to encode directly.
| null | CC BY-SA 2.5 | null | 2008-08-10T00:36:34.517 | 2008-08-10T00:42:06.550 | 2008-08-10T00:42:06.550 | 63 | 63 | null |
6,955 | 2 | null | 6,915 | 14 | null | Basically, you're asking for synchronized creation of a singleton, without using any synchronization (previously-constructed variables). In general, no, this is not possible. You need something available for synchronization.
As for your other question, yes, static variables which can be statically initialized (i.e. ... | null | CC BY-SA 2.5 | null | 2008-08-09T23:52:40.253 | 2008-08-10T00:06:19.117 | 2008-08-10T00:06:19.117 | 872 | 872 | null |
6,963 | 2 | null | 1,644 | 8 | null | It does not seem like this one was mentioned yet.
[http://thecommandline.net/](http://thecommandline.net/) --
"Exploring the rough edges where technology, society and public policy meet."
He does a weekly News show and a weekly topics show.
From the website,
:
"Thoughtful, informative, and deep, a real plunge into ... | null | CC BY-SA 2.5 | null | 2008-08-10T00:15:45.340 | 2008-08-10T00:15:45.340 | null | null | 873 | null |
6,971 | 2 | null | 6,926 | 1 | null | SAMS's [XNA Unleashed](https://rads.stackoverflow.com/amzn/click/com/0672329646) by Chad Carter is a great starting point for XNA and assumes little knowledge of game development practices or hard maths before you start. It has two chapters on basic and advanced shaders.
As a sidenote, keep an eye out on Google for WP... | null | CC BY-SA 2.5 | null | 2008-08-10T00:45:01.973 | 2008-08-10T00:45:01.973 | null | null | 483 | null |
6,972 | 2 | null | 6,891 | 0 | null | From a purely performance stand-point I'd guess that the third case is most performant. The other two need to extract a stack-trace and construct new objects, both of which are potentially fairly time-consuming.
Having said that these three blocks of code have different (external) behaviors so comparing them is like... | null | CC BY-SA 2.5 | null | 2008-08-10T00:47:17.023 | 2008-11-29T03:18:52.023 | 2008-11-29T03:18:52.023 | 16,076 | 358 | null |
6,977 | 2 | null | 6,973 | 0 | null | Is this a file you created and added to the project or did it mysteriously show up?
You can maybe check your .csproj file and see how it is being referenced (it should be a simple xml file and you can search for CSC97.tmp).
Perhaps post the information you find so we can have more details to help solve your problem
| null | CC BY-SA 2.5 | null | 2008-08-10T00:54:56.790 | 2008-08-10T00:54:56.790 | null | null | 122 | null |
6,975 | 2 | null | 6,847 | 0 | null | Using Test Driven Development certainly helps. You write a single component at a time and then enumerate all of the potential cases for inputs (via tests) before writing the code. This ensures that you've covered all bases and haven't written any code that no-one will use but might break.
Although I don't do anything... | null | CC BY-SA 2.5 | null | 2008-08-10T00:53:35.183 | 2008-08-10T00:53:35.183 | null | null | 358 | null |
6,985 | 2 | null | 6,973 | 0 | null | Looking around, it seems some people resolved this by repairing or reinstalling the .NET SDK. You might want to give that a try.
P.S. I see why you didn't include more of the compiler output, now. Not much to really see there. :)
| null | CC BY-SA 2.5 | null | 2008-08-10T01:30:42.927 | 2008-08-10T01:30:42.927 | null | null | 872 | null |
6,981 | 2 | null | 6,913 | 9 | null | Take a look at VB6 UserControls; I think they are exactly what you need. You can create a UserControl within your project, add controls and code to that control, and then insert it onto a form just like standard VB6 controls. I've used UserControls to share UI layouts on many occasions and it works great.
| null | CC BY-SA 2.5 | null | 2008-08-10T01:05:59.560 | 2008-08-20T04:11:34.790 | 2008-08-20T04:11:34.790 | 4 | 799 | null |
6,978 | 2 | null | 6,891 | 1 | null | As others have stated, the best performance comes from the bottom one since you are just rethrowing an existing object. The middle one is least correct because it looses the stack.
I personally use custom exceptions if I want to decouple certain dependencies in code. For example, I have a method that loads data from a... | null | CC BY-SA 3.0 | null | 2008-08-10T01:03:49.720 | 2011-10-31T14:06:13.417 | 2011-10-31T14:06:13.417 | 496,830 | 483 | null |
6,986 | 2 | null | 3,196 | 2 | null | This could also be accomplished by joining the table with itself,
```
SELECT DISTINCT t1.name
FROM tbl t1
INNER JOIN tbl t2
ON t1.name = t2.name
WHERE t1.key != t2.key;
```
| null | CC BY-SA 2.5 | null | 2008-08-10T01:31:05.703 | 2008-08-10T01:31:05.703 | null | null | 687 | null |
6,996 | 2 | null | 4,544 | 4 | null | Can you sniff the traffic to find what's actually being sent? Is it sending any auth data at all and it's incorrect or being presented in a form the server doesn't like, or is it never being sent by firefox at all?
| null | CC BY-SA 2.5 | null | 2008-08-10T02:04:32.530 | 2008-08-10T02:04:32.530 | null | null | 430 | null |
6,990 | 2 | null | 4,582 | 1 | null | I'd recommend picking up a copy of [Digital Video Compression](http://isbn.nu/9780071424875/price) - it's a really good overview of compression algorithms for images and video.
| null | CC BY-SA 2.5 | null | 2008-08-10T01:39:42.127 | 2008-08-10T01:39:42.127 | null | null | 2,521,991 | null |
6,987 | 2 | null | 6,973 | 6 | null | I don't know if this will help, but from [this forum](http://forums.msdn.microsoft.com/en-US/csharplanguage/thread/4217bec6-ea65-465f-8510-757558b36094/):
> Add an .ico file to the application section of the properties page, and recieved the error thats been described, when I checked the Icon file with an icon editor,... | null | CC BY-SA 2.5 | null | 2008-08-10T01:32:19.740 | 2008-08-10T01:32:19.740 | null | null | 122 | null |
6,997 | 2 | null | 5,863 | 3 | null | Ah, this is killing me! I did this at work about 3 months ago, and now I can't remember all the details.
I do remember, however, that you need basicHttpBinding, and you can't use the new serializer (which is the default); you have to use the "old" XmlSerializer.
Unfortunately, I don't work at the place where I did th... | null | CC BY-SA 2.5 | null | 2008-08-10T02:09:00.523 | 2008-08-10T02:09:00.523 | null | null | 781 | null |
6,980 | 2 | null | 6,899 | 279 | null | If you're using SQL Server 2005, you could use the FOR XML PATH command.
```
SELECT [VehicleID]
, [Name]
, (STUFF((SELECT CAST(', ' + [City] AS VARCHAR(MAX))
FROM [Location]
WHERE (VehicleID = Vehicle.VehicleID)
FOR XML PATH ('')), 1, 2, '')) AS Locations
FROM [Vehicle]
```
It's... | null | CC BY-SA 4.0 | null | 2008-08-10T01:05:00.980 | 2021-11-17T16:27:03.643 | 2021-11-17T16:27:03.643 | 775 | 775 | null |
6,973 | 1 | 6,987 | null | 12 | 13,871 | When attempting to compile my C# project, I get the following error:
```
'C:\Documents and Settings\Dan\Desktop\Rowdy Pixel\Apps\CleanerMenu\CleanerMenu\obj\Debug\CSC97.tmp' is not a valid Win32 resource file.
```
Having gone through many Google searches, I have determined that this is usually caused by a 256x256 im... | Invalid Resource File | CC BY-SA 3.0 | 0 | 2008-08-10T00:50:16.283 | 2020-08-15T22:43:49.733 | 2014-08-02T13:45:43.490 | 96,982 | 752 | [
"c#",
"visual-studio",
"resources"
] |
7,000 | 2 | null | 6,666 | 2 | null | I like the fact writing WCF services makes it easy to separate your service from the implementation. You can write your service and then host it in IIS, a console application, or a Windows service; you can also talk to it via HTTP, net TCP, etc.
| null | CC BY-SA 3.0 | null | 2008-08-10T02:13:06.007 | 2012-01-25T21:33:51.113 | 2012-01-25T21:33:51.113 | 63,550 | 781 | null |
7,008 | 2 | null | 3,615 | 6 | null | Joel Lucsy: That implementation of SQLite is a mixed-mode assembly which is not supported by Silverlight. Only a pure managed implementation would work under the Silverlight CLR.
| null | CC BY-SA 2.5 | null | 2008-08-10T02:38:27.843 | 2008-08-10T02:38:27.843 | null | null | 533 | null |
7,005 | 2 | null | 6,666 | 33 | null | What is a "regular old fashioned web service?" An ASMX service, or are you using WSE as well? ASMX services are not naturally interoperable, don't support WS-* specs, and ASMX is a technology that is aging very quickly. WSE (Web Service Enhancements) services DO add support for WS-* and can be made to be interoperable,... | null | CC BY-SA 2.5 | null | 2008-08-10T02:28:42.683 | 2008-08-10T02:36:34.820 | 2008-08-10T02:36:34.820 | 541 | 541 | null |
7,013 | 2 | null | 705 | 2 | null | There's also [Valentina](http://www.paradigmasoft.com/en/products/developer/adk/VNET). I cam e across this product when I was working on some Real Basic project. The RB version is very good.
| null | CC BY-SA 2.5 | null | 2008-08-10T02:55:20.930 | 2008-08-10T02:55:20.930 | null | null | 534 | null |
7,017 | 1 | 32,564 | null | -1 | 676 | I'm looking for ideas on how to draw a skinnable "button" in a game application. If I use a fixed sprite non-vector image for the button background, then I can't size the button easily. If I write code to draw a resizable button (like Windows buttons are drawn), then the programmer has to get involved -- and it makes s... | What is the best way to draw skinnable "buttons" in a video game? | CC BY-SA 2.5 | null | 2008-08-10T03:11:27.997 | 2009-06-24T12:49:17.160 | 2008-08-29T21:02:30.780 | 814 | 814 | [
"xna",
"button",
"skins"
] |
7,015 | 1 | 7,020 | null | 10 | 2,934 | I have a quad core machine and would like to write some code to parse a text file that takes advantage of all four cores. The text file basically contains one record per line.
Multithreading isn't my forte so I'm wondering if anyone could give me some patterns that I might be able to use to parse the file in an optima... | Multicore Text File Parsing | CC BY-SA 4.0 | null | 2008-08-10T03:07:39.157 | 2019-01-20T13:56:31.593 | 2019-01-20T13:56:31.593 | 567,854 | 493 | [
"c#",
"multithreading"
] |
7,020 | 2 | null | 7,015 | 9 | null | I'd go with your original idea. If you are concerned that the queue might get too large implement a buffer-zone for it (i.e. If is gets above 100 lines the stop reading the file and if it gets below 20 then start reading again. You'd need to do some testing to find the optimal barriers). Make it so that any of the thre... | null | CC BY-SA 2.5 | null | 2008-08-10T03:19:36.623 | 2008-08-10T03:19:36.623 | null | null | 358 | null |
7,018 | 2 | null | 6,475 | 1 | null | I think you would need to consider leap years. I didn't do the math, but I think during a leap year, with a hard code of 28 days for feb, a comparison of noon on 2/29 and noon on 3/1 would result in the same duplicate time stamp as before. Although it looks like you didn't implement it like that. They way you implem... | null | CC BY-SA 2.5 | null | 2008-08-10T03:12:10.240 | 2008-08-10T03:15:21.437 | 2017-05-23T12:18:30.323 | -1 | 430 | null |
7,033 | 2 | null | 7,031 | 2 | null | If you use javascript to hide the buttons, you open a security hole in the application. A malicious user could either disable javascript or apply some of their own to get around your security.
I suggest using PHP to chose to either render the buttons or not. I do this in .NET quite often.
You should be able to check... | null | CC BY-SA 2.5 | null | 2008-08-10T04:02:56.520 | 2008-08-10T04:02:56.520 | null | null | 106 | null |
7,034 | 1 | 2,366,237 | null | 523 | 495,698 | I have a data structure that represents a directed graph, and I want to render that dynamically on an HTML page. These graphs will usually be just a few nodes, maybe ten at the very upper end, so my guess is that performance isn't going to be a big deal. Ideally, I'd like to be able to hook it in with jQuery so that u... | Graph visualization library in JavaScript | CC BY-SA 3.0 | 0 | 2008-08-10T04:07:52.423 | 2022-04-28T11:07:44.760 | 2015-07-17T06:36:17.760 | 50,049 | 404 | [
"javascript",
"jquery",
"data-structures",
"graph-layout"
] |
7,023 | 2 | null | 7,015 | 1 | null | My experience is with Java, not C#, so apologies if these solutions don't apply.
The immediate solution I can think up off the top of my head would be to have an executor that runs 3 threads (using [Executors](http://java.sun.com/javase/6/docs/api/java/util/concurrent/Executors.html)`.newFixedThreadPool`, say). For ea... | null | CC BY-SA 2.5 | null | 2008-08-10T03:43:22.720 | 2008-08-10T03:59:52.203 | 2008-08-10T03:59:52.203 | 13 | 13 | null |
7,031 | 1 | 7,087 | null | 23 | 5,913 | I have been using PHP and JavaScript for building my dad's website. He wants to incorporate a login system into his website, and I have the design for the system using PHP. My problem is how do I show buttons if the person is logged in?... | Login Script with hidden buttons | CC BY-SA 3.0 | 0 | 2008-08-10T04:00:06.773 | 2019-07-03T13:24:47.660 | 2017-06-25T05:05:01.140 | 7,750,640 | 876 | [
"javascript",
"php"
] |
7,036 | 2 | null | 6,915 | 8 | null | You can't do it without any static variables, however if you are willing to tolerate one, you can use [Boost.Thread](http://www.boost.org/doc/html/thread.html) for this purpose. Read the "one-time initialisation" section for more info.
Then in your singleton accessor function, use `boost::call_once` to construct the o... | null | CC BY-SA 2.5 | null | 2008-08-10T04:13:08.543 | 2008-08-10T04:13:08.543 | null | null | 13 | null |
7,041 | 2 | null | 7,035 | 21 | null | I found the [xmessage](https://linux.die.net/man/1/xmessage) command, which is sort of good enough.
| null | CC BY-SA 4.0 | null | 2008-08-10T04:26:16.863 | 2018-07-10T03:24:18.857 | 2018-07-10T03:24:18.857 | 4,099,593 | 369 | null |
7,035 | 1 | 7,068 | null | 179 | 207,131 | I'm writing a few little bash scripts under Ubuntu linux. I want to be able to run them from the GUI without needing a terminal window to enter any input or view any output.
So far the only input required is a password for sudo - and gksudo handles that fine.
But I haven't found an easy way to show a message box yet. ... | How to show a GUI message box from a bash script in linux? | CC BY-SA 3.0 | 0 | 2008-08-10T04:07:55.043 | 2023-02-10T16:14:39.627 | 2016-08-26T19:44:55.193 | 895,245 | 369 | [
"linux",
"bash",
"scripting",
"ubuntu",
"gtk"
] |
7,043 | 2 | null | 7,035 | 9 | null | Here's a little Tcl script that will do what you want. The Wish interpreter should be installed by default on Ubuntu.
```
#!/usr/bin/wish
pack [label .msg -text [lindex $argv 0]]
pack [entry .ent]
bind .ent <KeyPress-Return> { puts [.ent get]; destroy . }
focus .ent
```
Call it like this:
```
myanswer=`gui-prompt ... | null | CC BY-SA 2.5 | null | 2008-08-10T04:34:36.627 | 2008-08-10T04:34:36.627 | null | null | 116 | null |