Newest Questions
24,189,457 questions
94
votes
6
answers
32k
views
When to use unsigned values over signed ones?
When is it appropriate to use an unsigned variable over a signed one? What about in a for loop?
I hear a lot of opinions about this and I wanted to see if there was anything resembling a consensus.
...
59
votes
10
answers
5k
views
Should I use nested classes in this case?
I am working on a collection of classes used for video playback and recording. I have one main class which acts like the public interface, with methods like play(), stop(), pause(), record() etc... ...
125
votes
13
answers
86k
views
PHP Session Security
What are some guidelines for maintaining responsible session security with PHP? There's information all over the web and it's about time it all landed in one place!
135
votes
22
answers
40k
views
Is there a version control system for database structure changes?
I often run into the following problem.
I work on some changes to a project that require new tables or columns in the database. I make the database modifications and continue my work. Usually, I ...
971
votes
21
answers
864k
views
How do you sort a dictionary by value?
I often have to sort a dictionary (consisting of keys & values) by value. For example, I have a hash of words and respective frequencies that I want to order by frequency.
There is a SortedList ...
37
votes
5
answers
3k
views
Best Practice: Collaborative Environment, Bin Directory, SVN [closed]
What are the best practices for checking in BIN directories in a collaborative development environment using SVN? Should project level references be excluded from checkin? Is it easier to just add ...
37
votes
5
answers
3k
views
BerkeleyDB Concurrency [closed]
What's the optimal level of concurrency that the C++ implementation of BerkeleyDB can reasonably support?
How many threads can I have hammering away at the DB before throughput starts to suffer ...
42
votes
3
answers
12k
views
GTK implementation of MessageBox
I have been trying to implement Win32's MessageBox using GTK. The app uses SDL/OpenGL, so this isn't a GTK app.
I handle the initialization (gtk_init) sort of stuff inside the MessageBox function as ...
83
votes
10
answers
24k
views
Adding scripting functionality to .NET applications
I have a little game written in C#. It uses a database as back-end. It's
a trading card game, and I wanted to implement the function of the cards as a script.
What I mean is that I essentially have ...
44
votes
3
answers
4k
views
Create a SQLite database based on an XSD Data Set
Does anybody know if there is a way to create an SQLite database based on an XSD DataSet? In the past, I've just used a basic SQLite manager, but I want to fuse things a bit more with my .NET ...
88
votes
4
answers
53k
views
SQL Server 2005 implementation of MySQL REPLACE INTO?
MySQL has this incredibly useful yet proprietary REPLACE INTO SQL Command.
Can this easily be emulated in SQL Server 2005?
Starting a new Transaction, doing a Select() and then either UPDATE or ...
44
votes
2
answers
32k
views
Register Windows program with the mailto protocol programmatically
How do I make it so mailto: links will be registered with my program?
How would I then handle that event in my program?
Most of the solutions I found from a quick Google search are how to do this ...
79
votes
9
answers
10k
views
Create a tag cloud by wrapping array values in h1 through h6 tags based on a mapping array of weights
I have the following arrays:
$artist = ["the roots", "michael jackson", "billy idol", "more", "and more", "and_YET_MORE"];
$count = [5, 3, 9,...
40
votes
4
answers
5k
views
Upgrading SQL Server 6.5
Yes, I know. The existence of a running copy of SQL Server 6.5 in 2008 is absurd.
That stipulated, what is the best way to migrate from 6.5 to 2005? Is there any direct path? Most of the ...
72
votes
4
answers
4k
views
Floating Point Number parsing: Is there a Catch All algorithm?
One of the fun parts of multi-cultural programming is number formats.
Americans use 10,000.50
Germans use 10.000,50
French use 10 000,50
My first approach would be to take the string, parse it ...
72
votes
8
answers
20k
views
Function for creating color wheels [closed]
This is something I've pseudo-solved many times and have never quite found a solution for.
The problem is to come up with a way to generate N colors, that are as distinguishable as possible where N ...
125
votes
11
answers
124k
views
error_log per Virtual Host?
On one Linux Server running Apache and PHP 5, we have multiple Virtual Hosts with separate log files. We cannot seem to separate the php error_log between virtual hosts.
Overriding this setting in ...
53
votes
3
answers
8k
views
Annotating YouTube videos programmatically [closed]
I want to be able to display a normal YouTube video with overlaid annotations, consisting of coloured rectangles for each frame. The only requirement is that this should be done programmatically.
...
86
votes
6
answers
18k
views
How do I print an HTML document from a web service?
I want to print HTML from a C# web service. The web browser control is overkill, and does not function well in a service environment, nor does it function well on a system with very tight security ...
346
votes
22
answers
135k
views
How to do version control for SQL Server database?
I want to get my databases under version control.
I'll always want to have at least some data in there (as alumb mentions: user types and administrators). I'll also often want a large collection of ...
64
votes
10
answers
178k
views
Embedding Windows Media Player for all browsers
Edit: This question was written in 2008, which was like 3 internet ages ago. If this question is still relevant to your environment, please accept my condolences. Everyone else should convert into a ...
102
votes
7
answers
10k
views
How do I sync the SVN revision number with my ASP.NET web site?
Stack Overflow has a subversion version number at the bottom:
svn revision: 679
I want to use such automatic versioning with my .NET Web Site/Application, Windows Forms, WPD projects/solutions.
How ...
90
votes
8
answers
22k
views
How do I track file downloads
I have a website that plays mp3s in a flash player. If a user clicks 'play' the flash player automatically downloads an mp3 and starts playing it.
Is there an easy way to track how many times a ...
60
votes
9
answers
6k
views
Compressing / Decompressing Folders & Files
Does anyone know of a good way to compress or decompress files and folders in C# quickly? Handling large files might be necessary.
40
votes
1
answer
2k
views
XSD DataSets and ignoring foreign keys
I have a pretty standard table set-up in a current application using the .NET XSD DataSet and TableAdapter features. My contracts table consists of some standard contract information, with a column ...
89
votes
5
answers
97k
views
How to export data from SQL Server 2005 to MySQL [closed]
I've been banging my head against SQL Server 2005 trying to get a lot of data out. I've been given a database with nearly 300 tables in it and I need to turn this into a MySQL database. My first ...
105
votes
18
answers
29k
views
How would you access Object properties from within an object method? [closed]
What is the "purist" or "correct" way to access an object's properties from within an object method that is not a getter/setter method?
I know that from outside of the object you should use a getter/...
120
votes
16
answers
82k
views
Java lib or app to convert CSV to XML file? [closed]
Is there an existing application or library in Java which will allow me to convert a CSV data file to XML file?
The XML tags would be provided through possibly the first row containing column ...
45
votes
1
answer
2k
views
ASP.NET Site Maps
Does anyone have experience creating SQL-based ASP.NET site-map providers?
I have the default XML file web.sitemap working properly with my Menu and SiteMapPath controls, but I'll need a way for the ...
68
votes
2
answers
6k
views
Decoding T-SQL CAST in C#/VB.NET
Recently our site has been deluged with the resurgence of the Asprox botnet SQL injection attack. Without going into details, the attack attempts to execute SQL code by encoding the T-SQL commands in ...
52
votes
8
answers
17k
views
Best Subversion clients for Windows Vista (64bit) [closed]
I've been using TortoiseSVN in a Windows environment for quite some time. It seems very feature-complete and nicely integrated into the Windows shell, and more importantly, it's fairly painless to ...
182
votes
15
answers
16k
views
Anatomy of a "Memory Leak"
In .NET perspective:
What is a memory leak?
How can you determine whether your application leaks? What are the effects?
How can you prevent a memory leak?
If your application has memory leak, does it ...
163
votes
3
answers
57k
views
How do you branch and merge with TortoiseSVN? [closed]
How do you branch and merge with Apache Subversion using the TortoiseSVN client?
107
votes
10
answers
46k
views
Is gettimeofday() guaranteed to be of microsecond resolution?
I am porting a game, that was originally written for the Win32 API, to Linux (well, porting the OS X port of the Win32 port to Linux).
I have implemented QueryPerformanceCounter by giving the uSeconds ...
133
votes
11
answers
71k
views
Flat file databases [closed]
What are the best practices around creating flat file database structures in PHP?
A lot of more matured PHP flat file frameworks out there which I attempt to implement SQL-like query syntax which is ...
54
votes
3
answers
7k
views
SQLStatement.execute() - multiple queries in one statement
I've written a database generation script in SQL and want to execute it in my Adobe AIR application:
Create Table tRole (
roleID integer Primary Key
,roleName varchar(40)
);
Create Table ...
50
votes
4
answers
12k
views
Getting Subclipse in Aptana to work with the newest release of Subversion
The version of Subclipse (1.2.4) currently available through Aptana's automatic Plugins Manager does not work with the newest version of Subversion.
I see on the Subclipse website however that they ...
48
votes
2
answers
2k
views
How do I add existing comments to RDoc in Ruby? [closed]
I want to format my existing comments as 'RDoc comments' so they can be viewed using ri.
What are some recommended resources for starting out using RDoc?
89
votes
4
answers
6k
views
Paging a collection with LINQ
How do you page through a collection in LINQ given that you have a startIndex and a count?
53
votes
1
answer
5k
views
Microsoft Office 2007 file type, Mime types and identifying characters
Where can I find a list of all of the MIME types and the identifying characters for Microsoft Office 2007 files?
I have an upload form that is restricting uploads based on the extensions and ...
117
votes
7
answers
28k
views
How do I get a distinct, ordered list of names from a DataTable using LINQ?
I have a DataTable with a Name column. I want to generate a collection of the unique names ordered alphabetically. The following query ignores the order by clause.
var names =
(from DataRow dr in ...
293
votes
29
answers
260k
views
Multiple submit buttons in an HTML form
Let's say you create a wizard in an HTML form. One button goes back, and one goes forward. Since the back button appears first in the markup when you press Enter, it will use that button to submit the ...
294
votes
8
answers
42k
views
Best way to allow plugins for a PHP application [closed]
I am starting a new web application in PHP and this time around I want to create something that people can extend by using a plugin interface.
How does one go about writing 'hooks' into their code ...
115
votes
3
answers
9k
views
Reliable timer in a console application
I am aware that in .NET there are three timer types (see Comparing the Timer Classes in the .NET Framework Class Library). I have chosen a threaded timer as the other types can drift if the main ...
154
votes
9
answers
84k
views
Check for changes to an SQL Server table?
How can I monitor an SQL Server database for changes to a table without using triggers or modifying the structure of the database in any way? My preferred programming environment is .NET and C#.
I'd ...
97
votes
8
answers
12k
views
How to unload a ByteArray using Actionscript 3?
How do I forcefully unload a ByteArray from memory using ActionScript 3?
I have tried the following:
// First non-working solution
byteArray.length = 0;
byteArray = new ByteArray();
// Second non-...
178
votes
9
answers
17k
views
How to use the C socket API in C++ on z/OS
I'm having issues getting the C sockets API to work properly in C++ on z/OS.
Although I am including sys/socket.h, I still get compile time errors telling me that AF_INET is not defined.
Am I missing ...
199
votes
7
answers
108k
views
Throw an error preventing a table update in a MySQL trigger
If I have a trigger before the update on a table, how can I throw an error that prevents the update on that table?
357
votes
23
answers
74k
views
What is the fastest way to get the value of π?
I'm looking for the fastest way to obtain the value of π, as a personal challenge. More specifically, I'm using ways that don't involve using #define constants like M_PI, or hard-coding the number in.
...
200
votes
9
answers
89k
views
Binary Data in MySQL [closed]
How do I store binary data in MySQL?