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
19,362
2
null
19,132
25
null
- - Note that in C, "=" is actually an operator, which does two things: - - Here's an extract from the ANSI C grammar. You can see that C doesn't have many different kinds of statements... the majority of statements in a program are expression statements, i.e. an expression with a semicolon at the end. ``` state...
null
CC BY-SA 2.5
null
2008-08-21T05:05:58.893
2008-08-21T05:05:58.893
null
null
116
null
19,360
2
null
19,355
0
null
I use quite archaic design that just works. - - - Then in my nant script, I have a task that copies, the current build environment plus _ app.config and copy it to app.config. Its nasty, but you can't get in between providers and ConfigurationManager to spoof it, by saying providers look at "dev" or "prod" connecti...
null
CC BY-SA 2.5
null
2008-08-21T05:04:44.327
2008-08-21T05:09:55.530
2008-08-21T05:09:55.530
1,220
1,220
null
19,349
1
19,367
null
3
1,287
Occasionally, I find that while debugging an ASP.Net application (written in visual studio 2008, running on Vista 64-bit) the local ASP.Net development server (i.e. 'Cassini') stops responding. A message often comes up telling me that "Data Execution Prevention (DEP)" has killed WebDev.WebServer.exe The event logs si...
"Data Execution Prevention" kills (VS2008) local ASP.Net Development Server (aka Cassini) on Vista 64
CC BY-SA 3.0
null
2008-08-21T04:50:13.720
2012-06-01T23:38:39.557
2012-02-10T15:51:47.697
590,783
49
[ "asp.net", "cassini", "dep" ]
19,367
2
null
19,349
3
null
The only way to know for sure would be to dig through the Cassini source and see if there are any areas where it generates code on the heap and then executes it without clearing the NX flag. However, instead of doing that, why not use IIS? EDIT: The danger of disabling DEP is that you open up security holes. DEP wor...
null
CC BY-SA 2.5
null
2008-08-21T05:15:01.073
2008-08-21T05:15:01.073
null
null
1,965
null
19,366
2
null
19,201
14
null
We've been using AccuRev for a few years now. It's a serious improvement over our last tool (Razor) and while I'd recommend it for others- it does have a few drawbacks. Benefits: - - - - Drawbacks: - - We opted to go with the cheaper license and not get the change packages feature (I can't see them working th...
null
CC BY-SA 2.5
null
2008-08-21T05:12:21.127
2008-08-21T05:12:21.127
null
null
1,881
null
19,370
2
null
19,349
2
null
You are on vista, iis got better (7), cassini stayed crappy. So just start this app on iis with a host header and a hosts file entry.
null
CC BY-SA 2.5
null
2008-08-21T05:18:09.613
2008-08-21T05:18:09.613
null
null
1,220
null
19,356
2
null
19,347
2
null
Effective C++ by Scott Meyers is a great book to help you learn C++. Gives you an overview of the language and introduces a lot of key concepts that you will use throughout the development of basically any C++ program.
null
CC BY-SA 2.5
null
2008-08-21T05:00:56.613
2008-08-21T05:00:56.613
null
null
2,016
null
19,368
2
null
18,803
1
null
UML seems to good for large projects with large teams of people. However I've worked in small teams where communication is better. Using UML-esque diagrams is good though, especially in the planning stage. I tend to think in code, so I find writing large specs hard. I prefer to write down the inputs' and outputs' and...
null
CC BY-SA 2.5
null
2008-08-21T05:15:38.543
2008-08-21T05:15:38.543
null
null
342
null
19,363
2
null
19,353
1
null
I don't think you'll find any built-in APIs for detection of silence. But you can always use good ol' math/discreete signal processing to find out loudness. Here's a small example: [http://msdn.microsoft.com/en-us/magazine/cc163341.aspx](http://msdn.microsoft.com/en-us/magazine/cc163341.aspx)
null
CC BY-SA 2.5
null
2008-08-21T05:07:14.337
2008-08-21T05:07:14.337
null
null
2,073
null
19,364
2
null
19,358
1
null
I think that [The J2EE guy still doesn’t get PHP](http://www.sitepoint.com/blogs/2004/07/01/the-j2ee-guy-still-doesnt-get-php/) is (still) worth a read.
null
CC BY-SA 2.5
null
2008-08-21T05:10:51.427
2008-08-21T05:10:51.427
null
null
1,654
null
19,372
2
null
19,347
8
null
Yeah, I got bit by the same bug. The university tended to lean on Java, and then allowed you to choose the language you wanted to work with during projects. The best way is to just jump in. Start small, take baby steps, and just Google things that confuse you when you get there. Also find projects that have released ...
null
CC BY-SA 2.5
null
2008-08-21T05:25:22.373
2008-08-21T05:30:59.787
2008-08-21T05:30:59.787
568
568
null
19,352
2
null
19,318
1
null
Kev, I found the solution, but its not trivial. You need to create a custom implementation of IHeaderHandler that creates the proper headers. There is a good step by step here: [http://msdn.microsoft.com/en-us/library/ms980699.aspx](http://msdn.microsoft.com/en-us/library/ms980699.aspx) EDIT: I saw your update. Ni...
null
CC BY-SA 2.5
null
2008-08-21T04:54:42.633
2008-08-21T04:54:42.633
null
null
1,965
null
19,375
2
null
19,355
0
null
> Can the "file" method suggested by @Jonathon be somehow used with the connectionStrings section? No, but there is nothing stopping you from storing the ConnectionString as an AppSettings key.
null
CC BY-SA 2.5
null
2008-08-21T05:33:47.017
2008-08-21T05:33:47.017
null
null
1,965
null
19,382
2
null
17,993
4
null
There are a couple of libraries out there which can help you. Unfortunately I haven't tried them myself, because I've never run into such a situation. - [Retroweaver](http://retroweaver.sourceforge.net/)- [Retrotransaltor](http://retrotranslator.sourceforge.net/)- [backport-jsr166](http://backport-jsr166.sourceforge....
null
CC BY-SA 2.5
null
2008-08-21T05:45:03.357
2008-08-21T05:45:03.357
null
null
198
null
19,380
2
null
19,355
3
null
> Edit: Can the "file" method suggested by @Jonathon be somehow used with the connectionStrings section? Or you can have multiple connection strings in the checked in config file, and use an AppSettings key to determine which ConnectionString is to be used. I have the following in my codebase for this purpose: ``...
null
CC BY-SA 2.5
null
2008-08-21T05:42:28.433
2008-08-21T05:42:28.433
null
null
1,894
null
19,384
2
null
19,347
2
null
> Effective C++ by Scott Meyers is a great book to help you learn C++. Gives you an overview of the language and introduces a lot of key concepts that you will use throughout the development of basically any C++ program. I love this book in all 3 editions, and it was one of the books in a class I had as a Senior at UT...
null
CC BY-SA 2.5
null
2008-08-21T05:47:07.000
2008-08-21T05:47:07.000
null
null
1,327
null
19,387
1
19,392
null
6
2,186
What would you recommend for OS X development of a graphical application like those possible in WPF? My specific background is in Smalltalk & Java, but I currently work mostly in DHTML/.NET (ASP.NET/C#).
Rich GUI OS X Frameworks?
CC BY-SA 2.5
0
2008-08-21T05:57:14.857
2019-06-07T04:30:26.023
2008-09-25T18:55:28.443
1,793
2,237
[ "wpf", "user-interface", "macos", "frameworks" ]
19,388
1
19,403
null
5
3,043
I've heard rumors that PHP is planning on introducing a "goto" command. What is it supposed to be doing? I've tried searching a bit, but haven't found anything awfully descriptive. I understand that it won't be a "`GOTO 10`"-like command...
GOTO command in PHP?
CC BY-SA 3.0
null
2008-08-21T05:57:59.673
2017-02-20T13:59:00.667
2014-12-05T15:03:34.540
254,477
2,238
[ "php", "language-features", "goto" ]
19,383
2
null
19,122
55
null
I decided to write a slightly more detailed explanation. The "magic" here lies in the operating system. Both programs do start up at roughly the same time, and run at the same time (the operating system assigns them slices of time on the processor to run) as every other simultaneously running process on your computer ...
null
CC BY-SA 2.5
null
2008-08-21T05:46:23.337
2008-08-21T05:46:23.337
null
null
1,892
null
19,392
2
null
19,387
15
null
Cocoa. Considered by many to be the best application framework ever. The language is Objective-C, SmallTalk-like language that inspired the creators of Java. Really, there is no reasonable alternative to Cocoa for OS X development, unless you have specific needs like wanting to be cross-platform.
null
CC BY-SA 2.5
null
2008-08-21T06:01:20.353
2008-08-21T06:01:20.353
null
null
1,109
null
19,393
2
null
19,387
1
null
I'm not sure what WPF is, but most development for the OSX platform is done in Objective-C with Cocoa. You can use the deprecated Carbon APIs with other languages like Java, but new applications for OSX really should be developed in Objective-C. You can start with [Apple's guide](https://developer.apple.com/library/arc...
null
CC BY-SA 4.0
null
2008-08-21T06:01:34.893
2019-06-07T04:30:26.023
2019-06-07T04:30:26.023
1,033,581
658
null
19,389
2
null
19,030
0
null
maybe you should take the approach of defaulting to: "the filename is correct" and work from there to disprove that statement: with the fact that you only allow filenames with: 'show name', 'season number x episode number' and 'episode name', you know for certain that these items should be separated by a "-" (dash) so...
null
CC BY-SA 3.0
null
2008-08-21T05:59:00.797
2012-08-11T15:56:22.453
2012-08-11T15:56:22.453
1,477,076
46
null
19,394
2
null
19,387
2
null
Cocoa is the primary framework to use on Mac OS X. It's what Apple uses, it's what most new development uses, and it's where new features are principally added. If you're coming from WPF, I think you might find quite a few of the concepts in Cocoa familiar. (Despite the fact that Cocoa is just a bit older.) It's bu...
null
CC BY-SA 2.5
null
2008-08-21T06:03:05.513
2008-08-21T06:20:50.837
2008-08-21T06:20:50.837
714
714
null
19,395
2
null
19,387
4
null
Aside from Interface Builder which is included as part of the Xcode tools, you can also use QT, GTK+, AWT & SWING (for your Java background), Tk, Squeak (for your Smalltalk background), Shoes (very cool little Ruby GUI toolkit), FXRuby (more Ruby), wxWidgets, XULRunner, and others I'm sure I've forgotten. For the most ...
null
CC BY-SA 2.5
null
2008-08-21T06:06:54.600
2008-08-21T06:06:54.600
null
null
1,868
null
19,377
2
null
19,295
1
null
We have a database table with key/language/term where key is a n integer and is a combined primary key together with language. We are using Struts, so we ended up writing our own implementation which allows us to do something like `<bean:message key="impressum.text" />`. It works very well and gives us the flexibili...
null
CC BY-SA 2.5
null
2008-08-21T05:36:50.990
2008-08-21T05:36:50.990
null
null
198
null
19,396
2
null
19,245
2
null
Sounds like dodgy COM objects causing the problem .. do you load them into the "Application", if you do then are they threadsafe; or are they used and discarded on each request? Yes, recycling every few hours would help 'hide' the problem, but they ought to be debugged and fixed properly ... have you tried divide/conq...
null
CC BY-SA 2.5
null
2008-08-21T06:08:34.830
2008-08-21T06:08:34.830
null
null
1,478
null
19,399
2
null
19,347
2
null
Wikipedia has an article on [comparisons between Java and C++](http://en.wikipedia.org/wiki/Comparison_of_Java_and_C%2B%2B). You don't have to worry about checked exceptions in C++, but you do need to know about [const correctness](http://en.wikipedia.org/wiki/Const_correctness).
null
CC BY-SA 2.5
null
2008-08-21T06:11:43.650
2008-08-21T06:11:43.650
null
null
1,659
null
19,402
2
null
19,388
0
null
It [looks](http://wiki.php.net/doc/todo/undocumented#php_5.3) like it's currently in PHP 5.3, but is not fully documented yet. From what I can tell it shares its goto syntax with C, so it should be easy to pick up and use. Just remember Dijkstra's [warning](http://www.cs.utexas.edu/users/EWD/ewd02xx/EWD215.PDF) and use...
null
CC BY-SA 2.5
null
2008-08-21T06:14:40.587
2008-08-21T06:14:40.587
null
null
658
null
19,401
1
null
null
1
416
We are experiencing this annoying problem where we have a context menu on our tray icon, if we display this context menu we to SetForegroundWindow and bring it to the front. This is really annoying and not at all what we want. Is there a workaround, I notice that Outlook MS Messenger and other MS apps do not suffer t...
Anyway to stop Windows bringing app to front when displaying a context menu on tray icon?
CC BY-SA 2.5
null
2008-08-21T06:14:17.857
2008-10-15T21:43:43.683
2008-10-15T21:43:43.700
6,899
1,478
[ "windows", "menu", "trayicon" ]
19,403
2
null
19,388
9
null
They are not adding a real GOTO, but extending the BREAK keyword to use static labels. Basically, it will be enhancing the ability to break out of nested if statements. Here's the concept example I found: ``` <?php for ($i = 0; $i < 9; $i++) { if (true) { break blah; } echo "not shown"; blah: ...
null
CC BY-SA 3.0
null
2008-08-21T06:14:47.763
2017-02-20T13:59:00.667
2017-02-20T13:59:00.667
4,380,409
227
null
19,361
2
null
19,355
4
null
AppSettings can be overridden with a local file: ``` <appSettings file="localoveride.config"/> ``` This allows for each developer to keep their own local settings. As far as the connection string, in a perfect world all developers should connect to a test DB, not run SQL Server each. However, I've found it best to...
null
CC BY-SA 2.5
null
2008-08-21T05:05:24.370
2008-08-21T05:05:24.370
null
null
1,965
null
19,404
2
null
19,388
0
null
@steveth45 My rule of thumb is that if you have nested code more than 3 levels deep, you are doing something wrong. Then you don't have to worry about using multiple break statements or goto :D
null
CC BY-SA 2.5
null
2008-08-21T06:16:43.297
2008-08-21T06:16:43.297
null
null
1,965
null
19,373
2
null
19,353
14
null
Audio analysis is a difficult thing requiring a lot of complex math (think Fourier Transforms). The question you have to ask is "what is silence". If the audio that you are trying to edit is captured from an analog source, the chances are that there isn't any silence... they will only be areas of soft noise (line hum, ...
null
CC BY-SA 3.0
null
2008-08-21T05:30:09.740
2015-09-10T17:16:59.683
2015-09-10T17:16:59.683
2,540,618
756
null
19,416
2
null
19,412
17
null
You didn't say which server you're using. In older versions of SQL Server, you can use this: ``` select top 1 * from mytable order by newid() ``` In SQL Server 2005 and up, you can use `TABLESAMPLE` to get a random sample that's repeatable: ``` SELECT FirstName, LastName FROM Contact TABLESAMPLE (1 ROWS) ; ```
null
CC BY-SA 3.0
null
2008-08-21T06:30:49.923
2015-04-18T06:03:17.620
2015-04-18T06:03:17.620
4,519,059
5
null
19,415
2
null
19,412
1
null
``` SELECT * FROM table ORDER BY RAND() LIMIT 1 ```
null
CC BY-SA 2.5
null
2008-08-21T06:30:29.363
2008-08-21T06:30:29.363
null
null
813
null
19,412
1
19,419
null
588
552,381
How can I request a random row (or as close to truly random as is possible) in pure SQL?
How to request a random row in SQL?
CC BY-SA 3.0
0
2008-08-21T06:28:49.927
2021-02-13T02:32:48.053
2014-07-07T13:26:48.653
347,414
473
[ "sql", "random" ]
19,414
2
null
19,412
72
null
I don't know how efficient this is, but I've used it before: ``` SELECT TOP 1 * FROM MyTable ORDER BY newid() ``` Because GUIDs are pretty random, the ordering means you get a random row.
null
CC BY-SA 3.0
null
2008-08-21T06:30:04.683
2015-04-30T08:52:58.577
2015-04-30T08:52:58.577
3,166,762
615
null
19,398
2
null
19,388
3
null
Granted, I am not a PHP programmer, and I don't know what PHP's exact implementation of GOTO will look like, but here is my understanding of GOTO: GOTO is just a more explicit flow control statement like any other. Let's say you have some nested loops and you only need to find one thing. You can put in a conditional s...
null
CC BY-SA 2.5
null
2008-08-21T06:11:30.483
2008-08-21T06:11:30.483
null
null
1,892
null
19,423
2
null
19,349
1
null
You can grant certain programs exclusion from DEP if you need. As [Jonathan](https://stackoverflow.com/users/1965/jonathan-holland) mentions this does open up any vulnerabilities that application may have.
null
CC BY-SA 2.5
null
2008-08-21T06:41:16.730
2008-08-21T06:41:16.730
2017-05-23T10:27:42.823
-1
580
null
19,426
2
null
19,349
0
null
Thanks for the answers. I guess I developed such an aversion to IIS in the .net 1.x era that I've refused to consider re-using it -- until now.
null
CC BY-SA 2.5
null
2008-08-21T06:51:00.920
2008-08-21T06:51:00.920
null
null
49
null
19,433
1
19,467
null
4
673
What is a good free library for editing MP3s/FLACs. By editing I mean: - - - - I don't mean software, I mean a library that I can use within another application. Programming language agnostic.
What is a good free library for editing MP3s/FLACs?
CC BY-SA 2.5
null
2008-08-21T07:06:38.153
2015-01-01T00:16:27.157
2015-01-01T00:16:27.157
1,505,120
1,915
[ "audio" ]
19,434
2
null
19,433
1
null
I use [Audacity](http://audacity.sourceforge.net/) for all my editing needs > Audacity is a free, easy-to-use audio editor and recorder for Windows, Mac OS X, GNU/Linux and other operating systems. You can use Audacity to:``` * Record live audio. * Convert tapes and records into digital recordings or CDs. * Edit...
null
CC BY-SA 2.5
null
2008-08-21T07:10:45.443
2008-08-21T07:10:45.443
null
null
202
null
19,406
2
null
19,401
2
null
Are you using ContextMenu or ContextMenuStrip? Your saying that opening the ContextMenu on a trayicon focuses all app forms? I have not experienced that, though I use the newer ContextMenuStrip class, not ContextMenu for my trayicons. EDIT: Would be nice to know if you are using Windows.Forms or WIN32, or MFC or wha...
null
CC BY-SA 2.5
null
2008-08-21T06:18:36.990
2008-08-21T06:18:36.990
null
null
1,965
null
19,422
2
null
19,412
180
null
Solutions like Jeremies: ``` SELECT * FROM table ORDER BY RAND() LIMIT 1 ``` work, but they need a sequential scan of all the table (because the random value associated with each row needs to be calculated - so that the smallest one can be determined), which can be quite slow for even medium sized tables. My recomme...
null
CC BY-SA 3.0
null
2008-08-21T06:37:01.547
2014-12-31T13:07:17.063
2014-12-31T13:07:17.063
1,265
1,265
null
19,436
1
19,447
null
4
2,329
I have a datalist with a OnDeleteCommand="Delete_Command". I want the delete a record with multiple primary Keys but I do not know how to access it from the Delete_Command event. If I use DataKeyField I'm limited to only one key. Any workarounds for this?
Delete Datalist row with multiple primary keys
CC BY-SA 3.0
null
2008-08-21T07:13:24.487
2012-08-11T16:00:48.113
2012-08-11T16:00:48.113
1,477,076
1,013
[ "asp.net" ]
19,440
2
null
19,412
0
null
I have to agree with CD-MaN: Using "ORDER BY RAND()" will work nicely for small tables or when you do your SELECT only a few times. I also use the "num_value >= RAND() * ..." technique, and if I really want to have random results I have a special "random" column in the table that I update once a day or so. That single...
null
CC BY-SA 2.5
null
2008-08-21T07:20:31.160
2008-08-21T07:20:31.160
null
null
999
null
19,437
1
19,444
null
11
18,424
I'm having issues with my SQL Reporting Services reports. I'm using a custom font for report headers, and when deployed to the server it does not render correctly when I print or export to PDF/TIFF. I have installed the font on the server. Is there anything else I need to do in order to use custom fonts? When viewing ...
Custom font in SQL Server 2005 Reporting Services
CC BY-SA 2.5
0
2008-08-21T07:16:16.087
2011-12-15T21:18:49.753
2008-08-21T23:36:15.480
1,199,387
1,199,387
[ "sql", "reporting-services" ]
19,442
1
19,443
null
23
5,379
How can I create this file in a directory in windows 2003 SP2: ``` .hgignore ``` I get error: You must type a file name.
how to allow files starting with period and no extension in windows 2003 server?
CC BY-SA 2.5
0
2008-08-21T07:26:27.030
2021-12-06T17:35:58.803
2009-05-31T08:42:24.310
110,204
479
[ "mercurial", "windows-server-2003", "hgignore" ]
19,444
2
null
19,437
4
null
The PDF files served up from SSRS, like many PDF files, have embedded postscript fonts. So, the local fonts used in the report are converted to a best matching postscript font when the conversion takes place so the PDF is totally portable without relying on locally installed fonts. You can see the official MS guideli...
null
CC BY-SA 2.5
null
2008-08-21T07:29:10.390
2008-08-21T08:07:46.710
2008-08-21T08:07:46.710
1,627
1,627
null
19,445
1
26,105
null
0
1,157
Management is thinking of changing out Content Management Systems. What do you use/recommend? 1. What UCM solution is your company using? 2. How big is your company? 3. Are you happy with the implementation? Current setup: 1. The company I work for uses Oracle ECM (formerly Stellent UCM). 2. We have somewhere ov...
Content Management system recommendations
CC BY-SA 3.0
0
2008-08-21T07:29:46.990
2017-08-09T06:25:02.960
2017-08-09T06:25:02.960
3,951,861
713
[ "content-management-system", "content-management", "ecm" ]
19,443
2
null
19,442
27
null
That's a "feature" of Windows Explorer. Try to create your files from a command line (or from a batch/program you wrote) and it should work fine. Try this from a dos prompt: ``` echo Hello there! > .hgignore ```
null
CC BY-SA 2.5
null
2008-08-21T07:28:37.320
2008-08-21T07:28:37.320
null
null
227
null
19,448
1
19,495
null
1
1,130
In my engine I have a need to be able to detect DXT1 textures that have texels with 0 alpha (e.g. a cutout for a window frame). This is easy for textures I compress myself, but I'm not sure about textures that are already compressed. Is there an easy way to tell from the header whether a DDS image contains alpha?
In a DDS file can you detect textures with 0/1 alpha bits?
CC BY-SA 2.5
null
2008-08-21T07:33:10.867
2017-01-31T15:17:42.923
2013-03-31T21:18:38.273
1,380,680
1,043
[ "graphics", "directx", "directdraw", "dds-format" ]
19,447
2
null
19,436
1
null
You can access all of the keys: ``` gridView.DataKeys[rowNum][dataKeyName] ``` where rowNum is e.RowIndex from the gridView_RowDeleting event handler, and dataKeyName is the key you want to get: ``` <asp:GridView ID="gridView" runat="server" DataKeyNames="userid, id1, id2, id3" OnRowDeleting="gridView_RowDeleting">...
null
CC BY-SA 2.5
null
2008-08-21T07:31:42.600
2008-08-21T07:31:42.600
null
null
968
null
19,451
2
null
19,433
1
null
Audacity uses the [Lame library](http://en.wikipedia.org/wiki/LAME), however not only is this not language agnostic it also has some questions over licensing. Nevertheless it might be a start
null
CC BY-SA 2.5
null
2008-08-21T07:39:46.450
2008-08-21T07:39:46.450
null
null
259
null
19,450
2
null
18,959
1
null
> Partitions have UUIDs associated with them. I don't know how to find these in Windows but in linux you can find the UUID for each partition with:> sudo vol_id -u device (e.g. /dev/sda1)If there is an equivilent function in Windows you could simply store the UUIDs for whatever partition they pick then iterate through ...
null
CC BY-SA 2.5
null
2008-08-21T07:37:10.340
2008-08-21T07:37:10.340
null
null
2,206
null
19,419
2
null
19,412
858
null
See this post: [SQL to Select a random row from a database table](http://www.petefreitag.com/item/466.cfm). It goes through methods for doing this in MySQL, PostgreSQL, Microsoft SQL Server, IBM DB2 and Oracle (the following is copied from that link): Select a random row with MySQL: ``` SELECT column FROM table ORDER...
null
CC BY-SA 3.0
null
2008-08-21T06:32:32.853
2013-08-21T16:39:40.667
2013-08-21T16:39:40.667
51
51
null
19,453
2
null
19,409
12
null
You can't trust what any called procedure does to any of the registers. Either push the registers onto the stack and pop them back off after calling printf or have the increment and end point values held in memory and read/written into registers as you need them. I hope the following works. I'm assuming that pushl h...
null
CC BY-SA 2.5
null
2008-08-21T07:47:00.007
2008-08-21T07:47:00.007
null
null
1,726
null
19,454
1
19,455
null
18
4,876
Following on from my recent question on [Large, Complex Objects as a Web Service Result](https://stackoverflow.com/questions/17725/large-complex-objects-as-a-web-service-result). I have been thinking about how I can ensure all future child classes are serializable to XML. Now, obviously I could implement the [IXmlSeria...
Enforce Attribute Decoration of Classes/Methods
CC BY-SA 4.0
0
2008-08-21T07:49:56.083
2019-05-17T20:10:11.463
2020-06-20T09:12:55.060
-1
832
[ "c#", "xml", "serialization", "coding-style", ".net-attributes" ]
19,457
2
null
19,445
0
null
1) My [company](http://searchlightdigital.com/) currently uses [Word Press](http://wordpress.com/) or no CMS at all. We are however working on a CMS that will work exactly as we want it to. 2) It's me and my friend so 2 of us 3) We're still starting up and finding clients so haven't had a chance to use it.
null
CC BY-SA 2.5
null
2008-08-21T07:57:55.720
2008-08-21T07:57:55.720
null
null
1,384,652
null
19,455
2
null
19,454
19
null
I'd write a unit/integration test that verifies that any class matching some given criteria (ie subclassing X) is decorated appropriately. If you set up your build to run with tests, you can have the build fail when this test fails. UPDATE: You said, "Looks like I will just have to roll my sleeves up and make sure tha...
null
CC BY-SA 2.5
null
2008-08-21T07:54:12.670
2008-08-21T10:29:48.523
2008-08-21T10:29:48.523
1,710
1,710
null
19,452
2
null
19,388
1
null
In the example given by [steveth45](https://stackoverflow.com/questions/19388/goto-command-in-php6#19398) you can use a function instead: ``` function findItem(...) { for (...) { for (...) { for (...) { if (x) { return theItem; } } } } } // no need for label now theIt...
null
CC BY-SA 2.5
null
2008-08-21T07:45:22.397
2008-08-21T07:45:22.397
2017-05-23T11:53:20.017
-1
486
null
19,461
1
null
null
11
12,042
I have a standard HTML image tag with an image in it, 100 by 100 pixels in size. I want people to be able to click the image and for that to pass the X and Y that they click into a function. The coordinates need to be relative to the image top and left.
Click an image, get coordinates
CC BY-SA 4.0
0
2008-08-21T08:02:12.420
2019-12-22T08:34:02.293
2019-12-22T08:34:02.293
12,258,312
1,384,652
[ "javascript", "html", "image" ]
19,421
2
null
19,412
3
null
Best way is putting a random value in a new column just for that purpose, and using something like this (pseude code + SQL): ``` randomNo = random() execSql("SELECT TOP 1 * FROM MyTable WHERE MyTable.Randomness > $randomNo") ``` This is the solution employed by the MediaWiki code. Of course, there is some bias again...
null
CC BY-SA 2.5
null
2008-08-21T06:36:10.830
2008-08-21T06:36:10.830
null
null
227
null
19,463
2
null
12,368
0
null
You can have deterministic object destruction in c++ You never want to call GC.Collect, it messes with the self tuning of the garbage collector to detect memory pressure and in some cases do nothing other than increase the current generation of every object on the heap. For those posting IDisposable answers. Callin...
null
CC BY-SA 2.5
null
2008-08-21T08:05:08.073
2008-08-25T21:18:25.343
2008-08-25T21:18:25.343
580
580
null
19,464
2
null
19,461
5
null
I think you're talking about: ``` <input id="info" type="image"> ``` When submitted, there are form values for the x and y coordinate based on the input element id (`info.x` and `info.y` in this case). [http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.4.1](http://www.w3.org/TR/REC-html40/interact/forms.html...
null
CC BY-SA 3.0
null
2008-08-21T08:05:41.567
2018-01-05T12:49:37.553
2018-01-05T12:49:37.553
92,701
5
null
19,466
1
19,472
null
18
21,621
How can I check `file permissions`, without having to run operating system specific command via `passthru()` or `exec()`?
Check file permissions
CC BY-SA 3.0
0
2008-08-21T08:06:06.933
2015-10-10T08:56:20.030
2015-10-10T08:56:20.030
4,800,955
115
[ "php", "file-permissions" ]
19,468
2
null
19,445
1
null
Our external business orientated site is running [joomla](http://www.joomla.org/) which once you get passed the learning procces of how it constructs sites, is very good for a multi-user environement. Company = 25+ people
null
CC BY-SA 2.5
null
2008-08-21T08:08:55.193
2008-08-21T08:08:55.193
null
null
1,111
null
19,458
1
null
null
1
340
I have developed a high speed transactional server for transfering data over the internet so I do not need to rely upon a database implementation like MySQL to provide this. That opens up the question of which SQL version to use? I really like SQLite, but I am not convinced it is industrial strength yet What I do like...
Which RDBMS should I use?
CC BY-SA 2.5
null
2008-08-21T07:58:10.277
2010-12-15T17:58:17.360
2010-12-15T17:58:17.360
42,439
null
[ "sql" ]
19,467
2
null
19,433
5
null
Just about every language has bindings to C, so you'll probably want to get the applicable C libraries for encoding/decoding mp3's and FLAC files. This list might include libFLAC [http://flac.sourceforge.net/api/index.html](http://flac.sourceforge.net/api/index.html) FLAC encoding/decoding LAME [http://lame.sourcefor...
null
CC BY-SA 2.5
null
2008-08-21T08:08:21.763
2008-08-21T08:08:21.763
null
null
1,892
null
19,469
2
null
19,466
0
null
What do you want to do by checking file permissions? When writing secure code, it's almost always incorrect to "check, then do" anything. The reason is that between the checking whether you can do something and actually doing it, the state of the system could change such that doing it would have a different result. ...
null
CC BY-SA 2.5
null
2008-08-21T08:09:41.993
2008-08-21T08:09:41.993
null
null
714
null
19,470
2
null
19,466
12
null
You can use the [is_readable()](http://www.php.net/manual/en/function.is-readable.php), [is_executable()](http://www.php.net/manual/en/function.is-executable.php) etc.. commands.
null
CC BY-SA 2.5
null
2008-08-21T08:09:46.720
2008-08-21T08:09:46.720
2020-06-20T09:12:55.060
-1
1,830
null
19,471
1
19,480
null
1
587
When I access my site from any computer, I see this warning popping up: > "This web site wants to run the following add-on: 'Microsoft Data Access - Remote Data Services Dat...' from 'Microsoft Corporation'. If you trust the web site and the add-on and want to allow it to run, click here..." I am guessing this...
Weird yellow bar pops-up: 'Microsoft Data Access - Remote Data Services
CC BY-SA 3.0
null
2008-08-21T08:10:14.910
2013-05-18T01:45:59.133
2013-05-18T01:45:59.133
1,012,641
260
[ "security", "internet-explorer-7" ]
19,472
2
null
19,466
23
null
Use [fileperms()](http://php.net/fileperms) function ``` clearstatcache(); echo substr(sprintf('%o', fileperms('/etc/passwd')), -4); ```
null
CC BY-SA 2.5
null
2008-08-21T08:10:44.817
2008-08-21T08:10:44.817
null
null
1,926
null
19,473
2
null
19,454
1
null
You can write unit tests to check for this kind of thing - it basically uses reflection. Given the fact this is possible I guess it would also be possible to write a FxCop rule, but I've never done such a thing.
null
CC BY-SA 2.5
null
2008-08-21T08:17:30.540
2008-08-21T08:17:30.540
null
null
1,908
null
19,480
2
null
19,471
3
null
Id be very concerned if this is on your own server. I found the following blog post that warns on the issue: [http://msmvps.com/blogs/hostsnews/archive/2007/09/13/can-you-spot-the-fake.aspx](http://msmvps.com/blogs/hostsnews/archive/2007/09/13/can-you-spot-the-fake.aspx) but doesn't provide any way of removing it. I'...
null
CC BY-SA 2.5
null
2008-08-21T08:22:28.190
2008-08-21T08:22:28.190
null
null
1,908
null
19,476
2
null
19,442
5
null
By the way Raymond Chen had a blog post about this topic a while back: [Why doesn't Explorer let you create a file whose name begins with a dot?](https://devblogs.microsoft.com/oldnewthing/20080414-00/?p=22763) (archive.org link with comments: [https://web.archive.org/web/20100305064616/http://blogs.msdn.com/oldnewthin...
null
CC BY-SA 4.0
null
2008-08-21T08:18:52.083
2021-12-06T17:35:58.803
2021-12-06T17:35:58.803
14,768
238
null
19,487
1
22,087
null
23
1,168
I generally use a manual process: 1. Look at the page, figure out the semantic elements, and build the HTML 2. Slice up the images I think I'll need 3. Start writing CSS 4. Tweak and repeat different steps as necessary Got a better approach, or a tool?
What's the best way to go from a Photoshop mockup to semantic HTML and CSS?
CC BY-SA 2.5
0
2008-08-21T08:32:34.873
2016-01-14T19:13:40.240
null
null
5
[ "html", "css" ]
19,488
2
null
19,481
2
null
@Point 1: Isn't the data binding engine the controller, if you really want to think in patterns? You just do not program it yourself, which is the whole point of using data binding in the first place.
null
CC BY-SA 2.5
null
2008-08-21T08:34:08.957
2008-08-21T08:34:08.957
null
null
1,810
null
19,489
2
null
19,481
6
null
As we say in the UK, First off all, I agree with you! But... For enterprise level applications, then spending the extra time on the system architecture, modelling and standards will give you a robust and sustainable system. But it will take longer to develop (or at least longer to get to an initial release) and thi...
null
CC BY-SA 2.5
null
2008-08-21T08:38:41.113
2008-08-21T08:38:41.113
null
null
993
null
19,481
1
null
null
22
5,716
Another discussion (we've been having a lot of them these days!) in our work is whether data binding is a bad idea or not. Personally, I think it is a Bad Thing™. My reasons are thrice: 1. It circumvents my well architectured MVP framework - with databinding, the view communicates bi-directionally with a model. Eww...
Is data binding a bad idea?
CC BY-SA 3.0
0
2008-08-21T08:25:46.667
2013-09-10T05:46:35.163
2012-07-11T19:15:30.240
106,224
1,193
[ "data-binding" ]
19,491
2
null
19,487
0
null
Some of the designers i know, usually uses Illustrator to make the design elements.
null
CC BY-SA 2.5
null
2008-08-21T08:39:33.750
2008-08-21T08:39:33.750
null
null
211
null
19,492
2
null
14,674
0
null
We have changed our project structure (making use of SVN Externals) where each project is now completely self-contained. That is, any references never go outwith the project directory (for example, if Project A references ASM X, then ASM X exists within a subfolder of ProjectA) I suspect that this should go some way ...
null
CC BY-SA 2.5
null
2008-08-21T08:40:06.307
2008-08-21T08:40:06.307
null
null
1,193
null
19,494
2
null
19,481
0
null
@Timbo: Yes and no.... but from a TDD perspective I'd like to cordon-off each controller so that I can test it in isolation. Also, say we want to run each edit via an EditCommand (so that we support Undo, for example) - for me, this rules out databinding. @Guy: Yes, this is exactly my POV. For me, databinding is g...
null
CC BY-SA 2.5
null
2008-08-21T08:46:06.307
2008-08-21T08:46:06.307
null
null
1,193
null
19,495
2
null
19,448
2
null
As far as I know, there's no way to tell from the header. There's a DDPF_ALPHAPIXELS flag, but I don't think that will get set based on what's in the pixel data. You'd need to parse the DXT1 blocks, and look for colours that have 0 alpha in them (making sure to check that the colour is actually used in the block, too, ...
null
CC BY-SA 2.5
null
2008-08-21T08:46:47.303
2008-08-21T09:47:32.447
2008-08-21T09:47:32.447
1,739
1,739
null
19,459
2
null
19,409
1
null
Nathan is on the right track. You can't assume that register values will be unmodified after calling a subroutine. In fact, it's best to assume they will be modified, else the subroutine wouldn't be able to do it's work (at least for low register count architectures like x86). If you want to preserve a value you should...
null
CC BY-SA 2.5
null
2008-08-21T08:00:47.960
2008-08-21T08:00:47.960
null
null
332
null
19,502
2
null
18,080
1
null
If you're after things like server data, would [RRDTool](http://oss.oetiker.ch/rrdtool/) be something you're after? It's not really a webserver type stats program though, I have no idea how it would scale. Edit: I've also just found [Splunk Swarm](http://wiki.splunk.com/Splunk_swarm), if you're interested in somethin...
null
CC BY-SA 2.5
null
2008-08-21T08:59:13.793
2008-10-05T23:26:04.370
2008-10-05T23:26:04.370
841
841
null
19,498
2
null
14,674
1
null
In our largest project (a system comprising of many applications) we have the following structure > /3rdPartyAssemblies /App1 /App2 /App3 /..... All external assemblies are added to 3rdPartyAssemblies/Vendor/Version/... We have a CoreBuild.sln file which acts as an MSBuild script for all of the assemblies that are s...
null
CC BY-SA 3.0
null
2008-08-21T08:53:31.047
2012-08-11T16:10:24.313
2012-08-11T16:10:24.313
1,477,076
1,297
null
19,506
2
null
18,077
1
null
As you're already using jQuery you could use [jQuery.browser](http://docs.jquery.com/Utilities/jQuery.browser) utility to do some browser sniffing and then target your CSS / JavaScript accordingly.
null
CC BY-SA 2.5
null
2008-08-21T09:03:12.770
2008-08-21T09:03:12.770
null
null
1,904
null
19,504
2
null
19,011
3
null
I think the most flexible approach would be to implement your own file system on top of the RMS. You can handle the RMS records in a similar way as blocks on a hard drive and use a [inode structure](http://en.wikipedia.org/wiki/Inode) or similar to spread logical files over multiple blocks. I would recommend implementi...
null
CC BY-SA 2.5
null
2008-08-21T09:01:19.797
2008-08-21T09:01:19.797
null
null
1,709
null
19,439
2
null
19,347
2
null
There are two main differences: the syntax, and memory management. In C++ you have pointers, which are more powerful (or less powerful depending on your interpretation of power) object references, which you already know about from Java. In Java you might do this: ``` Thing mything = new Thing(); // mything is an obj...
null
CC BY-SA 2.5
null
2008-08-21T07:19:36.157
2008-08-21T07:19:36.157
null
null
1,892
null
19,513
2
null
19,436
0
null
Oh, sorry, I missed it. AFAIK there is no such a possibility by default. Maybe you can create a composite key from your primary keys, like > Key1UnderscoreKey2UnderscoreKey3 and split it in the event handler. So this is a DIY multi-key handler for DataList :-) Edit: The underscore got lost during format, it replac...
null
CC BY-SA 2.5
null
2008-08-21T09:09:14.927
2008-08-21T09:25:27.773
2008-08-21T09:25:27.773
968
968
null
19,493
1
19,597
null
40
55,236
I'm trying to redirect all requests to my domain to another domain using mod_rewrite in an Apache 2.2 VirtualHost declaration. There is one exception to this -- I'd like all requests to the `/audio` path to be redirected. I've written a RewriteCond and RewriteRule to do this but it's not quite right and I can't figur...
mod_rewrite rule to redirect all requests except for one specific path
CC BY-SA 4.0
0
2008-08-21T08:42:17.407
2022-07-10T13:58:26.963
2022-07-10T13:58:26.963
1,145,388
1,174
[ "apache", "mod-rewrite" ]
19,517
1
21,841
null
7
1,373
I was reading the example chapter from [the book by Ayende](http://www.manning.com/rahien/) and on the website of [the Boo language](http://boo.codehaus.org/) I saw a reference to the [Specter BDD Framework](http://specter.sourceforge.net/). I am wondering if anybody is using it in their project, how that works out an...
Is anybody using the Specter BDD Framework?
CC BY-SA 3.0
0
2008-08-21T09:23:56.137
2013-02-14T15:14:12.110
2013-02-14T15:14:12.110
4,367
4,367
[ "c#", ".net", "bdd", "boo" ]
19,519
1
null
null
2
420
I wondered if anyone uses virtualized desktop PCs (running WinXP Pro or older) to have some old applications that are seldom used available for some ongoing tasks. Say you have a really old project that every once in a while needs a document update in a database system or something like that. The database application ...
Do you use virtualized desktops for legacy/seldom used applications?
CC BY-SA 2.5
0
2008-08-21T09:25:33.683
2008-09-28T11:56:23.580
2008-08-21T12:17:54.440
834
834
[ "desktop", "virtualization", "legacy" ]
19,516
1
19,521
null
3
1,186
Here is a simplification of my database: Then we have other tables that relate to the and tables individually. I now need to add a table where users can record telephone messages left by customers regarding Jobs and Quotes. I could create two identical tables ( and ), but this violates the DRY principal and see...
SQL2005: Linking a table to multiple tables and retaining Ref Integrity?
CC BY-SA 2.5
0
2008-08-21T09:12:00.083
2013-02-28T21:01:52.213
2008-11-17T21:52:40.453
3,743
366
[ "database", "sql-server-2005", "referential-integrity" ]
19,521
2
null
19,516
4
null
Create one Message table, containing a unique MessageId and the various properties you need to store for a message. ``` Table: Message Fields: Id, TimeReceived, MessageDetails, WhateverElse... ``` Create two link tables - QuoteMessage and JobMessage. These will just contain two fields each, foreign keys to the Quote...
null
CC BY-SA 3.0
null
2008-08-21T09:26:24.103
2013-02-28T21:01:52.213
2013-02-28T21:01:52.213
603,977
2,084
null
19,522
2
null
19,347
2
null
I also thoroughly recommend Bruce Eckel's [Thinking in C++](http://mindview.net/Books/TICPP/ThinkingInCPP2e.html). A fantastic book for already experienced programmers that want to get into the C++ mindset. He is kind enough to make electronic versions of his books [available for free](http://mindview.net/Books/Downl...
null
CC BY-SA 2.5
null
2008-08-21T09:26:29.767
2008-08-21T09:26:29.767
null
null
1,820
null
19,527
2
null
19,487
0
null
[This page](http://www.alistapart.com/articles/quickcssmockupswithphotoshop) shows how to do it a little more automated.
null
CC BY-SA 2.5
null
2008-08-21T09:30:34.890
2008-08-21T09:30:34.890
null
null
364
null
19,510
2
null
18,717
1
null
Foreign keys had never been explicit (FOREIGN KEY REFERENCES table(column)) declared in projects (business applications and social networking websites) which I worked on. But there always was a kind of convention of naming columns which were foreign keys. It's like with [database normalization](http://en.wikipedia.or...
null
CC BY-SA 3.0
null
2008-08-21T09:06:22.827
2013-08-10T19:37:01.017
2013-08-10T19:37:01.017
63,550
1,483
null
19,411
2
null
19,409
6
null
I'm not too familiar with _printf, but could it be that it modifies eax? Printf should return the number of chars printed, which in this case is two: '0' and '\n'. I think it returns this in eax, and when you increment it, you get 3, which is what you proceed to print. You might be better off using a different regist...
null
CC BY-SA 2.5
null
2008-08-21T06:28:08.917
2008-08-21T06:36:20.893
2008-08-21T06:36:20.893
1,084
1,084
null