PostId
int64
4
11.8M
PostCreationDate
stringlengths
19
19
OwnerUserId
int64
1
1.57M
OwnerCreationDate
stringlengths
10
19
ReputationAtPostCreation
int64
-55
461k
OwnerUndeletedAnswerCountAtPostTime
int64
0
21.5k
Title
stringlengths
3
250
BodyMarkdown
stringlengths
5
30k
Tag1
stringlengths
1
25
Tag2
stringlengths
1
25
Tag3
stringlengths
1
25
Tag4
stringlengths
1
25
Tag5
stringlengths
1
25
PostClosedDate
stringlengths
19
19
OpenStatus
stringclasses
5 values
unified_texts
stringlengths
32
30.1k
OpenStatus_id
int64
0
4
4
07/31/2008 21:42:52
8
07/31/2008 21:33:24
1
0
Decimal vs Double?
I'm new to C#, and I want to use a trackbar for the forms opacity This is my code decimal trans = trackBar1.Value / 5000 this.Opacity = trans When I try to build it, I get this error **Cannot implicitly convert type 'decimal' to 'double** I tried making trans a double, but then the control doesn't work. This code worked fine for me in VB.NET. Any suggestions?
c#
null
null
null
null
null
open
Decimal vs Double? === I'm new to C#, and I want to use a trackbar for the forms opacity This is my code decimal trans = trackBar1.Value / 5000 this.Opacity = trans When I try to build it, I get this error **Cannot implicitly convert type 'decimal' to 'double** I tried making trans a double, but then the control doesn't work. This code worked fine for me in VB.NET. Any suggestions?
0
6
07/31/2008 22:08:08
9
07/31/2008 21:35:26
1
0
Percentage width child in absolutely positioned parent doesn't work in IE7
I've got an absolutely positioned div containing several children, one of which is a relatively positioned div. When I use a percentage-based width on the child div, it collapses to zero width on IE7, but not on Firefox or Safari. If I use pixel width, it works. If the parent is relatively positioned, the percentage width on the child works. Is there something I'm missing here? Is there an easy fix besides the pixel-based width on the child? Is there an area of the CSS spec that covers this?
html
css
null
null
null
null
open
Percentage width child in absolutely positioned parent doesn't work in IE7 === I've got an absolutely positioned div containing several children, one of which is a relatively positioned div. When I use a percentage-based width on the child div, it collapses to zero width on IE7, but not on Firefox or Safari. If I use pixel width, it works. If the parent is relatively positioned, the percentage width on the child works. Is there something I'm missing here? Is there an easy fix besides the pixel-based width on the child? Is there an area of the CSS spec that covers this?
0
8
07/31/2008 23:33:19
9
07/31/2008 21:35:26
16
1
Tools for porting J# code to C#
Are there any conversion tools for porting Visual J# code to C#?
j#
null
null
null
null
null
open
Tools for porting J# code to C# === Are there any conversion tools for porting Visual J# code to C#?
0
9
07/31/2008 23:40:59
1
07/31/2008 14:22:31
1
1
How do I calculate someone's age in c#?
Given a DateTime representing their birthday, how do I calculate someone's age?
c#
null
null
null
null
null
open
How do I calculate someone's age in c#? === Given a DateTime representing their birthday, how do I calculate someone's age?
0
9,610,539
03/07/2012 23:07:09
1,021,610
10/31/2011 08:26:49
29
0
retrieve data from NSUserDefaults to TableView
I save values of two labels through NSUserDefaults : - (IBAction) saveData { // Store the data NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [defaults setObject:autore.text forKey:@"Author"]; [defaults setObject:testo.text forKey:@"Text"]; [defaults synchronize]; } Then i try tot retrieve those values in a tableView : // NSArray @synthesize dataArray; - (void)viewDidLoad { NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults]; self.dataArray = [NSArray arrayWithObjects:[prefs objectForKey:@"Author"], [prefs objectForKey:@"Text"],nil]; } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { // There is only one section. return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { // Return the number of time zone names. return [dataArray count]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { .............. .............. NSString *string = [dataArray objectAtIndex:indexPath.row]; // Authors cell.textLabel.text = string; // Text cell.detailTextLabel.text = string; return cell; } I would obtain result as like picture: ![figure][1] [1]: http://i.stack.imgur.com/UK9bE.png
iphone
objective-c
ios5
null
null
null
open
retrieve data from NSUserDefaults to TableView === I save values of two labels through NSUserDefaults : - (IBAction) saveData { // Store the data NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [defaults setObject:autore.text forKey:@"Author"]; [defaults setObject:testo.text forKey:@"Text"]; [defaults synchronize]; } Then i try tot retrieve those values in a tableView : // NSArray @synthesize dataArray; - (void)viewDidLoad { NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults]; self.dataArray = [NSArray arrayWithObjects:[prefs objectForKey:@"Author"], [prefs objectForKey:@"Text"],nil]; } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { // There is only one section. return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { // Return the number of time zone names. return [dataArray count]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { .............. .............. NSString *string = [dataArray objectAtIndex:indexPath.row]; // Authors cell.textLabel.text = string; // Text cell.detailTextLabel.text = string; return cell; } I would obtain result as like picture: ![figure][1] [1]: http://i.stack.imgur.com/UK9bE.png
0
39
08/01/2008 12:43:11
33
08/01/2008 12:32:10
1
0
Reliable Timer in a Console Application
I am aware in dot net there are three timer types (see [http://msdn.microsoft.com/en-us/magazine/cc164015.aspx][1]). I have chosen a the threaded timer as the other types can drift if the main thread is busy and I need this to be reliable. The way this timer works in the control of the timer is put on another thread so it can always tick along with the work begin completed on the parent thread when it is not busy. The issue I have is that with this timer in a console application is that while the timer is ticking along on another thread the main thread is not doing anything so the app closes. I tried adding a while true loop but then the main thread is too busy when the timer does go off. Any ideas welcome. [1]: http://msdn.microsoft.com/en-us/magazine/cc164015.aspx
c#
vb.net
timer
null
null
null
open
Reliable Timer in a Console Application === I am aware in dot net there are three timer types (see [http://msdn.microsoft.com/en-us/magazine/cc164015.aspx][1]). I have chosen a the threaded timer as the other types can drift if the main thread is busy and I need this to be reliable. The way this timer works in the control of the timer is put on another thread so it can always tick along with the work begin completed on the parent thread when it is not busy. The issue I have is that with this timer in a console application is that while the timer is ticking along on another thread the main thread is not doing anything so the app closes. I tried adding a while true loop but then the main thread is too busy when the timer does go off. Any ideas welcome. [1]: http://msdn.microsoft.com/en-us/magazine/cc164015.aspx
0
19
08/01/2008 05:21:22
13
08/01/2008 04:18:04
1
0
Fastest way to get value of pi
Solutions welcome in any language. :-) I'm looking for the fastest way to obtain the value of pi, as a personal challenge. More specifically I'm using ways that don't involve using #defined constants like M_PI, or hardcoding the number in. The program below tests the various ways I know of. The inline assembly version is, in theory, the fastest option, though clearly not portable; I've included it as a baseline to compare the other versions against. In my tests, with builtins, the `4 * atan(1)` version is fastest on GCC 4.2, because it auto-folds the `atan(1)` into a constant. With `-fno-builtin` specified, the `atan2(0, -1)` version is fastest. Here's the main testing program (`pitimes.c`): #include <math.h> #include <stdio.h> #include <time.h> #define ITERS 10000000 #define TESTWITH(x) { \ diff = 0.0; \ time1 = clock(); \ for (i = 0; i < ITERS; ++i) \ diff += (x) - M_PI; \ time2 = clock(); \ printf("%s\t=> %e, time => %f\n", #x, diff, diffclock(time2, time1)); \ } static inline double diffclock(clock_t time1, clock_t time0) { return (double) (time1 - time0) / CLOCKS_PER_SEC; } int main() { int i; clock_t time1, time2; double diff; /* Warmup. The atan2 case catches GCC's atan folding (which would * optimise the ``4 * atan(1) - M_PI'' to a no-op), if -fno-builtin * is not used. */ TESTWITH(4 * atan(1)) TESTWITH(4 * atan2(1, 1)) #if defined(__GNUC__) && (defined(__i386__) || defined(__amd64__)) extern double fldpi(); TESTWITH(fldpi()) #endif /* Actual tests start here. */ TESTWITH(atan2(0, -1)) TESTWITH(acos(-1)) TESTWITH(2 * asin(1)) TESTWITH(4 * atan2(1, 1)) TESTWITH(4 * atan(1)) return 0; } And the inline assembly stuff (`fldpi.c`), noting that it will only work for x86 and x64 systems: double fldpi() { double pi; asm("fldpi" : "=t" (pi)); return pi; } And a build script that builds all the configurations I'm testing (`build.sh`): #!/bin/sh gcc -O3 -Wall -c -m32 -o fldpi-32.o fldpi.c gcc -O3 -Wall -c -m64 -o fldpi-64.o fldpi.c gcc -O3 -Wall -ffast-math -m32 -o pitimes1-32 pitimes.c fldpi-32.o gcc -O3 -Wall -m32 -o pitimes2-32 pitimes.c fldpi-32.o -lm gcc -O3 -Wall -fno-builtin -m32 -o pitimes3-32 pitimes.c fldpi-32.o -lm gcc -O3 -Wall -ffast-math -m64 -o pitimes1-64 pitimes.c fldpi-64.o -lm gcc -O3 -Wall -m64 -o pitimes2-64 pitimes.c fldpi-64.o -lm gcc -O3 -Wall -fno-builtin -m64 -o pitimes3-64 pitimes.c fldpi-64.o -lm Apart from testing between various compiler flags (I've compared 32-bit against 64-bit too, because the optimisations are different), I've also tried switching the order of the tests around. `The atan2(0, -1)` version still comes out top every time, though. I'm keen to hear what results you have, as well as improvements to the testing process. :-)
pi
speed
language-agnostic
unix
null
null
open
Fastest way to get value of pi === Solutions welcome in any language. :-) I'm looking for the fastest way to obtain the value of pi, as a personal challenge. More specifically I'm using ways that don't involve using #defined constants like M_PI, or hardcoding the number in. The program below tests the various ways I know of. The inline assembly version is, in theory, the fastest option, though clearly not portable; I've included it as a baseline to compare the other versions against. In my tests, with builtins, the `4 * atan(1)` version is fastest on GCC 4.2, because it auto-folds the `atan(1)` into a constant. With `-fno-builtin` specified, the `atan2(0, -1)` version is fastest. Here's the main testing program (`pitimes.c`): #include <math.h> #include <stdio.h> #include <time.h> #define ITERS 10000000 #define TESTWITH(x) { \ diff = 0.0; \ time1 = clock(); \ for (i = 0; i < ITERS; ++i) \ diff += (x) - M_PI; \ time2 = clock(); \ printf("%s\t=> %e, time => %f\n", #x, diff, diffclock(time2, time1)); \ } static inline double diffclock(clock_t time1, clock_t time0) { return (double) (time1 - time0) / CLOCKS_PER_SEC; } int main() { int i; clock_t time1, time2; double diff; /* Warmup. The atan2 case catches GCC's atan folding (which would * optimise the ``4 * atan(1) - M_PI'' to a no-op), if -fno-builtin * is not used. */ TESTWITH(4 * atan(1)) TESTWITH(4 * atan2(1, 1)) #if defined(__GNUC__) && (defined(__i386__) || defined(__amd64__)) extern double fldpi(); TESTWITH(fldpi()) #endif /* Actual tests start here. */ TESTWITH(atan2(0, -1)) TESTWITH(acos(-1)) TESTWITH(2 * asin(1)) TESTWITH(4 * atan2(1, 1)) TESTWITH(4 * atan(1)) return 0; } And the inline assembly stuff (`fldpi.c`), noting that it will only work for x86 and x64 systems: double fldpi() { double pi; asm("fldpi" : "=t" (pi)); return pi; } And a build script that builds all the configurations I'm testing (`build.sh`): #!/bin/sh gcc -O3 -Wall -c -m32 -o fldpi-32.o fldpi.c gcc -O3 -Wall -c -m64 -o fldpi-64.o fldpi.c gcc -O3 -Wall -ffast-math -m32 -o pitimes1-32 pitimes.c fldpi-32.o gcc -O3 -Wall -m32 -o pitimes2-32 pitimes.c fldpi-32.o -lm gcc -O3 -Wall -fno-builtin -m32 -o pitimes3-32 pitimes.c fldpi-32.o -lm gcc -O3 -Wall -ffast-math -m64 -o pitimes1-64 pitimes.c fldpi-64.o -lm gcc -O3 -Wall -m64 -o pitimes2-64 pitimes.c fldpi-64.o -lm gcc -O3 -Wall -fno-builtin -m64 -o pitimes3-64 pitimes.c fldpi-64.o -lm Apart from testing between various compiler flags (I've compared 32-bit against 64-bit too, because the optimisations are different), I've also tried switching the order of the tests around. `The atan2(0, -1)` version still comes out top every time, though. I'm keen to hear what results you have, as well as improvements to the testing process. :-)
0
23
08/01/2008 12:09:41
48
08/01/2008 13:25:15
1
0
Latest information on PHP upcoming releases
I'm trying to track the progress of PHP 5.3 and PHP 6 and I occassionally see blogs posting information but there doesn't seem to ba an authoritative source. Does anybody know where there is an official summary of possible new features?
php
null
null
null
null
05/18/2012 11:12:42
not constructive
Latest information on PHP upcoming releases === I'm trying to track the progress of PHP 5.3 and PHP 6 and I occassionally see blogs posting information but there doesn't seem to ba an authoritative source. Does anybody know where there is an official summary of possible new features?
4
24
08/01/2008 12:12:19
22
08/01/2008 12:11:11
1
0
Throw Error In MySQL Trigger
If I have a trigger BEFORE UPDATE on a table. How can I throw an error that prevents the update on that table?
mysql
null
null
null
null
null
open
Throw Error In MySQL Trigger === If I have a trigger BEFORE UPDATE on a table. How can I throw an error that prevents the update on that table?
0
25
08/01/2008 12:13:50
23
08/01/2008 12:11:43
1
0
How to use the C socket API in C++
I've been having issues getting the C sockets API to work properly in C++. Specifically, although I am including sys/socket.h, I still get compile time errors telling me that AF_INET is not defined. Am I missing something obvious, or could this be related to the fact that I'm doing this coding on z/OS and my problems are much more complicated? ;)
c++
c
sockets
zos
null
null
open
How to use the C socket API in C++ === I've been having issues getting the C sockets API to work properly in C++. Specifically, although I am including sys/socket.h, I still get compile time errors telling me that AF_INET is not defined. Am I missing something obvious, or could this be related to the fact that I'm doing this coding on z/OS and my problems are much more complicated? ;)
0
11
07/31/2008 23:55:37
1
07/31/2008 14:22:31
1
2
How do I calculate relative time?
Given a specific DateTime value, how do I display relative time, like - 2 hours ago - 3 days ago - a month ago etcetera?
c#
null
null
null
null
null
open
How do I calculate relative time? === Given a specific DateTime value, how do I display relative time, like - 2 hours ago - 3 days ago - a month ago etcetera?
0
13
08/01/2008 00:42:38
9
07/31/2008 21:35:26
16
1
Determining web user's time zone
Is there a standard way for a web server to determine what time zone offset a user is in? From an HTTP header or part of the user-agent description, perhaps?
html
browser
null
null
null
null
open
Determining web user's time zone === Is there a standard way for a web server to determine what time zone offset a user is in? From an HTTP header or part of the user-agent description, perhaps?
0
14
08/01/2008 00:59:11
11
08/01/2008 00:59:11
1
0
What's the difference between Math.Floor() and Math.Truncate()?
What is the difference between Math.Floor() and Math.Truncate()?
c#
null
null
null
null
null
open
What's the difference between Math.Floor() and Math.Truncate()? === What is the difference between Math.Floor() and Math.Truncate()?
0
16
08/01/2008 04:59:33
2
07/31/2008 14:22:31
1
0
How do I fill a DataSet or a DataTable from a LINQ query resultset ?
How do you expose a LINQ query as an ASMX web service? Usually, from the business tier, I can return a typed DataSet or DataTable which can be serialized for transport over ASMX. How can I do the same for a LINQ query? Is there a way to populate a typed DataSet or DataTable via a LINQ query?: public static MyDataTable CallMySproc() { string conn = ...; MyDatabaseDataContext db = new MyDatabaseDataContext(conn); MyDataTable dt = new MyDataTable(); // execute a sproc via LINQ var query = from dr in db.MySproc().AsEnumerable select dr; // copy LINQ query resultset into a DataTable -this does not work ! dt = query.CopyToDataTable(); return dt; } How can I get the resultset of a LINQ query into a DataSet or DataTable? Alternatively, is the LINQ query serializeable so that I can expose it as an ASMX web service?
linq
web-service
c#
null
null
null
open
How do I fill a DataSet or a DataTable from a LINQ query resultset ? === How do you expose a LINQ query as an ASMX web service? Usually, from the business tier, I can return a typed DataSet or DataTable which can be serialized for transport over ASMX. How can I do the same for a LINQ query? Is there a way to populate a typed DataSet or DataTable via a LINQ query?: public static MyDataTable CallMySproc() { string conn = ...; MyDatabaseDataContext db = new MyDatabaseDataContext(conn); MyDataTable dt = new MyDataTable(); // execute a sproc via LINQ var query = from dr in db.MySproc().AsEnumerable select dr; // copy LINQ query resultset into a DataTable -this does not work ! dt = query.CopyToDataTable(); return dt; } How can I get the resultset of a LINQ query into a DataSet or DataTable? Alternatively, is the LINQ query serializeable so that I can expose it as an ASMX web service?
0
17
08/01/2008 05:09:55
2
07/31/2008 14:22:31
1
0
Binary Data in MYSQL
How do I store binary data in mysql?
database
mysql
null
null
null
null
open
Binary Data in MYSQL === How do I store binary data in mysql?
0
42
08/01/2008 12:50:18
37
08/01/2008 12:44:00
1
0
Best way to allow plugins for a PHP application
I am starting a new web application in PHP and I this time around I want to create something that people can extend by using a plug-in interface. I am a very confident PHP developer however I have never done this before so I'm not really sure where to start. How does one go about writing 'hooks' into their code so that plug-ins can attach to specific events? Thanks, Wally
php
architecture
plug-ins
null
null
null
open
Best way to allow plugins for a PHP application === I am starting a new web application in PHP and I this time around I want to create something that people can extend by using a plug-in interface. I am a very confident PHP developer however I have never done this before so I'm not really sure where to start. How does one go about writing 'hooks' into their code so that plug-ins can attach to specific events? Thanks, Wally
0
48
08/01/2008 13:01:17
40
08/01/2008 12:48:12
1
0
Multiple submit buttons on a 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 form. Ex: <form> <input type="text" name="field1" /> <!-- put your cursor in this field and press Enter --> <input type="submit" name="prev" value="Previous Page" /> <!-- This is the button that will submit --> <input type="submit" name="next" value="Next Page" /> <!-- But this is the button that I WANT to submit --> </form> What I would LIKE to do, is get to decide which button is used to submit the form when a user presses Enter. That way, when you press Enter the Wizard will move to the next page, not the previous. Do you have to use tabindex to do this?
html
forms
null
null
null
null
open
Multiple submit buttons on a 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 form. Ex: <form> <input type="text" name="field1" /> <!-- put your cursor in this field and press Enter --> <input type="submit" name="prev" value="Previous Page" /> <!-- This is the button that will submit --> <input type="submit" name="next" value="Next Page" /> <!-- But this is the button that I WANT to submit --> </form> What I would LIKE to do, is get to decide which button is used to submit the form when a user presses Enter. That way, when you press Enter the Wizard will move to the next page, not the previous. Do you have to use tabindex to do this?
0
59
08/01/2008 13:14:33
45
08/01/2008 13:04:45
1
0
How do I get a distinct, ordered list of names from a DataTable using Linq
Lets say I have a DataTable with a Name column. I want to have a collection of the unique names ordered alphabetically. The following query ignores the order by clause. var names = (from DataRow dr in dataTable.Rows orderby (string)dr["Name"] select (string)dr["Name"]).Distinct(); Why does the orderby not get enforced?
c#
linq
null
null
null
null
open
How do I get a distinct, ordered list of names from a DataTable using Linq === Lets say I have a DataTable with a Name column. I want to have a collection of the unique names ordered alphabetically. The following query ignores the order by clause. var names = (from DataRow dr in dataTable.Rows orderby (string)dr["Name"] select (string)dr["Name"]).Distinct(); Why does the orderby not get enforced?
0
66
08/01/2008 13:20:46
17
08/01/2008 12:02:21
1
5
How do you page a collection with LINQ?
How do you page through a collection in LINQ given that you have a startIndex and a count?
linq
null
null
null
null
null
open
How do you page a collection with LINQ? === How do you page through a collection in LINQ given that you have a startIndex and a count?
0
72
08/01/2008 13:38:27
25
08/01/2008 12:15:23
1
1
How do I add existing comments to RDoc in Ruby?
I've got all these comments that I want to make into 'RDoc comments' so they can be formatted appropriately and viewed using 'Ri.' Can anyone get me started on understanding how to use RDoc?
ruby
null
null
null
null
null
open
How do I add existing comments to RDoc in Ruby? === I've got all these comments that I want to make into 'RDoc comments' so they can be formatted appropriately and viewed using 'Ri.' Can anyone get me started on understanding how to use RDoc?
0
79
08/01/2008 13:56:33
58
08/01/2008 13:56:33
1
0
How can you get Subclipse in Aptana to work with the newest release of Subversion?
The version of Subclipse (1.2.4) currently available through Aptana's automagic Plugins Manager does not work with the newest version of Subversion. I see on the Subclipse website however that they have 1.4.2 out for Eclipse. So I added a new remote update site: http://subclipse.tigris.org/update_1.4.x to my Update manager. When I tried to install it, it told me I needed Mylyn 3.0.0. So I after much searching I found Mylyn 3.0.0 and added another new remote update site: http://download.eclipse.org/tools/mylyn/update/e3.3 to my update manager. Then when I tried to install that, it told me I needed org.eclipse.ui 3.3.0 or equivalent. Looking at the configuration details for Aptana, it looks like it is built against eclipse 3.2.2. Does anyone know if there is a way to upgrade the version of Eclipse Aptana is built against to 3.3.0? Or if there is some other way to get Subclipse to work with the very newest version of Subversion? I know this isn't necessarily a "programming" question, but I hope it's ok since it's highly relevant to the programming experience...
subversion
eclipse
subclipse
aptana
null
null
open
How can you get Subclipse in Aptana to work with the newest release of Subversion? === The version of Subclipse (1.2.4) currently available through Aptana's automagic Plugins Manager does not work with the newest version of Subversion. I see on the Subclipse website however that they have 1.4.2 out for Eclipse. So I added a new remote update site: http://subclipse.tigris.org/update_1.4.x to my Update manager. When I tried to install it, it told me I needed Mylyn 3.0.0. So I after much searching I found Mylyn 3.0.0 and added another new remote update site: http://download.eclipse.org/tools/mylyn/update/e3.3 to my update manager. Then when I tried to install that, it told me I needed org.eclipse.ui 3.3.0 or equivalent. Looking at the configuration details for Aptana, it looks like it is built against eclipse 3.2.2. Does anyone know if there is a way to upgrade the version of Eclipse Aptana is built against to 3.3.0? Or if there is some other way to get Subclipse to work with the very newest version of Subversion? I know this isn't necessarily a "programming" question, but I hope it's ok since it's highly relevant to the programming experience...
0
80
08/01/2008 13:57:07
26
08/01/2008 12:18:14
1
0
Adobe air - 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 tFile ( fileID integer Primary Key ,fileName varchar(50) ,fileDescription varchar(500) ,thumbnailID integer ,fileFormatID integer ,categoryID integer ,isFavorite boolean ,dateAdded date ,globalAccessCount integer ,lastAccessTime date ,downloadComplete boolean ,isNew boolean ,isSpotlight boolean ,duration varchar(30) ); Create Table tCategory ( categoryID integer Primary Key ,categoryName varchar(50) ,parent_categoryID integer ); ... I execute this in Air using the following method: public static function RunSqlFromFile(fileName:String):void { var file:File = File.applicationDirectory.resolvePath(fileName); var stream:FileStream = new FileStream(); stream.open(file, FileMode.READ) var strSql:String = stream.readUTFBytes(stream.bytesAvailable); NonQuery(strSql); } No errors are generated, however only tRole exists. It seems that it only looks at the first query (up to the semicolon- if I remove it, the query fails). Is there anyway to call multiple queries in one statement?
actionscript-3
flex
air
null
null
null
open
Adobe air - 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 tFile ( fileID integer Primary Key ,fileName varchar(50) ,fileDescription varchar(500) ,thumbnailID integer ,fileFormatID integer ,categoryID integer ,isFavorite boolean ,dateAdded date ,globalAccessCount integer ,lastAccessTime date ,downloadComplete boolean ,isNew boolean ,isSpotlight boolean ,duration varchar(30) ); Create Table tCategory ( categoryID integer Primary Key ,categoryName varchar(50) ,parent_categoryID integer ); ... I execute this in Air using the following method: public static function RunSqlFromFile(fileName:String):void { var file:File = File.applicationDirectory.resolvePath(fileName); var stream:FileStream = new FileStream(); stream.open(file, FileMode.READ) var strSql:String = stream.readUTFBytes(stream.bytesAvailable); NonQuery(strSql); } No errors are generated, however only tRole exists. It seems that it only looks at the first query (up to the semicolon- if I remove it, the query fails). Is there anyway to call multiple queries in one statement?
0
85
08/01/2008 14:19:52
59
08/01/2008 14:02:13
1
1
Flat File Databases in PHP
What are your best practices around creating flat file database structures in PHP? A lot of the more mature PHP flat file frameworks I see out there attempt to implement SQL-like query syntax, which is over the top for my purposes in most cases (I would just use a database at that point). Are there any elegant tricks out there to get good performance and features with the small code overhead one would want by taking on this problem in the first place?
php
null
null
null
null
null
open
Flat File Databases in PHP === What are your best practices around creating flat file database structures in PHP? A lot of the more mature PHP flat file frameworks I see out there attempt to implement SQL-like query syntax, which is over the top for my purposes in most cases (I would just use a database at that point). Are there any elegant tricks out there to get good performance and features with the small code overhead one would want by taking on this problem in the first place?
0
88
08/01/2008 14:36:18
61
08/01/2008 14:21:00
1
0
Is gettimeofday() guaranteed to be of microsecond resolution?
So I find myself 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), and have implemented QueryPerformanceCounter by giving the uSeconds since the process start up: BOOL QueryPerformanceCounter(LARGE_INTEGER* performanceCount) { gettimeofday(&currentTimeVal, NULL); performanceCount->QuadPart = (currentTimeVal.tv_sec - startTimeVal.tv_sec); performanceCount->QuadPart *= (1000 * 1000); performanceCount->QuadPart += (currentTimeVal.tv_usec - startTimeVal.tv_usec); return true; } This, coupled with QueryPerformanceFrequency() giving a constant 1000000 as the frequency works well **on my machine**, giving me a 64 bit variable that contains uSeconds since the program's start up. So _is this portable?_ I don't want to discover it works differently if the kernel was compiled in a certain way or anything like that. I am fine with it being non-portable to something other than Linux, however.
c++
c
linux
unix
timer
null
open
Is gettimeofday() guaranteed to be of microsecond resolution? === So I find myself 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), and have implemented QueryPerformanceCounter by giving the uSeconds since the process start up: BOOL QueryPerformanceCounter(LARGE_INTEGER* performanceCount) { gettimeofday(&currentTimeVal, NULL); performanceCount->QuadPart = (currentTimeVal.tv_sec - startTimeVal.tv_sec); performanceCount->QuadPart *= (1000 * 1000); performanceCount->QuadPart += (currentTimeVal.tv_usec - startTimeVal.tv_usec); return true; } This, coupled with QueryPerformanceFrequency() giving a constant 1000000 as the frequency works well **on my machine**, giving me a 64 bit variable that contains uSeconds since the program's start up. So _is this portable?_ I don't want to discover it works differently if the kernel was compiled in a certain way or anything like that. I am fine with it being non-portable to something other than Linux, however.
0
90
08/01/2008 14:41:24
58
08/01/2008 13:56:33
1
0
Good branch/merge tutorials for Tortoise SVN?
Anyone know of any really good tutorials explaining branching and merging with Subversion? All the better if it's specific to Tortoise SVN...
toroisesvn
subversion
tutorials
null
null
null
open
Good branch/merge tutorials for Tortoise SVN? === Anyone know of any really good tutorials explaining branching and merging with Subversion? All the better if it's specific to Tortoise SVN...
0
104
08/01/2008 15:12:34
39
08/01/2008 12:44:55
49
5
Anatomy of a "Memory Leak"
In .NET perspective: - What is a [Memory Leak][1]? - How to understand whether your application leaks? What are the effects? - How to prevent? - If your application has memory leak, does it go away when the process exits or killed? Or do memory leaks in your application affects other processes on the system even after process completion? - And what about unmanaged code accessed via COM Interop and/or P/Invoke? These are the questions that I have some answers myself but not complete. What do you think? [1]: http://en.wikipedia.org/wiki/Memory_leak
.net
c#
memory
perfomance
null
null
open
Anatomy of a "Memory Leak" === In .NET perspective: - What is a [Memory Leak][1]? - How to understand whether your application leaks? What are the effects? - How to prevent? - If your application has memory leak, does it go away when the process exits or killed? Or do memory leaks in your application affects other processes on the system even after process completion? - And what about unmanaged code accessed via COM Interop and/or P/Invoke? These are the questions that I have some answers myself but not complete. What do you think? [1]: http://en.wikipedia.org/wiki/Memory_leak
0
108
08/01/2008 15:22:29
72
08/01/2008 15:09:58
1
1
Best Subversion clients for Windows Vista (64bit)
I've been using [TortoiseSVN ][1] 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 teach to colleagues with little or no experience with source control. **However**, since we have moved to Windows Vista 64bit, Tortoise has been very buggy and has seemed to cause lots of explorer.exe abnormalities and crashes. This has happened both with older versions of the software and the latest version (1.5.1 build 13563). I was curious if anyone has suggestions for other Subversion clients that will run on Windows (specifically Vista 64bit). Developers here use a variety of text editors so using Visual Studio or Dreamweaver for SVN is not ideal. I have heard great things about [Cornerstone][2], and would love something similar for Windows if it exists. [1]: http://tortoisesvn.tigris.org/ [2]: http://www.zennaware.com/cornerstone/
svn
windows
null
null
null
null
open
Best Subversion clients for Windows Vista (64bit) === I've been using [TortoiseSVN ][1] 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 teach to colleagues with little or no experience with source control. **However**, since we have moved to Windows Vista 64bit, Tortoise has been very buggy and has seemed to cause lots of explorer.exe abnormalities and crashes. This has happened both with older versions of the software and the latest version (1.5.1 build 13563). I was curious if anyone has suggestions for other Subversion clients that will run on Windows (specifically Vista 64bit). Developers here use a variety of text editors so using Visual Studio or Dreamweaver for SVN is not ideal. I have heard great things about [Cornerstone][2], and would love something similar for Windows if it exists. [1]: http://tortoisesvn.tigris.org/ [2]: http://www.zennaware.com/cornerstone/
0
109
08/01/2008 15:23:05
71
08/01/2008 15:05:56
1
0
Decoding T-SQL CAST in C#/VB.net
Greetings all, Recently our site has been deluged with the resurgence of the ASPRox bot SQL Injection attack. Without going into details, the attack attempts to execute SQL code by encoding the T-SQL commands in an ASCII encoded BINARY string. It looks something like this: > DECLARE%20@S%20NVARCHAR(4000);SET%20@S=CAST(0x44004500...06F007200%20AS%20NVARCHAR(4000));EXEC(@S);-- I was able to decode this in SQL, but I was a little wary of doing this since I didn't know exactly what was happening at the time. I tried to write a simple decode tool so I could decode this type of text without even touching SQL server. The main part I need decoded is: > CAST(0x44004500...06F007200 AS > NVARCHAR(4000)) I've tried all of the following commands with no luck: txtDecodedText.Text = System.Web.HttpUtility.UrlDecode(txtURLText.Text); txtDecodedText.Text = Encoding.ASCII.GetString(Encoding.ASCII.GetBytes(txtURLText.Text)); txtDecodedText.Text = Encoding.Unicode.GetString(Encoding.Unicode.GetBytes(txtURLText.Text)); txtDecodedText.Text = Encoding.ASCII.GetString(Encoding.Unicode.GetBytes(txtURLText.Text)); txtDecodedText.Text = Encoding.Unicode.GetString(Convert.FromBase64String(txtURLText.Text)); Can anybody suggest the proper way to translate this encoding without using SQL Server. Is is possible? I'll take VB.net code since I'm familiar with that too.
c#
vb.net
sql
null
null
null
open
Decoding T-SQL CAST in C#/VB.net === Greetings all, Recently our site has been deluged with the resurgence of the ASPRox bot SQL Injection attack. Without going into details, the attack attempts to execute SQL code by encoding the T-SQL commands in an ASCII encoded BINARY string. It looks something like this: > DECLARE%20@S%20NVARCHAR(4000);SET%20@S=CAST(0x44004500...06F007200%20AS%20NVARCHAR(4000));EXEC(@S);-- I was able to decode this in SQL, but I was a little wary of doing this since I didn't know exactly what was happening at the time. I tried to write a simple decode tool so I could decode this type of text without even touching SQL server. The main part I need decoded is: > CAST(0x44004500...06F007200 AS > NVARCHAR(4000)) I've tried all of the following commands with no luck: txtDecodedText.Text = System.Web.HttpUtility.UrlDecode(txtURLText.Text); txtDecodedText.Text = Encoding.ASCII.GetString(Encoding.ASCII.GetBytes(txtURLText.Text)); txtDecodedText.Text = Encoding.Unicode.GetString(Encoding.Unicode.GetBytes(txtURLText.Text)); txtDecodedText.Text = Encoding.ASCII.GetString(Encoding.Unicode.GetBytes(txtURLText.Text)); txtDecodedText.Text = Encoding.Unicode.GetString(Convert.FromBase64String(txtURLText.Text)); Can anybody suggest the proper way to translate this encoding without using SQL Server. Is is possible? I'll take VB.net code since I'm familiar with that too.
0
120
08/01/2008 15:50:08
83
08/01/2008 16:31:56
1
1
ASP.NET Site Maps
Has anyone got experience creating SQL-based ASP.NET site-map providers? I've got the default XML web.sitemap file working properly with my Menu and SiteMapPath controls. But I'll need a way for the users of my site to create and modify pages dynamically. I'll need to tie page viewing permissions into the standard ASP.NET membership system as well. I'd like some advice on articles to read or video clips to watch. Thanks.
sql
aspnet
sitemap
membership
navigation
null
open
ASP.NET Site Maps === Has anyone got experience creating SQL-based ASP.NET site-map providers? I've got the default XML web.sitemap file working properly with my Menu and SiteMapPath controls. But I'll need a way for the users of my site to create and modify pages dynamically. I'll need to tie page viewing permissions into the standard ASP.NET membership system as well. I'd like some advice on articles to read or video clips to watch. Thanks.
0
123
08/01/2008 16:08:52
78
08/01/2008 16:03:23
1
0
CSV File to XML
Is there an existing application or library in Java which will allow me to take CSV data and create an XML file? The XML tags would be provided through maybe the first row containing column headings.
csv
xml
java
null
null
null
open
CSV File to XML === Is there an existing application or library in Java which will allow me to take CSV data and create an XML file? The XML tags would be provided through maybe the first row containing column headings.
0
126
08/01/2008 16:10:30
58
08/01/2008 13:56:33
11
1
How would you access Object properties from within an object method?
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/setter, but from within would you just do: Java: String property = this.property; PHP: $property = $this->property; or would you do: Java: String property = this.getProperty(); PHP: $property = $this->getProperty(); Forgive me if my Java is a little off, it's been a year since I programmed in Java...
oo
java
php
theory
null
05/08/2012 18:11:27
not constructive
How would you access Object properties from within an object method? === 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/setter, but from within would you just do: Java: String property = this.property; PHP: $property = $this->property; or would you do: Java: String property = this.getProperty(); PHP: $property = $this->getProperty(); Forgive me if my Java is a little off, it's been a year since I programmed in Java...
4
129
08/01/2008 16:22:42
48
08/01/2008 13:25:15
11
1
How to export data from SQL Server to MySQL
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 newarly 300 tables in it and I need to turn this into a MySQL database. My first call was to use bcp but unfortunately it doesn't produce valid CSV - strings aren't encapsulated so you can't deal with any row that has a string with a comma in it (or whatever you use as a delimiter) and I would still have to hand write all of the create table statements as obviously CSV doesn't tell you anything about the data types. What would be better is if there was some tool that could connect to both SQL Server and MySQL and then do a copy. You lose views, stored procedures, trigger, etc. but it isn't hard to copy a table that only uses base types from one DB to another... is it? Does anybody know of such a tool? I don't mind how many assumptions it makes or what simplifications occur, as long as it supports integer, float, datetime and string. I have to do a lot of pruning, normalising, etc. anyway so I don't care about keeping keys, relationships or anything like that but I need the initial set of data in fast!
csv
ansi
sql
php
mssql
07/03/2012 14:30:16
off topic
How to export data from SQL Server to MySQL === 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 newarly 300 tables in it and I need to turn this into a MySQL database. My first call was to use bcp but unfortunately it doesn't produce valid CSV - strings aren't encapsulated so you can't deal with any row that has a string with a comma in it (or whatever you use as a delimiter) and I would still have to hand write all of the create table statements as obviously CSV doesn't tell you anything about the data types. What would be better is if there was some tool that could connect to both SQL Server and MySQL and then do a copy. You lose views, stored procedures, trigger, etc. but it isn't hard to copy a table that only uses base types from one DB to another... is it? Does anybody know of such a tool? I don't mind how many assumptions it makes or what simplifications occur, as long as it supports integer, float, datetime and string. I have to do a lot of pruning, normalising, etc. anyway so I don't care about keeping keys, relationships or anything like that but I need the initial set of data in fast!
2
134
08/01/2008 16:33:38
71
08/01/2008 15:05:56
6
1
XSD DataSets and ignoring foreign keys
I have and pretty standard table setup in a current application using the .net XSD DataSet and TableAdapter features. My contracts table consists of some standard contract information, with a column for the primary department. This column is a foreign key to my Departments table, where I store the basic department name, id, notes. This is all setup and functioning in my SQL Server. When I use the XSD tool, I can drag both tables in at once and it auto detects/creates the foreign key I have between these two tables. This works great when I'm on my main page and am viewing contract data. However, when I go to my administrative page to modify the department data. I typically do something like this: Dim dtDepartment As New DepartmentDataTable() Dim taDepartment As New DepartmentTableAdapter() taDepartment.Fill(dtDepartment) However, at this point an exception is thrown saying to the effect that there is a foreign key reference broken here, I'm guessing since I don't have the Contract DataTable filled. Has anybody encountered this before? I know I can simply remove the foreign key from the XSD to make things work fine, but having the additional integrity check there and having the XSD schema match the SQL schema in the database is nice.
.net
database
null
null
null
null
open
XSD DataSets and ignoring foreign keys === I have and pretty standard table setup in a current application using the .net XSD DataSet and TableAdapter features. My contracts table consists of some standard contract information, with a column for the primary department. This column is a foreign key to my Departments table, where I store the basic department name, id, notes. This is all setup and functioning in my SQL Server. When I use the XSD tool, I can drag both tables in at once and it auto detects/creates the foreign key I have between these two tables. This works great when I'm on my main page and am viewing contract data. However, when I go to my administrative page to modify the department data. I typically do something like this: Dim dtDepartment As New DepartmentDataTable() Dim taDepartment As New DepartmentTableAdapter() taDepartment.Fill(dtDepartment) However, at this point an exception is thrown saying to the effect that there is a foreign key reference broken here, I'm guessing since I don't have the Contract DataTable filled. Has anybody encountered this before? I know I can simply remove the foreign key from the XSD to make things work fine, but having the additional integrity check there and having the XSD schema match the SQL schema in the database is nice.
0
145
08/01/2008 17:13:08
87
08/01/2008 16:59:16
1
0
Compressing / Decompressing Folders & Files in C#?
Anyone know of a good way to do this in C# quickly? Handling large files might be necessary. Thanks in advance? :)
c#
compression
decompression
folders
file
null
open
Compressing / Decompressing Folders & Files in C#? === Anyone know of a good way to do this in C# quickly? Handling large files might be necessary. Thanks in advance? :)
0
146
08/01/2008 17:14:58
30
08/01/2008 12:25:44
1
0
How do I track file downloads with apache/PHP
I have a website that plays mp3's 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 particular song clip (or any binary file) is downloaded?
php
apache
null
null
null
null
open
How do I track file downloads with apache/PHP === I have a website that plays mp3's 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 particular song clip (or any binary file) is downloaded?
0
163
08/01/2008 18:00:13
83
08/01/2008 16:31:56
11
2
How do I sync the SVN revision number with my ASP.NET web site?
stackoverflow.com has a version number at the bottom: "svn revision: 679" I want to use such automatic versioning with my .NET web, win forms, wpf projects/solutions.
versioning
svn
subversion
.net
aspnet
null
open
How do I sync the SVN revision number with my ASP.NET web site? === stackoverflow.com has a version number at the bottom: "svn revision: 679" I want to use such automatic versioning with my .NET web, win forms, wpf projects/solutions.
0
164
08/01/2008 18:02:22
91
08/01/2008 17:55:22
1
0
Embedding Windows Media Player for all Browsers
we are using WMV Videos on an internal sites, and we are embedding them into web sites. Now, this works quite good on Internet Explorer, but not on Firefox. I've found ways to make it work in Firefox, but then it stops working in Internet Explorer. We do not want to use Silverlight just yet, especially we can be sure that all clients will be Windows XP with installed Windows Media Player. I just wonder: Is there some sort of Universal Code that embeds WMP into both IE and Firefox, or do we need to implement some user-agent-detection and deliver different HTML for different Browsers?
windows
media
embed
null
null
null
open
Embedding Windows Media Player for all Browsers === we are using WMV Videos on an internal sites, and we are embedding them into web sites. Now, this works quite good on Internet Explorer, but not on Firefox. I've found ways to make it work in Firefox, but then it stops working in Internet Explorer. We do not want to use Silverlight just yet, especially we can be sure that all clients will be Windows XP with installed Windows Media Player. I just wonder: Is there some sort of Universal Code that embeds WMP into both IE and Firefox, or do we need to implement some user-agent-detection and deliver different HTML for different Browsers?
0
173
08/01/2008 18:33:08
83
08/01/2008 16:31:56
16
4
How do I version my MS SQL database in SVN?
I've been wanting to get my databases under version control. Does anyone have any advice or recommended articles to get me started?
subversion
svn
sql
mssql
versioncontrol
06/29/2012 15:08:28
not constructive
How do I version my MS SQL database in SVN? === I've been wanting to get my databases under version control. Does anyone have any advice or recommended articles to get me started?
4
174
08/01/2008 18:33:48
96
08/01/2008 18:33:48
1
0
Printing HTML
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 constraints. Is there any sort of free .NET library that will support the printing of a basic HTMl page? Here is the code I have so far, that is not running properly. public void PrintThing(string document) { if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) { Thread thread = new Thread((ThreadStart) delegate { PrintDocument(document); }); thread.SetApartmentState(ApartmentState.STA); thread.Start(); } else { PrintDocument(document); } } protected void PrintDocument(string document) { WebBrowser browser = new WebBrowser(); browser.DocumentText = document; while (browser.ReadyState != WebBrowserReadyState.Complete) { Application.DoEvents(); } browser.Print(); } This works fine when called from UI-type threads, but nothing happens when called from a service-type thread. Changing Print() to ShowPrintPreviewDialog() yields the following IE script error: Error: 'dialogArguments.___IE_PrintType' is null or not an object URL: res://ieframe.dll/preview.dlg And a small empty print preview dialog appears.
c#
html
printing
null
null
null
open
Printing HTML === 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 constraints. Is there any sort of free .NET library that will support the printing of a basic HTMl page? Here is the code I have so far, that is not running properly. public void PrintThing(string document) { if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) { Thread thread = new Thread((ThreadStart) delegate { PrintDocument(document); }); thread.SetApartmentState(ApartmentState.STA); thread.Start(); } else { PrintDocument(document); } } protected void PrintDocument(string document) { WebBrowser browser = new WebBrowser(); browser.DocumentText = document; while (browser.ReadyState != WebBrowserReadyState.Complete) { Application.DoEvents(); } browser.Print(); } This works fine when called from UI-type threads, but nothing happens when called from a service-type thread. Changing Print() to ShowPrintPreviewDialog() yields the following IE script error: Error: 'dialogArguments.___IE_PrintType' is null or not an object URL: res://ieframe.dll/preview.dlg And a small empty print preview dialog appears.
0
175
08/01/2008 18:36:14
65
08/01/2008 14:39:27
11
1
Annotating YouTube videos programatically
I want to be able to display a normal youtube video with overlaid annotations. This consists of colored rectangles for each frame. The only requirement is that this be done programatically. Youtube has annotations now, but require you use their front end to create them by hand. I want to be able to generate them. What's the best way of doing this? Some ideas: 1. Build your own flash player (ew?) 2. Somehow draw over the youtube flash player. Will this work? 3. Reverse engineer & hijack youtube's annotation system. Either messing with the local files or redirecting it's attempt to download the annotations. (using greasemonkey? Firefox plugin?) Ideas that don't count: download the video, edit it, re-encode it, and upload it :P
web
youtube
null
null
null
null
open
Annotating YouTube videos programatically === I want to be able to display a normal youtube video with overlaid annotations. This consists of colored rectangles for each frame. The only requirement is that this be done programatically. Youtube has annotations now, but require you use their front end to create them by hand. I want to be able to generate them. What's the best way of doing this? Some ideas: 1. Build your own flash player (ew?) 2. Somehow draw over the youtube flash player. Will this work? 3. Reverse engineer & hijack youtube's annotation system. Either messing with the local files or redirecting it's attempt to download the annotations. (using greasemonkey? Firefox plugin?) Ideas that don't count: download the video, edit it, re-encode it, and upload it :P
0
176
08/01/2008 18:37:40
91
08/01/2008 17:55:22
1
0
Apache/PHP: error_log per Virtual Host?
On one Linux Server running Apache and PHP 5, we got multiple Virtual Hosts with separate logfiles and everything. The only thing we cannot seem to separate between virtual hosts is the php error_log. Overriding this setting in the &lt;Location&gt; of the httpd.conf does not seem to do anything. Did I overlook something? Is there a way to have separate php error_logs for each Virtual Host?
php
apache
null
null
null
null
open
Apache/PHP: error_log per Virtual Host? === On one Linux Server running Apache and PHP 5, we got multiple Virtual Hosts with separate logfiles and everything. The only thing we cannot seem to separate between virtual hosts is the php error_log. Overriding this setting in the &lt;Location&gt; of the httpd.conf does not seem to do anything. Did I overlook something? Is there a way to have separate php error_logs for each Virtual Host?
0
177
08/01/2008 18:37:55
83
08/01/2008 16:31:56
16
4
How do I programmatically create a PDF in my .NET application?
Please recommend a good library for programmatically creating PDF documents in .NET applications. Thanks.
pdf
.net
null
null
null
04/25/2012 11:32:29
not constructive
How do I programmatically create a PDF in my .NET application? === Please recommend a good library for programmatically creating PDF documents in .NET applications. Thanks.
4
180
08/01/2008 18:42:19
65
08/01/2008 14:39:27
11
1
Function for creating color wheels
This is something I've pseudo-solved many times and never quite found a solution that's stuck with me. The problem is to come up with a way to generate N colors that are as distinguishable as possible where N is a parameter.
colors
language-agnostic
algorithm
null
null
null
open
Function for creating color wheels === This is something I've pseudo-solved many times and never quite found a solution that's stuck with me. The problem is to come up with a way to generate N colors that are as distinguishable as possible where N is a parameter.
0
192
08/01/2008 19:23:13
91
08/01/2008 17:55:22
1
0
Floating Point Number parsing: Is there a Catch All algorithm?
One of the fun parts of multi-cultural programming are numbers formats. Americans use 10,000.50, Germans use 10.000,50, French use 10 000,50 etc. My first approach would be: Take the string, parse it backwards, until I encounter a separator and use this as my decimal separator. The obvious flaw with that: 10.000 would be interpreted as 10. Another approach: if the string contains 2 different non-numeric characters, use the last one as the decimal separator and discard the others. If I only have one, check if it occurs more than once and discard it if it does. It it only appears once, check if it has 3 digits after it. If yes, discard it, otherwise use it as decimal separator. The obvious "best solution" would be to detect the User's culture or Browser, but that does not work if you have a Frenchman an an en-US Windows/Browser. I just wonder: does the .net Framework contain some mythical black magic floating point parser that is better than Double.(Try)Parse() in trying to auto-detect the number format?
.net
c#
vb.net
asp.net
null
null
open
Floating Point Number parsing: Is there a Catch All algorithm? === One of the fun parts of multi-cultural programming are numbers formats. Americans use 10,000.50, Germans use 10.000,50, French use 10 000,50 etc. My first approach would be: Take the string, parse it backwards, until I encounter a separator and use this as my decimal separator. The obvious flaw with that: 10.000 would be interpreted as 10. Another approach: if the string contains 2 different non-numeric characters, use the last one as the decimal separator and discard the others. If I only have one, check if it occurs more than once and discard it if it does. It it only appears once, check if it has 3 digits after it. If yes, discard it, otherwise use it as decimal separator. The obvious "best solution" would be to detect the User's culture or Browser, but that does not work if you have a Frenchman an an en-US Windows/Browser. I just wonder: does the .net Framework contain some mythical black magic floating point parser that is better than Double.(Try)Parse() in trying to auto-detect the number format?
0
194
08/01/2008 19:26:37
60
08/01/2008 14:04:09
41
5
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 documentation I've found deals with upgrading 6.5 to 7. Should I forget about the native SQL Server upgrade utilities, script out all of the objects and data, and try to recreate from scratch? I'm going to attempt the upgrade this weekend. Any advice would be welcomed.
mssql
migration
null
null
null
null
open
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 documentation I've found deals with upgrading 6.5 to 7. Should I forget about the native SQL Server upgrade utilities, script out all of the objects and data, and try to recreate from scratch? I'm going to attempt the upgrade this weekend. Any advice would be welcomed.
0
227
08/01/2008 21:40:55
146,637
08/01/2008 17:23:43
21
5
best way to generat a tag cloud from an array? using h1 through h6 for sizing
Lets say i have an array like such $artist = array("the roots","michael jackson","billy idol","more","and more","and_YET_MORE"); $count = array(5,3,9,1,1,3); and i want to generate a tag clound that will have artist with a higher number in count be a H6 tag and the lowest being H1? any ideas?
php
music
arrays
tags
cloud
null
open
best way to generat a tag cloud from an array? using h1 through h6 for sizing === Lets say i have an array like such $artist = array("the roots","michael jackson","billy idol","more","and more","and_YET_MORE"); $count = array(5,3,9,1,1,3); and i want to generate a tag clound that will have artist with a higher number in count be a H6 tag and the lowest being H1? any ideas?
0
231
08/01/2008 22:08:14
62
08/01/2008 14:21:21
1
2
Register Windows program with the mailto protocol programmatically
How do I make it so mailto: links will be registered with my program? And then how would I handle that event in my program? I'm using Delphi 7 (Win32 program), but you can assume I'm using C/C++ if it makes it easier to answer. Just a non-.NET answer. Most of the solutions I found from a quick Google search are how to do this manually, but I need to do this automatically for users of my program if they click a button such as "set as default email client".
mailto
windows
delphi
null
null
null
open
Register Windows program with the mailto protocol programmatically === How do I make it so mailto: links will be registered with my program? And then how would I handle that event in my program? I'm using Delphi 7 (Win32 program), but you can assume I'm using C/C++ if it makes it easier to answer. Just a non-.NET answer. Most of the solutions I found from a quick Google search are how to do this manually, but I need to do this automatically for users of my program if they click a button such as "set as default email client".
0
234
08/01/2008 22:13:34
91
08/01/2008 17:55:22
31
7
SQL Server 2005 implementation of MySQL REPLACE INTO?
MySQL has this incredibly useful yet properitary REPLACE INTO SQL Command. I wonder: Can this easily be emulated in SQL Server 2005? Starting a new Transaction, doing a Select() and then either UPDATE or INSERT and Commit is always a little bit a pain in the a.., especially when doing it in the application and therefore always keeping 2 versions of the statement. I wonder if there is an easy and **universal** way to implement such a function into SQL Server 2005?
sql-server
mysql
mssql
null
null
null
open
SQL Server 2005 implementation of MySQL REPLACE INTO? === MySQL has this incredibly useful yet properitary REPLACE INTO SQL Command. I wonder: Can this easily be emulated in SQL Server 2005? Starting a new Transaction, doing a Select() and then either UPDATE or INSERT and Commit is always a little bit a pain in the a.., especially when doing it in the application and therefore always keeping 2 versions of the statement. I wonder if there is an easy and **universal** way to implement such a function into SQL Server 2005?
0
237
08/01/2008 22:20:22
100
08/01/2008 20:41:59
11
1
Distributed source control options
I've been interested in Git, but the last time I looked the Windows support was essentially "run Linux". Are there any distributed source control tools that run well on Windows?
git
sourcecontrol
distributedsourcecontrol
null
null
null
open
Distributed source control options === I've been interested in Git, but the last time I looked the Windows support was essentially "run Linux". Are there any distributed source control tools that run well on Windows?
0
246
08/01/2008 22:34:42
71
08/01/2008 15:05:56
29
11
SQLite and XSD
Does anybody know if there is a way to create a SQLite database based on an XSD DataSet? In the past I've just used a basic SQLite manager, but want to fuse things a bit more with my .NET development if possible.
.net
database
sqlite
null
null
null
open
SQLite and XSD === Does anybody know if there is a way to create a SQLite database based on an XSD DataSet? In the past I've just used a basic SQLite manager, but want to fuse things a bit more with my .NET development if possible.
0
249
08/01/2008 22:44:11
103
08/01/2008 22:31:22
1
0
How do I access a remote form in php?
I want to gather info from a user on a local php page (that I control), and use that info to query a form on another site (that I don't control) - how do I do that?
php
forms
remote
null
null
12/17/2011 17:20:03
not a real question
How do I access a remote form in php? === I want to gather info from a user on a local php page (that I control), and use that info to query a form on another site (that I don't control) - how do I do that?
1
260
08/01/2008 23:22:08
91
08/01/2008 17:55:22
39
10
Adding Scripting functionality to .net Apps
I have a little game written in C#. It uses a database as backend. It's a Trading Card Game, and I wanted to implement the function of the cards as Script. What I mean is that I essentially have an Interface ICard which the Card implements (public class Card056 : ICard) and which contains function that are called by the game. Now, to make the thing maintainable/moddable, I would like to have the Class for each card as source code in the database and essentially compile it on first use. So when I have to add/change a card, I'll just add it to the database and tell my app to refresh, without needing any Assembly-Deployment (especially since we would be talking about 1 assembly per card which means hundreds of assemblies). Does anyone know if that is possible? Register a class from a source file and then instantiate it etc. ICard Cards[current] = new MyGame.CardLibrary.Card056(); Cards[current].OnEnterPlay(currentGame); The language is C#, but extra Bonus if it's possible to write the script in any .net language.
c#
script
jit
compiler
.net
null
open
Adding Scripting functionality to .net Apps === I have a little game written in C#. It uses a database as backend. It's a Trading Card Game, and I wanted to implement the function of the cards as Script. What I mean is that I essentially have an Interface ICard which the Card implements (public class Card056 : ICard) and which contains function that are called by the game. Now, to make the thing maintainable/moddable, I would like to have the Class for each card as source code in the database and essentially compile it on first use. So when I have to add/change a card, I'll just add it to the database and tell my app to refresh, without needing any Assembly-Deployment (especially since we would be talking about 1 assembly per card which means hundreds of assemblies). Does anyone know if that is possible? Register a class from a source file and then instantiate it etc. ICard Cards[current] = new MyGame.CardLibrary.Card056(); Cards[current].OnEnterPlay(currentGame); The language is C#, but extra Bonus if it's possible to write the script in any .net language.
0
263
08/01/2008 23:27:24
61
08/01/2008 14:21:00
46
5
GTK implementation of MessageBox
I have been trying to implement Win32's MessageBox using GTK. The app using SDL/OpenGL, so this isn't a GTK app. I handle the initialisation (**gtk_init**) sort of stuff inside the MessageBox function as follows: int MessageBox(HWND hwnd, const char* text, const char* caption, UINT type) { GtkWidget *window = NULL; GtkWidget *dialog = NULL; gtk_init(&gtkArgc, &gtkArgv); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); g_signal_connect(G_OBJECT(window), "delete_event", G_CALLBACK(delete_event), NULL); g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(destroy), NULL); // gcallback calls gtk_main_quit() gtk_init_add((GtkFunction)gcallback, NULL); if (type & MB_YESNO) { dialog = gtk_message_dialog_new(GTK_WINDOW(window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, text); } else { dialog = gtk_message_dialog_new(GTK_WINDOW(window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, text); } gtk_window_set_title(GTK_WINDOW(dialog), caption); gint result = gtk_dialog_run(GTK_DIALOG(dialog)); gtk_main(); gtk_widget_destroy(dialog); if (type & MB_YESNO) { switch (result) { default: case GTK_RESPONSE_DELETE_EVENT: case GTK_RESPONSE_NO: return IDNO; break; case GTK_RESPONSE_YES: return IDYES; break; } } return IDOK; } Now, I am by no means an experienced GTK programmer, and I realise that I'm probably doing something(s) horribly wrong. However, my problem is that the last dialog popped up with this function stays around until the process exits. Any ideas?
unix
linux
x11
gtk
sdl
null
open
GTK implementation of MessageBox === I have been trying to implement Win32's MessageBox using GTK. The app using SDL/OpenGL, so this isn't a GTK app. I handle the initialisation (**gtk_init**) sort of stuff inside the MessageBox function as follows: int MessageBox(HWND hwnd, const char* text, const char* caption, UINT type) { GtkWidget *window = NULL; GtkWidget *dialog = NULL; gtk_init(&gtkArgc, &gtkArgv); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); g_signal_connect(G_OBJECT(window), "delete_event", G_CALLBACK(delete_event), NULL); g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(destroy), NULL); // gcallback calls gtk_main_quit() gtk_init_add((GtkFunction)gcallback, NULL); if (type & MB_YESNO) { dialog = gtk_message_dialog_new(GTK_WINDOW(window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, text); } else { dialog = gtk_message_dialog_new(GTK_WINDOW(window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, text); } gtk_window_set_title(GTK_WINDOW(dialog), caption); gint result = gtk_dialog_run(GTK_DIALOG(dialog)); gtk_main(); gtk_widget_destroy(dialog); if (type & MB_YESNO) { switch (result) { default: case GTK_RESPONSE_DELETE_EVENT: case GTK_RESPONSE_NO: return IDNO; break; case GTK_RESPONSE_YES: return IDYES; break; } } return IDOK; } Now, I am by no means an experienced GTK programmer, and I realise that I'm probably doing something(s) horribly wrong. However, my problem is that the last dialog popped up with this function stays around until the process exits. Any ideas?
0
264
08/01/2008 23:28:51
104
08/01/2008 23:16:18
1
0
BerkeleyDB Concurrency
This isn't a question, just more seeking expert advice. 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 because of resource contention? I've read the manual and know how to set the number of locks, lockers, database page size, etc., but I'd just like some advice from someone who has real-world experience with BDB concurrency. My application is pretty simple, I'll be doing gets and puts of records that are about 1kb each. No cursors, no deleting.
c++
berkeleydb
null
null
null
null
open
BerkeleyDB Concurrency === This isn't a question, just more seeking expert advice. 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 because of resource contention? I've read the manual and know how to set the number of locks, lockers, database page size, etc., but I'd just like some advice from someone who has real-world experience with BDB concurrency. My application is pretty simple, I'll be doing gets and puts of records that are about 1kb each. No cursors, no deleting.
0
265
08/01/2008 23:29:32
105
08/01/2008 23:29:32
1
0
Best Practice: Collaborative Environment, Bin Directory, SVN
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 all bin directories? I develop a lot of DotNetNuke sites and it seems that in a multi-developer environment it's always a huge task to get the environment setup correctly. The ultimate goal (of course) is to have a new developer checkout the trunk from SVN, restore the DNN database and have it all just 'work'...
svn
bestpractices
subversion
collaboration
null
null
open
Best Practice: Collaborative Environment, Bin Directory, SVN === 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 all bin directories? I develop a lot of DotNetNuke sites and it seems that in a multi-developer environment it's always a huge task to get the environment setup correctly. The ultimate goal (of course) is to have a new developer checkout the trunk from SVN, restore the DNN database and have it all just 'work'...
0
279
08/02/2008 00:12:49
91
08/01/2008 17:55:22
35
12
ASP.net, Visual Studio and Subversion - how to integrate?
I use AnkhSVN and Visual Studio 2005 and 2008. Now, one thing that bugs me is that Ankh does not really work with ASP.net sites - I cannot add them properly to a repository and it won't detect changes, **especially** because the site is on a remote server accessed through Frontpage Extensions (File => Open Site). Now, I wonder what alternatives there are? Does anyone know a better plugin? Manually downloading the files through FTP and using TortoiseSVN or svn.exe is not really the level of integration I want :) I want to stay within the VS IDE when possible. Also, I do not control the remote Server, so I can not install anything on it, which means the whole change tracking/comparison to repository has to be done on my machine.
asp.net
visual-studio
svn
subversion
null
null
open
ASP.net, Visual Studio and Subversion - how to integrate? === I use AnkhSVN and Visual Studio 2005 and 2008. Now, one thing that bugs me is that Ankh does not really work with ASP.net sites - I cannot add them properly to a repository and it won't detect changes, **especially** because the site is on a remote server accessed through Frontpage Extensions (File => Open Site). Now, I wonder what alternatives there are? Does anyone know a better plugin? Manually downloading the files through FTP and using TortoiseSVN or svn.exe is not really the level of integration I want :) I want to stay within the VS IDE when possible. Also, I do not control the remote Server, so I can not install anything on it, which means the whole change tracking/comparison to repository has to be done on my machine.
0
289
08/02/2008 00:40:58
109
08/02/2008 00:20:47
1
0
How do you sort a C# dictionary by value?
I often have Dictionary of keys & values and need sort them by value. For example, I have a hash of Name and Age, and want to order them by Age. There's SortedList which is good for a single value (Age), but I want to map it back to the name. [SortedDictionary](http://msdn.microsoft.com/en-us/library/f7fta44c.aspx) orders by key, not value. Some resort to a [custom class](http://www.codeproject.com/KB/recipes/lookupcollection.aspx), but what's the cleanest way?
c#
sorting
null
null
null
null
open
How do you sort a C# dictionary by value? === I often have Dictionary of keys & values and need sort them by value. For example, I have a hash of Name and Age, and want to order them by Age. There's SortedList which is good for a single value (Age), but I want to map it back to the name. [SortedDictionary](http://msdn.microsoft.com/en-us/library/f7fta44c.aspx) orders by key, not value. Some resort to a [custom class](http://www.codeproject.com/KB/recipes/lookupcollection.aspx), but what's the cleanest way?
0
308
08/02/2008 01:52:54
106
08/02/2008 00:12:12
9
5
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 remember to write down the changes so that they can be replicated on the live system. However, I don't always remember what I've changed and I don't always remember to write it down. So, I make a push to the live system and get a big, obvious error that there is no NewColumnX. Ugh. Regardless of the fact that this may not be the best practice for this situation, is there a version control system for databases? I don't care about the specific database technology. I just want to know if one exists. If it happens to work with MS SQL Server, then great.
database
sql
version_control
null
null
null
open
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 remember to write down the changes so that they can be replicated on the live system. However, I don't always remember what I've changed and I don't always remember to write it down. So, I make a push to the live system and get a big, obvious error that there is no NewColumnX. Ugh. Regardless of the fact that this may not be the best practice for this situation, is there a version control system for databases? I don't care about the specific database technology. I just want to know if one exists. If it happens to work with MS SQL Server, then great.
0
313
08/02/2008 02:02:36
34
08/01/2008 12:39:52
164
11
.NET Migrations Engine
I was once under the belief that Microsoft was working on an official ruby-like Migration framework. However, I haven't been able to find any additional information (or even the original source of my believe). Does anyone know any information about an official migration framework? or possibly an open source one?
sql
.net
null
null
null
null
open
.NET Migrations Engine === I was once under the belief that Microsoft was working on an official ruby-like Migration framework. However, I haven't been able to find any additional information (or even the original source of my believe). Does anyone know any information about an official migration framework? or possibly an open source one?
0
328
08/02/2008 02:41:34
59
08/01/2008 14:02:13
50
7
PHP Session Security
What are some guidelines for maintaining responsible session security with PHP? There's information all over the web, so it's about time it all landed in one place!
php
security
null
null
null
null
open
PHP Session Security === What are some guidelines for maintaining responsible session security with PHP? There's information all over the web, so it's about time it all landed in one place!
0
336
08/02/2008 03:34:44
61
08/01/2008 14:21:00
56
6
When to use unsigned values over signed ones?
So I hear a lot of opinions about this, and I wanted to see if there was anything resembling a consensus. When is it appropriate to use an unsigned variable over a signed one? What about in a **for** loop? for (unsigned int i = 0; i < someThing.length(); i++) { SomeThing var = someThing.at(i); // You get the idea. } As I said, I hear a lot of opinions, but not a lot of consensus. I know Java doesn't have unsigned values, and that must have been a concious decision on Sun's part. Looking forward to hearing everybody's opinion.
language-agnostic
null
null
null
null
null
open
When to use unsigned values over signed ones? === So I hear a lot of opinions about this, and I wanted to see if there was anything resembling a consensus. When is it appropriate to use an unsigned variable over a signed one? What about in a **for** loop? for (unsigned int i = 0; i < someThing.length(); i++) { SomeThing var = someThing.at(i); // You get the idea. } As I said, I hear a lot of opinions, but not a lot of consensus. I know Java doesn't have unsigned values, and that must have been a concious decision on Sun's part. Looking forward to hearing everybody's opinion.
0
337
08/02/2008 03:35:55
111
08/02/2008 03:35:55
1
0
XML Processing in Python
I'm about to build a piece of a project that will need to build and post an xml document to a web service, and I'd like to do it in Python as a means to expand my skills there. Unfortunately, while I know the XML model fairly well in .Net, I'm uncertain what the pros and cons are of the XML models in Python. Anyone have experience doing XML processing in Python? Where would you suggest I start. The XML files I'll be building will be fairly simple. Thanks, Eric Sipple
python
xml
null
null
null
null
open
XML Processing in Python === I'm about to build a piece of a project that will need to build and post an xml document to a web service, and I'd like to do it in Python as a means to expand my skills there. Unfortunately, while I know the XML model fairly well in .Net, I'm uncertain what the pros and cons are of the XML models in Python. Anyone have experience doing XML processing in Python? Where would you suggest I start. The XML files I'll be building will be fairly simple. Thanks, Eric Sipple
0
361
08/02/2008 06:57:57
115
08/02/2008 05:44:40
1
1
Generate list of all possible permiations.
How would I go about generateing a list of all possible permiations of a string between x and y characters in length. Containing a variable list of characters.<Br /> Any language would work but it should be portable.<br />
string
generation
cross-platform
null
null
null
open
Generate list of all possible permiations. === How would I go about generateing a list of all possible permiations of a string between x and y characters in length. Containing a variable list of characters.<Br /> Any language would work but it should be portable.<br />
0
369
08/02/2008 08:12:39
117
08/02/2008 05:54:20
1
1
Can you make a _WEB_ build in one step?
Off the top of my head I would say that for a real one step web 'build' the following steps would have take place: 1. Take a source snapshot 2. Change any config files for release 3. Compress CSS and JS 4. Take a database snapshot [without test data] 5. Move the source to the server 6. Import the database 7. Automatically confirm the 'build' was successful Has anyone got a system that does all of these steps?
webdevelopment
ant
phing
joeltest
buildprocess
null
open
Can you make a _WEB_ build in one step? === Off the top of my head I would say that for a real one step web 'build' the following steps would have take place: 1. Take a source snapshot 2. Change any config files for release 3. Compress CSS and JS 4. Take a database snapshot [without test data] 5. Move the source to the server 6. Import the database 7. Automatically confirm the 'build' was successful Has anyone got a system that does all of these steps?
0
371
08/02/2008 08:19:18
49
08/01/2008 13:29:21
80
6
How do you make sure email you send programmatically is not automatically marked as spam?
This is a tricky one -- and i've always relied on techniques such as permission-based emails (i.e. only sending to people you have permission to send to) and not using blatantly spamish terminology. But lately some of the emails i send out programmatically have started being shuffled into people's spam folder automatically -- and i'm wondering what i can do about it. This is despite the fact that these particular emails are not ones that humans would mark as spam (specifically, they are emails that contain license keys that people have paid good money for, so i don't think they're going to consider them spam) I figure this is a big topic in which i am essentially an ignorant simpleton.
email
spam
null
null
null
null
open
How do you make sure email you send programmatically is not automatically marked as spam? === This is a tricky one -- and i've always relied on techniques such as permission-based emails (i.e. only sending to people you have permission to send to) and not using blatantly spamish terminology. But lately some of the emails i send out programmatically have started being shuffled into people's spam folder automatically -- and i'm wondering what i can do about it. This is despite the fact that these particular emails are not ones that humans would mark as spam (specifically, they are emails that contain license keys that people have paid good money for, so i don't think they're going to consider them spam) I figure this is a big topic in which i am essentially an ignorant simpleton.
0
387
08/02/2008 09:28:17
134
08/02/2008 09:12:56
1
0
Lucene Score results
In Lucence why does the same search on diffrent partitions return results with different scores? The results from the differnt servers match exactly.
lucene
null
null
null
null
null
open
Lucene Score results === In Lucence why does the same search on diffrent partitions return results with different scores? The results from the differnt servers match exactly.
0
395
08/02/2008 10:17:53
118
08/02/2008 06:12:32
1
1
How to switch a large app from VB6 to VB .net
My company makes a monolithic piece of software that our customers use to run their car dealerships. The original app was written in VB6, and it has grown substantially over the last few years. Until now, there hasn't really been a business case for switching to the .net framework. Sure, it's newer, considerably better at certain things, and when used correctly speeds development time, but there's nothing we can't do in VB6 that we need to be able to do. Getting things done is harder in VB6, but almost nothing is impossible. Recently though, Microsoft dropped support for VB6, and it seems obvious to me that switching to a new platform is inevitable. The way VB .net works and requires you to think is so fundamentally different (heck, even the way you pass variables into subs has changed), and as far as I can tell, switching to .net would require a complete re-design and re-write of the app. My question(s): Have any of you been in this position? Of the tools available to smooth the transition, which ones work and which should be avoided? And how do I sell our customers and my boss on this? As the suits like to say, where's the ROI?
.net
vb.net
vb6
null
null
null
open
How to switch a large app from VB6 to VB .net === My company makes a monolithic piece of software that our customers use to run their car dealerships. The original app was written in VB6, and it has grown substantially over the last few years. Until now, there hasn't really been a business case for switching to the .net framework. Sure, it's newer, considerably better at certain things, and when used correctly speeds development time, but there's nothing we can't do in VB6 that we need to be able to do. Getting things done is harder in VB6, but almost nothing is impossible. Recently though, Microsoft dropped support for VB6, and it seems obvious to me that switching to a new platform is inevitable. The way VB .net works and requires you to think is so fundamentally different (heck, even the way you pass variables into subs has changed), and as far as I can tell, switching to .net would require a complete re-design and re-write of the app. My question(s): Have any of you been in this position? Of the tools available to smooth the transition, which ones work and which should be avoided? And how do I sell our customers and my boss on this? As the suits like to say, where's the ROI?
0
402
08/02/2008 10:47:08
136
08/02/2008 10:21:53
11
2
iPhone app in landscape mode
What's the best way to create an iPhone application that runs in landscape mode from the start, regardless of the position of the device? Both programmatically and using the Interface Builder.
iphone
null
null
null
null
null
open
iPhone app in landscape mode === What's the best way to create an iPhone application that runs in landscape mode from the start, regardless of the position of the device? Both programmatically and using the Interface Builder.
0
403
08/02/2008 10:48:43
123
08/02/2008 08:01:26
1
0
Tool to aid Code Review..
For our small team of 20 developers, we used do code review like: 1. Make a label in svn and publish the label to the reviewers 2. Reviewers checkout the code and add comments in line (with marker like: // REVIEWER_NAME::REVIEW COMMENT:) 3. After all comments are in, reviewer checks in the code, preferably with new label. 4. Developer checks the comments and makes changes (if appropriate) 5. Developer keeps an excel sheet report for considered changes and reasons for ignored comments Problem: Developer needs to keep track of multiple labels which might have same comments Sometimes we even do One on One review and if we really have time, even do Table review (team of reviewers looks at the code on projector, on the fly, and pass comment) I was wondering: Are you guys using any specific tool which helps to do code reviews smoother? I have heard of Code collaborator. But have anyone used that? Is it worth the money?
review
collaboration
team
null
null
null
open
Tool to aid Code Review.. === For our small team of 20 developers, we used do code review like: 1. Make a label in svn and publish the label to the reviewers 2. Reviewers checkout the code and add comments in line (with marker like: // REVIEWER_NAME::REVIEW COMMENT:) 3. After all comments are in, reviewer checks in the code, preferably with new label. 4. Developer checks the comments and makes changes (if appropriate) 5. Developer keeps an excel sheet report for considered changes and reasons for ignored comments Problem: Developer needs to keep track of multiple labels which might have same comments Sometimes we even do One on One review and if we really have time, even do Table review (team of reviewers looks at the code on projector, on the fly, and pass comment) I was wondering: Are you guys using any specific tool which helps to do code reviews smoother? I have heard of Code collaborator. But have anyone used that? Is it worth the money?
0
415
08/02/2008 11:40:44
123
08/02/2008 08:01:26
1
1
Decode email address from Gravatar..
I suppose, Gravatar generates the image from email address. If so, the reverse should be possible. How difficult would be to get the email associated with the image? Isnt it a potential spam threat? What are your thoughts? (other than calling me paranoid ;) i did that already)
spamthreat
null
null
null
null
null
open
Decode email address from Gravatar.. === I suppose, Gravatar generates the image from email address. If so, the reverse should be possible. How difficult would be to get the email associated with the image? Isnt it a potential spam threat? What are your thoughts? (other than calling me paranoid ;) i did that already)
0
419
08/02/2008 11:52:01
268
08/04/2008 10:11:11
1
0
Unload a COM control when working in VB6 IDE
Part of my everyday work is maintaining and extending legacy VB6 applications. A common engire is written in C/C++ and VB6 uses these functions in order to improve performance. When it comes to asynchronous programming, a C interface is not enough and we rely on COM controls to fire events to VB6. My problem is that when I say in VB6 that I want to use a registered contorl, VB load this control in memory and does not unload it until I quit the VB6 IDE. As the control is loaded the whole time, I am unable to recompile it in VC6, because the DLL file is locked. A solution I found is not to enable the control in VB but use the CreateObject() with the full name of my control. The problem then is that I must declare my control as an Object because VB6 knows nothing of the interface I am using and I do not have access to IntelliSense, which is a pain. Any idea how I can tell VB6 to unload controls after quitting the application ? or directly in the IDE ? Thanks
vb6
com
null
null
null
null
open
Unload a COM control when working in VB6 IDE === Part of my everyday work is maintaining and extending legacy VB6 applications. A common engire is written in C/C++ and VB6 uses these functions in order to improve performance. When it comes to asynchronous programming, a C interface is not enough and we rely on COM controls to fire events to VB6. My problem is that when I say in VB6 that I want to use a registered contorl, VB load this control in memory and does not unload it until I quit the VB6 IDE. As the control is loaded the whole time, I am unable to recompile it in VC6, because the DLL file is locked. A solution I found is not to enable the control in VB but use the CreateObject() with the full name of my control. The problem then is that I must declare my control as an Object because VB6 knows nothing of the interface I am using and I do not have access to IntelliSense, which is a pain. Any idea how I can tell VB6 to unload controls after quitting the application ? or directly in the IDE ? Thanks
0
427
08/02/2008 12:12:02
123
08/02/2008 08:01:26
11
1
Programmatically Launch IE Mobile Favorites screen..
Is there any way to launch IEMobile's Favorites screen directly by specifying any command line parameter?
windows-mobile
iemobile
pocketinternetexplorer
pokcetpc
null
null
open
Programmatically Launch IE Mobile Favorites screen.. === Is there any way to launch IEMobile's Favorites screen directly by specifying any command line parameter?
0
429
08/02/2008 12:27:53
111
08/02/2008 03:35:55
8
1
How do you schedule tasks in Windows?
I run into a situation every couple of months where I need to develop a solution that's scheduled to run periodically, but I haven't found a way to handle this in Windows that I'm entirely happy with. Every time I do it, I end up feeling corralled into using a Windows Service, which seems to be an unacceptable amount of overhead for something I could do with a cron job in Unix. Am I missing something here? What have you used to schedule an application in Windows?
windows
null
null
null
null
null
open
How do you schedule tasks in Windows? === I run into a situation every couple of months where I need to develop a solution that's scheduled to run periodically, but I haven't found a way to handle this in Windows that I'm entirely happy with. Every time I do it, I end up feeling corralled into using a Windows Service, which seems to be an unacceptable amount of overhead for something I could do with a cron job in Unix. Am I missing something here? What have you used to schedule an application in Windows?
0
438
08/02/2008 12:56:58
136
08/02/2008 10:21:53
14
4
Implementation of "Remember me" in a Rails application.
My Rails-app has a sign in box with a "remember me" checkbox. Users who check that box should remain logged in even after closing their browser. I'm keeping track of whether users are logged in by storing their id in the user's session. But sessions are implemented in Rails as session cookies, which are not persistent. I can _make_ them persistent: class ApplicationController < ActionController::Base before_filter :update_session_expiration_date private def update_session_expiration_date options = ActionController::Base.session_options unless options[:session_expires] options[:session_expires] = 1.year.from_now end end end But that seems like a hack, which is surprising for such common functionality. Is there a better way?
rubyonrails
ruby-on-rails
ruby
null
null
null
open
Implementation of "Remember me" in a Rails application. === My Rails-app has a sign in box with a "remember me" checkbox. Users who check that box should remain logged in even after closing their browser. I'm keeping track of whether users are logged in by storing their id in the user's session. But sessions are implemented in Rails as session cookies, which are not persistent. I can _make_ them persistent: class ApplicationController < ActionController::Base before_filter :update_session_expiration_date private def update_session_expiration_date options = ActionController::Base.session_options unless options[:session_expires] options[:session_expires] = 1.year.from_now end end end But that seems like a hack, which is surprising for such common functionality. Is there a better way?
0
469
08/02/2008 15:11:16
147
08/02/2008 14:57:08
1
0
How can I find the full path to a font from its display name on a Mac?
I am using the Photoshop's javascript API to find the fonts in a given PSD. Given a font name returned by the API, I want to find the actual physical font file that that corresponds to on the disc. This is all happening in a python program running on OSX so I guess I'm looking for one of: * Some Photoshop javascript * A Python function * An OSX API that I can call from python
python
osx
font
photoshop
null
null
open
How can I find the full path to a font from its display name on a Mac? === I am using the Photoshop's javascript API to find the fonts in a given PSD. Given a font name returned by the API, I want to find the actual physical font file that that corresponds to on the disc. This is all happening in a python program running on OSX so I guess I'm looking for one of: * Some Photoshop javascript * A Python function * An OSX API that I can call from python
0
470
08/02/2008 15:11:47
71
08/01/2008 15:05:56
45
11
Homegrown consuming webservices
I've been writing a few web services for a .net app and now I'm ready to consume them. I've seen numerous examples where there is homegrown code for consing the service as opposed to using the auto generated methods Visisl Studio creates when adding the web reference. Is there some advantage to this?
.net
web-service
null
null
null
null
open
Homegrown consuming webservices === I've been writing a few web services for a .net app and now I'm ready to consume them. I've seen numerous examples where there is homegrown code for consing the service as opposed to using the auto generated methods Visisl Studio creates when adding the web reference. Is there some advantage to this?
0
482
08/02/2008 16:09:56
77
08/01/2008 16:02:03
1
0
WinForms ComboBox data binding gotcha
Ok, I'm a web developer, but I find myself dabbling in windows forms projects every now and then. One thing that confounds me to this day is the following. Assume you are doing something like the following List<string> myitems = new List<string> { "Item 1", "Item 2", "Item 3" }; ComboBox box = new ComboBox(); box.DataSource = myitems; ComboBox box2 = new ComboBox(); box.DataSource = myitems So now we have 2 combo boxes bound to that array, and everything works fine. But when you change the value of one combo box, it changes BOTH combo boxes to the one you just selected. Now, I know that Arrays are always passed by reference (learned that when i learned C :D), but why on earth would the combo boxes change together? I don't believe the combo box control is modifying the collection at all. As a work around, don't this would achieve the funcionality that is expected / desired ComboBox box = new ComboBox(); box.DataSource = myitems.ToArray();
c#
windows
forms
data-binding
null
null
open
WinForms ComboBox data binding gotcha === Ok, I'm a web developer, but I find myself dabbling in windows forms projects every now and then. One thing that confounds me to this day is the following. Assume you are doing something like the following List<string> myitems = new List<string> { "Item 1", "Item 2", "Item 3" }; ComboBox box = new ComboBox(); box.DataSource = myitems; ComboBox box2 = new ComboBox(); box.DataSource = myitems So now we have 2 combo boxes bound to that array, and everything works fine. But when you change the value of one combo box, it changes BOTH combo boxes to the one you just selected. Now, I know that Arrays are always passed by reference (learned that when i learned C :D), but why on earth would the combo boxes change together? I don't believe the combo box control is modifying the collection at all. As a work around, don't this would achieve the funcionality that is expected / desired ComboBox box = new ComboBox(); box.DataSource = myitems.ToArray();
0
484
08/02/2008 16:10:55
58
08/01/2008 13:56:33
108
7
How do you test layout design across multiple browsers/OSs?
What is a good method for testing website layout designs across multiple browsers and operating systems?
html
css
design
webdevelopment
null
null
open
How do you test layout design across multiple browsers/OSs? === What is a good method for testing website layout designs across multiple browsers and operating systems?
0
502
08/02/2008 17:01:58
147
08/02/2008 14:57:08
11
2
Get a preview jpeg of a pdf on windows?
I have a cross platform (python) application which needs to generate a jpeg preview of the fist page of a PDF. On the mac I am spawning [sips][1]. Is there something similarly simple I can do on Windows? [1]: http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/sips.1.html
pdf
windows
python
null
null
null
open
Get a preview jpeg of a pdf on windows? === I have a cross platform (python) application which needs to generate a jpeg preview of the fist page of a PDF. On the mac I am spawning [sips][1]. Is there something similarly simple I can do on Windows? [1]: http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/sips.1.html
0
514
08/02/2008 17:26:39
151
08/02/2008 16:20:32
1
2
Frequent SystemExit in Ruby when making HTTP calls
I have a Ruby on Rails Website that makes HTTP calls to an external Web Service. About once a day I get a SystemExit (stacktrace below) error email where a call to the service has failed. If I then try the exact same query on my site moments later it works fine. It's been happening since the site went live and I've had no luck tracking down what causes it. Ruby is version 1.8.6 and rails is version 1.2.6. Anyone else have this problem? This is the error and stacktrace. A SystemExit occurred /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.6/lib/fcgi_handler.rb:116:in `exit' /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.6/lib/fcgi_handler.rb:116:in `exit_now_handler' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/inflector.rb:250:in `to_proc' /usr/local/lib/ruby/1.8/net/protocol.rb:133:in `call' /usr/local/lib/ruby/1.8/net/protocol.rb:133:in `sysread' /usr/local/lib/ruby/1.8/net/protocol.rb:133:in `rbuf_fill' /usr/local/lib/ruby/1.8/timeout.rb:56:in `timeout' /usr/local/lib/ruby/1.8/timeout.rb:76:in `timeout' /usr/local/lib/ruby/1.8/net/protocol.rb:132:in `rbuf_fill' /usr/local/lib/ruby/1.8/net/protocol.rb:116:in `readuntil' /usr/local/lib/ruby/1.8/net/protocol.rb:126:in `readline' /usr/local/lib/ruby/1.8/net/http.rb:2017:in `read_status_line' /usr/local/lib/ruby/1.8/net/http.rb:2006:in `read_new' /usr/local/lib/ruby/1.8/net/http.rb:1047:in `request' /usr/local/lib/ruby/1.8/net/http.rb:945:in `request_get' /usr/local/lib/ruby/1.8/net/http.rb:380:in `get_response' /usr/local/lib/ruby/1.8/net/http.rb:543:in `start' /usr/local/lib/ruby/1.8/net/http.rb:379:in `get_response'
ruby
rubyonrails
crash
null
null
null
open
Frequent SystemExit in Ruby when making HTTP calls === I have a Ruby on Rails Website that makes HTTP calls to an external Web Service. About once a day I get a SystemExit (stacktrace below) error email where a call to the service has failed. If I then try the exact same query on my site moments later it works fine. It's been happening since the site went live and I've had no luck tracking down what causes it. Ruby is version 1.8.6 and rails is version 1.2.6. Anyone else have this problem? This is the error and stacktrace. A SystemExit occurred /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.6/lib/fcgi_handler.rb:116:in `exit' /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.6/lib/fcgi_handler.rb:116:in `exit_now_handler' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/inflector.rb:250:in `to_proc' /usr/local/lib/ruby/1.8/net/protocol.rb:133:in `call' /usr/local/lib/ruby/1.8/net/protocol.rb:133:in `sysread' /usr/local/lib/ruby/1.8/net/protocol.rb:133:in `rbuf_fill' /usr/local/lib/ruby/1.8/timeout.rb:56:in `timeout' /usr/local/lib/ruby/1.8/timeout.rb:76:in `timeout' /usr/local/lib/ruby/1.8/net/protocol.rb:132:in `rbuf_fill' /usr/local/lib/ruby/1.8/net/protocol.rb:116:in `readuntil' /usr/local/lib/ruby/1.8/net/protocol.rb:126:in `readline' /usr/local/lib/ruby/1.8/net/http.rb:2017:in `read_status_line' /usr/local/lib/ruby/1.8/net/http.rb:2006:in `read_new' /usr/local/lib/ruby/1.8/net/http.rb:1047:in `request' /usr/local/lib/ruby/1.8/net/http.rb:945:in `request_get' /usr/local/lib/ruby/1.8/net/http.rb:380:in `get_response' /usr/local/lib/ruby/1.8/net/http.rb:543:in `start' /usr/local/lib/ruby/1.8/net/http.rb:379:in `get_response'
0
535
08/02/2008 18:43:54
154
08/02/2008 17:32:17
1
3
Continuous Integration System for a Python Codebase
I'm starting work on a hobby project with a python codebase and would like to set up some form of continuous integration (i.e. running a battery of test-cases each time a check-in is made and sending nag e-mails to responsible persons when the tests fail) similar to CruiseControl or TeamCity. I realize I could do this with hooks in most VCSes, but that requires that the tests run on the same machine as the version control server, which isn't as elegant as I would like. Does anyone have any suggestions for a small, user-friendly, open-source continuous integration system suitable for a Python codebase?
python
tools
extremeprogramming
null
null
null
open
Continuous Integration System for a Python Codebase === I'm starting work on a hobby project with a python codebase and would like to set up some form of continuous integration (i.e. running a battery of test-cases each time a check-in is made and sending nag e-mails to responsible persons when the tests fail) similar to CruiseControl or TeamCity. I realize I could do this with hooks in most VCSes, but that requires that the tests run on the same machine as the version control server, which isn't as elegant as I would like. Does anyone have any suggestions for a small, user-friendly, open-source continuous integration system suitable for a Python codebase?
0
549
08/02/2008 19:51:50
136
08/02/2008 10:21:53
142
10
The Definitive Guide To Website Authentication
Let's try to create the definitive resource for website form based authentication. That includes things like: - how to log in - how to remain logged in - how to store passwords - using secret questions - forgotten password functionality - OpenID - "Remember me" checkbox - Browser autocompletion of usernames and passwords - secret urls - checking password strength - email validation - and much more It does not include things like: - roles and authorization - using CAPTCHAs - much more Please help by suggesting subtopics, and by submitting good articles about this subject.
web
webdevelopment
http
authentication
language-agnostic
null
open
The Definitive Guide To Website Authentication === Let's try to create the definitive resource for website form based authentication. That includes things like: - how to log in - how to remain logged in - how to store passwords - using secret questions - forgotten password functionality - OpenID - "Remember me" checkbox - Browser autocompletion of usernames and passwords - secret urls - checking password strength - email validation - and much more It does not include things like: - roles and authorization - using CAPTCHAs - much more Please help by suggesting subtopics, and by submitting good articles about this subject.
0
561
08/02/2008 21:34:24
157
08/02/2008 17:42:25
35
4
Using combinations of sets as test data
I'd like to be able to test a function with a tuple from a set of fringe cases and normal values. For example, in testing a function that returns true when given three lengths that form a valid triangle, I'd have specific cases, negative numbers, small numbers, large numbers, values close-to being overflowed, etcetera. Then generating combinations of these values, _with_ or _without_ repetition, to get a set of test data. (inf,0,-1), (5,10,1000), (10,5,5), (0,-1,5), (1000,inf,inf), ... (I actually know the answer to this, but it might be helpful for others, and a challenge for people here! --will post my answer(s) later on.)
language-agnostic
unit-testing
testing
null
null
null
open
Using combinations of sets as test data === I'd like to be able to test a function with a tuple from a set of fringe cases and normal values. For example, in testing a function that returns true when given three lengths that form a valid triangle, I'd have specific cases, negative numbers, small numbers, large numbers, values close-to being overflowed, etcetera. Then generating combinations of these values, _with_ or _without_ repetition, to get a set of test data. (inf,0,-1), (5,10,1000), (10,5,5), (0,-1,5), (1000,inf,inf), ... (I actually know the answer to this, but it might be helpful for others, and a challenge for people here! --will post my answer(s) later on.)
0
564
08/02/2008 21:47:34
25
08/01/2008 12:15:23
10
3
What is the difference between an int and an Integer in C?
I was just sitting at my local Borders sipping coffee and reading (for free) 'More Joel on Software' when I came across Joel saying something about a particular type of programmer knowing the difference between an int and an Integer in C. After a quick 'brain check,' I realized, to my dismay, that I didn't know the answer. Please help.
c
null
null
null
null
null
open
What is the difference between an int and an Integer in C? === I was just sitting at my local Borders sipping coffee and reading (for free) 'More Joel on Software' when I came across Joel saying something about a particular type of programmer knowing the difference between an int and an Integer in C. After a quick 'brain check,' I realized, to my dismay, that I didn't know the answer. Please help.
0
580
08/02/2008 23:30:59
91
08/01/2008 17:55:22
174
19
Deploying SQL Server Databases from Test to Live
I wonder how you guys manage deployment of a database between 2 SQL Servers, specifically SQL Server 2005. Now, there is a development and a live one. As this should be part of a buildscript (standard windows batch, even do with current complexity of those scripts, i might switch to PowerShell or so later), Enterprise Manager/Management Studio Express do not count. Would you just copy the .mdf File and attach it? I am always a bit careful when working with binary data, as this seems to be a compatiblity issue (even though development and live should run the same version of the server at all time). Or - given the lack of "EXPLAIN CREATE TABLE" in T-SQL - do you do something that exports an existing database into SQL-Scripts which you can run on the target server? If yes, is there a tool that can automatically dump a given Database into SQL Queries and that runs off the command line? (Again, Enterprise Manager/Management Studio Express do not count). And lastly - given the fact that the live database already contains data, the deployment may not involve creating all tables but rather checking the difference in structure and ALTER TABLE the live ones instead, which may also need data verification/conversion when existing fields change. Now, i hear a lot of great stuff about the [Red Gate][1] products, but for hobby projects, the price is a bit steep. So, what are you using to automatically deploy SQL Server Databases from Test to Live? [1]: http://www.red-gate.com/products/index.htm
mssql
deployment
null
null
null
null
open
Deploying SQL Server Databases from Test to Live === I wonder how you guys manage deployment of a database between 2 SQL Servers, specifically SQL Server 2005. Now, there is a development and a live one. As this should be part of a buildscript (standard windows batch, even do with current complexity of those scripts, i might switch to PowerShell or so later), Enterprise Manager/Management Studio Express do not count. Would you just copy the .mdf File and attach it? I am always a bit careful when working with binary data, as this seems to be a compatiblity issue (even though development and live should run the same version of the server at all time). Or - given the lack of "EXPLAIN CREATE TABLE" in T-SQL - do you do something that exports an existing database into SQL-Scripts which you can run on the target server? If yes, is there a tool that can automatically dump a given Database into SQL Queries and that runs off the command line? (Again, Enterprise Manager/Management Studio Express do not count). And lastly - given the fact that the live database already contains data, the deployment may not involve creating all tables but rather checking the difference in structure and ALTER TABLE the live ones instead, which may also need data verification/conversion when existing fields change. Now, i hear a lot of great stuff about the [Red Gate][1] products, but for hobby projects, the price is a bit steep. So, what are you using to automatically deploy SQL Server Databases from Test to Live? [1]: http://www.red-gate.com/products/index.htm
0
588
08/03/2008 00:03:58
172
08/02/2008 23:55:05
1
0
Best way to access Exchange using PHP
I'm writing a CMS application in PHP and one of the requirements is that it must be able to interface with the customer's exchange server. I've written up this functionality a few times before and have always used WebDAV to do it, but now I'm leaning away from that. I will be running the site on IIS OR Apache (no preference) on Windows server 2008. A few things I would need to do include adding contacts to a given user's address book, sending emails AS a given user and running reports on contacts for a user. All of this is pretty easy to do with WebDAV, but if there is a better way that doesn't require any functionality that is likely to be deprecated any time soon. Any ideas?
php
windows
exchange
2008
null
null
open
Best way to access Exchange using PHP === I'm writing a CMS application in PHP and one of the requirements is that it must be able to interface with the customer's exchange server. I've written up this functionality a few times before and have always used WebDAV to do it, but now I'm leaning away from that. I will be running the site on IIS OR Apache (no preference) on Windows server 2008. A few things I would need to do include adding contacts to a given user's address book, sending emails AS a given user and running reports on contacts for a user. All of this is pretty easy to do with WebDAV, but if there is a better way that doesn't require any functionality that is likely to be deprecated any time soon. Any ideas?
0
592
08/03/2008 00:38:59
116
08/02/2008 05:51:57
41
7
cx_Oracle - How do I access Oracle from Python?
How do I get started?
database
sql
python
oracle
cx_oracle
null
open
cx_Oracle - How do I access Oracle from Python? === How do I get started?
0
594
08/03/2008 01:15:08
116
08/02/2008 05:51:57
41
8
cx_Oracle - what is the best way to iterate over a result set?
There are several ways, what is the best one?
python
oracle
sql
database
cx_oracle
null
open
cx_Oracle - what is the best way to iterate over a result set? === There are several ways, what is the best one?
0
601
08/03/2008 02:05:59
90
08/01/2008 17:44:12
1
1
Robust Random Number Generation in C++/C#
I'm looking for a performant, reasonably robust RNG using no special hardware. It can use mathematical methods (Mersenne Twister, etc), it can "collect entropy" from the machine, whatever. On Linux/etc we have a drand48() which generates 48 random bits. I'd like a similar function/class for C++ or C# which can generate more than 32 bits of randomness and which low-order bits are equally as random as high-order bits. It doesn't have to be cryptographically secure but it must not use or be based on the C-language rand() or .NET System.Random. Any source code, links to source, etc. would be appreciated! Failing that, what TYPE of RNG should I be looking for? Thanks!
c#
c++
random
null
null
null
open
Robust Random Number Generation in C++/C# === I'm looking for a performant, reasonably robust RNG using no special hardware. It can use mathematical methods (Mersenne Twister, etc), it can "collect entropy" from the machine, whatever. On Linux/etc we have a drand48() which generates 48 random bits. I'd like a similar function/class for C++ or C# which can generate more than 32 bits of randomness and which low-order bits are equally as random as high-order bits. It doesn't have to be cryptographically secure but it must not use or be based on the C-language rand() or .NET System.Random. Any source code, links to source, etc. would be appreciated! Failing that, what TYPE of RNG should I be looking for? Thanks!
0
609
08/03/2008 02:48:43
179
08/03/2008 02:38:27
1
0
Build for Windows NT 4.0 using Visual Studio 2005?
My research to date indicates that it is impossible to build an application for execution on Windows NT 4.0 using Visual Studio (C++, in this case) 2005. Is this really true? Is there any workaround available?
windows
nt
wisualstudio
null
null
null
open
Build for Windows NT 4.0 using Visual Studio 2005? === My research to date indicates that it is impossible to build an application for execution on Windows NT 4.0 using Visual Studio (C++, in this case) 2005. Is this really true? Is there any workaround available?
0
610
08/03/2008 03:01:47
145
08/02/2008 14:40:17
1
2
GUI Programming APIs
Alright, this is a rather odd question that doesn't have one true answer: >What is the *** Best || Easiest to Use || Most Powerful || Cleanest *** GUI API or library (tk, SWING, Qt, etc.) you have had the privilege to use? I've had conversations with friends about how annoying _XYZ API_ was to deal with and how someone could build a better one, and I was curious what other's thoughts were on the subject. Is there a good and straightforward way to implement a GUI from the programmer's standpoint, and has someone done it yet?
language-agnostic
gui
api
null
null
null
open
GUI Programming APIs === Alright, this is a rather odd question that doesn't have one true answer: >What is the *** Best || Easiest to Use || Most Powerful || Cleanest *** GUI API or library (tk, SWING, Qt, etc.) you have had the privilege to use? I've had conversations with friends about how annoying _XYZ API_ was to deal with and how someone could build a better one, and I was curious what other's thoughts were on the subject. Is there a good and straightforward way to implement a GUI from the programmer's standpoint, and has someone done it yet?
0
622
08/03/2008 05:45:21
184
08/03/2008 05:34:19
1
1
Most efficient code for the first 10000 prime numbers?
I want to print the first 10000 prime numbers. Can anyone give me the most efficient code for this? Clarifications: 1. It does not matter if your code is inefficient for n >10000. 2. The size of the code does not matter. 3. You cannot just hard code the values in any manner.
efficiency
puzzle
number
challenge
prime
null
open
Most efficient code for the first 10000 prime numbers? === I want to print the first 10000 prime numbers. Can anyone give me the most efficient code for this? Clarifications: 1. It does not matter if your code is inefficient for n >10000. 2. The size of the code does not matter. 3. You cannot just hard code the values in any manner.
0
626
08/03/2008 06:40:54
136
08/02/2008 10:21:53
278
13
When to use lambda, when to use Proc.new?
In Ruby 1.8, there are subtle differences between proc/lambda on the one hand, and Proc.new on the other. - What are those differences? - Can you give guidelines on how to decide which one to choose? - In Ruby 1.9, proc and lambda are different. What's the deal?
ruby
null
null
null
null
null
open
When to use lambda, when to use Proc.new? === In Ruby 1.8, there are subtle differences between proc/lambda on the one hand, and Proc.new on the other. - What are those differences? - Can you give guidelines on how to decide which one to choose? - In Ruby 1.9, proc and lambda are different. What's the deal?
0
644
08/03/2008 09:55:26
191
08/03/2008 09:55:26
1
0
Swap unique indexed column values in database.
I have a database table and one of the fields (not primary key) is having unique index on it. Now I want to swap values under this column for two rows. How could this be done? Two hack I know are: 1. Delete both rows and re-insert them 2. Update rows with some other value and swap and then update to actual value. But I don't want to go for these as they do not seem to be the appropriate solution to the problem. Could anyone help me out?
sql
database
null
null
null
null
open
Swap unique indexed column values in database. === I have a database table and one of the fields (not primary key) is having unique index on it. Now I want to swap values under this column for two rows. How could this be done? Two hack I know are: 1. Delete both rows and re-insert them 2. Update rows with some other value and swap and then update to actual value. But I don't want to go for these as they do not seem to be the appropriate solution to the problem. Could anyone help me out?
0
650
08/03/2008 11:12:52
143
08/02/2008 12:45:43
11
2
Automatically update version number
I would like the version property of my application to be incremented for each build but I'm not sure on how to enable this functionality in Visual Studio (2005/2008). I have tried to specify the AssemblyVersion as 1.0.* but it doesn't get me exactly what I want. I'm also using a settings file and in earlier attempts when the assembly version changed my settings got reset to the default since the application looked for the settings file in another directory. I would like to be able to display a version number in the form of 1.1.38 so when a user finds a problem I can log the version they are using as well as tell them to upgrade if they have an old release.
c#
.net
visual-studio
null
null
null
open
Automatically update version number === I would like the version property of my application to be incremented for each build but I'm not sure on how to enable this functionality in Visual Studio (2005/2008). I have tried to specify the AssemblyVersion as 1.0.* but it doesn't get me exactly what I want. I'm also using a settings file and in earlier attempts when the assembly version changed my settings got reset to the default since the application looked for the settings file in another directory. I would like to be able to display a version number in the form of 1.1.38 so when a user finds a problem I can log the version they are using as well as tell them to upgrade if they have an old release.
0
651
08/03/2008 11:21:54
192
08/03/2008 10:15:38
1
0
Checklist for IIS 6 / ASP.NET Windows Authentication?
I've been having trouble getting my ASP.NET application to automatically log users into the Intranet site I'm building. No matter the googling or the experimentation I applied, there is always a login box displayed by IE7. I've got Windows authentication mode set in the Web.config, disabled anonymous access and configured the correct default domain in IIS, but it's still asking the user to log in and, more annoyingly, the user is required to provide the domain too (*DOMAIN\auser*), which is causing problems with non-technical visitors. Thank Zeus for password remembering functionality. I'm not the network administrator so it's possible that something about Active Directory is set up incorrectly, or it could just be me missing something very simple. Please note that I don't want to impersonate the user, I just need to know that the IPrincipal.Name property matches that of a valid record in my user database, hence authenticating the user to my application. To this end, it would be very useful to have a checklist of all configuration requirements for AD, ASP.NET and IIS to work together in this manner as a reference for debugging and hopefully reducing some user friction. Thanks for your help.
asp.net
iis
authentication
activedirectory
null
null
open
Checklist for IIS 6 / ASP.NET Windows Authentication? === I've been having trouble getting my ASP.NET application to automatically log users into the Intranet site I'm building. No matter the googling or the experimentation I applied, there is always a login box displayed by IE7. I've got Windows authentication mode set in the Web.config, disabled anonymous access and configured the correct default domain in IIS, but it's still asking the user to log in and, more annoyingly, the user is required to provide the domain too (*DOMAIN\auser*), which is causing problems with non-technical visitors. Thank Zeus for password remembering functionality. I'm not the network administrator so it's possible that something about Active Directory is set up incorrectly, or it could just be me missing something very simple. Please note that I don't want to impersonate the user, I just need to know that the IPrincipal.Name property matches that of a valid record in my user database, hence authenticating the user to my application. To this end, it would be very useful to have a checklist of all configuration requirements for AD, ASP.NET and IIS to work together in this manner as a reference for debugging and hopefully reducing some user friction. Thanks for your help.
0
657
08/03/2008 11:50:33
115
08/02/2008 05:44:40
18
10
Encrypting Passwords
What is the fastest, yet secure way to encrypt passwords in PHP, and for which ever method you choose is it portable?<br />In other words if I later migrate my website to a different server will my passwords continue to work?<br />The method I am using now I was told is dependent on the exact versions of the libraries installed on the server.
encryption
passwords
php
null
null
null
open
Encrypting Passwords === What is the fastest, yet secure way to encrypt passwords in PHP, and for which ever method you choose is it portable?<br />In other words if I later migrate my website to a different server will my passwords continue to work?<br />The method I am using now I was told is dependent on the exact versions of the libraries installed on the server.
0
664
08/03/2008 12:26:22
199
08/03/2008 12:26:21
1
0
What level of programming should I have to contribute to open source?
I'd like to contribute to open source but I'm not a professional programmer. I contributed an extra function to a PHP project once, but on submission it was rewritten and, in hindsight, the functionality was completely useless anyway. I was actively encouraged by the project members who were very supportive but I can't help feeling I was generating more work than was necessary for them. I suppose the question is - Are novice programmers a hindrance to a project?
opensource
null
null
null
null
null
open
What level of programming should I have to contribute to open source? === I'd like to contribute to open source but I'm not a professional programmer. I contributed an extra function to a PHP project once, but on submission it was rewritten and, in hindsight, the functionality was completely useless anyway. I was actively encouraged by the project members who were very supportive but I can't help feeling I was generating more work than was necessary for them. I suppose the question is - Are novice programmers a hindrance to a project?
0
683
08/03/2008 13:19:16
199
08/03/2008 12:26:21
1
1
Using 'in' to match an attribute of Python objects in an array
I don't remember whether I was dreaming or not but I seem to recall there being a function which allowed something like, <pre><code>foo in iter_attr(array of python objects, attribute name)</code></pre> I've looked over the docs but this kind of thing doesn't fall under any obvious listed headers
python
array
objects
iteration
null
null
open
Using 'in' to match an attribute of Python objects in an array === I don't remember whether I was dreaming or not but I seem to recall there being a function which allowed something like, <pre><code>foo in iter_attr(array of python objects, attribute name)</code></pre> I've looked over the docs but this kind of thing doesn't fall under any obvious listed headers
0
696
08/03/2008 14:03:28
204
08/03/2008 13:27:56
1
0
Connect PHP to an AS/400
I've got an upcoming project wherein I will need to connect our website (PHP5/Apache 1.3/OpenBSD 4.1) to our back-end system running on a iSeries with OS400 V5R3 so that I can access some tables stored there. I've done some checking around but am running into some roadblocks. From what I've seen the DB2 extensions and DB2 software from IBM only run under Linux. I've tried compiling the extensions with all the software from IBM and even tried their precompiled ibm_db2 extension with no luck. IBM only supports Linux so I turned on the Linux emulation in the kernel but that didn't seem to help anything. If anyone has run across getting everything to run natively under OpenBSD that would be great, but what I think I may have to do is setting up a second server running CentOS with DB2 installed (most likely via ZendCore for IBM since it seems to do all this for me) and the driver so that I can set up a small transaction server that I can post against and get a JSON representation of the DB2 data that I need. Does the second option seem overkill or does anyone else have any better ideas?
php
databases
db2
ibm-midrange
zend
null
open
Connect PHP to an AS/400 === I've got an upcoming project wherein I will need to connect our website (PHP5/Apache 1.3/OpenBSD 4.1) to our back-end system running on a iSeries with OS400 V5R3 so that I can access some tables stored there. I've done some checking around but am running into some roadblocks. From what I've seen the DB2 extensions and DB2 software from IBM only run under Linux. I've tried compiling the extensions with all the software from IBM and even tried their precompiled ibm_db2 extension with no luck. IBM only supports Linux so I turned on the Linux emulation in the kernel but that didn't seem to help anything. If anyone has run across getting everything to run natively under OpenBSD that would be great, but what I think I may have to do is setting up a second server running CentOS with DB2 installed (most likely via ZendCore for IBM since it seems to do all this for me) and the driver so that I can set up a small transaction server that I can post against and get a JSON representation of the DB2 data that I need. Does the second option seem overkill or does anyone else have any better ideas?
0

Dataset Card for "stackoverflow-unified-text-open-status-classification"

More Information needed

Downloads last month
58
Edit dataset card