question_id
int64
4
6.31M
answer_id
int64
7
6.31M
title
stringlengths
9
150
question_body
stringlengths
0
28.8k
answer_body
stringlengths
60
27.2k
question_text
stringlengths
40
28.9k
combined_text
stringlengths
124
39.6k
tags
listlengths
1
6
question_score
int64
0
26.3k
answer_score
int64
0
28.8k
view_count
int64
15
14M
answer_count
int64
0
182
favorite_count
int64
0
32
question_creation_date
stringdate
2008-07-31 21:42:52
2011-06-10 18:12:18
answer_creation_date
stringdate
2008-07-31 22:17:57
2011-06-10 18:14:17
22,903
22,911
How do I stop Windows applications from stealing focus
I know this isn't strictly a programming question but y'all must have experienced this. So...you have four or five RDP sessions open over the corp VPN, you're bashing away inside your favourite IDE, your VPN to the data centre bounces briefly then recovers, all your RDP sessions start re-establishing their connections ...
I use Tweak UI to configure explorer so that apps don't steal focus; you can also configure how many times they flash in the taskbar as well. EDIT: Once you are within Tweak UI, these options are found under General > Focus. EDIT: @Kev, apparently there is a 64-bit version (not MS approved, apparently, I would scan it ...
How do I stop Windows applications from stealing focus I know this isn't strictly a programming question but y'all must have experienced this. So...you have four or five RDP sessions open over the corp VPN, you're bashing away inside your favourite IDE, your VPN to the data centre bounces briefly then recovers, all you...
TITLE: How do I stop Windows applications from stealing focus QUESTION: I know this isn't strictly a programming question but y'all must have experienced this. So...you have four or five RDP sessions open over the corp VPN, you're bashing away inside your favourite IDE, your VPN to the data centre bounces briefly then...
[ "terminal-services", "rdp" ]
7
6
8,586
3
0
2008-08-22T17:09:14.593000
2008-08-22T17:11:21.500000
22,907
22,970
Which is better: Ad hoc queries or stored procedures?
Assuming you can't use LINQ for whatever reason, is it a better practice to place your queries in stored procedures, or is it just as good a practice to execute ad hoc queries against the database (say, SQL Server for argument's sake)?
In my experience writing mostly WinForms Client/Server apps these are the simple conclusions I've come to: Use Stored Procedures: For any complex data work. If you're going to be doing something truly requiring a cursor or temp tables it's usually fastest to do it within SQL Server. When you need to lock down access to...
Which is better: Ad hoc queries or stored procedures? Assuming you can't use LINQ for whatever reason, is it a better practice to place your queries in stored procedures, or is it just as good a practice to execute ad hoc queries against the database (say, SQL Server for argument's sake)?
TITLE: Which is better: Ad hoc queries or stored procedures? QUESTION: Assuming you can't use LINQ for whatever reason, is it a better practice to place your queries in stored procedures, or is it just as good a practice to execute ad hoc queries against the database (say, SQL Server for argument's sake)? ANSWER: In ...
[ "sql", "stored-procedures" ]
55
109
59,680
22
0
2008-08-22T17:10:30.440000
2008-08-22T17:32:28
22,909
22,930
Is there some way to show HTML content inside Flash?
I want to show HTML content inside Flash. Is there some way to do this? I am talking about full blown HTML (with JavaScript if possible).
Here is a decent article on how to accomplish that. @Flubba: I didn't say " great " article, I said " decent " - there is a big difference. Besides, no one else had answered and it had been around a while. I figured a "decent" answer was better than none. I am no Flash expert, so...
Is there some way to show HTML content inside Flash? I want to show HTML content inside Flash. Is there some way to do this? I am talking about full blown HTML (with JavaScript if possible).
TITLE: Is there some way to show HTML content inside Flash? QUESTION: I want to show HTML content inside Flash. Is there some way to do this? I am talking about full blown HTML (with JavaScript if possible). ANSWER: Here is a decent article on how to accomplish that. @Flubba: I didn't say " great " article, I said " ...
[ "javascript", "html", "flash", "adobe" ]
13
1
14,843
6
0
2008-08-22T17:10:59.567000
2008-08-22T17:18:39.983000
22,935
22,948
CSV (or sheet in XLS) to SQL create (and insert) statements with .Net?
Does anyone have a technique for generating SQL table create (and data insert) commands pragmatically from a CSV (or sheet in a.xls) file? I've got a third party database system which I'd like to populate with data from a csv file (or sheet in a xls file) but the importer supplied can't create the table structure autom...
In SQL server it is as easy as SELECT * INTO NewTablenNmeHere FROM OPENROWSET( 'Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\testing.xls','SELECT * FROM [Sheet1$]')
CSV (or sheet in XLS) to SQL create (and insert) statements with .Net? Does anyone have a technique for generating SQL table create (and data insert) commands pragmatically from a CSV (or sheet in a.xls) file? I've got a third party database system which I'd like to populate with data from a csv file (or sheet in a xls...
TITLE: CSV (or sheet in XLS) to SQL create (and insert) statements with .Net? QUESTION: Does anyone have a technique for generating SQL table create (and data insert) commands pragmatically from a CSV (or sheet in a.xls) file? I've got a third party database system which I'd like to populate with data from a csv file ...
[ ".net", "sql", "csv", "xls" ]
3
1
5,234
4
0
2008-08-22T17:19:24.130000
2008-08-22T17:23:06.040000
22,943
23,038
Does anybody know of existing code to read a mork file (Thunderbird Address Book)?
I have the need to read the Thunderbird address book on the fly. It is stored in a file format called Mork. Not a pleasant file format to read. I found a 1999 article explaining the file format. I would love to know if someone already has gone through this process and could make the code available. I found mork.pl by J...
The Beagle search engine had code to parse Mork files. It's not the most memory efficient solution, but it worked and could be a useful starting point. Here's a link to the file: http://svn.gnome.org/viewvc/beagle/tags/BEAGLE_0_2_18/Util/Mork.cs?view=markup (These days Beagle doesn't use this parser anymore; we took th...
Does anybody know of existing code to read a mork file (Thunderbird Address Book)? I have the need to read the Thunderbird address book on the fly. It is stored in a file format called Mork. Not a pleasant file format to read. I found a 1999 article explaining the file format. I would love to know if someone already ha...
TITLE: Does anybody know of existing code to read a mork file (Thunderbird Address Book)? QUESTION: I have the need to read the Thunderbird address book on the fly. It is stored in a file format called Mork. Not a pleasant file format to read. I found a 1999 article explaining the file format. I would love to know if ...
[ ".net", "file-format", "thunderbird", "mork" ]
3
4
1,149
1
0
2008-08-22T17:19:52.210000
2008-08-22T17:57:14.510000
22,968
23,148
How to process Excel files stored in an image data type column using SSIS package?
I have a.NET webforms front end that allows admin users to upload two.xls files for offline processing. As these files will be used for validation (and aggregation) I store these in an image field in a table. My ultimate goal is to create an SSIS package that will process these files offline. Does anyone know how to us...
In my (admittedly limited) experience with SSIS, it is quite good at rapidly getting something up and running, but frusteratingly limited in getting something that "feels" like the most elegant, efficient solution to a programmer. Since the Excel Source Editor seems to take only files as input, you need to give it a fi...
How to process Excel files stored in an image data type column using SSIS package? I have a.NET webforms front end that allows admin users to upload two.xls files for offline processing. As these files will be used for validation (and aggregation) I store these in an image field in a table. My ultimate goal is to creat...
TITLE: How to process Excel files stored in an image data type column using SSIS package? QUESTION: I have a.NET webforms front end that allows admin users to upload two.xls files for offline processing. As these files will be used for validation (and aggregation) I store these in an image field in a table. My ultimat...
[ "ssis" ]
3
1
2,143
1
0
2008-08-22T17:32:11.993000
2008-08-22T18:37:53.803000
22,976
23,089
How to provide namespaces in JavaScript with instanced objects
I've got a JavaScript "object", built this way: function foo() { this.length = 0; } foo.prototype.getLength = function() { return this.length; }... I know how to emulate namespaces with singleton JavaScript objects, but what is the best way to "namepace" an object such as that above that will intanced? I know that sev...
Simple: if(!MyNamespace) MyNamespace = {}; MyNamespace.foo = function() { this.length = 0; }; MyNamespace.foo.prototype.getLength = function() { return this.length; };
How to provide namespaces in JavaScript with instanced objects I've got a JavaScript "object", built this way: function foo() { this.length = 0; } foo.prototype.getLength = function() { return this.length; }... I know how to emulate namespaces with singleton JavaScript objects, but what is the best way to "namepace" a...
TITLE: How to provide namespaces in JavaScript with instanced objects QUESTION: I've got a JavaScript "object", built this way: function foo() { this.length = 0; } foo.prototype.getLength = function() { return this.length; }... I know how to emulate namespaces with singleton JavaScript objects, but what is the best w...
[ "javascript", "namespaces" ]
11
12
9,935
5
0
2008-08-22T17:37:07.303000
2008-08-22T18:18:30.947000
22,979
22,991
Detecting if SQL server is running
I'm looking for a way to poll different servers and check that SQL server is up and running. I'm writing my code in C#. I don't particularly care about individual databases, just that SQL server is running and responsive. Any ideas?
Well, the brute force solution is to attempt to initiate a connection with the database on each server. That will tell you whether it's running, though you could have timeout issues. The more elegant (but more difficult... isn't that always the way?) solution would be to use WMI to connect to the remote machine and fin...
Detecting if SQL server is running I'm looking for a way to poll different servers and check that SQL server is up and running. I'm writing my code in C#. I don't particularly care about individual databases, just that SQL server is running and responsive. Any ideas?
TITLE: Detecting if SQL server is running QUESTION: I'm looking for a way to poll different servers and check that SQL server is up and running. I'm writing my code in C#. I don't particularly care about individual databases, just that SQL server is running and responsive. Any ideas? ANSWER: Well, the brute force sol...
[ "c#", "sql-server" ]
8
5
14,273
6
0
2008-08-22T17:37:48.707000
2008-08-22T17:41:22.050000
22,980
23,137
Acts-as-readable Rails plugin Issue
I'm using Intridea's Acts as Readable Rails plugin for a messaging system I'm currently building. I've defined my message class accordingly: class Post < ActiveRecord::Base acts-as-readable end And everything seems to be working according to plan, but when trying to make the app show unread messages in my message view,...
The following will work <%= Post.find_unread_by(current_user).size %> or <%= Post.find_unread_by(current_user).length %> However if you check your development.log you should see that it gets the unread count by Retrieving all the posts Retrieving all the posts read by the user Removing all of 2. from 1. in ruby This wi...
Acts-as-readable Rails plugin Issue I'm using Intridea's Acts as Readable Rails plugin for a messaging system I'm currently building. I've defined my message class accordingly: class Post < ActiveRecord::Base acts-as-readable end And everything seems to be working according to plan, but when trying to make the app show...
TITLE: Acts-as-readable Rails plugin Issue QUESTION: I'm using Intridea's Acts as Readable Rails plugin for a messaging system I'm currently building. I've defined my message class accordingly: class Post < ActiveRecord::Base acts-as-readable end And everything seems to be working according to plan, but when trying to...
[ "ruby-on-rails", "ruby", "plugins" ]
9
11
637
1
0
2008-08-22T17:37:51.403000
2008-08-22T18:33:33.890000
22,981
22,992
ASP.Net: How to do pagination with a Repeater?
I'm using the Repeater control on my site to display data from the database. I need to do pagination ("now displaying page 1 of 10", 10 items per page, etc) but I'm not sure I'm going about it the best way possible. I know the Repeater control doesn't have any built-in pagination, so I'll have to make my own. Is there ...
This isn't a way to page the data, but have you looked into the ListView control? It gives the flexibility of repeater / data list but with built in paging like the grid view. And for paging in sql, you would want to do something like this
ASP.Net: How to do pagination with a Repeater? I'm using the Repeater control on my site to display data from the database. I need to do pagination ("now displaying page 1 of 10", 10 items per page, etc) but I'm not sure I'm going about it the best way possible. I know the Repeater control doesn't have any built-in pag...
TITLE: ASP.Net: How to do pagination with a Repeater? QUESTION: I'm using the Repeater control on my site to display data from the database. I need to do pagination ("now displaying page 1 of 10", 10 items per page, etc) but I'm not sure I'm going about it the best way possible. I know the Repeater control doesn't hav...
[ "asp.net", "sql-server" ]
0
2
2,013
3
0
2008-08-22T17:37:54.617000
2008-08-22T17:41:23.127000
22,988
23,007
Form post doesn't contain textbox data [ASP.NET C#]
I have several "ASP:TextBox" controls on a form (about 20). When the form loads, the text boxes are populated from a database. The user can change the populated values, and when they submit the form, I take the values posted to the server and conditionally save them (determined by some business logic). All but 1 of the...
Are you initially loading the data only when!Page.IsPostBack? Also, is view state enabled for the text box?
Form post doesn't contain textbox data [ASP.NET C#] I have several "ASP:TextBox" controls on a form (about 20). When the form loads, the text boxes are populated from a database. The user can change the populated values, and when they submit the form, I take the values posted to the server and conditionally save them (...
TITLE: Form post doesn't contain textbox data [ASP.NET C#] QUESTION: I have several "ASP:TextBox" controls on a form (about 20). When the form loads, the text boxes are populated from a database. The user can change the populated values, and when they submit the form, I take the values posted to the server and conditi...
[ "c#", "asp.net" ]
6
9
6,511
5
0
2008-08-22T17:40:23.893000
2008-08-22T17:43:41.560000
23,001
23,069
Any good tools to automate SQL Server management tasks?
I know I could write scripts and create jobs to run them, but at least some of what I'm wanting it to do is beyond my programming abilities for that to be an option. What I'm imagining is something that can run on a regular schedule that will examine all the databases on a server and automatically shrink data and log f...
If you are using SQL Server 2005. Fire up the Management Studio and look at the Maintenance Plan section. See http://msdn.microsoft.com/en-us/library/ms187658.aspx for an overview and http://msdn.microsoft.com/en-us/library/ms189036.aspx for details on the Maintenance plan wizard. Finally, http://msdn.microsoft.com/en-...
Any good tools to automate SQL Server management tasks? I know I could write scripts and create jobs to run them, but at least some of what I'm wanting it to do is beyond my programming abilities for that to be an option. What I'm imagining is something that can run on a regular schedule that will examine all the datab...
TITLE: Any good tools to automate SQL Server management tasks? QUESTION: I know I could write scripts and create jobs to run them, but at least some of what I'm wanting it to do is beyond my programming abilities for that to be an option. What I'm imagining is something that can run on a regular schedule that will exa...
[ "sql-server" ]
1
2
200
4
0
2008-08-22T17:42:24.077000
2008-08-22T18:10:12.123000
23,016
23,220
Checklist for testing a new site
What are the most common things to test in a new site? For instance to prevent exploits by bots, malicious users, massive load, etc.? And just as importantly, what tools and approaches should you use? (some stress test tools are really expensive/had to use, do you write your own? etc) Common exploits that should be che...
Try and break your own site before someone else does. Your web site is basically a publicly accessible API that allows access to a database and other backend systems. Test the URLs as if they were any other API. I like to start by cataloging all URLs that have some sort of permenant affect on the state of the system - ...
Checklist for testing a new site What are the most common things to test in a new site? For instance to prevent exploits by bots, malicious users, massive load, etc.? And just as importantly, what tools and approaches should you use? (some stress test tools are really expensive/had to use, do you write your own? etc) C...
TITLE: Checklist for testing a new site QUESTION: What are the most common things to test in a new site? For instance to prevent exploits by bots, malicious users, massive load, etc.? And just as importantly, what tools and approaches should you use? (some stress test tools are really expensive/had to use, do you writ...
[ "testing" ]
5
4
824
7
0
2008-08-22T17:47:27.933000
2008-08-22T19:11:46.203000
23,027
23,060
CruiseControl.Net Build Publisher - Only publish compiled files
While setting up CruiseControl, I added a buildpublisher block to the publisher tasks: C:\MyBuild\ C:\MyBuildPublished\ false This works, but it copies the entire file contents of the build, I only want to copy the DLL's and.aspx pages, I don't need the source code to get published. Does anyone know of a way to filter ...
I set up a task to do this. I'm not aware of any way to make CruiseControl be that specific. I usually just chain a batch file to do the copy to the CC.net task.
CruiseControl.Net Build Publisher - Only publish compiled files While setting up CruiseControl, I added a buildpublisher block to the publisher tasks: C:\MyBuild\ C:\MyBuildPublished\ false This works, but it copies the entire file contents of the build, I only want to copy the DLL's and.aspx pages, I don't need the so...
TITLE: CruiseControl.Net Build Publisher - Only publish compiled files QUESTION: While setting up CruiseControl, I added a buildpublisher block to the publisher tasks: C:\MyBuild\ C:\MyBuildPublished\ false This works, but it copies the entire file contents of the build, I only want to copy the DLL's and.aspx pages, I...
[ ".net", "build-process", "cruisecontrol.net" ]
9
3
4,977
4
0
2008-08-22T17:53:24.143000
2008-08-22T18:05:24.583000
23,031
23,040
When/how frequently should I test?
As a novice developer who is getting into the rhythm of my first professional project, I'm trying to develop good habits as soon as possible. However, I've found that I often forget to test, put it off, or do a whole bunch of tests at the end of a build instead of one at a time. My question is what rhythm do you like t...
Well, if you want to follow the TDD guys, before you start to code;) I am very much in the same position as you. I want to get more into testing, but I am currently in a position where we are working to "get the code out" rather than "get the code out right" which scares the crap out of me. So I am slowly trying to int...
When/how frequently should I test? As a novice developer who is getting into the rhythm of my first professional project, I'm trying to develop good habits as soon as possible. However, I've found that I often forget to test, put it off, or do a whole bunch of tests at the end of a build instead of one at a time. My qu...
TITLE: When/how frequently should I test? QUESTION: As a novice developer who is getting into the rhythm of my first professional project, I'm trying to develop good habits as soon as possible. However, I've found that I often forget to test, put it off, or do a whole bunch of tests at the end of a build instead of on...
[ "testing" ]
4
6
801
12
0
2008-08-22T17:54:10.787000
2008-08-22T17:57:37.160000
23,064
23,067
XML Collection Best Practices
I'm creating an application that will store a hierarchical collection of items in an XML file and I'm wondering about the industry standard for storing collections in XML. Which of the following two formats is preferred? (If there is another option I'm not seeing, please advise.) Option A Option B
I'm no XML expert, but I find Option B to be more human readable, and I think it's just as machine readable as Option A. I believe that XML is designed to be both human and machine readable, so I would go for Option B myself. I just realized something else after Ryan Farley's post. If the Students or Classes section be...
XML Collection Best Practices I'm creating an application that will store a hierarchical collection of items in an XML file and I'm wondering about the industry standard for storing collections in XML. Which of the following two formats is preferred? (If there is another option I'm not seeing, please advise.) Option A ...
TITLE: XML Collection Best Practices QUESTION: I'm creating an application that will store a hierarchical collection of items in an XML file and I'm wondering about the industry standard for storing collections in XML. Which of the following two formats is preferred? (If there is another option I'm not seeing, please ...
[ "xml" ]
4
4
4,741
4
0
2008-08-22T18:07:56.917000
2008-08-22T18:09:36.507000
23,082
23,676
How Did You Decide Between WISA and LAMP?
Did you ever have to choose between WISA or LAMP at the beginning of a web project? While pros and cons are littered around the net, it would be helpful to know about your real experience in coming up w/ criteria, evaluating, deciding, and reflecting upon your decision to go w/ either platform.
I think the first part is your Application. If you decide to go PHP, you almost automatically end up with LAMP, as WIMP or WISP stacks are quite rare (I think blog.stackoverflow.com runs on WIMP), and with.net you definitely want to go WISA. So normally, it boils down to.net vs. PHP. (Ignoring Ruby, Python and all the ...
How Did You Decide Between WISA and LAMP? Did you ever have to choose between WISA or LAMP at the beginning of a web project? While pros and cons are littered around the net, it would be helpful to know about your real experience in coming up w/ criteria, evaluating, deciding, and reflecting upon your decision to go w/...
TITLE: How Did You Decide Between WISA and LAMP? QUESTION: Did you ever have to choose between WISA or LAMP at the beginning of a web project? While pros and cons are littered around the net, it would be helpful to know about your real experience in coming up w/ criteria, evaluating, deciding, and reflecting upon your...
[ "architecture", "web-applications", "lamp", "platform", "wisa" ]
11
11
9,066
13
0
2008-08-22T18:16:39.547000
2008-08-22T22:35:32.267000
23,083
23,101
What's an alternative to GWL_USERDATA for storing an object pointer?
In the Windows applications I work on, we have a custom framework that sits directly above Win32 (don't ask). When we create a window, our normal practice is to put this in the window's user data area via SetWindowLong(hwnd, GWL_USERDATA, this), which allows us to have an MFC-like callback or a tightly integrated WndPr...
SetWindowLongPtr was created to replace SetWindowLong in these instances. It's LONG_PTR parameter allows you to store a pointer for 32-bit or 64-bit compilations. LONG_PTR SetWindowLongPtr( HWND hWnd, int nIndex, LONG_PTR dwNewLong ); Remember that the constants have changed too, so usage now looks like: SetWindowLongP...
What's an alternative to GWL_USERDATA for storing an object pointer? In the Windows applications I work on, we have a custom framework that sits directly above Win32 (don't ask). When we create a window, our normal practice is to put this in the window's user data area via SetWindowLong(hwnd, GWL_USERDATA, this), which...
TITLE: What's an alternative to GWL_USERDATA for storing an object pointer? QUESTION: In the Windows applications I work on, we have a custom framework that sits directly above Win32 (don't ask). When we create a window, our normal practice is to put this in the window's user data area via SetWindowLong(hwnd, GWL_USER...
[ "windows", "winapi", "32bit-64bit" ]
31
45
22,026
2
0
2008-08-22T18:16:51.653000
2008-08-22T18:21:41.783000
23,094
24,334
What's the best way to deal with cache and the browser back button?
What's the best way to handle a user going back to a page that had cached items in an asp.net app? Is there a good way to capture the back button (event?) and handle the cache that way?
You can try using the HttpResponse.Cache property if that would help: Response.Cache.SetExpires(DateTime.Now.AddSeconds(60)); Response.Cache.SetCacheability(HttpCacheability.Public); Response.Cache.SetValidUntilExpires(false); Response.Cache.VaryByParams["Category"] = true; if (Response.Cache.VaryByParams["Category"])...
What's the best way to deal with cache and the browser back button? What's the best way to handle a user going back to a page that had cached items in an asp.net app? Is there a good way to capture the back button (event?) and handle the cache that way?
TITLE: What's the best way to deal with cache and the browser back button? QUESTION: What's the best way to handle a user going back to a page that had cached items in an asp.net app? Is there a good way to capture the back button (event?) and handle the cache that way? ANSWER: You can try using the HttpResponse.Cach...
[ "asp.net", "caching", "back-button" ]
9
7
8,214
5
0
2008-08-22T18:19:10.447000
2008-08-23T16:10:11.200000
23,102
23,206
What common web exploits should I know about?
I'm pretty green still when it comes to web programming, I've spent most of my time on client applications. So I'm curious about the common exploits I should fear/test for in my site.
OWASP keeps a list of the Top 10 web attacks to watch our for, in addition to a ton of other useful security information for web development.
What common web exploits should I know about? I'm pretty green still when it comes to web programming, I've spent most of my time on client applications. So I'm curious about the common exploits I should fear/test for in my site.
TITLE: What common web exploits should I know about? QUESTION: I'm pretty green still when it comes to web programming, I've spent most of my time on client applications. So I'm curious about the common exploits I should fear/test for in my site. ANSWER: OWASP keeps a list of the Top 10 web attacks to watch our for, ...
[ "security", "testing" ]
54
29
12,608
13
0
2008-08-22T18:22:09.207000
2008-08-22T19:03:40.027000
23,106
23,300
Best method to parse various custom XML documents in Java
What is the best method to parse multiple, discrete, custom XML documents with Java?
I would use Stax to parse XML, it's fast and easy to use. I've been using it on my last project to parse XML files up to 24MB. There's a nice introduction on java.net, which tells you everything you need to know to get started.
Best method to parse various custom XML documents in Java What is the best method to parse multiple, discrete, custom XML documents with Java?
TITLE: Best method to parse various custom XML documents in Java QUESTION: What is the best method to parse multiple, discrete, custom XML documents with Java? ANSWER: I would use Stax to parse XML, it's fast and easy to use. I've been using it on my last project to parse XML files up to 24MB. There's a nice introduc...
[ "java", "xml" ]
10
6
8,454
6
0
2008-08-22T18:22:39.860000
2008-08-22T19:45:47.540000
23,124
23,227
Need to test an ajax timeout condition
As the title mentions, I have a timeout callback handler on an ajax call, and I want to be able to test that condition but nothing is coming to mind immediately on ways I can force my application to hit that state, any suggestions?
First off, I think you need to be clearer in your question - what technology are you using and where is this process that is timing out - server-side or client-side? If you want to have the server-side code take a long time and you are using.NET, place this line in the method you call server-side: System.Threading.Thre...
Need to test an ajax timeout condition As the title mentions, I have a timeout callback handler on an ajax call, and I want to be able to test that condition but nothing is coming to mind immediately on ways I can force my application to hit that state, any suggestions?
TITLE: Need to test an ajax timeout condition QUESTION: As the title mentions, I have a timeout callback handler on an ajax call, and I want to be able to test that condition but nothing is coming to mind immediately on ways I can force my application to hit that state, any suggestions? ANSWER: First off, I think you...
[ "asp.net", "ajax", "testing" ]
1
2
1,789
3
0
2008-08-22T18:27:59.147000
2008-08-22T19:14:36.600000
23,166
23,179
What's a good beginning text on functional programming?
I like to study languages outside my comfort zone, but I've had a hard time finding a place to start for functional languages. I heard a lot of good things about Structure and Interpretations of Computer Programs, but when I tried to read through it a couple of years ago it just seemed to whiz over my head. I do way be...
The Little Schemer teaches recursion really well, and it's fun and simple to read. I also liked The Scheme Programming Language for a broader introduction into the language.
What's a good beginning text on functional programming? I like to study languages outside my comfort zone, but I've had a hard time finding a place to start for functional languages. I heard a lot of good things about Structure and Interpretations of Computer Programs, but when I tried to read through it a couple of ye...
TITLE: What's a good beginning text on functional programming? QUESTION: I like to study languages outside my comfort zone, but I've had a hard time finding a place to start for functional languages. I heard a lot of good things about Structure and Interpretations of Computer Programs, but when I tried to read through...
[ "functional-programming", "lisp", "scheme" ]
54
29
6,691
15
0
2008-08-22T18:46:09.010000
2008-08-22T18:52:28.230000
23,176
23,181
Suggestions on Ajax development environment for PHP
I am a C/C++ programmer professionally, but I've created a couple of personal web sites using PHP and MySQL. They're pretty basic, and I'd like to jazz them up using Ajax, but I've never done any Ajax. I've done all the development so far manually, i.e. no IDE or anything like that. Does anyone have suggestions on Ajax...
As T.O. says, try Aptana. There's a very good free version, and they really push the AJAX. They even have Jaxer, an "AJAX Server" that they're working on. If nothing else, the plugins are great, and, other than a few quirks, I really like working in it.
Suggestions on Ajax development environment for PHP I am a C/C++ programmer professionally, but I've created a couple of personal web sites using PHP and MySQL. They're pretty basic, and I'd like to jazz them up using Ajax, but I've never done any Ajax. I've done all the development so far manually, i.e. no IDE or anyt...
TITLE: Suggestions on Ajax development environment for PHP QUESTION: I am a C/C++ programmer professionally, but I've created a couple of personal web sites using PHP and MySQL. They're pretty basic, and I'd like to jazz them up using Ajax, but I've never done any Ajax. I've done all the development so far manually, i...
[ "php", "javascript", "ajax", "ide" ]
5
2
1,280
6
0
2008-08-22T18:50:54.660000
2008-08-22T18:54:07.353000
23,178
23,194
"All Users" Folder
Is there a.NET variable that returns the "All Users" directory?
You'll want to use the system.environment variables. Most of the predefined ones are shown here. For the " All Users " you would use: System.Environment.GetEnvironmentVariable("ALLUSERSPROFILE") I know I got a lot of upmods and a correct answer for my other stuff, but this actually works. where as the other environment...
"All Users" Folder Is there a.NET variable that returns the "All Users" directory?
TITLE: "All Users" Folder QUESTION: Is there a.NET variable that returns the "All Users" directory? ANSWER: You'll want to use the system.environment variables. Most of the predefined ones are shown here. For the " All Users " you would use: System.Environment.GetEnvironmentVariable("ALLUSERSPROFILE") I know I got a ...
[ ".net", "io" ]
1
7
1,296
3
0
2008-08-22T18:52:14.690000
2008-08-22T18:57:25.753000
23,190
25,002
How Does One Sum Dimensions of an Array Specified at Run-Time?
I am working on a function to establish the entropy of a distribution. It uses a copula, if any are familiar with that. I need to sum up the values in the array based on which dimensions are "cared about." Example: Consider the following example... Dimension 0 (across) _ _ _ _ _ _ _ _ _ _ _ _ _ |_ 0 _|_ 0 _|_ 0 _|_ 2 _...
This could have applications. Lets say you implemented a 2D Conway's Game of Life (which defines a 2D plane, 1 for 'alive', 0 for 'dead') and you stored the Games history for every iteration (which then defines a 3D cube). If you wanted to know how many bacteria there was alive over history, you would use the above alg...
How Does One Sum Dimensions of an Array Specified at Run-Time? I am working on a function to establish the entropy of a distribution. It uses a copula, if any are familiar with that. I need to sum up the values in the array based on which dimensions are "cared about." Example: Consider the following example... Dimensio...
TITLE: How Does One Sum Dimensions of an Array Specified at Run-Time? QUESTION: I am working on a function to establish the entropy of a distribution. It uses a copula, if any are familiar with that. I need to sum up the values in the array based on which dimensions are "cared about." Example: Consider the following e...
[ "c++", "c", "arrays", "microsoft-dynamics" ]
4
2
1,306
10
0
2008-08-22T18:56:04.850000
2008-08-24T12:27:40.617000
23,216
23,229
Summary of differences in regular expression syntax for various tools and languages?
I can never remember the differences in regular expression syntax used by tools like grep and AWK, or languages like Python and PHP. Generally, Perl has the most expansive syntax, but I'm often hamstrung by the limitations of even egrep ("extended" grep ). Is there a site that lists the differences in a concise and eas...
Mastering Regular Expressions, devotes the last four chapters to Java, PHP, Perl, and.NET. One chapter for each. From what I know, the pocket edition contains just those final four chapters.
Summary of differences in regular expression syntax for various tools and languages? I can never remember the differences in regular expression syntax used by tools like grep and AWK, or languages like Python and PHP. Generally, Perl has the most expansive syntax, but I'm often hamstrung by the limitations of even egre...
TITLE: Summary of differences in regular expression syntax for various tools and languages? QUESTION: I can never remember the differences in regular expression syntax used by tools like grep and AWK, or languages like Python and PHP. Generally, Perl has the most expansive syntax, but I'm often hamstrung by the limita...
[ "regex", "grep" ]
8
7
4,567
3
0
2008-08-22T19:10:51.150000
2008-08-22T19:15:44.633000
23,217
23,222
What's the purpose (if any) of "javascript:" in event handler tags?
I've been making a concerted effort to improve my javascript skills lately by reading as much javascript code as I can. In doing this I've sometimes seen the javascript: prefix appended to the front of event handler attributes in HTML element tags. What's the purpose of this prefix? Basically, is there any appreciable ...
Probably nothing in your example. My understanding is that javascript: is for anchor tags (in place of an actual href ). You'd use it so that your script can execute when the user clicks the link, but without initiating a navigation back to the page (which a blank href coupled with an onclick will do). For example: Bla...
What's the purpose (if any) of "javascript:" in event handler tags? I've been making a concerted effort to improve my javascript skills lately by reading as much javascript code as I can. In doing this I've sometimes seen the javascript: prefix appended to the front of event handler attributes in HTML element tags. Wha...
TITLE: What's the purpose (if any) of "javascript:" in event handler tags? QUESTION: I've been making a concerted effort to improve my javascript skills lately by reading as much javascript code as I can. In doing this I've sometimes seen the javascript: prefix appended to the front of event handler attributes in HTML...
[ "javascript" ]
18
19
1,830
10
0
2008-08-22T19:10:56.250000
2008-08-22T19:12:17.213000
23,228
24,143
Why is String.Format static?
Compare String.Format("Hello {0}", "World"); with "Hello {0}".Format("World"); Why did the.Net designers choose a static method over an instance method? What do you think?
I don't actually know the answer but I suspect that it has something to do with the aspect of invoking methods on string literals directly. If I recall correctly (I didn't actually verify this because I don't have an old IDE handy), early versions of the C# IDE had trouble detecting method calls against string literals...
Why is String.Format static? Compare String.Format("Hello {0}", "World"); with "Hello {0}".Format("World"); Why did the.Net designers choose a static method over an instance method? What do you think?
TITLE: Why is String.Format static? QUESTION: Compare String.Format("Hello {0}", "World"); with "Hello {0}".Format("World"); Why did the.Net designers choose a static method over an instance method? What do you think? ANSWER: I don't actually know the answer but I suspect that it has something to do with the aspect o...
[ ".net", "string" ]
41
31
5,986
22
0
2008-08-22T19:15:08.533000
2008-08-23T11:05:01.653000
23,250
23,502
When do you use the "this" keyword?
I was curious about how other people use the this keyword. I tend to use it in constructors, but I may also use it throughout the class in other methods. Some examples: In a constructor: public Light(Vector v) { this.dir = new Vector(v); } Elsewhere public void SomeMethod() { Vector vec = new Vector(); double d = (vec ...
There are several usages of this keyword in C#. To qualify members hidden by similar name To have an object pass itself as a parameter to other methods To have an object return itself from a method To declare indexers To declare extension methods To pass parameters between constructors To internally reassign value type...
When do you use the "this" keyword? I was curious about how other people use the this keyword. I tend to use it in constructors, but I may also use it throughout the class in other methods. Some examples: In a constructor: public Light(Vector v) { this.dir = new Vector(v); } Elsewhere public void SomeMethod() { Vector ...
TITLE: When do you use the "this" keyword? QUESTION: I was curious about how other people use the this keyword. I tend to use it in constructors, but I may also use it throughout the class in other methods. Some examples: In a constructor: public Light(Vector v) { this.dir = new Vector(v); } Elsewhere public void Some...
[ "c#", "coding-style", "this" ]
248
217
229,981
31
0
2008-08-22T19:21:25.227000
2008-08-22T21:12:48.937000
23,270
36,667
How IE7 determines a site's Security Zone
Does anyone know how IE7 determines what Security Zone to use for a site? I see the basics for IE6 here, but I can't find the equivalent for IE7.
I could use a little more information to narrow down my answer, but here is what I have: Internet Explorer has 5 different security zones be default: Local Machine Zone, Intranet, Internet, Trusted, and Restricted These are determined in urlmon.dll (Url Moniker) More information here: http://msdn.microsoft.com/en-us/li...
How IE7 determines a site's Security Zone Does anyone know how IE7 determines what Security Zone to use for a site? I see the basics for IE6 here, but I can't find the equivalent for IE7.
TITLE: How IE7 determines a site's Security Zone QUESTION: Does anyone know how IE7 determines what Security Zone to use for a site? I see the basics for IE6 here, but I can't find the equivalent for IE7. ANSWER: I could use a little more information to narrow down my answer, but here is what I have: Internet Explore...
[ "security", "internet-explorer-7", "security-zone" ]
4
2
1,532
4
0
2008-08-22T19:28:00.140000
2008-08-31T06:29:06.977000
23,277
23,290
What is the difference between procedural programming and functional programming?
I've read the Wikipedia articles for both procedural programming and functional programming, but I'm still slightly confused. Could someone boil it down to the core?
A functional language (ideally) allows you to write a mathematical function, i.e. a function that takes n arguments and returns a value. If the program is executed, this function is logically evaluated as needed. 1 A procedural language, on the other hand, performs a series of sequential steps. (There's a way of transf...
What is the difference between procedural programming and functional programming? I've read the Wikipedia articles for both procedural programming and functional programming, but I'm still slightly confused. Could someone boil it down to the core?
TITLE: What is the difference between procedural programming and functional programming? QUESTION: I've read the Wikipedia articles for both procedural programming and functional programming, but I'm still slightly confused. Could someone boil it down to the core? ANSWER: A functional language (ideally) allows you to...
[ "functional-programming", "glossary", "paradigms", "procedural-programming" ]
327
185
180,814
17
0
2008-08-22T19:29:45.253000
2008-08-22T19:37:53.580000
23,287
242,189
Algorithm to find Largest prime factor of a number
What is the best approach to calculating the largest prime factor of a number? I'm thinking the most efficient would be the following: Find lowest prime number that divides cleanly Check if result of division is prime If not, find next lowest Go to 2. I'm basing this assumption on it being easier to calculate the small...
Actually there are several more efficient ways to find factors of big numbers (for smaller ones trial division works reasonably well). One method which is very fast if the input number has two factors very close to its square root is known as Fermat factorisation. It makes use of the identity N = (a + b)(a - b) = a^2 -...
Algorithm to find Largest prime factor of a number What is the best approach to calculating the largest prime factor of a number? I'm thinking the most efficient would be the following: Find lowest prime number that divides cleanly Check if result of division is prime If not, find next lowest Go to 2. I'm basing this a...
TITLE: Algorithm to find Largest prime factor of a number QUESTION: What is the best approach to calculating the largest prime factor of a number? I'm thinking the most efficient would be the following: Find lowest prime number that divides cleanly Check if result of division is prime If not, find next lowest Go to 2....
[ "algorithm", "math", "prime-factoring" ]
203
147
240,765
30
0
2008-08-22T19:35:50.513000
2008-10-28T03:44:38.280000
23,288
23,292
Free ASP.Net and/or CSS Themes
Where can I get some decent looking free ASP.Net or CSS themes?
I wouldn't bother looking for ASP.NET stuff specifically (probably won't find any anyways). Finding a good CSS theme easily can be used in ASP.NET. Here's some sites that I love for CSS goodness: http://www.freecsstemplates.org/ http://www.oswd.org/ http://www.openwebdesign.org/ http://www.styleshout.com/ http://www.fr...
Free ASP.Net and/or CSS Themes Where can I get some decent looking free ASP.Net or CSS themes?
TITLE: Free ASP.Net and/or CSS Themes QUESTION: Where can I get some decent looking free ASP.Net or CSS themes? ANSWER: I wouldn't bother looking for ASP.NET stuff specifically (probably won't find any anyways). Finding a good CSS theme easily can be used in ASP.NET. Here's some sites that I love for CSS goodness: ht...
[ "css", "asp.net", "themes" ]
36
33
132,443
4
0
2008-08-22T19:36:06.033000
2008-08-22T19:39:11.143000
23,310
23,353
Source Control Beginners
What would be the best version control system to learn as a beginner to source control?
Anything but Visual Source Safe; preferably one which supports the concepts of branching and merging. As others have said, Subversion is a great choice, especially with the TortoiseSVN client. Be sure to check out (pardon the pun) Eric Sink's classic series of Source Control HOWTO articles.
Source Control Beginners What would be the best version control system to learn as a beginner to source control?
TITLE: Source Control Beginners QUESTION: What would be the best version control system to learn as a beginner to source control? ANSWER: Anything but Visual Source Safe; preferably one which supports the concepts of branching and merging. As others have said, Subversion is a great choice, especially with the Tortois...
[ "version-control" ]
6
24
2,573
16
0
2008-08-22T19:49:05.457000
2008-08-22T20:09:20.993000
23,373
23,406
Create an EXE from a SWF using Flex 3 without requiring AIR?
I have a simple little test app written in Flex 3 (MXML and some AS3). I can compile it to a SWF just fine, but I'd like to make it into an EXE so I can give it to a couple of my coworkers who might find it useful. With Flash 8, I could just target an EXE instead of a SWF and it would wrap the SWF in a projector, and e...
In your Flex SDK folders you should see a 'runtimes\player\win\FlashPlayer.exe' which is a stand alone Flash player. Open your SWF with that and you'll see a 'Create Projector...' menu item in the File menu which will create the stand-alone EXE.
Create an EXE from a SWF using Flex 3 without requiring AIR? I have a simple little test app written in Flex 3 (MXML and some AS3). I can compile it to a SWF just fine, but I'd like to make it into an EXE so I can give it to a couple of my coworkers who might find it useful. With Flash 8, I could just target an EXE ins...
TITLE: Create an EXE from a SWF using Flex 3 without requiring AIR? QUESTION: I have a simple little test app written in Flex 3 (MXML and some AS3). I can compile it to a SWF just fine, but I'd like to make it into an EXE so I can give it to a couple of my coworkers who might find it useful. With Flash 8, I could just...
[ "apache-flex", "actionscript-3", "flash" ]
9
22
14,060
3
0
2008-08-22T20:18:12.610000
2008-08-22T20:31:22.390000
23,382
23,441
Scheduled Tasks for Web Applications
What are the different approaches for creating scheduled tasks for web applications, with or without a separate web/desktop application?
If we're talking Microsoft platform, then I'd always develop a separate Windows Service to handle such batch tasks. You can always reference the same assemblies that are being used by your web application to avoid any nasty code duplication.
Scheduled Tasks for Web Applications What are the different approaches for creating scheduled tasks for web applications, with or without a separate web/desktop application?
TITLE: Scheduled Tasks for Web Applications QUESTION: What are the different approaches for creating scheduled tasks for web applications, with or without a separate web/desktop application? ANSWER: If we're talking Microsoft platform, then I'd always develop a separate Windows Service to handle such batch tasks. You...
[ "scheduled-tasks" ]
4
4
11,949
12
0
2008-08-22T20:22:47.420000
2008-08-22T20:46:18.347000
23,391
23,505
What should I learn to increase my skills?
My path to a 'fulltime'- developer stated as a analyst using VBA with Excel, Access, and then onto C#. I went to college part time once I discovered I had a passion for coding not business. I do about most of my coding in C#, but being an ASP.NET developer I also write in HTML, JavaScript, SQL etc... the usual suspects...
If you want to be one of the best you need to specialise. If you become very good in many skills then you may never become truly excellent in one. I know because I have taken this route myself and have found it difficult to get employment at times. After all, who wants someone who is capable at many languages when ther...
What should I learn to increase my skills? My path to a 'fulltime'- developer stated as a analyst using VBA with Excel, Access, and then onto C#. I went to college part time once I discovered I had a passion for coding not business. I do about most of my coding in C#, but being an ASP.NET developer I also write in HTML...
TITLE: What should I learn to increase my skills? QUESTION: My path to a 'fulltime'- developer stated as a analyst using VBA with Excel, Access, and then onto C#. I went to college part time once I discovered I had a passion for coding not business. I do about most of my coding in C#, but being an ASP.NET developer I ...
[ "c#", ".net" ]
9
6
2,367
9
0
2008-08-22T20:25:46.103000
2008-08-22T21:13:22.213000
23,399
23,432
Is it better to structure an SQL table to have a match, or return no result
I've got an interesting design question. I'm designing the security side of our project, to allow us to have different versions of the program for different costs and also to allow Manager-type users to grant or deny access to parts of the program to other users. Its going to web-based and hosted on our servers. I'm us...
If it's only going to be Allow/Deny, then a simple linking table between Users and Resources would work fine. If there is an entry keyed to the User-Resource in the linking table, allow access. UserResources ------------- UserId FK->Users ResourceId FK->Resources and the sql would be something like if exists (select 1 ...
Is it better to structure an SQL table to have a match, or return no result I've got an interesting design question. I'm designing the security side of our project, to allow us to have different versions of the program for different costs and also to allow Manager-type users to grant or deny access to parts of the prog...
TITLE: Is it better to structure an SQL table to have a match, or return no result QUESTION: I've got an interesting design question. I'm designing the security side of our project, to allow us to have different versions of the program for different costs and also to allow Manager-type users to grant or deny access to...
[ "sql", "sql-server", "optimization" ]
0
4
258
4
0
2008-08-22T20:28:38.887000
2008-08-22T20:41:25.190000
23,402
23,417
Are there any alternatives to Gigaspaces?
Anything thats as good and as stable and as feature-rich as gigaspaces?
Gigaspaces is top notch as far as a Javaspaces implementation goes for scalability and performance. Are you restricted to a Javaspaces implementation? Blitz Javaspaces is top notch for a free product.
Are there any alternatives to Gigaspaces? Anything thats as good and as stable and as feature-rich as gigaspaces?
TITLE: Are there any alternatives to Gigaspaces? QUESTION: Anything thats as good and as stable and as feature-rich as gigaspaces? ANSWER: Gigaspaces is top notch as far as a Javaspaces implementation goes for scalability and performance. Are you restricted to a Javaspaces implementation? Blitz Javaspaces is top notc...
[ "java", "jakarta-ee", "gigaspaces" ]
10
8
4,365
4
0
2008-08-22T20:30:04.017000
2008-08-22T20:35:55.970000
23,439
25,899
FLVPlayback component memory issues
My website is entirely flash based, it moves around a 3D model which was given to me as chunks of video that I've converted to FLV files. I'm using the FLVPlayback component to control the video inside of my program. While running memory checks using System.totalMemory I've noticed that whenever a video is loaded, it w...
You can't help the memory problems much until Flash adds destructors and explicit object deletion, unfortunately. See this thread: Unloading a ByteArray in Actionscript 3 There's a limit to how much memory Flash applets can use; the GC seems to fire upon reaching that limit. I've seen my memory-easy applets use as much...
FLVPlayback component memory issues My website is entirely flash based, it moves around a 3D model which was given to me as chunks of video that I've converted to FLV files. I'm using the FLVPlayback component to control the video inside of my program. While running memory checks using System.totalMemory I've noticed t...
TITLE: FLVPlayback component memory issues QUESTION: My website is entirely flash based, it moves around a 3D model which was given to me as chunks of video that I've converted to FLV files. I'm using the FLVPlayback component to control the video inside of my program. While running memory checks using System.totalMem...
[ "actionscript-3", "memory", "video", "flash" ]
1
1
2,612
5
0
2008-08-22T20:44:55.150000
2008-08-25T11:52:04.143000
23,446
23,473
How do I format Visual Studio Test results file (.trx) into a more readable format?
Have just started using Visual Studio Professional's built-in unit testing features, which as I understand, uses MS Test to run the tests. The.trx file that the tests produce is xml, but was wondering if there was an easy way to convert this file into a more "manager-friendly" format? My ultimate goal is to be able to ...
Since this file is XML you could and should use xsl to transform it to another format. The IAmUnkown - blog has an entry about decoding/transforming the trx file into html. You can also use.NetSpecExporter from Bekk to create nice reports. Their product also uses XSL, so you could probably steal it from the downloaded ...
How do I format Visual Studio Test results file (.trx) into a more readable format? Have just started using Visual Studio Professional's built-in unit testing features, which as I understand, uses MS Test to run the tests. The.trx file that the tests produce is xml, but was wondering if there was an easy way to convert...
TITLE: How do I format Visual Studio Test results file (.trx) into a more readable format? QUESTION: Have just started using Visual Studio Professional's built-in unit testing features, which as I understand, uses MS Test to run the tests. The.trx file that the tests produce is xml, but was wondering if there was an e...
[ "visual-studio-2008", "unit-testing" ]
18
9
37,770
5
0
2008-08-22T20:48:03.897000
2008-08-22T20:58:42.123000
23,448
24,167
DSLs (Domain Specific Languages) in Finance
Has anyone worked with DSLs (Domain Specific Languages) in the finance domain? I am planning to introduce some kind of DSL support in the application that I am working on and would like to share some ideas. I am in a stage of identifying which are the most stable domain elements and selecting the features which would b...
Jay Fields and Obie Fernandez have written and talked extensively on the subject. Jay Fields intro on Domain Specific Languages Jay Fields' series on Business Natural Language Obie Fernandez Expressing Contract Terms in a DSL A very good presentation on infoQ by Jay Fields You'll also find general stuff on implementing...
DSLs (Domain Specific Languages) in Finance Has anyone worked with DSLs (Domain Specific Languages) in the finance domain? I am planning to introduce some kind of DSL support in the application that I am working on and would like to share some ideas. I am in a stage of identifying which are the most stable domain eleme...
TITLE: DSLs (Domain Specific Languages) in Finance QUESTION: Has anyone worked with DSLs (Domain Specific Languages) in the finance domain? I am planning to introduce some kind of DSL support in the application that I am working on and would like to share some ideas. I am in a stage of identifying which are the most s...
[ "dsl", "finance" ]
19
9
6,111
5
0
2008-08-22T20:48:14.003000
2008-08-23T12:04:32.493000
23,472
23,533
Resources for an Oracle beginner
Can anyone recommend some good resources that highlight the differences between Oracle and the AS/400 database? I am trying to help someone with a lot of AS/400 experience implement an Oracle installation, and they need some guidance. A book or online resource would be ideal.
I've done this a fair few times and the solutions out there really depend on the environment (enterprise / mission critical or development). The BEST way would be the Oracle AS/400 Gateway. Here are some important links in that area: Allow AS/400 apps to access oracle with the Oracle Access Manager: Installation Guide ...
Resources for an Oracle beginner Can anyone recommend some good resources that highlight the differences between Oracle and the AS/400 database? I am trying to help someone with a lot of AS/400 experience implement an Oracle installation, and they need some guidance. A book or online resource would be ideal.
TITLE: Resources for an Oracle beginner QUESTION: Can anyone recommend some good resources that highlight the differences between Oracle and the AS/400 database? I am trying to help someone with a lot of AS/400 experience implement an Oracle installation, and they need some guidance. A book or online resource would be...
[ "oracle", "ibm-midrange" ]
1
2
369
3
0
2008-08-22T20:58:21.703000
2008-08-22T21:23:11.783000
23,511
5,009,525
Algorithm behind MD5Crypt
I'm working with Subversion based on Windows and would like to write an easy utility in.NET for working with the Apache password file. I understand that it uses a function referred to as MD5Crypt, but I can't seem to find a description of the algorithm beyond that at some point it uses MD5 to create a hash. Can someone...
A precise textual description of the crypt algorithm updated for use with sha256 and sha512 is at http://www.akkadia.org/drepper/SHA-crypt.txt It includes contrasts with the MD5 algorithm, so it should give you what you're looking for.
Algorithm behind MD5Crypt I'm working with Subversion based on Windows and would like to write an easy utility in.NET for working with the Apache password file. I understand that it uses a function referred to as MD5Crypt, but I can't seem to find a description of the algorithm beyond that at some point it uses MD5 to ...
TITLE: Algorithm behind MD5Crypt QUESTION: I'm working with Subversion based on Windows and would like to write an easy utility in.NET for working with the Apache password file. I understand that it uses a function referred to as MD5Crypt, but I can't seem to find a description of the algorithm beyond that at some poi...
[ ".net", "svn", "apache", "md5", "crypt" ]
3
4
4,319
4
0
2008-08-22T21:16:45.170000
2011-02-15T21:09:46.357000
23,564
23,643
What WCF best practices do you follow in object model design?
I've noticed that a handful of WCF applications choose to "break" their objects apart; that is, a project might have a DataObjects assembly that contains DataContracts/Members in addition to a meaningful class library that performs business logic. Is this an unnecessary level of abstraction? Is there any inherent evil ...
The key reason to separating internal business objects from the data contracts/message contracts is that you don't want internal changes to your app to necessarily change the service contract. If you're creating versioned web services (with more than 1 version of the implemented interfaces) then you often have a single...
What WCF best practices do you follow in object model design? I've noticed that a handful of WCF applications choose to "break" their objects apart; that is, a project might have a DataObjects assembly that contains DataContracts/Members in addition to a meaningful class library that performs business logic. Is this an...
TITLE: What WCF best practices do you follow in object model design? QUESTION: I've noticed that a handful of WCF applications choose to "break" their objects apart; that is, a project might have a DataObjects assembly that contains DataContracts/Members in addition to a meaningful class library that performs business...
[ "wcf" ]
12
17
6,012
1
0
2008-08-22T21:36:55.807000
2008-08-22T22:14:41.550000
23,566
23,571
What does 'IISReset' do?
On IIS 6, what does an IIS reset do? Please compare to recycling an app pool and stopping and starting an ASP.NET web site. If you replace a DLL or edit/replace the web.config on an ASP.NET web site is that the same as stopping and starting that web site?
IISReset stops and restarts the entire web server (including non-ASP.NET apps) Recycling an app pool will only affect applications running in that app pool. Editing the web.config in a web application only affects that web application (recycles just that app). Editing the machine.config on the machine will recycle all ...
What does 'IISReset' do? On IIS 6, what does an IIS reset do? Please compare to recycling an app pool and stopping and starting an ASP.NET web site. If you replace a DLL or edit/replace the web.config on an ASP.NET web site is that the same as stopping and starting that web site?
TITLE: What does 'IISReset' do? QUESTION: On IIS 6, what does an IIS reset do? Please compare to recycling an app pool and stopping and starting an ASP.NET web site. If you replace a DLL or edit/replace the web.config on an ASP.NET web site is that the same as stopping and starting that web site? ANSWER: IISReset sto...
[ "asp.net", "iis", "iis-7", "iis-6", "iis-8" ]
74
81
125,535
9
0
2008-08-22T21:37:35.900000
2008-08-22T21:40:26.767000
23,569
23,700
Calculating Distance Between 2 Cities
How do you calculate the distance between 2 cities?
If you need to take the curvature of the earth into account, the Great-Circle distance is what you're looking for. The Wikipedia article probably does a better job of explaining how the formula works than me, and there's also this aviation formulary page that covers that goes into more detail. The formulas are only the...
Calculating Distance Between 2 Cities How do you calculate the distance between 2 cities?
TITLE: Calculating Distance Between 2 Cities QUESTION: How do you calculate the distance between 2 cities? ANSWER: If you need to take the curvature of the earth into account, the Great-Circle distance is what you're looking for. The Wikipedia article probably does a better job of explaining how the formula works tha...
[ "algorithm", "math", "trigonometry", "geography" ]
16
33
16,542
14
0
2008-08-22T21:39:41.917000
2008-08-22T22:53:00.587000
23,614
23,669
Reporting Systems for ASP.NET
What are the best open source (open source and commercial) reporting tools for ASP.NET similar to Crystal Reports for ASP.NET?
Microsoft Reporting Services, free and included with SQL Server 2005 and 2008. Of course, this is great if you need a separation of report design and application, which for Enterprise applications is a huge plus. However, if what you want is to be able to create "in application" dashboards, where "you" design the repor...
Reporting Systems for ASP.NET What are the best open source (open source and commercial) reporting tools for ASP.NET similar to Crystal Reports for ASP.NET?
TITLE: Reporting Systems for ASP.NET QUESTION: What are the best open source (open source and commercial) reporting tools for ASP.NET similar to Crystal Reports for ASP.NET? ANSWER: Microsoft Reporting Services, free and included with SQL Server 2005 and 2008. Of course, this is great if you need a separation of repo...
[ "asp.net", "report" ]
6
8
8,874
6
0
2008-08-22T22:00:07.593000
2008-08-22T22:33:18.870000
23,640
23,692
Free or Open Source Collaboration/eLearning Software
I am looking for open source or free data collaboration software. Specifically this is for a non-profit organization that wants to teach remote students how a foreign language. The idea is that an instructor would teach a class and there would be up to 10 students in the class at a time. The instructor would be able to...
The BlindSide site also listed these other projects: ePresence OpenMeetings DimDim WebHuddle All opensource as well.
Free or Open Source Collaboration/eLearning Software I am looking for open source or free data collaboration software. Specifically this is for a non-profit organization that wants to teach remote students how a foreign language. The idea is that an instructor would teach a class and there would be up to 10 students in...
TITLE: Free or Open Source Collaboration/eLearning Software QUESTION: I am looking for open source or free data collaboration software. Specifically this is for a non-profit organization that wants to teach remote students how a foreign language. The idea is that an instructor would teach a class and there would be up...
[ "product" ]
3
3
1,260
8
0
2008-08-22T22:13:06.017000
2008-08-22T22:46:06.250000
23,689
631,134
Natural language date/time parser for .NET?
Does anyone know of a.NET date/time parser similar to Chronic for Ruby (handles stuff like "tomorrow" or "3pm next thursday")? Note: I do write Ruby (which is how I know about Chronic) but this project must use.NET.
We developed exactly what you are looking for on an internal project. We are thinking of making this public if there is sufficient need for it. Take a look at this blog for more details: http://precisionsoftwaredesign.com/blog.php. Feel free to contact me if you are interested: contact@precisionsoftware.us This library...
Natural language date/time parser for .NET? Does anyone know of a.NET date/time parser similar to Chronic for Ruby (handles stuff like "tomorrow" or "3pm next thursday")? Note: I do write Ruby (which is how I know about Chronic) but this project must use.NET.
TITLE: Natural language date/time parser for .NET? QUESTION: Does anyone know of a.NET date/time parser similar to Chronic for Ruby (handles stuff like "tomorrow" or "3pm next thursday")? Note: I do write Ruby (which is how I know about Chronic) but this project must use.NET. ANSWER: We developed exactly what you are...
[ ".net", "datetime", "nlp" ]
27
12
6,270
9
0
2008-08-22T22:45:10.790000
2009-03-10T16:36:12.697000
23,713
23,929
.NET Security Policy change by standard users?
The.NET Security Policy can be changed from a script by using CasPol.exe. Say I will be distributing an application to several users on a local network. Most of those users will be unprivileged, standard accounts, so they will not have necessary permissions for the relevant command. I think I shall be looking into doma...
The latest version of.Net 3.5 SP1 now allows you to run managed executables over a network share without using CasPol. See this post
.NET Security Policy change by standard users? The.NET Security Policy can be changed from a script by using CasPol.exe. Say I will be distributing an application to several users on a local network. Most of those users will be unprivileged, standard accounts, so they will not have necessary permissions for the relevan...
TITLE: .NET Security Policy change by standard users? QUESTION: The.NET Security Policy can be changed from a script by using CasPol.exe. Say I will be distributing an application to several users on a local network. Most of those users will be unprivileged, standard accounts, so they will not have necessary permissio...
[ ".net", "windows", "security" ]
1
1
297
1
0
2008-08-22T23:06:00.490000
2008-08-23T03:46:01.147000
23,715
23,732
Running Apache alongside another web server?
Has anyone had any success running two different web servers -- such as Apache and CherryPy -- alongside each other on the same machine? I am experimenting with other web servers right now, and I'd like to see if I can do my experiments while keeping my other sites up and running. You could say that this isn't so much ...
You can't have two processes bound to the same port on the same IP address. You can add another IP address to the box and have each server listen on one. Another option is to proxy pass one server to the other. With Apache, you could do something like: NameVirtualHost * ServerName other.site.com # assumes CherryPy lis...
Running Apache alongside another web server? Has anyone had any success running two different web servers -- such as Apache and CherryPy -- alongside each other on the same machine? I am experimenting with other web servers right now, and I'd like to see if I can do my experiments while keeping my other sites up and ru...
TITLE: Running Apache alongside another web server? QUESTION: Has anyone had any success running two different web servers -- such as Apache and CherryPy -- alongside each other on the same machine? I am experimenting with other web servers right now, and I'd like to see if I can do my experiments while keeping my oth...
[ "linux", "apache" ]
3
7
1,620
3
0
2008-08-22T23:06:43.437000
2008-08-22T23:24:25.377000
23,737
23,768
Do you have any tips to improve ReSharper and/or Visual Studio performance?
I'm using visual studio 2008 and ReSharper 4 and it's kind of slow. My machine has 2 GB of RAM, dual core processor and a 7200 rpm hard disk. I know more RAM and a faster hard disk could improve performance, but do you have any tips to improve ReSharper/Visual Studio performance?
Turn off the annoying RSS reader Tools, Options, Environment, Startup Turn off all the animations Tools, Options, Environment, Animate Environment Tools Install the recent Service Pack Clean out your WebCache AppData\Local\Microsoft\WebSiteCache
Do you have any tips to improve ReSharper and/or Visual Studio performance? I'm using visual studio 2008 and ReSharper 4 and it's kind of slow. My machine has 2 GB of RAM, dual core processor and a 7200 rpm hard disk. I know more RAM and a faster hard disk could improve performance, but do you have any tips to improve ...
TITLE: Do you have any tips to improve ReSharper and/or Visual Studio performance? QUESTION: I'm using visual studio 2008 and ReSharper 4 and it's kind of slow. My machine has 2 GB of RAM, dual core processor and a 7200 rpm hard disk. I know more RAM and a faster hard disk could improve performance, but do you have an...
[ ".net", "visual-studio", "performance", "resharper" ]
14
8
11,780
6
0
2008-08-22T23:27:21.050000
2008-08-23T00:03:13.770000
23,738
23,754
Why is Peer-to-Peer programming a hard topic to obtain good research for?
After reading a bit more about how Gnutella and other P2P networks function, I wanted to start my own peer-to-peer system. I went in thinking that I would find plenty of tutorials and language-agnostic guidelines which could be applied, however I was met with a vague simplistic overview. I could only find very small, p...
I had to write a basic Gnutella client in C# using Web Services and I think the class notes on the P2P stuff are still available here and here.
Why is Peer-to-Peer programming a hard topic to obtain good research for? After reading a bit more about how Gnutella and other P2P networks function, I wanted to start my own peer-to-peer system. I went in thinking that I would find plenty of tutorials and language-agnostic guidelines which could be applied, however I...
TITLE: Why is Peer-to-Peer programming a hard topic to obtain good research for? QUESTION: After reading a bit more about how Gnutella and other P2P networks function, I wanted to start my own peer-to-peer system. I went in thinking that I would find plenty of tutorials and language-agnostic guidelines which could be ...
[ "networking", "language-agnostic", "p2p" ]
2
1
3,432
7
0
2008-08-22T23:28:23.200000
2008-08-22T23:48:40.013000
23,755
23,769
How do you find a needle in a haystack?
When implementing a needle search of a haystack in an object-oriented way, you essentially have three alternatives: 1. needle.find(haystack) 2. haystack.find(needle) 3. searcher.find(needle, haystack) Which do you prefer, and why? I know some people prefer the second alternative because it avoids introducing a third ...
Usually actions should be applied to what you are doing the action on... in this case the haystack, so I think option 2 is the most appropriate. You also have a fourth alternative that I think would be better than alternative 3: haystack.find(needle, searcher) In this case, it allows you to provide the manner in which ...
How do you find a needle in a haystack? When implementing a needle search of a haystack in an object-oriented way, you essentially have three alternatives: 1. needle.find(haystack) 2. haystack.find(needle) 3. searcher.find(needle, haystack) Which do you prefer, and why? I know some people prefer the second alternativ...
TITLE: How do you find a needle in a haystack? QUESTION: When implementing a needle search of a haystack in an object-oriented way, you essentially have three alternatives: 1. needle.find(haystack) 2. haystack.find(needle) 3. searcher.find(needle, haystack) Which do you prefer, and why? I know some people prefer the...
[ "oop", "class-design", "program-structure" ]
76
53
13,100
29
0
2008-08-22T23:49:32.697000
2008-08-23T00:05:20.397000
23,763
27,185
Colorizing images in Java
I'm working on some code to colorize an image in Java. Basically what I'd like to do is something along the lines of GIMP's colorize command, so that if I have a BufferedImage and a Color, I can colorize the Image with the given color. Anyone got any ideas? My current best guess at doing something like this is to get t...
I have never used GIMP's colorize command. However, if your getting the RGB value of each pixel and adding RGB value to it you should really use a LookupOp. Here is some code that I wrote to apply a BufferedImageOp to a BufferedImage. Using Nicks example from above heres how I would do it. Let Y = 0.3*R + 0.59*G + 0.11...
Colorizing images in Java I'm working on some code to colorize an image in Java. Basically what I'd like to do is something along the lines of GIMP's colorize command, so that if I have a BufferedImage and a Color, I can colorize the Image with the given color. Anyone got any ideas? My current best guess at doing somet...
TITLE: Colorizing images in Java QUESTION: I'm working on some code to colorize an image in Java. Basically what I'd like to do is something along the lines of GIMP's colorize command, so that if I have a BufferedImage and a Color, I can colorize the Image with the given color. Anyone got any ideas? My current best gu...
[ "java", "colors", "bufferedimage", "colorize" ]
5
4
10,747
4
0
2008-08-22T23:57:13.863000
2008-08-26T01:02:32.793000
23,770
23,777
Effective strategy for leaving an audit trail/change history for DB applications?
What are some strategies that people have had success with for maintaining a change history for data in a fairly complex database. One of the applications that I frequently use and develop for could really benefit from a more comprehensive way of tracking how records have changed over time. For instance, right now reco...
In the past I have used triggers to construct db update/insert/delete logging. You could insert a record each time one of the above actions is done on a specific table into a logging table that keeps track of the action, what db user did it, timestamp, table it was performed on, and previous value. There is probably a ...
Effective strategy for leaving an audit trail/change history for DB applications? What are some strategies that people have had success with for maintaining a change history for data in a fairly complex database. One of the applications that I frequently use and develop for could really benefit from a more comprehensiv...
TITLE: Effective strategy for leaving an audit trail/change history for DB applications? QUESTION: What are some strategies that people have had success with for maintaining a change history for data in a fairly complex database. One of the applications that I frequently use and develop for could really benefit from a...
[ "database", "postgresql", "database-design", "crud", "audit-trail" ]
26
11
19,244
6
0
2008-08-23T00:05:58.210000
2008-08-23T00:12:10.443000
23,787
23,799
Cleanest Way to Find a Match In a List
What is the best way to find something in a list? I know LINQ has some nice tricks, but let's also get suggestions for C# 2.0. Lets get the best refactorings for this common code pattern. Currently I use code like this: // mObjList is a List MyObject match = null; foreach (MyObject mo in mObjList) { if (Criteria(mo)) {...
@ Konrad: So how do you use it? Let's say I want to match mo.ID to magicNumber. In C# 2.0 you'd write: result = mObjList.Find(delegate(int x) { return x.ID == magicNumber; }); 3.0 knows lambdas: result = mObjList.Find(x => x.ID == magicNumber);
Cleanest Way to Find a Match In a List What is the best way to find something in a list? I know LINQ has some nice tricks, but let's also get suggestions for C# 2.0. Lets get the best refactorings for this common code pattern. Currently I use code like this: // mObjList is a List MyObject match = null; foreach (MyObjec...
TITLE: Cleanest Way to Find a Match In a List QUESTION: What is the best way to find something in a list? I know LINQ has some nice tricks, but let's also get suggestions for C# 2.0. Lets get the best refactorings for this common code pattern. Currently I use code like this: // mObjList is a List MyObject match = null...
[ "c#", "refactoring" ]
12
18
27,561
4
0
2008-08-23T00:22:24.910000
2008-08-23T00:41:01.387000
23,802
24,106
How to handle including needed classes in PHP
I'm wondering what the best practice is for handling the problem with having to "include" so many files in my PHP scripts in order to ensure that all the classes I need to use are accessible to my script. Currently, I'm just using include_once to include the classes I access directly. Each of those would include_once t...
I my applications I usually have setup.php file that includes all core classes (i.e. framework and accompanying libraries). My custom classes are loaded using autoloader aided by directory layout map. Each time new class is added I run command line builder script that scans whole directory tree in search for model clas...
How to handle including needed classes in PHP I'm wondering what the best practice is for handling the problem with having to "include" so many files in my PHP scripts in order to ensure that all the classes I need to use are accessible to my script. Currently, I'm just using include_once to include the classes I acces...
TITLE: How to handle including needed classes in PHP QUESTION: I'm wondering what the best practice is for handling the problem with having to "include" so many files in my PHP scripts in order to ensure that all the classes I need to use are accessible to my script. Currently, I'm just using include_once to include t...
[ "php", "class", "include", "autoload" ]
3
6
3,089
7
0
2008-08-23T00:43:18.090000
2008-08-23T09:37:32.237000
23,836
23,857
How to create a simple install system for VB6 on XP/Vista and newer?
Heavy emphasis on simple. I've never made an installer and I'd rather not have to learn much. A system that I could hand a pile of files to and it would make some smart guesses about where to put them would be ideal. Go ahead and answer the general question. However In my cases I'm stuck with some extra constraints. Th...
InnoSetup or NSIS, whichever seems easier to you. ISTool is a nice GUI tool for InnoSetup which makes creating setup scripts even easier.
How to create a simple install system for VB6 on XP/Vista and newer? Heavy emphasis on simple. I've never made an installer and I'd rather not have to learn much. A system that I could hand a pile of files to and it would make some smart guesses about where to put them would be ideal. Go ahead and answer the general qu...
TITLE: How to create a simple install system for VB6 on XP/Vista and newer? QUESTION: Heavy emphasis on simple. I've never made an installer and I'd rather not have to learn much. A system that I could hand a pile of files to and it would make some smart guesses about where to put them would be ideal. Go ahead and ans...
[ "windows", "vb6", "installation" ]
7
11
5,438
7
0
2008-08-23T01:50:44.340000
2008-08-23T02:16:37.897000
23,853
23,879
How I hide empty Velocity variable names?
I am using Struts + Velocity in a Java application, but after I submit a form, the confirmation page (Velocity template) shows the variable names instead an empty label, like the Age in following example: Name: Fernando Age: {person.age} Sex: Male I would like to know how to hide it!
You can mark variables as " silent " like this: $!variable If $variable is null, nothing will be rendered. If it is not null, its value will render as it normally would.
How I hide empty Velocity variable names? I am using Struts + Velocity in a Java application, but after I submit a form, the confirmation page (Velocity template) shows the variable names instead an empty label, like the Age in following example: Name: Fernando Age: {person.age} Sex: Male I would like to know how to hi...
TITLE: How I hide empty Velocity variable names? QUESTION: I am using Struts + Velocity in a Java application, but after I submit a form, the confirmation page (Velocity template) shows the variable names instead an empty label, like the Age in following example: Name: Fernando Age: {person.age} Sex: Male I would like...
[ "java", "templates", "struts", "velocity" ]
46
78
17,085
2
0
2008-08-23T02:09:25.167000
2008-08-23T02:37:43.103000
23,867
24,337
Closing and Disposing a WCF Service
The Close method on an ICommunicationObject can throw two types of exceptions as MSDN outlines here. I understand why the Close method can throw those exceptions, but what I don't understand is why the Dispose method on a service proxy calls the Close method without a try around it. Isn't your Dispose method the one pl...
It seems to be a common design pattern in.NET code. Here is a citation from Framework design guidelines Consider providing method Close(), in addition to the Dispose(), if close is standard terminology in the area. When doing so, it is important that you make the Close implementation identical to Dispose... Here is a b...
Closing and Disposing a WCF Service The Close method on an ICommunicationObject can throw two types of exceptions as MSDN outlines here. I understand why the Close method can throw those exceptions, but what I don't understand is why the Dispose method on a service proxy calls the Close method without a try around it. ...
TITLE: Closing and Disposing a WCF Service QUESTION: The Close method on an ICommunicationObject can throw two types of exceptions as MSDN outlines here. I understand why the Close method can throw those exceptions, but what I don't understand is why the Dispose method on a service proxy calls the Close method without...
[ "wcf", "web-services" ]
15
10
10,018
2
0
2008-08-23T02:29:18.070000
2008-08-23T16:19:56.747000
23,899
60,404
Best practices for refactoring classic ASP?
I've got to do some significant development in a large, old, spaghetti-ridden ASP system. I've been away from ASP for a long time, focusing my energies on Rails development. One basic step I've taken is to refactor pages into subs and functions with meaningful names, so that at least it's easy to understand @ the top o...
Assumptions The documentation for the Classic ASP system is rather light. Management is not looking for a rewrite. Since you have been doing ruby on rails, your (VB/C#) ASP.NET is passable at best. My experience I too inherited a classic ASP system that was slapped together willy-nilly by ex excel-vba types. There was ...
Best practices for refactoring classic ASP? I've got to do some significant development in a large, old, spaghetti-ridden ASP system. I've been away from ASP for a long time, focusing my energies on Rails development. One basic step I've taken is to refactor pages into subs and functions with meaningful names, so that ...
TITLE: Best practices for refactoring classic ASP? QUESTION: I've got to do some significant development in a large, old, spaghetti-ridden ASP system. I've been away from ASP for a long time, focusing my energies on Rails development. One basic step I've taken is to refactor pages into subs and functions with meaningf...
[ "asp.net-mvc", "coding-style", "refactoring" ]
16
13
4,896
8
0
2008-08-23T02:56:37.833000
2008-09-13T08:13:51.920000
23,907
2,854,506
How can I graph the Lines of Code history for git repo?
Basically I want to get the number of lines-of-code in the repository after each commit. The only (really crappy) ways I have found is to use git filter-branch to run wc -l *, and a script that runs git reset --hard on each commit, then runs wc -l To make it a bit clearer, when the tool is run, it would output the line...
You might also consider gitstats, which generates this graph as an html file.
How can I graph the Lines of Code history for git repo? Basically I want to get the number of lines-of-code in the repository after each commit. The only (really crappy) ways I have found is to use git filter-branch to run wc -l *, and a script that runs git reset --hard on each commit, then runs wc -l To make it a bit...
TITLE: How can I graph the Lines of Code history for git repo? QUESTION: Basically I want to get the number of lines-of-code in the repository after each commit. The only (really crappy) ways I have found is to use git filter-branch to run wc -l *, and a script that runs git reset --hard on each commit, then runs wc -...
[ "git" ]
52
29
22,621
4
0
2008-08-23T03:00:46.277000
2010-05-18T04:09:01.977000
23,918
23,926
OpenGL Rotation
I'm trying to do a simple rotation in OpenGL but must be missing the point. I'm not looking for a specific fix so much as a quick explanation or link that explains OpenGL rotation more generally. At the moment I have code like this: glPushMatrix(); glRotatef(90.0, 0.0, 1.0, 0.0); glBegin(GL_TRIANGLES); glVertex3f( 1.0,...
Do you get a 1 unit straight line? It seems that 90deg rot. around Y is going to have you looking at the side of a triangle with no depth. You should try rotating around the Z axis instead and see if you get something that makes more sense. OpenGL has two matrices related to the display of geometry, the ModelView and t...
OpenGL Rotation I'm trying to do a simple rotation in OpenGL but must be missing the point. I'm not looking for a specific fix so much as a quick explanation or link that explains OpenGL rotation more generally. At the moment I have code like this: glPushMatrix(); glRotatef(90.0, 0.0, 1.0, 0.0); glBegin(GL_TRIANGLES); ...
TITLE: OpenGL Rotation QUESTION: I'm trying to do a simple rotation in OpenGL but must be missing the point. I'm not looking for a specific fix so much as a quick explanation or link that explains OpenGL rotation more generally. At the moment I have code like this: glPushMatrix(); glRotatef(90.0, 0.0, 1.0, 0.0); glBeg...
[ "c++", "opengl", "glut" ]
11
7
33,936
4
0
2008-08-23T03:23:44.350000
2008-08-23T03:40:29.037000
23,930
441,229
Factorial Algorithms in different languages
I want to see all the different ways you can come up with, for a factorial subroutine, or program. The hope is that anyone can come here and see if they might want to learn a new language. Ideas: Procedural Functional Object Oriented One liners Obfuscated Oddball Bad Code Polyglot Basically I want to see an example, of...
Polyglot: 5 languages, all using bignums So, I wrote a polyglot which works in the three languages I often write in, as well as one from my other answer to this question and one I just learned today. It's a standalone program, which reads a single line containing a nonnegative integer and prints a single line containin...
Factorial Algorithms in different languages I want to see all the different ways you can come up with, for a factorial subroutine, or program. The hope is that anyone can come here and see if they might want to learn a new language. Ideas: Procedural Functional Object Oriented One liners Obfuscated Oddball Bad Code Pol...
TITLE: Factorial Algorithms in different languages QUESTION: I want to see all the different ways you can come up with, for a factorial subroutine, or program. The hope is that anyone can come here and see if they might want to learn a new language. Ideas: Procedural Functional Object Oriented One liners Obfuscated Od...
[ "algorithm", "language-agnostic" ]
64
184
29,592
129
0
2008-08-23T03:46:32.750000
2009-01-13T23:02:32.120000
23,950
24,023
Best method to get objects from a BlockingQueue in a concurrent program?
What is the best method to get objects out of a BlockingQueue, in a concurrent program, without hitting a race condition? I'm currently doing the following and I'm not convinced it is the best method: BlockingQueue vQueue; /* in the constructor I pass in a BlockingQueue object full of violations that need to be process...
class Producer implements Runnable { private final BlockingQueue queue; Producer(BlockingQueue q) { queue = q; } public void run() { try { while (true) { queue.put(produce()); } } catch (InterruptedException ex) {... handle...} } Object produce() {... } } class Consumer implements Runnable { private final BlockingQueu...
Best method to get objects from a BlockingQueue in a concurrent program? What is the best method to get objects out of a BlockingQueue, in a concurrent program, without hitting a race condition? I'm currently doing the following and I'm not convinced it is the best method: BlockingQueue vQueue; /* in the constructor I ...
TITLE: Best method to get objects from a BlockingQueue in a concurrent program? QUESTION: What is the best method to get objects out of a BlockingQueue, in a concurrent program, without hitting a race condition? I'm currently doing the following and I'm not convinced it is the best method: BlockingQueue vQueue; /* in ...
[ "java", "concurrency" ]
4
6
7,955
1
0
2008-08-23T04:03:18.997000
2008-08-23T05:39:15.197000
23,961
24,097
What to do about ScanAlert?
One of my clients uses McAfee ScanAlert (i.e., HackerSafe). It basically hits the site with about 1500 bad requests a day looking for security holes. Since it demonstrates malicious behavior it is tempting to just block it after a couple bad requests, but maybe I should let it exercise the UI. Is it a true test if I do...
Isn't it a security flaw of the site to let hackers throw everything in their arsenal against the site? Well, you should focus on closing holes, rather than trying to thwart scanners (which is a futile battle). Consider running such tests yourself.
What to do about ScanAlert? One of my clients uses McAfee ScanAlert (i.e., HackerSafe). It basically hits the site with about 1500 bad requests a day looking for security holes. Since it demonstrates malicious behavior it is tempting to just block it after a couple bad requests, but maybe I should let it exercise the U...
TITLE: What to do about ScanAlert? QUESTION: One of my clients uses McAfee ScanAlert (i.e., HackerSafe). It basically hits the site with about 1500 bad requests a day looking for security holes. Since it demonstrates malicious behavior it is tempting to just block it after a couple bad requests, but maybe I should let...
[ "performance", "security" ]
3
2
468
4
0
2008-08-23T04:11:36.047000
2008-08-23T09:17:00.227000
23,962
23,975
Is there some way to speed up recursion by remembering child nodes?
For example, Look at the code that calculates the n-th Fibonacci number: fib(int n) { if(n==0 || n==1) return 1; return fib(n-1) + fib(n-2); } The problem with this code is that it will generate stack overflow error for any number greater than 15 (in most computers). Assume that we are calculating fib(10). In this proc...
Yes your insight is correct. This is called dynamic programming. It is usually a common memory runtime trade-off. In the case of fibo, you don't even need to cache everything: [edit] The author of the question seems to be looking for a general method to cache rather than a method to compute Fibonacci. Search wikipedia ...
Is there some way to speed up recursion by remembering child nodes? For example, Look at the code that calculates the n-th Fibonacci number: fib(int n) { if(n==0 || n==1) return 1; return fib(n-1) + fib(n-2); } The problem with this code is that it will generate stack overflow error for any number greater than 15 (in m...
TITLE: Is there some way to speed up recursion by remembering child nodes? QUESTION: For example, Look at the code that calculates the n-th Fibonacci number: fib(int n) { if(n==0 || n==1) return 1; return fib(n-1) + fib(n-2); } The problem with this code is that it will generate stack overflow error for any number gre...
[ "performance", "recursion" ]
18
17
7,276
18
0
2008-08-23T04:12:29.240000
2008-08-23T04:24:57.807000
23,963
23,971
RESTful web services and HTTP verbs
What is the minimum set of HTTP verbs that a server should allow for a web service to be classed as RESTful? What if my hoster doesn't permit PUT and DELETE? Is this actually important, can I live happily ever after with just GET and POST? Update: Thanks for the answers folks, Roger's answer was probably best because o...
Yes, you can live without PUT and DELETE. This article tells you why: http://www.artima.com/lejava/articles/why_put_and_delete.html While to true RESTafrians this may be heresy, in the real world you do what you can, with what you have. Be as rational as you can and as consistent with your own convention as you can, bu...
RESTful web services and HTTP verbs What is the minimum set of HTTP verbs that a server should allow for a web service to be classed as RESTful? What if my hoster doesn't permit PUT and DELETE? Is this actually important, can I live happily ever after with just GET and POST? Update: Thanks for the answers folks, Roger'...
TITLE: RESTful web services and HTTP verbs QUESTION: What is the minimum set of HTTP verbs that a server should allow for a web service to be classed as RESTful? What if my hoster doesn't permit PUT and DELETE? Is this actually important, can I live happily ever after with just GET and POST? Update: Thanks for the ans...
[ "web-services", "rest" ]
14
22
16,862
5
0
2008-08-23T04:14:17.257000
2008-08-23T04:23:10.713000
23,970
38,588
How do I marshal a lambda (Proc) in Ruby?
Joe Van Dyk asked the Ruby mailing list: Hi, In Ruby, I guess you can't marshal a lambda/proc object, right? Is that possible in lisp or other languages? What I was trying to do: l = lamda {... } Bj.submit "/path/to/ruby/program",:stdin => Marshal.dump(l) So, I'm sending BackgroundJob a lambda object, which contains th...
You cannot marshal a Lambda or Proc. This is because both of them are considered closures, which means they close around the memory on which they were defined and can reference it. (In order to marshal them you'd have to Marshal all of the memory they could access at the time they were created.) As Gaius pointed out th...
How do I marshal a lambda (Proc) in Ruby? Joe Van Dyk asked the Ruby mailing list: Hi, In Ruby, I guess you can't marshal a lambda/proc object, right? Is that possible in lisp or other languages? What I was trying to do: l = lamda {... } Bj.submit "/path/to/ruby/program",:stdin => Marshal.dump(l) So, I'm sending Backgr...
TITLE: How do I marshal a lambda (Proc) in Ruby? QUESTION: Joe Van Dyk asked the Ruby mailing list: Hi, In Ruby, I guess you can't marshal a lambda/proc object, right? Is that possible in lisp or other languages? What I was trying to do: l = lamda {... } Bj.submit "/path/to/ruby/program",:stdin => Marshal.dump(l) So, ...
[ "ruby", "serialization", "lambda", "proc-object" ]
21
21
9,295
7
0
2008-08-23T04:22:44.880000
2008-09-01T23:10:45.360000
23,988
23,997
Why is an s-box input longer than its output?
I don't understand where the extra bits are coming from in this article about s-boxes. Why doesn't the s-box take in the same number of bits for input as output?
It is the way s-boxes work. They can be m * n ==> m bit input, n bit output. For example, in the AES S-box the number of bits in input is equal to the number of bits in output. In DES, m=6 and n=4. The input is expanded from 32 to 48 bits in the first stages of DES. So it is be reduced to 32 bits again by applying one ...
Why is an s-box input longer than its output? I don't understand where the extra bits are coming from in this article about s-boxes. Why doesn't the s-box take in the same number of bits for input as output?
TITLE: Why is an s-box input longer than its output? QUESTION: I don't understand where the extra bits are coming from in this article about s-boxes. Why doesn't the s-box take in the same number of bits for input as output? ANSWER: It is the way s-boxes work. They can be m * n ==> m bit input, n bit output. For exam...
[ "cryptography" ]
2
3
1,132
2
0
2008-08-23T04:37:51.270000
2008-08-23T04:55:28.217000
23,994
24,005
Experiences Using ASP.NET MVC Framework
I am wondering what experiences people are having using the ASP.NET MVC Framework? In particular I am looking for feedback on the type of experience folks are having using the framework. What are people using for their view engine? What about the db layer, NHibernate, LINQ to SQL or something else? I know stackoverflow...
I've just been recently turned on to MVC and Linq to Sql for Asp.Net. I'm still learning both, and I'm really enjoying them both. There are quite a few screen casts on http://www.asp.net/learn/.
Experiences Using ASP.NET MVC Framework I am wondering what experiences people are having using the ASP.NET MVC Framework? In particular I am looking for feedback on the type of experience folks are having using the framework. What are people using for their view engine? What about the db layer, NHibernate, LINQ to SQL...
TITLE: Experiences Using ASP.NET MVC Framework QUESTION: I am wondering what experiences people are having using the ASP.NET MVC Framework? In particular I am looking for feedback on the type of experience folks are having using the framework. What are people using for their view engine? What about the db layer, NHibe...
[ ".net", "asp.net", "asp.net-mvc" ]
4
0
714
6
0
2008-08-23T04:51:32.597000
2008-08-23T05:07:21.997000
23,996
26,243
Setting Attributes in Webby Layouts
I'm working with Webby and am looking for some clarification. Can I define attributes like title or author in my layout?
Not really. The layout has access to the page attributes rather than the other way. The easiest way to do what you want is to populate the SITE.page_defaults hash in your site's Rakefile (probably build.rake). Add something like the following: SITE.page_defaults['title'] = "My awesome title" SITE.page_defaults['author'...
Setting Attributes in Webby Layouts I'm working with Webby and am looking for some clarification. Can I define attributes like title or author in my layout?
TITLE: Setting Attributes in Webby Layouts QUESTION: I'm working with Webby and am looking for some clarification. Can I define attributes like title or author in my layout? ANSWER: Not really. The layout has access to the page attributes rather than the other way. The easiest way to do what you want is to populate t...
[ "ruby", "webby" ]
2
1
376
2
0
2008-08-23T04:53:47.863000
2008-08-25T15:25:59.247000
24,041
24,044
Markdown vs markup - are they related?
I'm using markdown to edit this question right now. In some wikis I used wiki markup. Are they the same thing? Are they related? Please explain. If I want to implement one or the other in a web project (like stackoverflow) what do I need to use?
Markup is a generic term for a language that describes a document's formatting Markdown is a specific markup library: http://daringfireball.net/projects/markdown/ These days the term is more commonly used to refer to markup languages that mimic the style of the library. See: https://en.wikipedia.org/wiki/Markdown
Markdown vs markup - are they related? I'm using markdown to edit this question right now. In some wikis I used wiki markup. Are they the same thing? Are they related? Please explain. If I want to implement one or the other in a web project (like stackoverflow) what do I need to use?
TITLE: Markdown vs markup - are they related? QUESTION: I'm using markdown to edit this question right now. In some wikis I used wiki markup. Are they the same thing? Are they related? Please explain. If I want to implement one or the other in a web project (like stackoverflow) what do I need to use? ANSWER: Markup i...
[ "markdown", "markup", "glossary" ]
285
313
121,243
6
0
2008-08-23T06:34:09.493000
2008-08-23T06:40:08.683000
24,045
24,062
AnkhSVN versus VisualSVN
I currently use AnkhSVN to integrate subversion into Visual Studio. Is there any reason I should switch to VisualSVN? AnkhSVN is free (in more than one sense of the word) while VisualSVN costs $50. So right there unless I'm missing some great feature of VisualSVN I don't see any reason to switch.
I used VisualSVN until Ankh hit 2.0, and ever since, I've abandoned VisualSVN. Ankh has surpassed VisualSVN in functionality, in my mind, and all the 1.x perf and integration issues are gone.
AnkhSVN versus VisualSVN I currently use AnkhSVN to integrate subversion into Visual Studio. Is there any reason I should switch to VisualSVN? AnkhSVN is free (in more than one sense of the word) while VisualSVN costs $50. So right there unless I'm missing some great feature of VisualSVN I don't see any reason to switc...
TITLE: AnkhSVN versus VisualSVN QUESTION: I currently use AnkhSVN to integrate subversion into Visual Studio. Is there any reason I should switch to VisualSVN? AnkhSVN is free (in more than one sense of the word) while VisualSVN costs $50. So right there unless I'm missing some great feature of VisualSVN I don't see a...
[ "visual-studio", "svn", "version-control", "visualsvn", "ankhsvn" ]
59
48
27,608
4
0
2008-08-23T06:42:01.067000
2008-08-23T07:44:29.870000
24,099
24,140
Best way to license Microsoft software as an independent developer
I've recently switched from being an employee of a small consulting company to being an independent consultant and as time goes on I will need to upgrade Windows and Visual Studio. So what is the most affordable way to go about this for a small time developer? My previous boss suggested I get a TechNet Plus subscriptio...
I recommend that if VS Express is not good enough, use Professional. Standard is missing some really useful features, like a Remote Debugger. Here is a detailed comparison: http://msdn.microsoft.com/en-us/vs2008/products/cc149003.aspx I'd say cancel TechNet and get one of the bottom two MSDN Subscriptions, Visual Studi...
Best way to license Microsoft software as an independent developer I've recently switched from being an employee of a small consulting company to being an independent consultant and as time goes on I will need to upgrade Windows and Visual Studio. So what is the most affordable way to go about this for a small time dev...
TITLE: Best way to license Microsoft software as an independent developer QUESTION: I've recently switched from being an employee of a small consulting company to being an independent consultant and as time goes on I will need to upgrade Windows and Visual Studio. So what is the most affordable way to go about this fo...
[ "windows", "visual-studio", "licensing" ]
16
5
4,876
5
0
2008-08-23T09:19:54.883000
2008-08-23T11:02:29.800000
24,109
24,119
C++ IDE for Linux?
I want to expand my programming horizons to Linux. A good, dependable basic toolset is important, and what is more basic than an IDE? I could find these SO topics: Lightweight IDE for linux and What tools do you use to develop C++ applications on Linux? I'm not looking for a lightweight IDE. If an IDE is worth the mone...
Initially: confusion When originally writing this answer, I had recently made the switch from Visual Studio (with years of experience) to Linux and the first thing I did was try to find a reasonable IDE. At the time this was impossible: no good IDE existed. Epiphany: UNIX is an IDE. All of it. 1 And then I realised tha...
C++ IDE for Linux? I want to expand my programming horizons to Linux. A good, dependable basic toolset is important, and what is more basic than an IDE? I could find these SO topics: Lightweight IDE for linux and What tools do you use to develop C++ applications on Linux? I'm not looking for a lightweight IDE. If an ID...
TITLE: C++ IDE for Linux? QUESTION: I want to expand my programming horizons to Linux. A good, dependable basic toolset is important, and what is more basic than an IDE? I could find these SO topics: Lightweight IDE for linux and What tools do you use to develop C++ applications on Linux? I'm not looking for a lightwe...
[ "c++", "linux", "ide" ]
209
258
1,031,427
45
0
2008-08-23T09:52:59.517000
2008-08-23T10:06:09.157000
24,130
24,134
Classes vs 2D arrays
Which is better to use in PHP, a 2D array or a class? I've included an example of what I mean by this. // Using a class class someClass { public $name; public $height; public $weight; function __construct($name, $height, $weight) { $this -> name = $name; $this -> height = $height; $this -> weight = $weight; } } $clas...
The "class" that you've constructed above is what most people would use a struct for in other languages. I'm not sure what the performance implications are in PHP, though I suspect instantiating the objects is probably more costly here, if only by a little bit. That being said, if the cost is relatively low, it IS a bi...
Classes vs 2D arrays Which is better to use in PHP, a 2D array or a class? I've included an example of what I mean by this. // Using a class class someClass { public $name; public $height; public $weight; function __construct($name, $height, $weight) { $this -> name = $name; $this -> height = $height; $this -> weight ...
TITLE: Classes vs 2D arrays QUESTION: Which is better to use in PHP, a 2D array or a class? I've included an example of what I mean by this. // Using a class class someClass { public $name; public $height; public $weight; function __construct($name, $height, $weight) { $this -> name = $name; $this -> height = $height...
[ "php", "arrays", "class" ]
6
9
1,887
9
0
2008-08-23T10:41:36.340000
2008-08-23T10:52:51.727000
24,179
36,398
How does Hive compare to HBase?
I'm interested in finding out how the recently-released Hive compares to HBase in terms of performance. The SQL-like interface used by Hive is very much preferable to the HBase API we have implemented.
It's hard to find much about Hive, but I found this snippet on the Hive site that leans heavily in favor of HBase (bold added): Hive is based on Hadoop which is a batch processing system. Accordingly, this system does not and cannot promise low latencies on queries. The paradigm here is strictly of submitting jobs and ...
How does Hive compare to HBase? I'm interested in finding out how the recently-released Hive compares to HBase in terms of performance. The SQL-like interface used by Hive is very much preferable to the HBase API we have implemented.
TITLE: How does Hive compare to HBase? QUESTION: I'm interested in finding out how the recently-released Hive compares to HBase in terms of performance. The SQL-like interface used by Hive is very much preferable to the HBase API we have implemented. ANSWER: It's hard to find much about Hive, but I found this snippet...
[ "hadoop", "hbase", "hive" ]
57
51
44,500
7
0
2008-08-23T12:22:04.993000
2008-08-30T22:16:14.213000
24,193
24,248
Python code generator for Visual Studio?
I had an idea, if I add a python.py file to my C# project, and tag the file with a custom generator that would execute the python file, and treat the output as the result of the code generation, ie. put it into a C# file, that would allow me to do quite a lot of code generation as part of the build process. Does anyone...
OK, I see. Well, as far as I know there isn't any code generator for Python. There is a good introduction on how to roll your own here. Actually, that's quite an under-used part of the environment, I suppose it's so because it needs you to use the IDE to compile the project, as it'd seem only the IDE knows about these ...
Python code generator for Visual Studio? I had an idea, if I add a python.py file to my C# project, and tag the file with a custom generator that would execute the python file, and treat the output as the result of the code generation, ie. put it into a C# file, that would allow me to do quite a lot of code generation ...
TITLE: Python code generator for Visual Studio? QUESTION: I had an idea, if I add a python.py file to my C# project, and tag the file with a custom generator that would execute the python file, and treat the output as the result of the code generation, ie. put it into a C# file, that would allow me to do quite a lot o...
[ "python", "visual-studio-2008", "code-generation" ]
5
2
2,055
5
0
2008-08-23T12:41:43.433000
2008-08-23T14:07:27.080000
24,196
24,223
Simple Frameworks for Displaying Bitmaps and Handling Button Presses
We have a set of applications that basically display a bunch of bitmaps and text, then allow user to press "buttons" (certain bitmaps) that cause actions to occur. We currently have these implemented using DirectX and a bunch of code to place the bitmaps and handle the button-presses. But we'd like to have the followin...
Maybe the way to go is something like Clutter or Allegro. If you check in this article at ArsTechnica what they are using Clutter for, you might get an idea how to use it. I don't know for sure if it works on Windows, but I'm pretty sure it does, considering it only depends on libraries that are supported under Windows...
Simple Frameworks for Displaying Bitmaps and Handling Button Presses We have a set of applications that basically display a bunch of bitmaps and text, then allow user to press "buttons" (certain bitmaps) that cause actions to occur. We currently have these implemented using DirectX and a bunch of code to place the bitm...
TITLE: Simple Frameworks for Displaying Bitmaps and Handling Button Presses QUESTION: We have a set of applications that basically display a bunch of bitmaps and text, then allow user to press "buttons" (certain bitmaps) that cause actions to occur. We currently have these implemented using DirectX and a bunch of code...
[ "c++", "user-interface", "graphics", "bitmap" ]
0
1
378
3
0
2008-08-23T12:47:55.587000
2008-08-23T13:24:48.540000
24,207
71,401
“rusage” statistics
I'm trying to use “rusage” statistics in my program to get data similar to that of the time tool. However, I'm pretty sure that I'm doing something wrong. The values seem about right but can be a bit weird at times. I didn't find good resources online. Does somebody know how to do it better? Sorry for the long code. cl...
What is the purpose of: while (usec >= 1000) usec /= 10; I gather that you want the most significant three digits of the usec; in that case, the most straightforward way I can think of is to divide usec by 1000, and be done with that. Test cases: 999999 ⇒ 999 99999 ⇒ 999 (should be 099) 9999 ⇒ 999 (should be 009) 999 ⇒...
“rusage” statistics I'm trying to use “rusage” statistics in my program to get data similar to that of the time tool. However, I'm pretty sure that I'm doing something wrong. The values seem about right but can be a bit weird at times. I didn't find good resources online. Does somebody know how to do it better? Sorry f...
TITLE: “rusage” statistics QUESTION: I'm trying to use “rusage” statistics in my program to get data similar to that of the time tool. However, I'm pretty sure that I'm doing something wrong. The values seem about right but can be a bit weird at times. I didn't find good resources online. Does somebody know how to do ...
[ "c++", "unix", "time", "profiling" ]
1
3
2,846
2
0
2008-08-23T12:57:16.483000
2008-09-16T11:32:17.767000
24,212
30,029
Use QItemDelegate to show image thumbnails
What's the best way to use QT4's QItemDelegate to show thumbnails for images in a view? Specifically, how do you stop the item delegate from blocking when generating pixmaps from very large image files (> 500MB)? Can anyone link to some example code that achieves this? Then again, perhaps this isn't the place to look f...
You're doing it wrong if you are generating pixmaps inside any of the delegate methods (paint, draw...). Try to generate the thumbnails only once (on worker thread or maybe not even at runtime, if possible) and have the delegate just display them for the appropriate role. If you do it at runtime display a default pictu...
Use QItemDelegate to show image thumbnails What's the best way to use QT4's QItemDelegate to show thumbnails for images in a view? Specifically, how do you stop the item delegate from blocking when generating pixmaps from very large image files (> 500MB)? Can anyone link to some example code that achieves this? Then ag...
TITLE: Use QItemDelegate to show image thumbnails QUESTION: What's the best way to use QT4's QItemDelegate to show thumbnails for images in a view? Specifically, how do you stop the item delegate from blocking when generating pixmaps from very large image files (> 500MB)? Can anyone link to some example code that achi...
[ "c++", "qt", "image", "thumbnails", "qitemdelegate" ]
3
4
2,136
1
0
2008-08-23T13:07:19.517000
2008-08-27T13:06:36.647000
24,221
24,231
Java Annotations
What is the purpose of annotations in Java? I have this fuzzy idea of them as somewhere in between a comment and actual code. Do they affect the program at run time? What are their typical usages? Are they unique to Java? Is there a C++ equivalent?
Annotations are primarily used by code that is inspecting other code. They are often used for modifying (i.e. decorating or wrapping) existing classes at run-time to change their behavior. Frameworks such as JUnit and Hibernate use annotations to minimize the amount of code you need to write yourself to use the framewo...
Java Annotations What is the purpose of annotations in Java? I have this fuzzy idea of them as somewhere in between a comment and actual code. Do they affect the program at run time? What are their typical usages? Are they unique to Java? Is there a C++ equivalent?
TITLE: Java Annotations QUESTION: What is the purpose of annotations in Java? I have this fuzzy idea of them as somewhere in between a comment and actual code. Do they affect the program at run time? What are their typical usages? Are they unique to Java? Is there a C++ equivalent? ANSWER: Annotations are primarily u...
[ "java", "annotations", "glossary" ]
122
88
36,437
9
0
2008-08-23T13:23:14.957000
2008-08-23T13:38:25.760000
24,241
24,254
Code Injection With C#
Can you use windows hooks or other methods to do code injection with c#? I've seen lots of things about code injection but all of them are done in C/C++. I don't know either of those languages and have a really hard time translating. Does anyone have any ideas on how to do this?
Kevin, it is possible. You can create library with window hook proc using managed C++. All you need to do is to inject this hook into some application using standard WinAPI (SetWindowsHookEx etc.). Inside this hook you can call System::AppDomain::CurrentDomain->Load method to load your assembly into target application'...
Code Injection With C# Can you use windows hooks or other methods to do code injection with c#? I've seen lots of things about code injection but all of them are done in C/C++. I don't know either of those languages and have a really hard time translating. Does anyone have any ideas on how to do this?
TITLE: Code Injection With C# QUESTION: Can you use windows hooks or other methods to do code injection with c#? I've seen lots of things about code injection but all of them are done in C/C++. I don't know either of those languages and have a really hard time translating. Does anyone have any ideas on how to do this?...
[ "c#", "code-injection" ]
13
6
43,468
4
0
2008-08-23T13:57:06.263000
2008-08-23T14:23:52.330000
24,243
24,244
Select existing data from database to create test data
I have a SqlServer database that I've manually filled with some test data. Now I'd like to extract this test data as insert statements and check it in to source control. The idea is that other team members should be able to create the same database, run the created insert scripts and have the same data to test and deve...
EMS DB Extract for SQL Server ( http://www.sqlmanager.net/en/products/mssql/extract ) seems to do what you want, and it seems to be free. Hope this helps, Robin
Select existing data from database to create test data I have a SqlServer database that I've manually filled with some test data. Now I'd like to extract this test data as insert statements and check it in to source control. The idea is that other team members should be able to create the same database, run the created...
TITLE: Select existing data from database to create test data QUESTION: I have a SqlServer database that I've manually filled with some test data. Now I'd like to extract this test data as insert statements and check it in to source control. The idea is that other team members should be able to create the same databas...
[ "sql-server", "database" ]
3
1
892
4
0
2008-08-23T14:01:32.413000
2008-08-23T14:04:05.917000
24,262
24,274
About File permissions in C#
While creating a file synchronization program in C# I tried to make a method copy in LocalFileItem class that uses System.IO.File.Copy(destination.Path, Path, true) method where Path is a string. After executing this code with destination. Path = "C:\\Test2" and this.Path = "C:\\Test\\F1.txt" I get an exception saying ...
It seems you have misplaced the parameters in File.Copy(), it should be File.Copy(string source, string destination). Also is "C:\Test2" a directory? You can't copy file to a directory. Use something like that instead: File.Copy( sourceFile, Path.Combine(destinationDir,Path.GetFileName(sourceFile)) );
About File permissions in C# While creating a file synchronization program in C# I tried to make a method copy in LocalFileItem class that uses System.IO.File.Copy(destination.Path, Path, true) method where Path is a string. After executing this code with destination. Path = "C:\\Test2" and this.Path = "C:\\Test\\F1.tx...
TITLE: About File permissions in C# QUESTION: While creating a file synchronization program in C# I tried to make a method copy in LocalFileItem class that uses System.IO.File.Copy(destination.Path, Path, true) method where Path is a string. After executing this code with destination. Path = "C:\\Test2" and this.Path ...
[ "c#", "file", "copy" ]
7
4
4,539
3
0
2008-08-23T14:31:21.780000
2008-08-23T14:47:54.207000
24,270
25,061
What's the point of OOP?
As far as I can tell, in spite of the countless millions or billions spent on OOP education, languages, and tools, OOP has not improved developer productivity or software reliability, nor has it reduced development costs. Few people use OOP in any rigorous sense (few people adhere to or understand principles such as LS...
There's no empirical evidence that suggests that object orientation is a more natural way for people to think about the world. There's some work in the field of psychology of programming that shows that OO is not somehow more fitting than other approaches. Object-oriented representations do not appear to be universally...
What's the point of OOP? As far as I can tell, in spite of the countless millions or billions spent on OOP education, languages, and tools, OOP has not improved developer productivity or software reliability, nor has it reduced development costs. Few people use OOP in any rigorous sense (few people adhere to or underst...
TITLE: What's the point of OOP? QUESTION: As far as I can tell, in spite of the countless millions or billions spent on OOP education, languages, and tools, OOP has not improved developer productivity or software reliability, nor has it reduced development costs. Few people use OOP in any rigorous sense (few people ad...
[ "language-agnostic", "oop" ]
126
24
31,089
45
0
2008-08-23T14:40:28.687000
2008-08-24T14:03:42.790000
24,279
24,294
Functional programming and non-functional programming
In my second year of University we were "taught" Haskell, I know almost nothing about it and even less about functional programming. What is functional programming, why and/xor where would I want to use it instead of non-functional programming and am I correct in thinking that C is a non-functional programming language...
One key feature in a functional language is the concept of first-class functions. The idea is that you can pass functions as parameters to other functions and return them as values. Functional programming involves writing code that does not change state. The primary reason for doing so is so that successive calls to a ...
Functional programming and non-functional programming In my second year of University we were "taught" Haskell, I know almost nothing about it and even less about functional programming. What is functional programming, why and/xor where would I want to use it instead of non-functional programming and am I correct in th...
TITLE: Functional programming and non-functional programming QUESTION: In my second year of University we were "taught" Haskell, I know almost nothing about it and even less about functional programming. What is functional programming, why and/xor where would I want to use it instead of non-functional programming and ...
[ "functional-programming", "paradigms", "glossary" ]
74
94
34,309
8
0
2008-08-23T14:58:11.623000
2008-08-23T15:19:17.390000
24,298
741,170
Best Solution For Authentication in Ruby on Rails
I'm looking for a pre-built solution I can use in my RoR application. I'm ideally looking for something similar to the ASP.NET Forms authentication that provides email validation, sign-up controls, and allows users to reset their passwords. Oh yeah, and easily allows me to pull the user that is currently logged into th...
AuthLogic appears to be the new kid on the block and seems to be the next evolution of restful_authentication, easier to use, etc http://github.com/binarylogic/authlogic/tree/master Edit: now that Rails 3 is out, Devise seems to be the new, new kid on the block https://github.com/plataformatec/devise or I have been rol...
Best Solution For Authentication in Ruby on Rails I'm looking for a pre-built solution I can use in my RoR application. I'm ideally looking for something similar to the ASP.NET Forms authentication that provides email validation, sign-up controls, and allows users to reset their passwords. Oh yeah, and easily allows me...
TITLE: Best Solution For Authentication in Ruby on Rails QUESTION: I'm looking for a pre-built solution I can use in my RoR application. I'm ideally looking for something similar to the ASP.NET Forms authentication that provides email validation, sign-up controls, and allows users to reset their passwords. Oh yeah, an...
[ "ruby-on-rails", "ruby", "authentication" ]
84
84
56,537
12
0
2008-08-23T15:27:11.647000
2009-04-12T02:08:57.777000
24,310
844,821
Programming a simple IRC (Internet-Relay-Chat) Client
I started using IRC at a young age, and I have always been fascinated with it. As a language exercise, I was thinking about programming a simple IRC client in Ruby with Shoes as a graphical front-end. My question to you, kind-sirs, what do I need to become familiar with to start on this great adventure (besides shoes a...
An earlier post mentioned RFC1459. While it is a very good introduction to IRC, it has actually been superseded by RFCs 2810-2813. Here is a more complete list of documentation you need to program anything IRC-related: RFC1459 (original RFC; superseded, but still useful) RFC2810 (IRC architecture) RFC2811 (IRC channel ...
Programming a simple IRC (Internet-Relay-Chat) Client I started using IRC at a young age, and I have always been fascinated with it. As a language exercise, I was thinking about programming a simple IRC client in Ruby with Shoes as a graphical front-end. My question to you, kind-sirs, what do I need to become familiar ...
TITLE: Programming a simple IRC (Internet-Relay-Chat) Client QUESTION: I started using IRC at a young age, and I have always been fascinated with it. As a language exercise, I was thinking about programming a simple IRC client in Ruby with Shoes as a graphical front-end. My question to you, kind-sirs, what do I need t...
[ "ruby", "shoes", "irc" ]
11
31
13,187
5
0
2008-08-23T15:49:06.960000
2009-05-10T06:22:26.690000
24,408
24,841
Database query representation impersonating file on Windows share?
Is there any way to have something that looks just like a file on a Windows file share, but is really a resource served up over HTTP? For context, I'm working with an old app that can only deal with files on a Windows file share, I want to create a simple HTTP-based service to serve the content of the files dynamically...
WebDAV (basically) takes an existing directory, and shares it over HTTP - which sounds like the opposite of what you want. You need something that speaks SMB/CIFS on one end, and your own code on the other. The easiest way to do that is with a userspace file system. To that end, here's a couple of links: WinFUSE, which...
Database query representation impersonating file on Windows share? Is there any way to have something that looks just like a file on a Windows file share, but is really a resource served up over HTTP? For context, I'm working with an old app that can only deal with files on a Windows file share, I want to create a simp...
TITLE: Database query representation impersonating file on Windows share? QUESTION: Is there any way to have something that looks just like a file on a Windows file share, but is really a resource served up over HTTP? For context, I'm working with an old app that can only deal with files on a Windows file share, I wan...
[ "file", "http", "webdav" ]
3
2
350
3
0
2008-08-23T17:24:48.760000
2008-08-24T04:31:02.900000
24,414
25,826
Can I capture Windows Mobile PIE keyboard events?
Anyone know of a way to capture keyboard events (keyup / keydown) in Portable IE under Window mobile? I noticed that key events are not supported in JS, and would like to come up with a solution that works without any client side additions.
Without any client side additions? As per IEMobile Team Blog, the only way for that would be wait for the next release:(
Can I capture Windows Mobile PIE keyboard events? Anyone know of a way to capture keyboard events (keyup / keydown) in Portable IE under Window mobile? I noticed that key events are not supported in JS, and would like to come up with a solution that works without any client side additions.
TITLE: Can I capture Windows Mobile PIE keyboard events? QUESTION: Anyone know of a way to capture keyboard events (keyup / keydown) in Portable IE under Window mobile? I noticed that key events are not supported in JS, and would like to come up with a solution that works without any client side additions. ANSWER: Wi...
[ "internet-explorer", "windows-mobile", "key-events" ]
1
1
858
1
0
2008-08-23T17:30:23.020000
2008-08-25T09:46:43.663000
24,439
24,687
IE 7+ Favorites
Is it possible to develop a plug-in for Internet Explorer that can replace the existing favorites functionality?
Absolutely, however, it does depend somewhat on what you expect "replacing" to mean. You can develop an extension to provide a new set of menus or dropdown toolbar of some kind like the Google Bookmarks toolbar for example, or like the Delicious toolbar & sidebar. These IMO are much better designs for managing bookmark...
IE 7+ Favorites Is it possible to develop a plug-in for Internet Explorer that can replace the existing favorites functionality?
TITLE: IE 7+ Favorites QUESTION: Is it possible to develop a plug-in for Internet Explorer that can replace the existing favorites functionality? ANSWER: Absolutely, however, it does depend somewhat on what you expect "replacing" to mean. You can develop an extension to provide a new set of menus or dropdown toolbar ...
[ "internet-explorer", "bookmarks", "favorites" ]
3
5
220
1
0
2008-08-23T17:54:12.260000
2008-08-23T22:59:47.003000
24,451
24,476
Are there any legitimate use-cases for "goto" in a language that supports loops and functions?
I've long been under the impression that goto should never be used if possible. However, while perusing libavcodec (which is written in C) the other day, I was surprised to notice multiple uses of it. Is it ever advantageous to use goto in a language that supports loops and functions? If so, why? Please provide a concr...
There are a few reasons for using the "goto" statement that I'm aware of (some have spoken to this already): Cleanly exiting a function Often in a function, you may allocate resources and need to exit in multiple places. Programmers can simplify their code by putting the resource cleanup code at the end of the function...
Are there any legitimate use-cases for "goto" in a language that supports loops and functions? I've long been under the impression that goto should never be used if possible. However, while perusing libavcodec (which is written in C) the other day, I was surprised to notice multiple uses of it. Is it ever advantageous ...
TITLE: Are there any legitimate use-cases for "goto" in a language that supports loops and functions? QUESTION: I've long been under the impression that goto should never be used if possible. However, while perusing libavcodec (which is written in C) the other day, I was surprised to notice multiple uses of it. Is it ...
[ "language-agnostic", "goto" ]
226
282
58,928
25
0
2008-08-23T18:18:04.933000
2008-08-23T18:42:33.003000
24,456
24,517
Embedding IPTC image data with PHP GD
I'm trying to embed a IPTC data onto a JPEG image using iptcembed() but am having a bit of trouble. I have verified it is in the end product: // Embed the IPTC data $content = iptcembed($data, $path); // Verify IPTC data is in the end image $iptc = iptcparse($content); var_dump($iptc); Which returns the tags entered. ...
getimagesize has an optional second parameter Imageinfo which contains the info you need. From the manual: This optional parameter allows you to extract some extended information from the image file. Currently, this will return the different JPG APP markers as an associative array. Some programs use these APP markers t...
Embedding IPTC image data with PHP GD I'm trying to embed a IPTC data onto a JPEG image using iptcembed() but am having a bit of trouble. I have verified it is in the end product: // Embed the IPTC data $content = iptcembed($data, $path); // Verify IPTC data is in the end image $iptc = iptcparse($content); var_dump($i...
TITLE: Embedding IPTC image data with PHP GD QUESTION: I'm trying to embed a IPTC data onto a JPEG image using iptcembed() but am having a bit of trouble. I have verified it is in the end product: // Embed the IPTC data $content = iptcembed($data, $path); // Verify IPTC data is in the end image $iptc = iptcparse($con...
[ "php", "gd", "iptc" ]
2
3
3,086
1
0
2008-08-23T18:24:21.643000
2008-08-23T19:19:46.767000
24,467
26,282
(N)Hibernate Auto-Join
I'm developing a web- application using NHibernate. Can you tell me how to write a NHibernate Query for the following SQL query: SELECT v1.Id FROM VIEW v1 LEFT JOIN VIEW v2 ON v1.SourceView = v2.Id ORDER BY v1.Position It's basically a auto-join but I don't know how to write this in Nhibernate. Lets say the property na...
You could just perform the select on the original entity and make the association between the two objects "lazy = false". As long as the entities are mapped then both will be returned and you wont get a lazyloadingexception when trying to access the object. If you don't want to map "lazy=false" then you can also iterat...
(N)Hibernate Auto-Join I'm developing a web- application using NHibernate. Can you tell me how to write a NHibernate Query for the following SQL query: SELECT v1.Id FROM VIEW v1 LEFT JOIN VIEW v2 ON v1.SourceView = v2.Id ORDER BY v1.Position It's basically a auto-join but I don't know how to write this in Nhibernate. L...
TITLE: (N)Hibernate Auto-Join QUESTION: I'm developing a web- application using NHibernate. Can you tell me how to write a NHibernate Query for the following SQL query: SELECT v1.Id FROM VIEW v1 LEFT JOIN VIEW v2 ON v1.SourceView = v2.Id ORDER BY v1.Position It's basically a auto-join but I don't know how to write thi...
[ "sql", "nhibernate", "orm" ]
1
1
674
1
0
2008-08-23T18:31:02.187000
2008-08-25T15:45:33.647000
24,468
24,477
Running "partially trusted" .NET assemblies from a network share
When I try to run a.NET assembly ( boo.exe ) from a network share (mapped to a drive), it fails since it's only partially trusted: Unhandled Exception: System.Security.SecurityException: That assembly does not allow partially trusted callers. at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly a...
With.NET 3.5 SP1,.NET assemblies running from UNC shares have full permissions. See Brad Abrams's Allow.exes to be run off a network shares for workaround and discussions, and finally the follow up.NET 3.5 SP1 allows managed code to be launched from a network share.
Running "partially trusted" .NET assemblies from a network share When I try to run a.NET assembly ( boo.exe ) from a network share (mapped to a drive), it fails since it's only partially trusted: Unhandled Exception: System.Security.SecurityException: That assembly does not allow partially trusted callers. at System.Se...
TITLE: Running "partially trusted" .NET assemblies from a network share QUESTION: When I try to run a.NET assembly ( boo.exe ) from a network share (mapped to a drive), it fails since it's only partially trusted: Unhandled Exception: System.Security.SecurityException: That assembly does not allow partially trusted cal...
[ ".net", "security" ]
11
5
8,714
4
0
2008-08-23T18:33:55.287000
2008-08-23T18:42:49.883000