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
97,781
97,799
What is the best tool to convert common video formats to FLV on a Linux CLI
Part of a new product I have been assigned to work on involves server-side conversion of the 'common' video formats to something that Flash can play. As far as I know, my only option is to convert to FLV. I have been giving ffmpeg a go around, but I'm finding a few WMV files that come out with garbled sound (I've tried...
Flash can play the following formats: FLV with AAC or MP3 audio, and FLV1 (Sorenson Spark H.263), VP6, or H.264 video. MP4 with AAC or MP3 audio, and H.264 video (mp4s must be hinted with qt-faststart or mp4box). ffmpeg is an overall good conversion utility; mencoder works better with obscure and proprietary formats (d...
What is the best tool to convert common video formats to FLV on a Linux CLI Part of a new product I have been assigned to work on involves server-side conversion of the 'common' video formats to something that Flash can play. As far as I know, my only option is to convert to FLV. I have been giving ffmpeg a go around, ...
TITLE: What is the best tool to convert common video formats to FLV on a Linux CLI QUESTION: Part of a new product I have been assigned to work on involves server-side conversion of the 'common' video formats to something that Flash can play. As far as I know, my only option is to convert to FLV. I have been giving ff...
[ "linux", "flash", "video", "flv" ]
11
15
3,944
2
0
2008-09-18T22:48:10.807000
2008-09-18T22:50:17.013000
97,800
97,813
How can I fix this delphi 7 compile error - "Duplicate resource(s)"
I'm trying to compile a Delphi 7 project that I've inherited, and I'm getting this error: [Error] WARNING. Duplicate resource(s): [Error] Type 2 (BITMAP), ID EDIT: [Error] File C:[path shortened]\common\CRGrid.res resource kept; file c:\common\raptree.RES resource discarded. It says warning, but it's actually an error ...
Try firing up your resource editor (I'm pretty sure Delphi comes with one) and open the files. Check what bitmap resources are in the two, see which can be the duplicate. If you need to keep both resources, you need to renumber one of them.
How can I fix this delphi 7 compile error - "Duplicate resource(s)" I'm trying to compile a Delphi 7 project that I've inherited, and I'm getting this error: [Error] WARNING. Duplicate resource(s): [Error] Type 2 (BITMAP), ID EDIT: [Error] File C:[path shortened]\common\CRGrid.res resource kept; file c:\common\raptree....
TITLE: How can I fix this delphi 7 compile error - "Duplicate resource(s)" QUESTION: I'm trying to compile a Delphi 7 project that I've inherited, and I'm getting this error: [Error] WARNING. Duplicate resource(s): [Error] Type 2 (BITMAP), ID EDIT: [Error] File C:[path shortened]\common\CRGrid.res resource kept; file ...
[ "delphi", "resources" ]
3
3
8,684
4
0
2008-09-18T22:50:28.883000
2008-09-18T22:54:21.417000
97,830
98,228
WAS hosting vs. Windows Service hosting
I'm working on a project using Windows 2008,.NET 3.5 and WCF for some internal services and the question of how to host the services has arisen. Since we're using Windows 2008 I was thinking it'd be good to take advantage of Windows Process Activation Service (WAS) although the feeling on the project seems to be that u...
Recently I had to answer very similar question and these are the reasons why I decided to use IIS 7.0 and WAS instead of Windows Service infrastructure. IIS 7.0 is much more robust host and it comes with numerous features that make debugging easy. Failed requests tracing, worker process recycling, process orphaning to ...
WAS hosting vs. Windows Service hosting I'm working on a project using Windows 2008,.NET 3.5 and WCF for some internal services and the question of how to host the services has arisen. Since we're using Windows 2008 I was thinking it'd be good to take advantage of Windows Process Activation Service (WAS) although the f...
TITLE: WAS hosting vs. Windows Service hosting QUESTION: I'm working on a project using Windows 2008,.NET 3.5 and WCF for some internal services and the question of how to host the services has arisen. Since we're using Windows 2008 I was thinking it'd be good to take advantage of Windows Process Activation Service (W...
[ ".net", "wcf", "iis-7" ]
7
11
2,337
1
0
2008-09-18T22:58:27.040000
2008-09-19T00:10:48.830000
97,833
99,270
Windows Server 2003 NLB drainstop notification on stop
How would I drainstop one of the nodes in a MS NLB via command line and then get notified of its completion? If there's no way to callback, is there an easy way to poll?
http://technet.microsoft.com/en-us/library/cc772833.aspx has it all. Run the drainstop and then query until it is drained. nlb query yourServer
Windows Server 2003 NLB drainstop notification on stop How would I drainstop one of the nodes in a MS NLB via command line and then get notified of its completion? If there's no way to callback, is there an easy way to poll?
TITLE: Windows Server 2003 NLB drainstop notification on stop QUESTION: How would I drainstop one of the nodes in a MS NLB via command line and then get notified of its completion? If there's no way to callback, is there an easy way to poll? ANSWER: http://technet.microsoft.com/en-us/library/cc772833.aspx has it all....
[ "windows-server-2003", "load-balancing" ]
2
4
4,167
1
0
2008-09-18T22:58:34.463000
2008-09-19T03:24:00.833000
97,840
97,854
How to send mail from ASP.NET with IIS6 SMTP in a dedicated server?
I'm trying to configure a dedicated server that runs ASP.NET to send mail through the local IIS SMTP server but mail is getting stuck in the Queue folder and doesn't get delivered. I'm using this code in an.aspx page to test: <%@ Page Language="C#" AutoEventWireup="true" %> <% new System.Net.Mail.SmtpClient("localhost...
I find the best thing usually depending on how much email there is, is to just forward the mail through your ISP's SMTP server. Less headaches. Looks like that's where you are having issues, from your SMTP to external servers, not asp.net to your SMTP. Just have your SMTP server set to send it to your ISP, or you can c...
How to send mail from ASP.NET with IIS6 SMTP in a dedicated server? I'm trying to configure a dedicated server that runs ASP.NET to send mail through the local IIS SMTP server but mail is getting stuck in the Queue folder and doesn't get delivered. I'm using this code in an.aspx page to test: <%@ Page Language="C#" Aut...
TITLE: How to send mail from ASP.NET with IIS6 SMTP in a dedicated server? QUESTION: I'm trying to configure a dedicated server that runs ASP.NET to send mail through the local IIS SMTP server but mail is getting stuck in the Queue folder and doesn't get delivered. I'm using this code in an.aspx page to test: <%@ Page...
[ "asp.net", "iis", "smtp" ]
4
2
16,111
3
0
2008-09-18T23:00:07.487000
2008-09-18T23:05:58.457000
97,850
97,903
Version control on a 2GB USB drive
For my school work, I do a lot of switching computers (from labs to my laptop to the library). I'd kind of like to put this code under some kind of version control. Of course the problem is that I can't always install additional software on the computers I use. Is there any kind of version control system that I can kee...
You could use Portable Python and Bazaar (Bazaar is a Python app). I like to use Bazaar for my own personal projects because of its extreme simplicity. Plus, it can be portable because Python can be portable. You will just need to install it's dependencies in your Portable Python installation as well.
Version control on a 2GB USB drive For my school work, I do a lot of switching computers (from labs to my laptop to the library). I'd kind of like to put this code under some kind of version control. Of course the problem is that I can't always install additional software on the computers I use. Is there any kind of ve...
TITLE: Version control on a 2GB USB drive QUESTION: For my school work, I do a lot of switching computers (from labs to my laptop to the library). I'd kind of like to put this code under some kind of version control. Of course the problem is that I can't always install additional software on the computers I use. Is th...
[ "windows", "version-control", "usb-drive" ]
43
13
13,836
14
0
2008-09-18T23:05:12.827000
2008-09-18T23:13:00.030000
97,856
97,933
Is there an XML XQuery interface to existing XML files?
My company is in education industry and we use XML to store course content. We also store some course related information (mostly metainfo) in relational database. Right now we are in the process of switching from our proprietary XML Schema to DocBook 5. Along with the switch we want to move course related information ...
Take a look at exist, it is an open source xml database that supports XQuery.
Is there an XML XQuery interface to existing XML files? My company is in education industry and we use XML to store course content. We also store some course related information (mostly metainfo) in relational database. Right now we are in the process of switching from our proprietary XML Schema to DocBook 5. Along wit...
TITLE: Is there an XML XQuery interface to existing XML files? QUESTION: My company is in education industry and we use XML to store course content. We also store some course related information (mostly metainfo) in relational database. Right now we are in the process of switching from our proprietary XML Schema to Do...
[ "xml", "xquery" ]
2
2
859
6
0
2008-09-18T23:06:05.460000
2008-09-18T23:16:36.310000
97,857
97,944
Properly scoped transactions in Stored Procs
Suppose I have a stored procedure that manages its own transaction CREATE PROCEDURE theProc AS BEGIN BEGIN TRANSACTION -- do some stuff IF @ThereIsAProblem ROLLBACK TRANSACTION ELSE COMMIT TRANSACTION END If I call this proc from an existing transaction, the proc can ROLLBACK the external transaction. BEGIN TRANSACT...
The syntax to do this probably varies by database. But in Transact-SQL what you do is check @@TRANCOUNT to see if you are in a transaction. If you are then you want to create a savepoint, and at the end you can just pass through the end of the function (believing a commit or rollback will happen later) or else rollback...
Properly scoped transactions in Stored Procs Suppose I have a stored procedure that manages its own transaction CREATE PROCEDURE theProc AS BEGIN BEGIN TRANSACTION -- do some stuff IF @ThereIsAProblem ROLLBACK TRANSACTION ELSE COMMIT TRANSACTION END If I call this proc from an existing transaction, the proc can ROLL...
TITLE: Properly scoped transactions in Stored Procs QUESTION: Suppose I have a stored procedure that manages its own transaction CREATE PROCEDURE theProc AS BEGIN BEGIN TRANSACTION -- do some stuff IF @ThereIsAProblem ROLLBACK TRANSACTION ELSE COMMIT TRANSACTION END If I call this proc from an existing transaction,...
[ "sql-server", "stored-procedures", "transactions", "scope" ]
4
2
452
2
0
2008-09-18T23:06:17.067000
2008-09-18T23:18:47.257000
97,865
100,215
Get position data from mobile browser
I am developing a web app that will be hit frequently by mobile browsers. I am wondering if there is a way to get enough information from the browser request to lookup position data (triangulation or GPS) Not from the request directly, of course. A colleague suggested there some carriers supply a unique identifier in t...
Google has ClientLocation as part of their AJAX APIs. You'll need to load Google's AJAX API (requires an API key) and it'll try to resolve the user's location data for you.
Get position data from mobile browser I am developing a web app that will be hit frequently by mobile browsers. I am wondering if there is a way to get enough information from the browser request to lookup position data (triangulation or GPS) Not from the request directly, of course. A colleague suggested there some ca...
TITLE: Get position data from mobile browser QUESTION: I am developing a web app that will be hit frequently by mobile browsers. I am wondering if there is a way to get enough information from the browser request to lookup position data (triangulation or GPS) Not from the request directly, of course. A colleague sugge...
[ "mobile", "gps" ]
12
12
30,888
5
0
2008-09-18T23:06:41.747000
2008-09-19T07:20:00.313000
97,875
97,896
"rm -rf" equivalent for Windows?
I need a way to recursively delete a folder and its children. Is there a prebuilt tool for this, or do I need to write one? DEL /S doesn't delete directories. DELTREE was removed from Windows 2000+
RMDIR or RD if you are using the classic Command Prompt (cmd.exe): rd /s /q "path" RMDIR [/S] [/Q] [drive:]path RD [/S] [/Q] [drive:]path /S Removes all directories and files in the specified directory in addition to the directory itself. Used to remove a directory tree. /Q Quiet mode, do not ask if ok to remove a dire...
"rm -rf" equivalent for Windows? I need a way to recursively delete a folder and its children. Is there a prebuilt tool for this, or do I need to write one? DEL /S doesn't delete directories. DELTREE was removed from Windows 2000+
TITLE: "rm -rf" equivalent for Windows? QUESTION: I need a way to recursively delete a folder and its children. Is there a prebuilt tool for this, or do I need to write one? DEL /S doesn't delete directories. DELTREE was removed from Windows 2000+ ANSWER: RMDIR or RD if you are using the classic Command Prompt (cmd.e...
[ "windows", "cmd", "wsh" ]
710
969
1,026,730
24
0
2008-09-18T23:08:29.120000
2008-09-18T23:11:12.423000
97,913
98,057
Quick and Dirty Usability testing tips?
What are your best usability testing tips? I need quick & cheap.
While aimed at web design, Steve Krug's excellent " Don't Make Me Think: A Common Sense Approach To Web Usability " features (in the second edition, at least), a great chapter entitled "Usability Testing On 10 Cents A Day", which I think is applicable to a much wider range of platforms. The chapter specifically deals w...
Quick and Dirty Usability testing tips? What are your best usability testing tips? I need quick & cheap.
TITLE: Quick and Dirty Usability testing tips? QUESTION: What are your best usability testing tips? I need quick & cheap. ANSWER: While aimed at web design, Steve Krug's excellent " Don't Make Me Think: A Common Sense Approach To Web Usability " features (in the second edition, at least), a great chapter entitled "Us...
[ "testing", "user-experience", "usability", "human-computer-interface" ]
6
9
1,803
8
0
2008-09-18T23:13:56.767000
2008-09-18T23:38:19.953000
97,920
490,269
Asterisk AGI framework for IVR; Adhearsion alternative?
I am trying to get started writing scalable, telecom-grade applications with Asterisk and Ruby. I had originally intended to use the Adhearsion framework for this, but it does not have the required maturity and its documentation is severely lacking. AsteriskRuby seems to be a good alternative, as it's well documented a...
You should revisit Adhearsion as v0.8.1 is out, and the documentation has gotten much better quite recently. Have a look here: http://adhearsion.com http://docs.adhearsion.com http://api.adhearsion.com
Asterisk AGI framework for IVR; Adhearsion alternative? I am trying to get started writing scalable, telecom-grade applications with Asterisk and Ruby. I had originally intended to use the Adhearsion framework for this, but it does not have the required maturity and its documentation is severely lacking. AsteriskRuby s...
TITLE: Asterisk AGI framework for IVR; Adhearsion alternative? QUESTION: I am trying to get started writing scalable, telecom-grade applications with Asterisk and Ruby. I had originally intended to use the Adhearsion framework for this, but it does not have the required maturity and its documentation is severely lacki...
[ "ruby", "asterisk", "telephony", "ivr", "agi" ]
1
1
4,915
9
0
2008-09-18T23:14:32.897000
2009-01-29T02:12:42.847000
97,927
98,388
Codegear RAD Studio help system is corrupted
I've been using Codegear RAD Studio for a over a year now but since the "May08 Help Update" the help system no longer works. If I open the help the contents pane is entirely blank. If I hit F1 I get the following error: "Unable to interpret the specified HxC file." I've searched for the answer using search engines and ...
It sounds like you need to do a complete uninstall/reinstall. Alas. Be sure to check http://docs.codegear.com for the latest in Delphi help. On that site you can also download the Delphi 2007 help in various forms, including PDF and CHM.
Codegear RAD Studio help system is corrupted I've been using Codegear RAD Studio for a over a year now but since the "May08 Help Update" the help system no longer works. If I open the help the contents pane is entirely blank. If I hit F1 I get the following error: "Unable to interpret the specified HxC file." I've sear...
TITLE: Codegear RAD Studio help system is corrupted QUESTION: I've been using Codegear RAD Studio for a over a year now but since the "May08 Help Update" the help system no longer works. If I open the help the contents pane is entirely blank. If I hit F1 I get the following error: "Unable to interpret the specified Hx...
[ "delphi", "delphi-2007" ]
2
3
905
2
0
2008-09-18T23:15:15.593000
2008-09-19T00:38:11.527000
97,948
98,022
What is std::pair?
What is std::pair for, why would I use it, and what benefits does boost::compressed_pair bring?
std::pair is a data type for grouping two values together as a single object. std::map uses it for key, value pairs. While you're learning pair, you might check out tuple. It's like pair but for grouping an arbitrary number of values. tuple is part of TR1 and many compilers already include it with their Standard Librar...
What is std::pair? What is std::pair for, why would I use it, and what benefits does boost::compressed_pair bring?
TITLE: What is std::pair? QUESTION: What is std::pair for, why would I use it, and what benefits does boost::compressed_pair bring? ANSWER: std::pair is a data type for grouping two values together as a single object. std::map uses it for key, value pairs. While you're learning pair, you might check out tuple. It's l...
[ "c++", "boost", "stl", "std-pair" ]
46
35
45,577
10
0
2008-09-18T23:19:38.017000
2008-09-18T23:32:20.360000
97,962
99,366
Debounce clicks when submitting a web form
A poorly-written back-end system we interface with is having trouble with handling the load we're producing. While they fix their load problems, we're trying to reduce any additional load we're generating, one of which is that the back-end system continues to try and service a form submission even if another submission...
If you've got jQuery handy, attach a click() event that disables the button after the initial submission - $('input[type="submit"]').click(function(event){ event.preventDefault(); this.click(null); }); that sort of thing.
Debounce clicks when submitting a web form A poorly-written back-end system we interface with is having trouble with handling the load we're producing. While they fix their load problems, we're trying to reduce any additional load we're generating, one of which is that the back-end system continues to try and service a...
TITLE: Debounce clicks when submitting a web form QUESTION: A poorly-written back-end system we interface with is having trouble with handling the load we're producing. While they fix their load problems, we're trying to reduce any additional load we're generating, one of which is that the back-end system continues to...
[ "javascript", "html", "prototypejs" ]
5
2
8,153
6
0
2008-09-18T23:23:19.320000
2008-09-19T03:42:32.957000
97,971
98,151
Getting Started with an IDE?
Having programmed through emacs and vi for years and years at this point, I have heard that using an IDE is a very good way of becoming more efficient. To that end, I have decided to try using Eclipse for a lot of coding and seeing how I get on. Are there any suggestions for easing the transition over to an IDE. Obviou...
Eclipse is the best IDE I've used, even considering its quite large footprint and sluggishness on slow computers (like my work machine... Pentium III!). Rather than trying to 'ease the transition', I think it's better to jump right in and let yourself be overwhelmed by the bells and whistles and truly useful refactorin...
Getting Started with an IDE? Having programmed through emacs and vi for years and years at this point, I have heard that using an IDE is a very good way of becoming more efficient. To that end, I have decided to try using Eclipse for a lot of coding and seeing how I get on. Are there any suggestions for easing the tran...
TITLE: Getting Started with an IDE? QUESTION: Having programmed through emacs and vi for years and years at this point, I have heard that using an IDE is a very good way of becoming more efficient. To that end, I have decided to try using Eclipse for a lot of coding and seeing how I get on. Are there any suggestions f...
[ "eclipse", "emacs", "ide" ]
3
4
441
8
0
2008-09-18T23:24:53.480000
2008-09-18T23:57:19.970000
97,976
1,213,548
Setting the focus in a datagridview in windows form
I have a datagridview that accepts a list(of myObject) as a datasource. I want to add a new row to the datagrid to add to the database. I get this done by getting the list... adding a blank myObject to the list and then reseting the datasource. I now want to set the focus to the second cell in the new row. To CLARIFY i...
You can set the focus to a specific cell in a row but only if the SelectionMode on the DataGridView is set to CellSelect. If it is, simply do the following: dataGridView.Rows[rowNumber].Cells[columnNumber].Selected = true;
Setting the focus in a datagridview in windows form I have a datagridview that accepts a list(of myObject) as a datasource. I want to add a new row to the datagrid to add to the database. I get this done by getting the list... adding a blank myObject to the list and then reseting the datasource. I now want to set the f...
TITLE: Setting the focus in a datagridview in windows form QUESTION: I have a datagridview that accepts a list(of myObject) as a datasource. I want to add a new row to the datagrid to add to the database. I get this done by getting the list... adding a blank myObject to the list and then reseting the datasource. I now...
[ "vb.net", "winforms", "datagridview" ]
1
4
18,900
3
0
2008-09-18T23:25:51.467000
2009-07-31T16:28:02.010000
97,982
178,477
How can I get a history of the number of pages in Google's index for a particular site?
A Google search for "site:example.com" will tell you the number of pages of example.com that are currently in Google's index. Is it possible to find out how this number has changed over time?
I set up a Python script as a cron job to parse the result from the Google results page and save it. I set it to run once per day for each of a set of sites. I wrote another script to produce a CSV spreadsheet from the data. I can open that in a spreadsheet program and quickly make charts to visualise trends. I have si...
How can I get a history of the number of pages in Google's index for a particular site? A Google search for "site:example.com" will tell you the number of pages of example.com that are currently in Google's index. Is it possible to find out how this number has changed over time?
TITLE: How can I get a history of the number of pages in Google's index for a particular site? QUESTION: A Google search for "site:example.com" will tell you the number of pages of example.com that are currently in Google's index. Is it possible to find out how this number has changed over time? ANSWER: I set up a Py...
[ "seo" ]
1
0
873
5
0
2008-09-18T23:26:57.690000
2008-10-07T13:41:25.390000
97,983
98,091
How to put up an off-the-shelf https to http gateway?
I have an HTTP server which is in our internal network and accessible only from inside it. I would like to put another server that would listen to an HTTPS port accessible from outside, and forward the requests to that HTTP server (and send back the responses via HTTPS). I know that there are several ways to do this wi...
With Apache look into mod_proxy. Apache 2.2 mod_proxy docs Apache 2.0 mod_proxy docs
How to put up an off-the-shelf https to http gateway? I have an HTTP server which is in our internal network and accessible only from inside it. I would like to put another server that would listen to an HTTPS port accessible from outside, and forward the requests to that HTTP server (and send back the responses via HT...
TITLE: How to put up an off-the-shelf https to http gateway? QUESTION: I have an HTTP server which is in our internal network and accessible only from inside it. I would like to put another server that would listen to an HTTPS port accessible from outside, and forward the requests to that HTTP server (and send back th...
[ "apache", "http", "https", "webserver", "gateway" ]
0
1
1,076
3
0
2008-09-18T23:26:59.437000
2008-09-18T23:46:39.247000
97,984
98,021
How to secure database passwords in PHP?
When a PHP application makes a database connection it of course generally needs to pass a login and password. If I'm using a single, minimum-permission login for my application, then the PHP needs to know that login and password somewhere. What is the best way to secure that password? It seems like just writing it in t...
Several people misread this as a question about how to store passwords in a database. That is wrong. It is about how to store the password that lets you get to the database. The usual solution is to move the password out of source-code into a configuration file. Then leave administration and securing that configuration...
How to secure database passwords in PHP? When a PHP application makes a database connection it of course generally needs to pass a login and password. If I'm using a single, minimum-permission login for my application, then the PHP needs to know that login and password somewhere. What is the best way to secure that pas...
TITLE: How to secure database passwords in PHP? QUESTION: When a PHP application makes a database connection it of course generally needs to pass a login and password. If I'm using a single, minimum-permission login for my application, then the PHP needs to know that login and password somewhere. What is the best way ...
[ "php", "database", "security" ]
442
264
249,349
18
0
2008-09-18T23:27:03.913000
2008-09-18T23:32:18.923000
97,987
98,024
Advantage of switch over if-else statement
What's the best practice for using a switch statement vs using an if statement for 30 unsigned enumerations where about 10 have an expected action (that presently is the same action). Performance and space need to be considered but are not critical. I've abstracted the snippet so don't hate me for the naming convention...
Use switch. In the worst case the compiler will generate the same code as a if-else chain, so you don't lose anything. If in doubt put the most common cases first into the switch statement. In the best case the optimizer may find a better way to generate the code. Common things a compiler does is to build a binary deci...
Advantage of switch over if-else statement What's the best practice for using a switch statement vs using an if statement for 30 unsigned enumerations where about 10 have an expected action (that presently is the same action). Performance and space need to be considered but are not critical. I've abstracted the snippet...
TITLE: Advantage of switch over if-else statement QUESTION: What's the best practice for using a switch statement vs using an if statement for 30 unsigned enumerations where about 10 have an expected action (that presently is the same action). Performance and space need to be considered but are not critical. I've abst...
[ "c++", "if-statement", "optimization", "switch-statement" ]
189
183
145,679
23
0
2008-09-18T23:28:23.800000
2008-09-18T23:32:46.613000
98,026
98,051
How can I get that huge security icon on my secure site?
If I go to www.paypal.com, Firefox displays a huge icon in the location bar. Is it possible to get my web site to do this without paying $2700 to Verisign? Where is the best place to buy SSL certificates and not break the bank?
You're talking about EV (extended validation) SSL. Digicert are very competitive for this ($488 per year) and also standard SSL certificates. Whoever you go for though, make sure you check what browser compatibility they have as some of the cheaper ones do not have as wide support as the more expensive ones meaning you...
How can I get that huge security icon on my secure site? If I go to www.paypal.com, Firefox displays a huge icon in the location bar. Is it possible to get my web site to do this without paying $2700 to Verisign? Where is the best place to buy SSL certificates and not break the bank?
TITLE: How can I get that huge security icon on my secure site? QUESTION: If I go to www.paypal.com, Firefox displays a huge icon in the location bar. Is it possible to get my web site to do this without paying $2700 to Verisign? Where is the best place to buy SSL certificates and not break the bank? ANSWER: You're t...
[ "security" ]
2
3
343
5
0
2008-09-18T23:33:15.397000
2008-09-18T23:37:18.460000
98,033
3,719,617
Wrap a delegate in an IEqualityComparer
Several Linq.Enumerable functions take an IEqualityComparer. Is there a convenient wrapper class that adapts a delegate(T,T)=>bool to implement IEqualityComparer? It's easy enough to write one (if your ignore problems with defining a correct hashcode), but I'd like to know if there is an out-of-the-box solution. Specif...
Ordinarily, I'd get this resolved by commenting @Sam on the answer (I've done some editing on the original post to clean it up a bit without altering the behavior.) The following is my riff of @Sam's answer, with a [IMNSHO] critical fix to the default hashing policy:- class FuncEqualityComparer: IEqualityComparer { rea...
Wrap a delegate in an IEqualityComparer Several Linq.Enumerable functions take an IEqualityComparer. Is there a convenient wrapper class that adapts a delegate(T,T)=>bool to implement IEqualityComparer? It's easy enough to write one (if your ignore problems with defining a correct hashcode), but I'd like to know if the...
TITLE: Wrap a delegate in an IEqualityComparer QUESTION: Several Linq.Enumerable functions take an IEqualityComparer. Is there a convenient wrapper class that adapts a delegate(T,T)=>bool to implement IEqualityComparer? It's easy enough to write one (if your ignore problems with defining a correct hashcode), but I'd l...
[ ".net", "linq", "delegates" ]
131
46
49,800
15
0
2008-09-18T23:34:18.310000
2010-09-15T16:13:49.633000
98,044
120,046
What is the simplest way to interact between a SAP OMS and Websphere Commerce?
What is the simplest way to interact between a SAP OMS and Websphere Commerce? Would it be using a Websphere Adaptor for SAP or webmethods or something else? Does something else need to be considered while opting for one of these? The final system needs to be synchronous between SAP and the WCS front end. No ques..no d...
I recommend a combination of the SAP Business Connector ( http://service.sap.com/sbc-download ), which provides an easy interface for receiving/sending RFC calls from/to the SAP side, and the IBM WebSphere Java library, which allows easy interaction with WebSphere. ("webshphere.jar", can probably be found somewhere on ...
What is the simplest way to interact between a SAP OMS and Websphere Commerce? What is the simplest way to interact between a SAP OMS and Websphere Commerce? Would it be using a Websphere Adaptor for SAP or webmethods or something else? Does something else need to be considered while opting for one of these? The final ...
TITLE: What is the simplest way to interact between a SAP OMS and Websphere Commerce? QUESTION: What is the simplest way to interact between a SAP OMS and Websphere Commerce? Would it be using a Websphere Adaptor for SAP or webmethods or something else? Does something else need to be considered while opting for one of...
[ "sap-basis", "webmethods", "websphere-commerce", "wcs", "adaptor" ]
3
1
1,192
2
0
2008-09-18T23:35:26.827000
2008-09-23T09:29:50.333000
98,045
98,366
Which EJB 3 persisent provider should I use?
I are using EJB 3 on a fairly large J2EE project, by default with Netbeans sets the persistent provider for the entity beans to TopLink. There is the option to change the provider to one of the following or even add a new persistence library: Hibernate KODO OpenJPA Which persistence provider do you prefer to use? What ...
Theres only two JPA providers I'd consider using: If you want to stick to standard JPA I'd use EclipseLink. Whereas Toplink Essentials is the reference implementation of JPA 1.0, EclipseLink basically inherited the TopLink Essentials code and will be the reference implementation of JPA 2.0 (and bundled with Glassfish V...
Which EJB 3 persisent provider should I use? I are using EJB 3 on a fairly large J2EE project, by default with Netbeans sets the persistent provider for the entity beans to TopLink. There is the option to change the provider to one of the following or even add a new persistence library: Hibernate KODO OpenJPA Which per...
TITLE: Which EJB 3 persisent provider should I use? QUESTION: I are using EJB 3 on a fairly large J2EE project, by default with Netbeans sets the persistent provider for the entity beans to TopLink. There is the option to change the provider to one of the following or even add a new persistence library: Hibernate KODO...
[ "java", "orm", "jpa", "jakarta-ee" ]
3
7
3,269
6
0
2008-09-18T23:35:40.397000
2008-09-19T00:34:53.843000
98,074
98,419
Why is this X.509 certificate considered invalid?
I have a given certificate installed on my server. That certificate has valid dates, and seems perfectly valid in the Windows certificates MMC snap-in. However, when I try to read the certificate, in order to use it in an HttpRequest, I can't find it. Here is the code used: X509Store store = new X509Store(StoreName.Roo...
Try verifying the certificate chain using the X509Chain class. This can tell you exactly why the certificate isn't considered valid. As erickson suggested, your X509Store may not have the trusted certificate from the CA in the chain. If you used OpenSSL or another tool to generate your own self-signed CA, you need to a...
Why is this X.509 certificate considered invalid? I have a given certificate installed on my server. That certificate has valid dates, and seems perfectly valid in the Windows certificates MMC snap-in. However, when I try to read the certificate, in order to use it in an HttpRequest, I can't find it. Here is the code u...
TITLE: Why is this X.509 certificate considered invalid? QUESTION: I have a given certificate installed on my server. That certificate has valid dates, and seems perfectly valid in the Windows certificates MMC snap-in. However, when I try to read the certificate, in order to use it in an HttpRequest, I can't find it. ...
[ "c#", "ssl", "certificate", "x509" ]
9
8
15,888
3
0
2008-09-18T23:42:11.723000
2008-09-19T00:45:01.980000
98,079
98,108
Can eclipse extract a second class in class file to its own file
I often refactor code first by creating an inner class inside the class I'm working on--When I'm done, I move the entire thing into a new class file. This makes refactoring code into the new class extremely easy because A) I'm only dealing with a single file, and B) I don't create new files until I have a pretty good i...
I'm sorry I gave the wrong answer before. I rechecked, and it didn't do quite want you want. I did find a solution for you though, again, in 3.4. Highlight the class, do a copy CTRL-C or cut CTRL-X, click on the package you want the class do go into, and do a paste, CTRL-V. Eclipse will auto generate the class for you....
Can eclipse extract a second class in class file to its own file I often refactor code first by creating an inner class inside the class I'm working on--When I'm done, I move the entire thing into a new class file. This makes refactoring code into the new class extremely easy because A) I'm only dealing with a single f...
TITLE: Can eclipse extract a second class in class file to its own file QUESTION: I often refactor code first by creating an inner class inside the class I'm working on--When I'm done, I move the entire thing into a new class file. This makes refactoring code into the new class extremely easy because A) I'm only deali...
[ "java", "eclipse", "refactoring" ]
37
46
10,586
5
0
2008-09-18T23:43:53.497000
2008-09-18T23:49:38.103000
98,090
98,116
How do I parse a PHP serialized datastructure in Java?
I have a system that combines the best and worst of Java and PHP. I am trying to migrate a component that was once written in PHP into a Java One. Does anyone have some tips for how I can parse a PHP serialized datastructure in Java? By serialized I mean output from php's serialize function.
PHP serializes to a simple text-based format. PHPSerialize looks like a parser written in Java. You can also port the Python implementation to Java -- I doubt it's very complex.
How do I parse a PHP serialized datastructure in Java? I have a system that combines the best and worst of Java and PHP. I am trying to migrate a component that was once written in PHP into a Java One. Does anyone have some tips for how I can parse a PHP serialized datastructure in Java? By serialized I mean output fro...
TITLE: How do I parse a PHP serialized datastructure in Java? QUESTION: I have a system that combines the best and worst of Java and PHP. I am trying to migrate a component that was once written in PHP into a Java One. Does anyone have some tips for how I can parse a PHP serialized datastructure in Java? By serialized...
[ "java", "php", "serialization" ]
5
3
4,502
2
0
2008-09-18T23:46:20.137000
2008-09-18T23:51:12.153000
98,096
1,602,714
SQL Server: Is SELECTing a literal value faster than SELECTing a field?
I've seen some people use EXISTS (SELECT 1 FROM...) rather than EXISTS (SELECT id FROM...) as an optimization--rather than looking up and returning a value, SQL Server can simply return the literal it was given. Is SELECT(1) always faster? Would Selecting a value from the table require work that Selecting a literal wou...
For google's sake, I'll update this question with the same answer as this one ( Subquery using Exists 1 or Exists * ) since (currently) an incorrect answer is marked as accepted. Note the SQL standard actually says that EXISTS via * is identical to a constant. No. This has been covered a bazillion times. SQL Server is ...
SQL Server: Is SELECTing a literal value faster than SELECTing a field? I've seen some people use EXISTS (SELECT 1 FROM...) rather than EXISTS (SELECT id FROM...) as an optimization--rather than looking up and returning a value, SQL Server can simply return the literal it was given. Is SELECT(1) always faster? Would Se...
TITLE: SQL Server: Is SELECTing a literal value faster than SELECTing a field? QUESTION: I've seen some people use EXISTS (SELECT 1 FROM...) rather than EXISTS (SELECT id FROM...) as an optimization--rather than looking up and returning a value, SQL Server can simply return the literal it was given. Is SELECT(1) alway...
[ "sql", "sql-server" ]
1
6
3,080
8
0
2008-09-18T23:47:12.570000
2009-10-21T18:33:08.680000
98,098
98,206
VS2005: Limit the Heap size
Is the a VS2005 C++ compiler flag like the Xmx???M java flag so I can limit the heap size of my application running on Windows. I need to limit the heap size so I can fill the memory to find out the current free memory. (The code also runs on an embedded system where this is the best method to get the memory usage)
You might want to look into whether the gflags utility (in the Windows Debugging Tools) can do this. It can do a lot of other interesting things with the heap of native applications.
VS2005: Limit the Heap size Is the a VS2005 C++ compiler flag like the Xmx???M java flag so I can limit the heap size of my application running on Windows. I need to limit the heap size so I can fill the memory to find out the current free memory. (The code also runs on an embedded system where this is the best method ...
TITLE: VS2005: Limit the Heap size QUESTION: Is the a VS2005 C++ compiler flag like the Xmx???M java flag so I can limit the heap size of my application running on Windows. I need to limit the heap size so I can fill the memory to find out the current free memory. (The code also runs on an embedded system where this i...
[ "memory", "visual-c++", "heap-memory" ]
1
0
2,094
3
0
2008-09-18T23:47:20.557000
2008-09-19T00:06:31.290000
98,124
98,162
Why does Javascript getYear() return a three digit number?
Why does this javascript return 108 instead of 2008? it gets the day and month correct but not the year? myDate = new Date(); year = myDate.getYear(); year = 108?
It's a Y2K thing, only the years since 1900 are counted. There are potential compatibility issues now that getYear() has been deprecated in favour of getFullYear() - from quirksmode: To make the matter even more complex, date.getYear() is deprecated nowadays and you should use date.getFullYear(), which, in turn, is not...
Why does Javascript getYear() return a three digit number? Why does this javascript return 108 instead of 2008? it gets the day and month correct but not the year? myDate = new Date(); year = myDate.getYear(); year = 108?
TITLE: Why does Javascript getYear() return a three digit number? QUESTION: Why does this javascript return 108 instead of 2008? it gets the day and month correct but not the year? myDate = new Date(); year = myDate.getYear(); year = 108? ANSWER: It's a Y2K thing, only the years since 1900 are counted. There are pote...
[ "javascript", "date" ]
102
133
46,359
14
0
2008-09-18T23:53:48.340000
2008-09-18T23:58:40.890000
98,127
98,140
Accessing Domain Cookies within an iFrame on Internet Explorer
My domain (let's call it www.example.com) creates a cookie. On another site (let's say, www.myspace.com), my domain is loaded within an iFrame. On every browser (Firefox, Opera, Camino, Safari, etc...) except for Internet Explorer, I can access my own cookie. In IE, it doesn't give me access to the cookie from within t...
Internet Explorer's default privacy setting means that 3rd-party cookies (e.g. those in iframes) are treated differently to 1st party cookies. (by default, 3rd party cookies are silently rejected). For IE6 to accept cookies in an iframe, you need to ensure your site is delivering a P3P compact header. See http://msdn.m...
Accessing Domain Cookies within an iFrame on Internet Explorer My domain (let's call it www.example.com) creates a cookie. On another site (let's say, www.myspace.com), my domain is loaded within an iFrame. On every browser (Firefox, Opera, Camino, Safari, etc...) except for Internet Explorer, I can access my own cooki...
TITLE: Accessing Domain Cookies within an iFrame on Internet Explorer QUESTION: My domain (let's call it www.example.com) creates a cookie. On another site (let's say, www.myspace.com), my domain is loaded within an iFrame. On every browser (Firefox, Opera, Camino, Safari, etc...) except for Internet Explorer, I can a...
[ "internet-explorer", "iframe", "cookies" ]
25
35
23,960
3
0
2008-09-18T23:54:43.037000
2008-09-18T23:56:01.627000
98,134
98,155
How can I make Windows software run as a different user within a script?
I'm using a build script that calls Wise to create some install files. The problem is that the Wise license only allows it to be run under one particular user account, which is not the same account that my build script will run under. I know Windows has the runas command but this won't work for an automated script as t...
This might help: Why doesn't the RunAs program accept a password on the command line?
How can I make Windows software run as a different user within a script? I'm using a build script that calls Wise to create some install files. The problem is that the Wise license only allows it to be run under one particular user account, which is not the same account that my build script will run under. I know Windo...
TITLE: How can I make Windows software run as a different user within a script? QUESTION: I'm using a build script that calls Wise to create some install files. The problem is that the Wise license only allows it to be run under one particular user account, which is not the same account that my build script will run u...
[ "windows", "build-process", "scripting", "wise" ]
4
2
5,455
4
0
2008-09-18T23:55:12.440000
2008-09-18T23:58:12.747000
98,163
98,241
How to get runonce to run, without having to have an administrator login
Is there any way to force an update of software using RunOnce, without having an administrator log in, if there is a service running as Administrator running in the background? EDIT: The main thing I want to be able to do is Run when the RunOnce does, I.E. before Explorer starts. I need to be able to install things, wi...
I'm not sure I understand the question. Let me try: The service you mention, is it yours? If so, you can add code to it to imitate Windows: from your service, examine the RunOnce value and launch the executable it specifies. You can use the CreateProcessAsUser() API to launch it in the context of an arbitrary user. Aft...
How to get runonce to run, without having to have an administrator login Is there any way to force an update of software using RunOnce, without having an administrator log in, if there is a service running as Administrator running in the background? EDIT: The main thing I want to be able to do is Run when the RunOnce d...
TITLE: How to get runonce to run, without having to have an administrator login QUESTION: Is there any way to force an update of software using RunOnce, without having an administrator log in, if there is a service running as Administrator running in the background? EDIT: The main thing I want to be able to do is Run ...
[ "windows-services", "installation", "registry", "runonce" ]
0
2
3,127
1
0
2008-09-18T23:59:01.870000
2008-09-19T00:13:17.623000
98,186
103,356
NDepend CQL Count Query
I want to query a table of public methods of a specific class and a count of each methods usage in NDepend CQL. Currently query looks like this: SELECT METHODS FROM TYPES "AE.DataAccess.DBHelper" WHERE IsPublic Is it possible to aggregate queries in CQL?
It looks like the following query will generate a nice table with the values I was looking for that can be exported to Excel. What an awesome tool. SELECT METHODS FROM TYPES "AE.DataAccess.DBHelper" WHERE IsPublic ORDER BY MethodCa DESC
NDepend CQL Count Query I want to query a table of public methods of a specific class and a count of each methods usage in NDepend CQL. Currently query looks like this: SELECT METHODS FROM TYPES "AE.DataAccess.DBHelper" WHERE IsPublic Is it possible to aggregate queries in CQL?
TITLE: NDepend CQL Count Query QUESTION: I want to query a table of public methods of a specific class and a count of each methods usage in NDepend CQL. Currently query looks like this: SELECT METHODS FROM TYPES "AE.DataAccess.DBHelper" WHERE IsPublic Is it possible to aggregate queries in CQL? ANSWER: It looks like ...
[ "aggregate", "cql", "ndepend" ]
3
2
440
1
0
2008-09-19T00:02:49.880000
2008-09-19T16:15:45.413000
98,196
98,405
Firing UI control events from a Unit Test
As a beginner to TDD I am trying to write a test that assumes a property has had its value changed on a PropertyGrid (C#, WinForms,.NET 3.5). Changing a property on an object in a property grid does not fire the event (fair enough, as it's a UI raised event, so I can see why changing the owned object may be invisible t...
To unit test your code you will need to mock up an object of the UI interface element. There are many tools you can use to do this, and I can't recommend one over another. There's a good comparison between MoQ and Rhino Mocks here at Phil Haack's blog that I've found useful and might be useful to you. Anothing thing to...
Firing UI control events from a Unit Test As a beginner to TDD I am trying to write a test that assumes a property has had its value changed on a PropertyGrid (C#, WinForms,.NET 3.5). Changing a property on an object in a property grid does not fire the event (fair enough, as it's a UI raised event, so I can see why ch...
TITLE: Firing UI control events from a Unit Test QUESTION: As a beginner to TDD I am trying to write a test that assumes a property has had its value changed on a PropertyGrid (C#, WinForms,.NET 3.5). Changing a property on an object in a property grid does not fire the event (fair enough, as it's a UI raised event, s...
[ "c#", "winforms", "unit-testing" ]
3
5
2,647
3
0
2008-09-19T00:04:10.797000
2008-09-19T00:42:34.573000
98,212
338,153
How do you go about validating check boxes in ASP.NET MVC?
I am wondering what methods people are using for validating check boxes in ASP.NET MVC (both client and server side). I am using JQuery currently for client side validation but I am curious what methods people are using, ideally with the least amount of fuss (I am looking for a new solution). I should mention that I am...
If you go on to the validation website and download the whole package that included the demo files, you can find the one with example of validating check boxes and radio buttons. The link is here: http://jquery.bassistance.de/validate/jquery.validate.zip
How do you go about validating check boxes in ASP.NET MVC? I am wondering what methods people are using for validating check boxes in ASP.NET MVC (both client and server side). I am using JQuery currently for client side validation but I am curious what methods people are using, ideally with the least amount of fuss (I...
TITLE: How do you go about validating check boxes in ASP.NET MVC? QUESTION: I am wondering what methods people are using for validating check boxes in ASP.NET MVC (both client and server side). I am using JQuery currently for client side validation but I am curious what methods people are using, ideally with the least...
[ "asp.net-mvc", "validation", "checkbox" ]
1
1
1,453
2
0
2008-09-19T00:08:08.197000
2008-12-03T18:08:37.140000
98,224
98,234
How to list directory content of remote FTP, recursively
After downloading files from a remote UNIX FTP server, you want to verify that you have downloaded all the files correctly. Minimal you will get information similar to "dir /s" command in Windows command prompt. The FTP client runs on Windows.
Sadly this was written for Unix/Linux users:/ Personally, I would install CYGWIN just to get Linux binaries of LFTP/RSYNC to work on windows, as there appears not to be anything that competes with it. As @zadok.myopenid.com mentioned rsync, this appears to be a windows build for it using CYGWIN ( if you manage to be ab...
How to list directory content of remote FTP, recursively After downloading files from a remote UNIX FTP server, you want to verify that you have downloaded all the files correctly. Minimal you will get information similar to "dir /s" command in Windows command prompt. The FTP client runs on Windows.
TITLE: How to list directory content of remote FTP, recursively QUESTION: After downloading files from a remote UNIX FTP server, you want to verify that you have downloaded all the files correctly. Minimal you will get information similar to "dir /s" command in Windows command prompt. The FTP client runs on Windows. ...
[ "ftp" ]
25
25
58,646
5
0
2008-09-19T00:09:50.847000
2008-09-19T00:12:10.903000
98,225
484,136
Vim macros don't work when using viper + vimpulse in Emacs
Any other tweaks for making emacs as vim-like as possible would be appreciated as well. Addendum: The main reason I don't just use vim is that I love how emacs lets you open a file in two different frames [ADDED: sorry, this was confusing: I mean separate windows, which emacs calls "frames"]. It's like making a vertica...
You could run VIM in client server mode, then you could have two windows connecting to one instance, hence removing the need for Emacs.
Vim macros don't work when using viper + vimpulse in Emacs Any other tweaks for making emacs as vim-like as possible would be appreciated as well. Addendum: The main reason I don't just use vim is that I love how emacs lets you open a file in two different frames [ADDED: sorry, this was confusing: I mean separate windo...
TITLE: Vim macros don't work when using viper + vimpulse in Emacs QUESTION: Any other tweaks for making emacs as vim-like as possible would be appreciated as well. Addendum: The main reason I don't just use vim is that I love how emacs lets you open a file in two different frames [ADDED: sorry, this was confusing: I m...
[ "vim", "emacs", "viper-mode", "vimpulse" ]
4
7
1,931
9
0
2008-09-19T00:09:56.510000
2009-01-27T16:38:56.577000
98,236
98,295
MIPS Assembly Pointer-to-a Pointer?
I think I know how to handle this case, but I just want to make sure I have it right. Say you have the following C code: int myInt = 3; int* myPointer = &myInt int** mySecondPointer = &myPointer P contains an address that points to a place in memory which has another address. I'd like to modify the second address. So t...
Yes, that's correct as far as I can tell. It would have been easier if you used the same variable names (e.g. symbols instead of hard register names). Why haven't you simply compiled the c-code and took a look at the list-file or assembly-output? I always do that when in doubt.
MIPS Assembly Pointer-to-a Pointer? I think I know how to handle this case, but I just want to make sure I have it right. Say you have the following C code: int myInt = 3; int* myPointer = &myInt int** mySecondPointer = &myPointer P contains an address that points to a place in memory which has another address. I'd lik...
TITLE: MIPS Assembly Pointer-to-a Pointer? QUESTION: I think I know how to handle this case, but I just want to make sure I have it right. Say you have the following C code: int myInt = 3; int* myPointer = &myInt int** mySecondPointer = &myPointer P contains an address that points to a place in memory which has anothe...
[ "pointers", "assembly", "mips" ]
5
4
9,076
1
0
2008-09-19T00:12:40.247000
2008-09-19T00:21:17.543000
98,242
98,256
Post increment operator behavior
Possible Duplicate: Pre & post increment operator behavior in C, C++, Java, & C# Here is a test case: void foo(int i, int j) { printf("%d %d", i, j); }... test = 0; foo(test++, test); I would expect to get a "0 1" output, but I get "0 0" What gives??
This is an example of unspecified behavior. The standard does not say what order arguments should be evaluated in. This is a compiler implementation decision. The compiler is free to evaluate the arguments to the function in any order. In this case, it looks like actually processes the arguments right to left instead o...
Post increment operator behavior Possible Duplicate: Pre & post increment operator behavior in C, C++, Java, & C# Here is a test case: void foo(int i, int j) { printf("%d %d", i, j); }... test = 0; foo(test++, test); I would expect to get a "0 1" output, but I get "0 0" What gives??
TITLE: Post increment operator behavior QUESTION: Possible Duplicate: Pre & post increment operator behavior in C, C++, Java, & C# Here is a test case: void foo(int i, int j) { printf("%d %d", i, j); }... test = 0; foo(test++, test); I would expect to get a "0 1" output, but I get "0 0" What gives?? ANSWER: This is a...
[ "c++", "c", "post-increment" ]
15
47
2,513
10
0
2008-09-19T00:13:26.093000
2008-09-19T00:15:17.930000
98,268
98,287
What's the difference between a "script" and an "application"?
I'm referring to distinctions such as in this answer:...bash isn't for writing applications it's for, well, scripting. So sure, your application might have some housekeeping scripts but don't go writing critical-business-logic.sh because another language is probably better for stuff like that. As programmer who's worke...
Traditionally a program is compiled and a script is interpreted, but that is not really important anymore. You can generate a compiled version of most scripts if you really want to, and other 'compiled' languages like Java are in fact interpreted (at the byte code level.) A more modern definition might be that a progra...
What's the difference between a "script" and an "application"? I'm referring to distinctions such as in this answer:...bash isn't for writing applications it's for, well, scripting. So sure, your application might have some housekeeping scripts but don't go writing critical-business-logic.sh because another language is...
TITLE: What's the difference between a "script" and an "application"? QUESTION: I'm referring to distinctions such as in this answer:...bash isn't for writing applications it's for, well, scripting. So sure, your application might have some housekeeping scripts but don't go writing critical-business-logic.sh because a...
[ "terminology" ]
37
54
46,990
21
0
2008-09-19T00:16:56.617000
2008-09-19T00:20:19.433000
98,275
99,328
MySQL triggers + replication with multiple databases
I am running a couple of databases on MySQL 5.0.45 and am trying to get my legacy database to sync with a revised schema, so I can run both side by side. I am doing this by adding triggers to the new database but I am running into problems with replication. My set up is as follows. Server "master" Database "legacydb", ...
This may have something to do with it: A stored function acquires table locks before executing, to avoid inconsistency in the binary log due to mismatch of the order in which statements execute and when they appear in the log. Statements that invoke a function are recorded rather than the statements executed within the...
MySQL triggers + replication with multiple databases I am running a couple of databases on MySQL 5.0.45 and am trying to get my legacy database to sync with a revised schema, so I can run both side by side. I am doing this by adding triggers to the new database but I am running into problems with replication. My set up...
TITLE: MySQL triggers + replication with multiple databases QUESTION: I am running a couple of databases on MySQL 5.0.45 and am trying to get my legacy database to sync with a revised schema, so I can run both side by side. I am doing this by adding triggers to the new database but I am running into problems with repl...
[ "mysql", "triggers", "replication" ]
4
3
4,849
1
0
2008-09-19T00:18:20.170000
2008-09-19T03:34:40.463000
98,320
98,544
Does having many unused beans in a Spring Bean Context waste significant resources?
My model layer is being used by a handful of different projects and I'd like to use a single XML Spring Configuration file for the model regardless of which project is using it. My question is: Since not all beans are used in all projects am I wasting resources to any significant amount if there not being instantiated?...
Taken from the Spring Reference Manual: The default behavior for ApplicationContext implementations is to eagerly pre-instantiate all singleton beans at startup. Pre-instantiation means that an ApplicationContext will eagerly create and configure all of its singleton beans as part of its initialization process. General...
Does having many unused beans in a Spring Bean Context waste significant resources? My model layer is being used by a handful of different projects and I'd like to use a single XML Spring Configuration file for the model regardless of which project is using it. My question is: Since not all beans are used in all projec...
TITLE: Does having many unused beans in a Spring Bean Context waste significant resources? QUESTION: My model layer is being used by a handful of different projects and I'd like to use a single XML Spring Configuration file for the model regardless of which project is using it. My question is: Since not all beans are ...
[ "java", "spring" ]
9
10
3,506
4
0
2008-09-19T00:25:25.987000
2008-09-19T01:08:13.717000
98,340
98,356
What are the common undefined/unspecified behavior for C that you run into?
An example of unspecified behavior in the C language is the order of evaluation of arguments to a function. It might be left to right or right to left, you just don't know. This would affect how foo(c++, c) or foo(++c, c) gets evaluated. What other unspecified behavior is there that can surprise the unaware programmer?
A language lawyer question. Hmkay. My personal top3: violating the strict aliasing rule violating the strict aliasing rule violating the strict aliasing rule:-) Edit Here is a little example that does it wrong twice: (assume 32 bit ints and little endian) float funky_float_abs (float a) { unsigned int temp = *(unsigned...
What are the common undefined/unspecified behavior for C that you run into? An example of unspecified behavior in the C language is the order of evaluation of arguments to a function. It might be left to right or right to left, you just don't know. This would affect how foo(c++, c) or foo(++c, c) gets evaluated. What o...
TITLE: What are the common undefined/unspecified behavior for C that you run into? QUESTION: An example of unspecified behavior in the C language is the order of evaluation of arguments to a function. It might be left to right or right to left, you just don't know. This would affect how foo(c++, c) or foo(++c, c) gets...
[ "c", "language-lawyer", "undefined-behavior", "unspecified-behavior" ]
73
91
18,764
11
0
2008-09-19T00:30:10.313000
2008-09-19T00:33:12.910000
98,363
98,470
emulate unix 'cut' using standard windows command line/batch commands
Is there a way to emulate the unix cut command on windows XP, without resorting to cygwin or other non-standard windows capabilities? Example: Use tasklist /v, find the specific task by the window title, then extract the PID from that list to pass to taskkill.
FYI, tasklist and taskkill already have filtering capabilities: tasklist /FI "imagename eq chrome.exe" taskkill /F /FI "imagename eq iexplore.exe" If you want more general functionality, batch scripts (ugh) can help. For example: for /f "tokens=1,2 delims= " %%i in ('tasklist /v') do ( if "%%i" == "%~1" ( echo TASKKILL...
emulate unix 'cut' using standard windows command line/batch commands Is there a way to emulate the unix cut command on windows XP, without resorting to cygwin or other non-standard windows capabilities? Example: Use tasklist /v, find the specific task by the window title, then extract the PID from that list to pass to...
TITLE: emulate unix 'cut' using standard windows command line/batch commands QUESTION: Is there a way to emulate the unix cut command on windows XP, without resorting to cygwin or other non-standard windows capabilities? Example: Use tasklist /v, find the specific task by the window title, then extract the PID from th...
[ "windows", "unix", "command-line" ]
6
10
16,928
1
0
2008-09-19T00:34:28.430000
2008-09-19T00:53:17.683000
98,376
98,415
Java .properties file equivalent for Ruby?
I need to store some simple properties in a file and access them from Ruby. I absolutely love the.properties file format that is the standard for such things in Java (using the java.util.Properties class)... it is simple, easy to use and easy to read. So, is there a Ruby class somewhere that will let me load up some ke...
Is this for a Rails application or a Ruby one? Really with either you may be able to stick your properties in a yaml file and then YAML::Load(File.open("file")) it. NOTE from Mike Stone: It would actually be better to do: File.open("file") { |yf| YAML::load(yf) } or YAML.load_file("file") as the ruby docs suggest, othe...
Java .properties file equivalent for Ruby? I need to store some simple properties in a file and access them from Ruby. I absolutely love the.properties file format that is the standard for such things in Java (using the java.util.Properties class)... it is simple, easy to use and easy to read. So, is there a Ruby class...
TITLE: Java .properties file equivalent for Ruby? QUESTION: I need to store some simple properties in a file and access them from Ruby. I absolutely love the.properties file format that is the standard for such things in Java (using the java.util.Properties class)... it is simple, easy to use and easy to read. So, is ...
[ "ruby", "file-io" ]
28
26
17,715
6
0
2008-09-19T00:36:12.310000
2008-09-19T00:44:43.617000
98,394
98,520
Does such a procedure exist in a Scheme standard and if yes, how is it called?
I looked for the name of a procedure, which applies a tree structure of procedures to a tree structure of data, yielding a tree structure of results - all three trees having the same structure. Such a procedure might have the signature: (map-tree data functree) Its return value would be the result of elementwise applic...
I don't have a very good name for the function. I'm pasting my implementation below (I've called it map-traversing; others should suggest a better name). I've made the argument order mirror that of map itself. (define (map-traversing func data) (if (list? func) (map map-traversing func data) (func data))) Using your sa...
Does such a procedure exist in a Scheme standard and if yes, how is it called? I looked for the name of a procedure, which applies a tree structure of procedures to a tree structure of data, yielding a tree structure of results - all three trees having the same structure. Such a procedure might have the signature: (map...
TITLE: Does such a procedure exist in a Scheme standard and if yes, how is it called? QUESTION: I looked for the name of a procedure, which applies a tree structure of procedures to a tree structure of data, yielding a tree structure of results - all three trees having the same structure. Such a procedure might have t...
[ "mapping", "scheme" ]
3
3
380
2
0
2008-09-19T00:39:41.040000
2008-09-19T01:03:14.227000
98,400
98,561
How do I examine the configuration of a remote git repository?
I've got a git-svn clone of an svn repo, and I want to encourage my colleagues to look at git as an option. The problem is that cloning the repo out of svn takes 3 days, but cloning from my git instance takes 10 minutes. I've got a script that will allow people to clone my git repo and re-point it at the original SVN, ...
I'd say the better way to do this would be, instead of requiring that your coworkers do a git clone, just give them a a tarball of your existing git-svn checkout. This way, you don't have to repoint or query anything, as it's already done.
How do I examine the configuration of a remote git repository? I've got a git-svn clone of an svn repo, and I want to encourage my colleagues to look at git as an option. The problem is that cloning the repo out of svn takes 3 days, but cloning from my git instance takes 10 minutes. I've got a script that will allow pe...
TITLE: How do I examine the configuration of a remote git repository? QUESTION: I've got a git-svn clone of an svn repo, and I want to encourage my colleagues to look at git as an option. The problem is that cloning the repo out of svn takes 3 days, but cloning from my git instance takes 10 minutes. I've got a script ...
[ "git", "git-svn" ]
4
4
667
2
0
2008-09-19T00:41:23.047000
2008-09-19T01:12:12.600000
98,426
98,474
How to Refactor to Generics from Class that Inherits from CollectionBase?
I am working on an application that is about 250,000 lines of code. I'm currently the only developer working on this application that was originally built in.NET 1.1. Pervasive throughout is a class that inherits from CollectionBase. All database collections inherit from this class. I am considering refactoring to inhe...
250,000 Lines is alot to refactor, plus you should take into account several of the follow: Do you have a QA department that will be able to QA the refactored code? Do you have unit tests for the old code? Is there a timeframe that is around the project, i.e. are you maintaining the code as users are finding bugs? if y...
How to Refactor to Generics from Class that Inherits from CollectionBase? I am working on an application that is about 250,000 lines of code. I'm currently the only developer working on this application that was originally built in.NET 1.1. Pervasive throughout is a class that inherits from CollectionBase. All database...
TITLE: How to Refactor to Generics from Class that Inherits from CollectionBase? QUESTION: I am working on an application that is about 250,000 lines of code. I'm currently the only developer working on this application that was originally built in.NET 1.1. Pervasive throughout is a class that inherits from Collection...
[ "c#", "generics", ".net-3.5", ".net-2.0", "refactoring" ]
2
1
1,769
6
0
2008-09-19T00:46:25.283000
2008-09-19T00:54:01.910000
98,465
98,477
Why is there no main() function in vxWorks?
When using vxWorks as a development platform, we can't write our application with the standard main() function. Why can't we have a main function?
Before the 6.0 version VxWorks only supported kernel execution environment for tasks and did not support processes, which is the traditional application execution environment on OS like Unix or Windows. Tasks have an entry point which is the address of the code to execute as a task. This address corresponds to a C or a...
Why is there no main() function in vxWorks? When using vxWorks as a development platform, we can't write our application with the standard main() function. Why can't we have a main function?
TITLE: Why is there no main() function in vxWorks? QUESTION: When using vxWorks as a development platform, we can't write our application with the standard main() function. Why can't we have a main function? ANSWER: Before the 6.0 version VxWorks only supported kernel execution environment for tasks and did not suppo...
[ "vxworks" ]
6
14
5,475
1
0
2008-09-19T00:53:05.423000
2008-09-19T00:54:29.350000
98,476
102,947
Problems with sound on a 6265i Nokia using J2ME and Netbeans 6.1
Currently, I have some basic code to play a simple tone whenever a button is pressed in the command item menu. Using: Manager.playTone(note, duration, volume); I also have a blackberry that I'm testing this same midlet on and the sound works fine. So, is this something specific to Nokia phones that aren't allowing me t...
http://discussion.forum.nokia.com/forum/showthread.php?t=91500 This thread on Forum Nokia seems to suggest that certain Nokia models have problems playing tones with the Manager.playTone() function, more specifically a MediaException is thrown, as you are having (MediaException is just the default exception if any prob...
Problems with sound on a 6265i Nokia using J2ME and Netbeans 6.1 Currently, I have some basic code to play a simple tone whenever a button is pressed in the command item menu. Using: Manager.playTone(note, duration, volume); I also have a blackberry that I'm testing this same midlet on and the sound works fine. So, is ...
TITLE: Problems with sound on a 6265i Nokia using J2ME and Netbeans 6.1 QUESTION: Currently, I have some basic code to play a simple tone whenever a button is pressed in the command item menu. Using: Manager.playTone(note, duration, volume); I also have a blackberry that I'm testing this same midlet on and the sound w...
[ "java-me", "nokia", "midp", "cldc", "netbeans6.1" ]
1
2
926
1
0
2008-09-19T00:54:28.383000
2008-09-19T15:34:23.033000
98,479
98,865
Max value of int in ChucK
What is the maximum value of an int in ChucK? Is there a symbolic constant for it?
New in the latest version! << >>; For reference though, it uses the " long " keyword in C++ to represent integers. So on 32-bit computers the max should be 0x7FFFFFFF, or 2147483647. On 64-bit computers it will be 0x7FFFFFFFFFFFFFFFFF, or 9223372036854775807. Answer from Kassen and Stephen Sinclair on the chuck-users m...
Max value of int in ChucK What is the maximum value of an int in ChucK? Is there a symbolic constant for it?
TITLE: Max value of int in ChucK QUESTION: What is the maximum value of an int in ChucK? Is there a symbolic constant for it? ANSWER: New in the latest version! << >>; For reference though, it uses the " long " keyword in C++ to represent integers. So on 32-bit computers the max should be 0x7FFFFFFF, or 2147483647. O...
[ "chuck" ]
2
6
320
2
0
2008-09-19T00:54:58.727000
2008-09-19T02:06:08.197000
98,484
98,553
How to insert characters to a file using C#
I have a huge file, where I have to insert certain characters at a specific location. What is the easiest way to do that in C# without rewriting the whole file again.
Filesystems do not support "inserting" data in the middle of a file. If you really have a need for a file that can be written to in a sorted kind of way, I suggest you look into using an embedded database. You might want to take a look at SQLite or BerkeleyDB. Then again, you might be working with a text file or a lega...
How to insert characters to a file using C# I have a huge file, where I have to insert certain characters at a specific location. What is the easiest way to do that in C# without rewriting the whole file again.
TITLE: How to insert characters to a file using C# QUESTION: I have a huge file, where I have to insert certain characters at a specific location. What is the easiest way to do that in C# without rewriting the whole file again. ANSWER: Filesystems do not support "inserting" data in the middle of a file. If you really...
[ "c#", ".net", "file", "random-access" ]
13
10
10,337
10
0
2008-09-19T00:56:05.150000
2008-09-19T01:10:35.070000
98,489
98,583
What is the proper way to do a Subversion merge in Eclipse?
I'm pretty used to how to do CVS merges in Eclipse, and I'm otherwise happy with the way that both Subclipse and Subversive work with the SVN repository, but I'm not quite sure how to do merges properly. When I do a merge, it seems to want to stick the merged files in a seperate directory in my project rather than over...
I would advise not trying to use Eclipse's plugins as your primary access to Subversion. If you are developing on Windows, TortoiseSVN is the best program that I have seen for Subversion access. Explore to the directory of which you wish to merge, right click on it and use the Tortoise SVN merge option. Assuming a non-...
What is the proper way to do a Subversion merge in Eclipse? I'm pretty used to how to do CVS merges in Eclipse, and I'm otherwise happy with the way that both Subclipse and Subversive work with the SVN repository, but I'm not quite sure how to do merges properly. When I do a merge, it seems to want to stick the merged ...
TITLE: What is the proper way to do a Subversion merge in Eclipse? QUESTION: I'm pretty used to how to do CVS merges in Eclipse, and I'm otherwise happy with the way that both Subclipse and Subversive work with the SVN repository, but I'm not quite sure how to do merges properly. When I do a merge, it seems to want to...
[ "eclipse", "svn", "merge", "subversive" ]
18
1
54,393
9
0
2008-09-19T00:57:48.827000
2008-09-19T01:17:04.023000
98,497
98,502
Generating unique account numbers - recursive call
Hi i need to generate 9 digit unique account numbers. Here is my pseudocode: function generateAccNo() generate an account number between 100,000,000 and 999,999,999 if the account number already exists in the DB call generateAccNo() /* recursive call */ else return new accout number end if end function The function ...
You realize this could very well cause a stack overflow, right? As the number of customesr increases, the probability of not finding a an acceptable account number increases. Also, why can't you just do sequential account numbers and just increase by one every time? With this approach, you'd just have to read the max i...
Generating unique account numbers - recursive call Hi i need to generate 9 digit unique account numbers. Here is my pseudocode: function generateAccNo() generate an account number between 100,000,000 and 999,999,999 if the account number already exists in the DB call generateAccNo() /* recursive call */ else return n...
TITLE: Generating unique account numbers - recursive call QUESTION: Hi i need to generate 9 digit unique account numbers. Here is my pseudocode: function generateAccNo() generate an account number between 100,000,000 and 999,999,999 if the account number already exists in the DB call generateAccNo() /* recursive cal...
[ "unique", "records" ]
5
8
6,263
10
0
2008-09-19T00:59:11.163000
2008-09-19T01:00:50.350000
98,516
98,546
How do I obtain equipment serial numbers programmatically?
I need to run an equipment audit and to do that I need to obtain the Windows PC, monitor etc. serial numbers. So I faced with going to each PC and manually writing down the numbers. Is there a way I can get this programmatically so each user can run a small program and email me the results?
If this information is anywhere, it'd be in WMI ( http://en.wikipedia.org/wiki/Windows_Management_Instrumentation ) - you could write a VBscript script to query this information and save it to a remote share on a server for example.
How do I obtain equipment serial numbers programmatically? I need to run an equipment audit and to do that I need to obtain the Windows PC, monitor etc. serial numbers. So I faced with going to each PC and manually writing down the numbers. Is there a way I can get this programmatically so each user can run a small pro...
TITLE: How do I obtain equipment serial numbers programmatically? QUESTION: I need to run an equipment audit and to do that I need to obtain the Windows PC, monitor etc. serial numbers. So I faced with going to each PC and manually writing down the numbers. Is there a way I can get this programmatically so each user c...
[ "serial-number" ]
4
6
3,888
5
0
2008-09-19T01:02:57.287000
2008-09-19T01:08:19.973000
98,559
98,572
How to parse hex values into a uint?
uint color; bool parsedhex = uint.TryParse(TextBox1.Text, out color); //where Text is of the form 0xFF0000 if(parsedhex) //... doesn't work. What am i doing wrong?
Try Convert.ToUInt32(hex, 16) //Using ToUInt32 not ToUInt64, as per OP comment
How to parse hex values into a uint? uint color; bool parsedhex = uint.TryParse(TextBox1.Text, out color); //where Text is of the form 0xFF0000 if(parsedhex) //... doesn't work. What am i doing wrong?
TITLE: How to parse hex values into a uint? QUESTION: uint color; bool parsedhex = uint.TryParse(TextBox1.Text, out color); //where Text is of the form 0xFF0000 if(parsedhex) //... doesn't work. What am i doing wrong? ANSWER: Try Convert.ToUInt32(hex, 16) //Using ToUInt32 not ToUInt64, as per OP comment
[ "c#" ]
88
141
110,793
4
0
2008-09-19T01:12:01.337000
2008-09-19T01:14:31.893000
98,586
98,977
Where can I find the world's fastest atof implementation?
I'm looking for an extremely fast atof() implementation on IA32 optimized for US-en locale, ASCII, and non-scientific notation. The windows multithreaded CRT falls down miserably here as it checks for locale changes on every call to isdigit(). Our current best is derived from the best of perl + tcl's atof implementatio...
What is your accuracy requirement? If you truly need it "correct" (always gets the nearest floating-point value to the decimal specified), it will probably be hard to beat the standard library versions (other than removing locale support, which you've already done), since this requires doing arbitrary precision arithme...
Where can I find the world's fastest atof implementation? I'm looking for an extremely fast atof() implementation on IA32 optimized for US-en locale, ASCII, and non-scientific notation. The windows multithreaded CRT falls down miserably here as it checks for locale changes on every call to isdigit(). Our current best i...
TITLE: Where can I find the world's fastest atof implementation? QUESTION: I'm looking for an extremely fast atof() implementation on IA32 optimized for US-en locale, ASCII, and non-scientific notation. The windows multithreaded CRT falls down miserably here as it checks for locale changes on every call to isdigit(). ...
[ "c++", "c", "performance", "assembly", "floating-point" ]
20
11
9,881
6
0
2008-09-19T01:17:55.317000
2008-09-19T02:26:15.450000
98,610
98,634
How can I get Eclipse to show .* files?
By default, Eclipse won't show my.htaccess file that I maintain in my project. It just shows an empty folder in the Package Viewer tree. How can I get it to show up? No obvious preferences.
In the package explorer, in the upper right corner of the view, there is a little down arrow. Tool tip will say view menu. From that menu, select filters From there, uncheck.* resources. So Package Explorer -> View Menu -> Filters -> uncheck.* resources. With Eclipse Kepler and OS X this is a bit different: Package Exp...
How can I get Eclipse to show .* files? By default, Eclipse won't show my.htaccess file that I maintain in my project. It just shows an empty folder in the Package Viewer tree. How can I get it to show up? No obvious preferences.
TITLE: How can I get Eclipse to show .* files? QUESTION: By default, Eclipse won't show my.htaccess file that I maintain in my project. It just shows an empty folder in the Package Viewer tree. How can I get it to show up? No obvious preferences. ANSWER: In the package explorer, in the upper right corner of the view,...
[ "eclipse", "file", "hidden" ]
547
860
212,344
14
0
2008-09-19T01:23:28.970000
2008-09-19T01:27:15.950000
98,622
171,045
Combo Box Item comparison and compiler warnings
In VisualStudio (Pro 2008), I have just noticed some inconsistent behaviour and wondered if there was any logical reasoning behind it In a WinForms project, if I use the line if(myComboBox.Items[i] == myObject) I get a compiler warning that I might get 'Possible unintended references' as I am comparing type object to t...
The compile warning for the first sample is because any custom == operator for your class would be ignored and the references compared (maybe not what you intended, hence the warning). It's not possible to specify that an operator should be overridden on an interface, so this will always be a reference comparison. The ...
Combo Box Item comparison and compiler warnings In VisualStudio (Pro 2008), I have just noticed some inconsistent behaviour and wondered if there was any logical reasoning behind it In a WinForms project, if I use the line if(myComboBox.Items[i] == myObject) I get a compiler warning that I might get 'Possible unintende...
TITLE: Combo Box Item comparison and compiler warnings QUESTION: In VisualStudio (Pro 2008), I have just noticed some inconsistent behaviour and wondered if there was any logical reasoning behind it In a WinForms project, if I use the line if(myComboBox.Items[i] == myObject) I get a compiler warning that I might get '...
[ "visual-studio", "compiler-construction" ]
2
1
394
2
0
2008-09-19T01:25:14.270000
2008-10-04T21:46:45.630000
98,641
98,681
Benefits of learning scheme?
I've just started one of my courses, as classes just began 2 weeks ago, and we are learning Scheme right now in one for I assume some reason later on, but so far from what he is teaching is basically how to write in scheme. As I sit here trying to stay awake I'm just trying to grasp why I would want to know this, and w...
It's a functional programming language and will do well broaden your experience. Even if you don't use it in the real world doesn't mean it doesn't have any value. It will help you master things like recursion and help to force you to think of problems in different ways than you normally would. I wish my school forced ...
Benefits of learning scheme? I've just started one of my courses, as classes just began 2 weeks ago, and we are learning Scheme right now in one for I assume some reason later on, but so far from what he is teaching is basically how to write in scheme. As I sit here trying to stay awake I'm just trying to grasp why I w...
TITLE: Benefits of learning scheme? QUESTION: I've just started one of my courses, as classes just began 2 weeks ago, and we are learning Scheme right now in one for I assume some reason later on, but so far from what he is teaching is basically how to write in scheme. As I sit here trying to stay awake I'm just tryin...
[ "scheme" ]
24
35
13,237
9
0
2008-09-19T01:29:01.827000
2008-09-19T01:35:18.380000
98,642
98,761
Best way to detect collision between sprites?
Whats the best way to detect collisions in a 2d game sprites? I am currently working in allegro and G++
There are a plethora of ways to detect collision detection. The methods you use will be slightly altered if depending on if your using a 2d or 3d environment. Also remember when instituting a collision detection system, to take into account any physics you may want to implement in the game (needed for most descent 3d g...
Best way to detect collision between sprites? Whats the best way to detect collisions in a 2d game sprites? I am currently working in allegro and G++
TITLE: Best way to detect collision between sprites? QUESTION: Whats the best way to detect collisions in a 2d game sprites? I am currently working in allegro and G++ ANSWER: There are a plethora of ways to detect collision detection. The methods you use will be slightly altered if depending on if your using a 2d or ...
[ "2d", "collision-detection", "allegro" ]
3
4
21,263
6
0
2008-09-19T01:29:15.930000
2008-09-19T01:48:13.170000
98,650
99,010
What is the strict aliasing rule?
When asking about common undefined behavior in C, people sometimes refer to the strict aliasing rule. What are they talking about?
A typical situation where you encounter strict aliasing problems is when overlaying a struct (like a device/network msg) onto a buffer of the word size of your system (like a pointer to uint32_t s or uint16_t s). When you overlay a struct onto such a buffer, or a buffer onto such a struct through pointer casting you ca...
What is the strict aliasing rule? When asking about common undefined behavior in C, people sometimes refer to the strict aliasing rule. What are they talking about?
TITLE: What is the strict aliasing rule? QUESTION: When asking about common undefined behavior in C, people sometimes refer to the strict aliasing rule. What are they talking about? ANSWER: A typical situation where you encounter strict aliasing problems is when overlaying a struct (like a device/network msg) onto a ...
[ "c++", "c", "undefined-behavior", "strict-aliasing", "type-punning" ]
991
701
299,157
11
0
2008-09-19T01:30:27.830000
2008-09-19T02:36:24.677000
98,653
98,662
From small to large projects
I've been quite used to working on small projects which I coded with 1,000 lines or less (pong, tetris, simple 3d games, etc). However as my abilities in programming are increasing, my organization isn't. I seem to be making everything dependent on one one another, so it's very hard for me to change the implementation ...
Sketch out an architectural design ahead of time. It doesn't have to be too detailed, but imagine how you want things to fit together in general terms.
From small to large projects I've been quite used to working on small projects which I coded with 1,000 lines or less (pong, tetris, simple 3d games, etc). However as my abilities in programming are increasing, my organization isn't. I seem to be making everything dependent on one one another, so it's very hard for me ...
TITLE: From small to large projects QUESTION: I've been quite used to working on small projects which I coded with 1,000 lines or less (pong, tetris, simple 3d games, etc). However as my abilities in programming are increasing, my organization isn't. I seem to be making everything dependent on one one another, so it's...
[ "oop" ]
4
1
222
4
0
2008-09-19T01:31:33.880000
2008-09-19T01:33:05.390000
98,669
98,698
Scriptaculous not working with the latest Prototype
This is a really weird problem that I have been having. When I download Scriptaculous from the official web site, script.aculo.us, bundled in the ZIP is prototype.js version 1.6.0.1. This works perfectly fine, I can follow along the wiki examples and begin learning. However, when I upgrade to prototype 1.6.0.2 (the lat...
scriptaculous is a JS library built on top of prototype. As such, they will be behind prototype in their release schedule. To ensure that scriptaculous works only use it with the prototype file that came in the download. Sure, given enough time and energy, you can find all the changed references from prototype 1.6.0.1 ...
Scriptaculous not working with the latest Prototype This is a really weird problem that I have been having. When I download Scriptaculous from the official web site, script.aculo.us, bundled in the ZIP is prototype.js version 1.6.0.1. This works perfectly fine, I can follow along the wiki examples and begin learning. H...
TITLE: Scriptaculous not working with the latest Prototype QUESTION: This is a really weird problem that I have been having. When I download Scriptaculous from the official web site, script.aculo.us, bundled in the ZIP is prototype.js version 1.6.0.1. This works perfectly fine, I can follow along the wiki examples and...
[ "javascript", "prototypejs", "scriptaculous" ]
2
4
948
2
0
2008-09-19T01:33:46.823000
2008-09-19T01:37:57.437000
98,687
98,906
What is the best solution for database connection pooling in python?
I have developed some custom DAO-like classes to meet some very specialized requirements for my project that is a server-side process that does not run inside any kind of framework. The solution works great except that every time a new request is made, I open a new connection via MySQLdb.connect. What is the best "drop...
IMO, the "more obvious/more idiomatic/better solution" is to use an existing ORM rather than invent DAO-like classes. It appears to me that ORM's are more popular than "raw" SQL connections. Why? Because Python is OO, and the mapping from a SQL row to an object is absolutely essential. There aren't many use cases where...
What is the best solution for database connection pooling in python? I have developed some custom DAO-like classes to meet some very specialized requirements for my project that is a server-side process that does not run inside any kind of framework. The solution works great except that every time a new request is made...
TITLE: What is the best solution for database connection pooling in python? QUESTION: I have developed some custom DAO-like classes to meet some very specialized requirements for my project that is a server-side process that does not run inside any kind of framework. The solution works great except that every time a n...
[ "python", "mysql", "connection-pooling" ]
42
16
71,443
9
0
2008-09-19T01:36:03.447000
2008-09-19T02:13:07.260000
98,693
98,736
I need a binary comparison tool for Win/Linux
First of all, I don't need a textual comparison so Beyond Compare doesn't do what I need. I'm looking for a util that can report on the differences between two files, at the byte level. Bare minimum is the need to see the percentage change in the file, or a report on affected bytes/sectors. Is there anything available ...
I found VBinDiff. I haven't used it, but it probably does what you want.
I need a binary comparison tool for Win/Linux First of all, I don't need a textual comparison so Beyond Compare doesn't do what I need. I'm looking for a util that can report on the differences between two files, at the byte level. Bare minimum is the need to see the percentage change in the file, or a report on affect...
TITLE: I need a binary comparison tool for Win/Linux QUESTION: First of all, I don't need a textual comparison so Beyond Compare doesn't do what I need. I'm looking for a util that can report on the differences between two files, at the byte level. Bare minimum is the need to see the percentage change in the file, or ...
[ "linux", "windows", "binary", "comparison" ]
3
7
8,156
6
0
2008-09-19T01:37:32.757000
2008-09-19T01:44:31.540000
98,695
98,710
Design Principles
What principles do you generally follow when doing class design?
Principles Of Object Oriented Class Design (the "SOLID" principles) SRP: The Single Responsibility Principle A class should have one, and only one, reason to change. OCP: The Open Closed Principle You should be able to extend a classes behavior, without modifying it. LSP: The Liskov Substitution Principle Derived class...
Design Principles What principles do you generally follow when doing class design?
TITLE: Design Principles QUESTION: What principles do you generally follow when doing class design? ANSWER: Principles Of Object Oriented Class Design (the "SOLID" principles) SRP: The Single Responsibility Principle A class should have one, and only one, reason to change. OCP: The Open Closed Principle You should be...
[ "oop", "principles" ]
15
28
2,255
12
0
2008-09-19T01:37:52.727000
2008-09-19T01:39:35.950000
98,705
100,593
What are the semantics of a const member function?
I understand that the function is not allowed to change the state of the object, but I thought I read somewhere that the compiler was allowed to assume that if the function was called with the same arguments, it would return the same value and thus could reuse a cached value if it was available. e.g. class object { int...
const is about program semantics and not about implementation details. You should mark a member function const when it does not change the visible state of the object, and should be callable on an object that is itself const. Within a const member function on a class X, the type of this is X const *: pointer to constan...
What are the semantics of a const member function? I understand that the function is not allowed to change the state of the object, but I thought I read somewhere that the compiler was allowed to assume that if the function was called with the same arguments, it would return the same value and thus could reuse a cached...
TITLE: What are the semantics of a const member function? QUESTION: I understand that the function is not allowed to change the state of the object, but I thought I read somewhere that the compiler was allowed to assume that if the function was called with the same arguments, it would return the same value and thus co...
[ "c++", "methods", "constants" ]
13
27
6,870
9
0
2008-09-19T01:38:28.013000
2008-09-19T08:56:48.350000
98,711
104,906
Suggestions on how to add the functionality to import Finale music files on an application?
I'm working on a music writing application and would like to add the functionality to import Finale music files. Right now, the only thing I know is that they are enigma binary files. Does anyone have any suggestions on where I could start so that I could be able to parse through these types of files?
Finale files are not just binary files, but compressed, encrypted binary files. ETF files are text files and do have some documentation in older versions of the Finale plug-in developer kit. But ETF export was removed from Finale several versions ago. As was previously suggested, your best bet is to import MusicXML fil...
Suggestions on how to add the functionality to import Finale music files on an application? I'm working on a music writing application and would like to add the functionality to import Finale music files. Right now, the only thing I know is that they are enigma binary files. Does anyone have any suggestions on where I ...
TITLE: Suggestions on how to add the functionality to import Finale music files on an application? QUESTION: I'm working on a music writing application and would like to add the functionality to import Finale music files. Right now, the only thing I know is that they are enigma binary files. Does anyone have any sugge...
[ "parsing" ]
1
4
756
4
0
2008-09-19T01:40:31.720000
2008-09-19T19:42:06.573000
98,722
98,862
FinalBuilder Enumeration of files and folders
What's the best way to enumerate a set of files and folders using FinalBuilder? The context of my question is, I want to compare a source folder with a destination folder, and replace any matching files in the destination folder that are older than the source folder. Any suggestions?
ok, for future reference, it turns out that under the catgeory "Iterators" there are two very helpful actions. File/Fileset Iterator Folder Iterator Further digging revealed the Robocopy Mirror action, which does exactly what I was looking for, namely syncing the destination folder with the source folder. No need to wr...
FinalBuilder Enumeration of files and folders What's the best way to enumerate a set of files and folders using FinalBuilder? The context of my question is, I want to compare a source folder with a destination folder, and replace any matching files in the destination folder that are older than the source folder. Any su...
TITLE: FinalBuilder Enumeration of files and folders QUESTION: What's the best way to enumerate a set of files and folders using FinalBuilder? The context of my question is, I want to compare a source folder with a destination folder, and replace any matching files in the destination folder that are older than the sou...
[ "finalbuilder" ]
1
2
794
1
0
2008-09-19T01:42:13.683000
2008-09-19T02:05:29.663000
98,739
99,014
Should entities have behavior or not?
Should entities have behavior? or not? Why or why not? If not, does that violate Encapsulation?
If your entities do not have behavior, then you are not writing object-oriented code. If everything is done with getters and setters and no other behavior, you're writing procedural code. A lot of shops say they're practicing SOA when they keep their entities dumb. Their justification is that the data structure rarely ...
Should entities have behavior or not? Should entities have behavior? or not? Why or why not? If not, does that violate Encapsulation?
TITLE: Should entities have behavior or not? QUESTION: Should entities have behavior? or not? Why or why not? If not, does that violate Encapsulation? ANSWER: If your entities do not have behavior, then you are not writing object-oriented code. If everything is done with getters and setters and no other behavior, you...
[ "oop" ]
4
8
2,778
5
0
2008-09-19T01:45:09.807000
2008-09-19T02:37:02.630000
98,768
98,786
Should I impose a maximum length on passwords?
I can understand that imposing a minimum length on passwords makes a lot of sense (to save users from themselves), but my bank has a requirement that passwords are between 6 and 8 characters long, and I started wondering... Wouldn't this just make it easier for brute force attacks? (Bad) Does this imply that my passwor...
Passwords are hashed to 32, 40, 128, whatever length. The only reason for a minimum length is to prevent easy to guess passwords. There is no purpose for a maximum length. The obligatory XKCD explaining why you're doing your user a disservice if you impose a max length:
Should I impose a maximum length on passwords? I can understand that imposing a minimum length on passwords makes a lot of sense (to save users from themselves), but my bank has a requirement that passwords are between 6 and 8 characters long, and I started wondering... Wouldn't this just make it easier for brute force...
TITLE: Should I impose a maximum length on passwords? QUESTION: I can understand that imposing a minimum length on passwords makes a lot of sense (to save users from themselves), but my bank has a requirement that passwords are between 6 and 8 characters long, and I started wondering... Wouldn't this just make it easi...
[ "security", "encryption", "passwords" ]
205
227
106,715
24
0
2008-09-19T01:49:29.360000
2008-09-19T01:52:13.580000
98,774
98,838
Preallocating file space in C#?
I am creating a downloading application and I wish to preallocate room on the harddrive for the files before they are actually downloaded as they could potentially be rather large, and noone likes to see "This drive is full, please delete some files and try again." So, in that light, I wrote this. // Quick, and very di...
FileStream.SetLength is the one you want. The syntax: public override void SetLength( long value )
Preallocating file space in C#? I am creating a downloading application and I wish to preallocate room on the harddrive for the files before they are actually downloaded as they could potentially be rather large, and noone likes to see "This drive is full, please delete some files and try again." So, in that light, I w...
TITLE: Preallocating file space in C#? QUESTION: I am creating a downloading application and I wish to preallocate room on the harddrive for the files before they are actually downloaded as they could potentially be rather large, and noone likes to see "This drive is full, please delete some files and try again." So, ...
[ "c#", "file", "file-io" ]
22
31
6,997
3
0
2008-09-19T01:50:52.477000
2008-09-19T02:01:07.350000
98,801
99,260
Should I inject things into my entities?
When using an IoC container, is it considered good design to inject other classes into them? i.e. a persistence class
Generally I advise against it. Entities are just that and should represent some identifiable and important part of your core domain. They should have one responsibility and be very, very good at doing it. If the entity requires additional services in order to complete a task (say persist itself) you're starting to let ...
Should I inject things into my entities? When using an IoC container, is it considered good design to inject other classes into them? i.e. a persistence class
TITLE: Should I inject things into my entities? QUESTION: When using an IoC container, is it considered good design to inject other classes into them? i.e. a persistence class ANSWER: Generally I advise against it. Entities are just that and should represent some identifiable and important part of your core domain. T...
[ "oop" ]
5
3
722
5
0
2008-09-19T01:55:18.143000
2008-09-19T03:22:38.650000
98,827
99,048
Assign variables with a regular expression
I'm looking for a method to assign variables with patterns in regular expressions with C++.NET something like String^ speed; String^ size; "command SPEED=[speed] SIZE=[size]" Right now I'm using IndexOf() and Substring() but it is quite ugly
String^ speed; String^ size; Match m; Regex theregex = new Regex ( "SPEED=(? (.*?)) SIZE=(? (.*?)) ", RegexOptions::ExplicitCapture); m = theregex.Match (yourinputstring); if (m.Success) { if (m.Groups["speed"].Success) speed = m.Groups["speed"].Value; if (m.Groups["size"].Success) size = m.Groups["size"].Value; } else...
Assign variables with a regular expression I'm looking for a method to assign variables with patterns in regular expressions with C++.NET something like String^ speed; String^ size; "command SPEED=[speed] SIZE=[size]" Right now I'm using IndexOf() and Substring() but it is quite ugly
TITLE: Assign variables with a regular expression QUESTION: I'm looking for a method to assign variables with patterns in regular expressions with C++.NET something like String^ speed; String^ size; "command SPEED=[speed] SIZE=[size]" Right now I'm using IndexOf() and Substring() but it is quite ugly ANSWER: String^ ...
[ ".net", "regex", "string", "parsing" ]
4
3
2,633
3
0
2008-09-19T01:59:39.083000
2008-09-19T02:45:06.823000
98,856
103,801
Can the NetBeans code formatter be made to format javadoc comments?
The NetBeans 6.1 editor doesn't seem to like to wrap comments, and the code formatter seems to ignore them. For JavaDoc comments, this behaviour seems inappropriate, as you can end up spending a lot of wasted time manually reflowing paragraphs. I was wondering if there's some magic setting to get the builtin code forma...
This issue has been raised to the Netbeans development team and will likely be added in a "future" release of Netbeans. If you want this feature (or any other feature) to be added to the IDE, go to the issue tracking website and vote for this feature. http://www.netbeans.org/issues/show_bug.cgi?id=11553 Most open-sourc...
Can the NetBeans code formatter be made to format javadoc comments? The NetBeans 6.1 editor doesn't seem to like to wrap comments, and the code formatter seems to ignore them. For JavaDoc comments, this behaviour seems inappropriate, as you can end up spending a lot of wasted time manually reflowing paragraphs. I was w...
TITLE: Can the NetBeans code formatter be made to format javadoc comments? QUESTION: The NetBeans 6.1 editor doesn't seem to like to wrap comments, and the code formatter seems to ignore them. For JavaDoc comments, this behaviour seems inappropriate, as you can end up spending a lot of wasted time manually reflowing p...
[ "java", "netbeans", "formatting", "javadoc" ]
3
1
2,324
2
0
2008-09-19T02:04:07.670000
2008-09-19T17:15:07.143000
98,859
99,337
Information Hiding and Properties
Does Information Hiding mean I should minimize the number of properties my classes have? Is that right? Do you tend to make your classes private fields with methods?
Ever strike up a conversation by asking "How are you?", only to be met with a litany of their troubles and triumphs, pet peeves and uninteresting interests, feelings of insecurity and maybe an in-depth review of the breakfast muffins......that's not information hiding. Most of us don't do that. Kids do, at least until ...
Information Hiding and Properties Does Information Hiding mean I should minimize the number of properties my classes have? Is that right? Do you tend to make your classes private fields with methods?
TITLE: Information Hiding and Properties QUESTION: Does Information Hiding mean I should minimize the number of properties my classes have? Is that right? Do you tend to make your classes private fields with methods? ANSWER: Ever strike up a conversation by asking "How are you?", only to be met with a litany of their...
[ "oop" ]
3
1
543
8
0
2008-09-19T02:04:47.107000
2008-09-19T03:36:11.427000
98,867
99,224
Where did the concept of Interfaces come from?
In c#, we have interfaces. Where did these come from? They didn't exist in c++.
Interfaces are pretty old, and have been around for quite a while. Early (mid to late late 1970's) non-object oriented languages such as Modula and Euclid used constructs called "modules" to specify the interfaces between components. Components would then communicate with each other via explicit importing and exporting...
Where did the concept of Interfaces come from? In c#, we have interfaces. Where did these come from? They didn't exist in c++.
TITLE: Where did the concept of Interfaces come from? QUESTION: In c#, we have interfaces. Where did these come from? They didn't exist in c++. ANSWER: Interfaces are pretty old, and have been around for quite a while. Early (mid to late late 1970's) non-object oriented languages such as Modula and Euclid used constr...
[ "language-agnostic", "interface" ]
10
12
1,828
18
0
2008-09-19T02:06:21.487000
2008-09-19T03:14:43.087000
98,878
595,772
How does one elaborate design using CRC cards?
I've always been wondering how people use CRC (class responsiblity collaboration) cards. I've read about them in books, found vague information on the internet, but never grasped it really. I think someone ought to make a youtube video showing a session with CRC cards, since one of my books described it as being very h...
I'll try to give an answer. So CRC cards are generally used for modelling in a Object-Oriented environment to get a better understanding of the system that has to be developed (but that I think you'll know already). CRC cards come at the very end, when you arrive just before the actual implementation. The different ste...
How does one elaborate design using CRC cards? I've always been wondering how people use CRC (class responsiblity collaboration) cards. I've read about them in books, found vague information on the internet, but never grasped it really. I think someone ought to make a youtube video showing a session with CRC cards, sin...
TITLE: How does one elaborate design using CRC cards? QUESTION: I've always been wondering how people use CRC (class responsiblity collaboration) cards. I've read about them in books, found vague information on the internet, but never grasped it really. I think someone ought to make a youtube video showing a session w...
[ "oop", "ooad", "crc-cards" ]
30
13
5,316
6
0
2008-09-19T02:07:23.013000
2009-02-27T17:34:41.883000
98,895
1,052,042
IIS is returning 404 errors for ASPX pages that exist (aka DllRegisterServer entry point was not found)
I'm having problems refreshing.Net 2.0 with IIS 6. I have been able to successfully execute "aspnet_regiis.exe -i", but when I try to register the aspnet_isapi.dll: regsvr32 “C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" I get the error C:\Windows..\aspnet_isapi.dll was loaded, but the DllRegisterServ...
In the end, I think the problem was caused by a step that is missed by the script when you refresh ASP.Net 2.0 with IIS 6. I managed to resolve this using the following steps: Refresh the install using C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -s /w3svc/1/root Enable ASP.Net Web Service Extension in t...
IIS is returning 404 errors for ASPX pages that exist (aka DllRegisterServer entry point was not found) I'm having problems refreshing.Net 2.0 with IIS 6. I have been able to successfully execute "aspnet_regiis.exe -i", but when I try to register the aspnet_isapi.dll: regsvr32 “C:\WINDOWS\Microsoft.NET\Framework\v2.0.5...
TITLE: IIS is returning 404 errors for ASPX pages that exist (aka DllRegisterServer entry point was not found) QUESTION: I'm having problems refreshing.Net 2.0 with IIS 6. I have been able to successfully execute "aspnet_regiis.exe -i", but when I try to register the aspnet_isapi.dll: regsvr32 “C:\WINDOWS\Microsoft.NE...
[ ".net", "iis" ]
1
3
42,713
5
0
2008-09-19T02:11:09.167000
2009-06-27T03:20:29.670000
98,901
99,701
Windows XP - Create Shortcuts on Desktop and controll their placement
In any language really, im looking for a simple (very simple) way to control the position of a shortcut on the users desktop. I already make the assumption that Auto Arrange and Align to Grid are unchecked. Ex: The program creates the shortcut to the desktop than places it at position (450,302) on the desktop. I know h...
One can use an automation program such as AutoIt or AutoHotkey to simulate the user clicking and moving the shortcut to another location. These programs can also create the shortcut and place it on the desktop.
Windows XP - Create Shortcuts on Desktop and controll their placement In any language really, im looking for a simple (very simple) way to control the position of a shortcut on the users desktop. I already make the assumption that Auto Arrange and Align to Grid are unchecked. Ex: The program creates the shortcut to the...
TITLE: Windows XP - Create Shortcuts on Desktop and controll their placement QUESTION: In any language really, im looking for a simple (very simple) way to control the position of a shortcut on the users desktop. I already make the assumption that Auto Arrange and Align to Grid are unchecked. Ex: The program creates t...
[ "windows", "winapi", "shortcut" ]
2
0
1,130
3
0
2008-09-19T02:12:26.497000
2008-09-19T04:47:22.317000
98,908
98,979
What is the point of the Lowered* columns in asp.net membership tables?
What is the architectural reason for the column names prefixed with "Lowered" in the SQL schema for ASP.Net membership and friends? Some examples of the columns in question are below: aspnet_Applications.LoweredApplicationName aspnet_users.LoweredUserName aspnet_membership.LowerEmail I see that the lowered columns are ...
There is no purpose for this in a non case sensitive database like SQL Server. This is a reusable database regardless of the type of database in which you are using. E.g. Informix is case-sensitive for all string data which is stored. Using this database on an Informix server would be a good reason to have/use this col...
What is the point of the Lowered* columns in asp.net membership tables? What is the architectural reason for the column names prefixed with "Lowered" in the SQL schema for ASP.Net membership and friends? Some examples of the columns in question are below: aspnet_Applications.LoweredApplicationName aspnet_users.LoweredU...
TITLE: What is the point of the Lowered* columns in asp.net membership tables? QUESTION: What is the architectural reason for the column names prefixed with "Lowered" in the SQL schema for ASP.Net membership and friends? Some examples of the columns in question are below: aspnet_Applications.LoweredApplicationName asp...
[ "asp.net" ]
3
2
700
1
0
2008-09-19T02:13:33.560000
2008-09-19T02:26:50.737000
98,916
98,934
programmatically find number of hosts in a Netmask
How do you programmatically find the number of hosts that a netmask supports. Eg, If you have a /30, how do you find how many IP's are in it without using a lookup table? Preferably would be able to work with the "/" notation, rather than 255.xxx.xxx.xxx notation.
Here's the formula: 2 ^ (32 - netmask) - 2 where netmask is a bit count as you've shown in the Cisco notation above. So a network with a /30 mask has 2 usable addresses. The lowest network number always represents the network segment itself and the highest is always the broadcast... this leads to the -2 at the end of t...
programmatically find number of hosts in a Netmask How do you programmatically find the number of hosts that a netmask supports. Eg, If you have a /30, how do you find how many IP's are in it without using a lookup table? Preferably would be able to work with the "/" notation, rather than 255.xxx.xxx.xxx notation.
TITLE: programmatically find number of hosts in a Netmask QUESTION: How do you programmatically find the number of hosts that a netmask supports. Eg, If you have a /30, how do you find how many IP's are in it without using a lookup table? Preferably would be able to work with the "/" notation, rather than 255.xxx.xxx....
[ "math", "networking" ]
1
4
3,240
6
0
2008-09-19T02:14:37.427000
2008-09-19T02:18:07.263000
98,930
98,969
Managing the patch level of multiple windows systems
In an environment with multiple windows servers what is the best way to ensure patch compliance accross all systems? Is there a simple tool (some sort of client/server app?) that allows reports to be generated showing the status of all the systems so any that aren't automatically patching themselves can be fixed withou...
Microsoft Windows Server Update Services Microsoft Windows Server Update Services (WSUS) enables information technology administrators to deploy the latest Microsoft product updates to computers running the Windows operating system. By using WSUS, administrators can fully manage the distribution of updates that are rel...
Managing the patch level of multiple windows systems In an environment with multiple windows servers what is the best way to ensure patch compliance accross all systems? Is there a simple tool (some sort of client/server app?) that allows reports to be generated showing the status of all the systems so any that aren't ...
TITLE: Managing the patch level of multiple windows systems QUESTION: In an environment with multiple windows servers what is the best way to ensure patch compliance accross all systems? Is there a simple tool (some sort of client/server app?) that allows reports to be generated showing the status of all the systems s...
[ "windows", "system-administration", "patch" ]
2
1
1,819
2
0
2008-09-19T02:17:26.280000
2008-09-19T02:24:38.463000
98,941
99,659
wxWidgets: Detecting click event on custom controls
How to add a click event listener to my custom control made with wxWidgets? The custom control uses wxWindow as the base. On the event list I see wxEVT_LEFT_DOWN wxEVT_LEFT_UP wxEVT_LEFT_DCLICK wxEVT_MIDDLE_DOWN wxEVT_MIDDLE_UP wxEVT_MIDDLE_DCLICK wxEVT_RIGHT_DOWN wxEVT_RIGHT_UP wxEVT_RIGHT_DCLICK wxEVT_MOTION wxEVT_EN...
Typically, there is no "click" event (and in the case of wxWidgets - there isn't ). The action of clicking is broken into its two parts: Mouse Down and Mouse Up. Typically what you think of as a "left click" event is actually handled in a "left up" event. Try it out: Hover over a button (such as the "Add Comment" butto...
wxWidgets: Detecting click event on custom controls How to add a click event listener to my custom control made with wxWidgets? The custom control uses wxWindow as the base. On the event list I see wxEVT_LEFT_DOWN wxEVT_LEFT_UP wxEVT_LEFT_DCLICK wxEVT_MIDDLE_DOWN wxEVT_MIDDLE_UP wxEVT_MIDDLE_DCLICK wxEVT_RIGHT_DOWN wxE...
TITLE: wxWidgets: Detecting click event on custom controls QUESTION: How to add a click event listener to my custom control made with wxWidgets? The custom control uses wxWindow as the base. On the event list I see wxEVT_LEFT_DOWN wxEVT_LEFT_UP wxEVT_LEFT_DCLICK wxEVT_MIDDLE_DOWN wxEVT_MIDDLE_UP wxEVT_MIDDLE_DCLICK wx...
[ "events", "mouse", "click", "wxwidgets" ]
3
4
7,528
2
0
2008-09-19T02:20:03.467000
2008-09-19T04:34:18.247000
98,984
99,266
Black-box vs White-box Reuse
What are the pros/cons of using black-box reuse over white-box reuse?
In my experience, White box reuse is normally done through inheritance and black box is done through composition. White Box Reuse Pro: You can customize the module to fit the specific situation, this allows reuse in more situations Con: You now own the customized result, so it adds to your code complexity. Black Box Re...
Black-box vs White-box Reuse What are the pros/cons of using black-box reuse over white-box reuse?
TITLE: Black-box vs White-box Reuse QUESTION: What are the pros/cons of using black-box reuse over white-box reuse? ANSWER: In my experience, White box reuse is normally done through inheritance and black box is done through composition. White Box Reuse Pro: You can customize the module to fit the specific situation,...
[ "oop" ]
4
10
13,274
4
0
2008-09-19T02:28:18.627000
2008-09-19T03:23:18.480000
99,001
99,046
WCF netTCPBinding - Is transport encryption enough?
I've got a WCF service which handles some sensitive data. I'd like to make sure I keep that data from being exposed and so I'm looking at netTCPBinding... primarily because I can control the network it runs across and performance is a high priority. I recognize that there are two areas that can be encrypted: transport ...
The message-level encryption is needed when you do not control an intermediary. Intermediary services need to be able to modify the soap headers and could peek at your sensitive data for malicious purposes. But if you control everything from initial sender to ultimate receiver, then you do not need encryption at that l...
WCF netTCPBinding - Is transport encryption enough? I've got a WCF service which handles some sensitive data. I'd like to make sure I keep that data from being exposed and so I'm looking at netTCPBinding... primarily because I can control the network it runs across and performance is a high priority. I recognize that t...
TITLE: WCF netTCPBinding - Is transport encryption enough? QUESTION: I've got a WCF service which handles some sensitive data. I'd like to make sure I keep that data from being exposed and so I'm looking at netTCPBinding... primarily because I can control the network it runs across and performance is a high priority. ...
[ ".net", "wcf", "networking", "encryption", "tcp" ]
5
5
5,464
3
0
2008-09-19T02:34:19.237000
2008-09-19T02:44:43.983000
99,045
429,196
Handling browser pop-up windows with Selenium
We are running Selenium regression tests against our existing code base, and certain screens in our web app use pop-ups for intermediate steps. Currently we use the commands in the test: // force new window to open at this point - so we can select it later selenium().getEval("this.browserbot.getCurrentWindow().open('',...
It works!! Just to make it easier for the folks who prefer selenese. This worked for me using IE7(normal mode). What a freaking hassle. Thank the spaghetti monster in the sky for SO or there is no way I would have got this working in IE. getEval selenium.browserbot.getCurrentWindow().open('', 'windowName'); click butto...
Handling browser pop-up windows with Selenium We are running Selenium regression tests against our existing code base, and certain screens in our web app use pop-ups for intermediate steps. Currently we use the commands in the test: // force new window to open at this point - so we can select it later selenium().getEva...
TITLE: Handling browser pop-up windows with Selenium QUESTION: We are running Selenium regression tests against our existing code base, and certain screens in our web app use pop-ups for intermediate steps. Currently we use the commands in the test: // force new window to open at this point - so we can select it later...
[ "internet-explorer", "selenium", "popup", "regression-testing" ]
21
4
64,221
5
0
2008-09-19T02:44:34.420000
2009-01-09T18:40:46.113000
99,054
107,994
Having trouble achieving 1Gbit UDP throughput
For UDP packets with a payload less then 1470, is it possible to achieve 1Gbit throughput? Due to the small packet size, there should be some bottlenecks in achieving such throughput (I/O, OS, network, etc.). I imagine drivers and hardware might have to be tuned to small packet/high throughput. Has anybody attempted su...
I've previously done some experimenting with throughput on gigabit links on relatively standard pc hardware, albeit doing just transmits (via tcpreplay ), rather than udp. The biggest bottleneck that I found was in just getting packets to the NIC itself. This can be significantly improved by using a high speed bus to i...
Having trouble achieving 1Gbit UDP throughput For UDP packets with a payload less then 1470, is it possible to achieve 1Gbit throughput? Due to the small packet size, there should be some bottlenecks in achieving such throughput (I/O, OS, network, etc.). I imagine drivers and hardware might have to be tuned to small pa...
TITLE: Having trouble achieving 1Gbit UDP throughput QUESTION: For UDP packets with a payload less then 1470, is it possible to achieve 1Gbit throughput? Due to the small packet size, there should be some bottlenecks in achieving such throughput (I/O, OS, network, etc.). I imagine drivers and hardware might have to be...
[ "sockets", "networking", "udp" ]
9
7
8,291
5
0
2008-09-19T02:46:28.770000
2008-09-20T12:05:39.470000
99,057
104,742
Getting BPL Versions at program startup
Is it possible to check what version of BPL (ie Rtl70.BPL, Indy70.bpl etc) are installed on a clients computer when the program starts? I have had some programs crash because the BPL on there computer is different to the ones on the build machine. If i have to add each BPL used into the installer on each update, i thin...
Unfortunately, no. If the crash is due to missing imports from the.bpl files required by your application, there is no way (short of rewriting the Delphi RTL and linker themselves) to check for those packages from within the crashing executable itself. PatrickvL's solution is probably the best for your situation. Nefta...
Getting BPL Versions at program startup Is it possible to check what version of BPL (ie Rtl70.BPL, Indy70.bpl etc) are installed on a clients computer when the program starts? I have had some programs crash because the BPL on there computer is different to the ones on the build machine. If i have to add each BPL used i...
TITLE: Getting BPL Versions at program startup QUESTION: Is it possible to check what version of BPL (ie Rtl70.BPL, Indy70.bpl etc) are installed on a clients computer when the program starts? I have had some programs crash because the BPL on there computer is different to the ones on the build machine. If i have to a...
[ "delphi", "delphi-7", "bpl" ]
2
2
2,114
5
0
2008-09-19T02:47:47.067000
2008-09-19T19:21:04.190000
99,059
99,206
copying data from production to test server without erasing schema
Using sql server 2000, I would like to take my production data and put it in my test database, but I don't want to overwrite the schema of the test database as there are fields in it that I haven't added to production yet. Can this be done? I should add that these databases are on different servers.
I think the Import/Export Wizard exists in SQL Server 2000. Wizards are generally irritating, but it only takes a few minutes and you probably already have it installed. The wizard can be used to create a DTS package that can append all of the data from your production database to the end of tables in another database ...
copying data from production to test server without erasing schema Using sql server 2000, I would like to take my production data and put it in my test database, but I don't want to overwrite the schema of the test database as there are fields in it that I haven't added to production yet. Can this be done? I should add...
TITLE: copying data from production to test server without erasing schema QUESTION: Using sql server 2000, I would like to take my production data and put it in my test database, but I don't want to overwrite the schema of the test database as there are fields in it that I haven't added to production yet. Can this be ...
[ "sql-server" ]
2
0
827
5
0
2008-09-19T02:47:50.980000
2008-09-19T03:12:13.030000
99,098
99,175
Generate a current datestamp in Java
What is the best way to generate a current datestamp in Java? YYYY-MM-DD:hh-mm-ss
Using the standard JDK, you will want to use java.text.SimpleDateFormat Date myDate = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd:HH-mm-ss"); String myDateString = sdf.format(myDate); However, if you have the option to use the Apache Commons Lang package, you can use org.apache.commons.lang.time...
Generate a current datestamp in Java What is the best way to generate a current datestamp in Java? YYYY-MM-DD:hh-mm-ss
TITLE: Generate a current datestamp in Java QUESTION: What is the best way to generate a current datestamp in Java? YYYY-MM-DD:hh-mm-ss ANSWER: Using the standard JDK, you will want to use java.text.SimpleDateFormat Date myDate = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd:HH-mm-ss"); String m...
[ "java", "datestamp" ]
13
27
18,559
5
0
2008-09-19T02:54:27.953000
2008-09-19T03:07:30.933000
99,132
99,174
how to prevent "directory already exists error" in a makefile when using mkdir
I need to generate a directory in my makefile and I would like to not get the "directory already exists error" over and over even though I can easily ignore it. I mainly use mingw/msys but would like something that works across other shells/systems too. I tried this but it didn't work, any ideas? ifeq (,$(findstring $(...
On UNIX Just use this: mkdir -p $(OBJDIR) The -p option to mkdir prevents the error message if the directory exists.
how to prevent "directory already exists error" in a makefile when using mkdir I need to generate a directory in my makefile and I would like to not get the "directory already exists error" over and over even though I can easily ignore it. I mainly use mingw/msys but would like something that works across other shells/...
TITLE: how to prevent "directory already exists error" in a makefile when using mkdir QUESTION: I need to generate a directory in my makefile and I would like to not get the "directory already exists error" over and over even though I can easily ignore it. I mainly use mingw/msys but would like something that works ac...
[ "makefile", "directory", "exists" ]
123
127
131,242
12
0
2008-09-19T03:01:16.987000
2008-09-19T03:07:29.313000
99,161
99,186
How do you make Vim unhighlight what you searched for?
I search for "nurple" in a file. I found it, great. But now, every occurrence of "nurple" is rendered in sick black on yellow. Forever. Forever, that is, until I search for something I know won't be found, such as "asdhfalsdflajdflakjdf" simply so it clears the previous search highlighting. Can't I just hit a magic key...
Just put this in your.vimrc " redraws the screen and removes any search highlighting. nnoremap:nohl
How do you make Vim unhighlight what you searched for? I search for "nurple" in a file. I found it, great. But now, every occurrence of "nurple" is rendered in sick black on yellow. Forever. Forever, that is, until I search for something I know won't be found, such as "asdhfalsdflajdflakjdf" simply so it clears the pre...
TITLE: How do you make Vim unhighlight what you searched for? QUESTION: I search for "nurple" in a file. I found it, great. But now, every occurrence of "nurple" is rendered in sick black on yellow. Forever. Forever, that is, until I search for something I know won't be found, such as "asdhfalsdflajdflakjdf" simply so...
[ "search", "vim", "highlight" ]
264
199
134,346
14
0
2008-09-19T03:05:24.980000
2008-09-19T03:09:27.730000
99,164
99,178
Iterate with for loop or while loop?
I often see code like: Iterator i = list.iterator(); while(i.hasNext()) {... } but I write that (when Java 1.5 isn't available or for each can't be used) as: for(Iterator i = list.iterator(); i.hasNext(); ) {... } because It is shorter It keeps i in a smaller scope It reduces the chance of confusion. (Is i used outside...
I prefer the for loop because it also sets the scope of the iterator to just the for loop.
Iterate with for loop or while loop? I often see code like: Iterator i = list.iterator(); while(i.hasNext()) {... } but I write that (when Java 1.5 isn't available or for each can't be used) as: for(Iterator i = list.iterator(); i.hasNext(); ) {... } because It is shorter It keeps i in a smaller scope It reduces the ch...
TITLE: Iterate with for loop or while loop? QUESTION: I often see code like: Iterator i = list.iterator(); while(i.hasNext()) {... } but I write that (when Java 1.5 isn't available or for each can't be used) as: for(Iterator i = list.iterator(); i.hasNext(); ) {... } because It is shorter It keeps i in a smaller scope...
[ "java", "for-loop", "iterator" ]
46
87
66,123
15
0
2008-09-19T03:06:18.223000
2008-09-19T03:07:42.993000
99,241
101,584
Is there any way to get access to the DOM from Objective-C when using UIWebView?
UIWebView is fine for displaying HTML, but I'd like to modify the loaded DOM from my Objective-C program. Does anybody know how to do that? This is a third party page, so I can't really include any custom JS to do so...unless I can modify the DOM somehow.
This may be of some help, as not to plagiarize the solution provider in the link, here's the link: http://lists.apple.com/archives/safari-iphone-web-dev/2008/Sep/msg00001.html
Is there any way to get access to the DOM from Objective-C when using UIWebView? UIWebView is fine for displaying HTML, but I'd like to modify the loaded DOM from my Objective-C program. Does anybody know how to do that? This is a third party page, so I can't really include any custom JS to do so...unless I can modify ...
TITLE: Is there any way to get access to the DOM from Objective-C when using UIWebView? QUESTION: UIWebView is fine for displaying HTML, but I'd like to modify the loaded DOM from my Objective-C program. Does anybody know how to do that? This is a third party page, so I can't really include any custom JS to do so...un...
[ "iphone", "objective-c" ]
6
3
5,672
2
0
2008-09-19T03:18:32.437000
2008-09-19T12:49:15.287000
99,242
99,286
RMI server: rmiregistry or LocateRegistry.createRegistry
For RMI on server-side, do we need to start rmiregistry program, or just call LocateRegistry.createRegistry? If both are possible, what are the advantages and disadvantages?
They're the same thing... rmiregistry is a separate program, which you can run from a command line or a script, while LocateRegistry.createRegistry does the same thing programatically. In my experience, for "real" servers you will want to use rmiregistry so that you know it's always running regardless of whether or not...
RMI server: rmiregistry or LocateRegistry.createRegistry For RMI on server-side, do we need to start rmiregistry program, or just call LocateRegistry.createRegistry? If both are possible, what are the advantages and disadvantages?
TITLE: RMI server: rmiregistry or LocateRegistry.createRegistry QUESTION: For RMI on server-side, do we need to start rmiregistry program, or just call LocateRegistry.createRegistry? If both are possible, what are the advantages and disadvantages? ANSWER: They're the same thing... rmiregistry is a separate program, w...
[ "java", "rmi", "rmiregistry" ]
14
8
12,944
4
0
2008-09-19T03:19:11.327000
2008-09-19T03:27:58.297000
99,262
99,284
What is the most common feature that demands the use of Visual Studio Professional over Standard?
I'm afraid my trial of VS 2008 is running out soon, and unless a client pays for it, I might be shelling out some cash for it. I've been looking through the comparison chart to compare VS Professional to Standard, and so far I think I'm safe. I wanted to hear from you on what the most important features are that I woul...
Remote Debugging, Server Explorer, Compact Development (With Device Emulator). It really does depend on your situation but I don't think you'll be without a paddle in general.
What is the most common feature that demands the use of Visual Studio Professional over Standard? I'm afraid my trial of VS 2008 is running out soon, and unless a client pays for it, I might be shelling out some cash for it. I've been looking through the comparison chart to compare VS Professional to Standard, and so f...
TITLE: What is the most common feature that demands the use of Visual Studio Professional over Standard? QUESTION: I'm afraid my trial of VS 2008 is running out soon, and unless a client pays for it, I might be shelling out some cash for it. I've been looking through the comparison chart to compare VS Professional to ...
[ "visual-studio", "visual-studio-2008" ]
3
2
263
7
0
2008-09-19T03:22:51.163000
2008-09-19T03:27:44.957000