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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
170,772 | 170,783 | Where can i find a good in depth guide to C# 3? | It seems that C# 3 hit me without me even noticing, could you guys tell me about good in depth guides to C# 3? from lambda to linq to everything else that was introduced with the third version of the language. Printed books would be nice, but online guides would be even better! | ScottGu has some great posts on C# 3: The C#?? null coalescing operator (and using it with LINQ) LINQ to SQL: Part 8 (this is an 8 part series, check the top of the post for links to the first 7) Automatic Properties, Object Initializers, and Collection Initializers Extension Methods Lambda Expressions Query Syntax Ano... | Where can i find a good in depth guide to C# 3? It seems that C# 3 hit me without me even noticing, could you guys tell me about good in depth guides to C# 3? from lambda to linq to everything else that was introduced with the third version of the language. Printed books would be nice, but online guides would be even b... | TITLE:
Where can i find a good in depth guide to C# 3?
QUESTION:
It seems that C# 3 hit me without me even noticing, could you guys tell me about good in depth guides to C# 3? from lambda to linq to everything else that was introduced with the third version of the language. Printed books would be nice, but online guid... | [
"c#",
"documentation",
"c#-3.0"
] | 16 | 16 | 824 | 10 | 0 | 2008-10-04T18:07:13.563000 | 2008-10-04T18:13:11.897000 |
170,777 | 170,794 | CruiseControl.net failing with HTTP Error 500 on Vista x64 | I installed CruiseControl.net ( from the CruiseControl.NET-1.4-Setup.exe installer ) on my Vista x64 development machine. The server portion is running fine; however, the webdashboard piece is not working. The first error message I saw when I tried to pull up http://localhost/ccnet squawked about not being able to run ... | Here's the top of the HTTP 500 error dump I was getting: HTTP Error 500.0 - Internal Server Error Description: The page cannot be displayed because an internal server error has occurred. Error Code: 0x800700c1 Notification: ExecuteRequestHandler Module: IsapiModule Requested URL: http://localhost/ccnet/default.aspx Phy... | CruiseControl.net failing with HTTP Error 500 on Vista x64 I installed CruiseControl.net ( from the CruiseControl.NET-1.4-Setup.exe installer ) on my Vista x64 development machine. The server portion is running fine; however, the webdashboard piece is not working. The first error message I saw when I tried to pull up h... | TITLE:
CruiseControl.net failing with HTTP Error 500 on Vista x64
QUESTION:
I installed CruiseControl.net ( from the CruiseControl.NET-1.4-Setup.exe installer ) on my Vista x64 development machine. The server portion is running fine; however, the webdashboard piece is not working. The first error message I saw when I ... | [
"configuration",
"windows-vista",
"cruisecontrol.net"
] | 2 | 3 | 2,324 | 2 | 0 | 2008-10-04T18:10:20.107000 | 2008-10-04T18:18:19.983000 |
170,787 | 170,812 | How do I know if Windows has just recovered from a BSOD? | From http://support.microsoft.com/kb/317277: If Windows XP restarts because of a serious error, the Windows Error Reporting tool prompts you... How can my app know that "Windows XP has restarted because of a serious error"? | Note: this is a good question for a code-challenge Here are some executable codes, but feel free to add other solutions, in other languages: The uptime might be a good indication: net stats workstation | find /i "since" Now link that information with a way to read the windows event logs, like, say in PowerShell: Get-Ev... | How do I know if Windows has just recovered from a BSOD? From http://support.microsoft.com/kb/317277: If Windows XP restarts because of a serious error, the Windows Error Reporting tool prompts you... How can my app know that "Windows XP has restarted because of a serious error"? | TITLE:
How do I know if Windows has just recovered from a BSOD?
QUESTION:
From http://support.microsoft.com/kb/317277: If Windows XP restarts because of a serious error, the Windows Error Reporting tool prompts you... How can my app know that "Windows XP has restarted because of a serious error"?
ANSWER:
Note: this i... | [
"windows",
"wmi",
"bsod"
] | 4 | 9 | 2,061 | 3 | 0 | 2008-10-04T18:15:47.430000 | 2008-10-04T18:36:23.753000 |
170,791 | 170,810 | How can I get an OpenFileDialog in a custom control's property grid? | I'm creating a.net custom control and it should be able to load multiple text files. I have a public property named ListFiles with those properties set: [Browsable(true), Category("Configuration"), Description("List of Files to Load")] public string ListFiles { get { return m_oList; } set { m_oList = value; } } Dependi... | You can do this by adding a UITypeEditor. Here is an example of a UITypeEditor that gives you the OpenFileDialog for chossing a filename. | How can I get an OpenFileDialog in a custom control's property grid? I'm creating a.net custom control and it should be able to load multiple text files. I have a public property named ListFiles with those properties set: [Browsable(true), Category("Configuration"), Description("List of Files to Load")] public string L... | TITLE:
How can I get an OpenFileDialog in a custom control's property grid?
QUESTION:
I'm creating a.net custom control and it should be able to load multiple text files. I have a public property named ListFiles with those properties set: [Browsable(true), Category("Configuration"), Description("List of Files to Load"... | [
"c#",
".net",
"controls",
"propertygrid"
] | 12 | 11 | 11,694 | 3 | 0 | 2008-10-04T18:16:54.573000 | 2008-10-04T18:32:39.487000 |
170,800 | 335,724 | Embedding HWND into external process using SetParent | I'm trying to embed a window from my process into the window of an external process using the SetParent function and have encountered a few problems. First off, here is an outline of what I am currently doing to embed my window into the application: HWND myWindow; //Handle to my application window HWND externalWindow; ... | Well, I finally found the answer to my question. To fix the issue with the main app losing focus you need to use the AttachThreadInput function to attach the embedded window thread to the main app thread. Also, one can use the TranslateAccelerator function in response to WM_KEYDOWN messages to ensure accelerator messag... | Embedding HWND into external process using SetParent I'm trying to embed a window from my process into the window of an external process using the SetParent function and have encountered a few problems. First off, here is an outline of what I am currently doing to embed my window into the application: HWND myWindow; //... | TITLE:
Embedding HWND into external process using SetParent
QUESTION:
I'm trying to embed a window from my process into the window of an external process using the SetParent function and have encountered a few problems. First off, here is an outline of what I am currently doing to embed my window into the application:... | [
"c",
"winapi"
] | 17 | 11 | 10,296 | 3 | 0 | 2008-10-04T18:26:43.833000 | 2008-12-02T22:41:08.870000 |
170,824 | 171,135 | Date class different in Ruby stdlib and Rails stdlib | I want to use the Date::ABBR_MONTHS constant in my rails application. I see the Ruby stdlib documentation at http://www.ruby-doc.org/stdlib/ which does not seem to have this constant. However, this constant is there at http://stdlib.rubyonrails.org/ What is the difference between these two libraries? This constant is w... | ABBR_MONTHS is something you get given to you by ActiveSupport and it's just added into the Date class. The first library is for ruby, where the second one is for ruby on rails. The constant may not be working because of different versions of Rails. | Date class different in Ruby stdlib and Rails stdlib I want to use the Date::ABBR_MONTHS constant in my rails application. I see the Ruby stdlib documentation at http://www.ruby-doc.org/stdlib/ which does not seem to have this constant. However, this constant is there at http://stdlib.rubyonrails.org/ What is the diffe... | TITLE:
Date class different in Ruby stdlib and Rails stdlib
QUESTION:
I want to use the Date::ABBR_MONTHS constant in my rails application. I see the Ruby stdlib documentation at http://www.ruby-doc.org/stdlib/ which does not seem to have this constant. However, this constant is there at http://stdlib.rubyonrails.org/... | [
"ruby-on-rails",
"ruby",
"date"
] | 3 | 3 | 837 | 2 | 0 | 2008-10-04T18:44:49.180000 | 2008-10-04T22:45:47.743000 |
170,844 | 171,235 | Anyone really using Code Access Security to protect their assemblies and/or methods? | Seems to me most of developers completely ignore this features. People prefer handling security exceptions as generic ones relying on standard windows roles and rights instead of learning to use CAS ways of enhancing security - probably because CAS is quite confusing in its logic and naming. Can anyone suggest any gene... | Yes and no. Unfortunately, you're right - developers rarely use CAS at all, let alone utilize it to it's fullest. In very few situations do I see them actually doing this (okay, its not really the programmers but the organization forcing them....) Besides being used to allow users to limit assemblies downloaded from th... | Anyone really using Code Access Security to protect their assemblies and/or methods? Seems to me most of developers completely ignore this features. People prefer handling security exceptions as generic ones relying on standard windows roles and rights instead of learning to use CAS ways of enhancing security - probabl... | TITLE:
Anyone really using Code Access Security to protect their assemblies and/or methods?
QUESTION:
Seems to me most of developers completely ignore this features. People prefer handling security exceptions as generic ones relying on standard windows roles and rights instead of learning to use CAS ways of enhancing ... | [
".net",
"security",
"code-access-security"
] | 4 | 3 | 579 | 2 | 0 | 2008-10-04T18:57:44.100000 | 2008-10-05T00:18:24.263000 |
170,850 | 172,954 | Parsing T-SQL to Parameterize a Query | The application I am currently working on generates a lot of SQL inline queries. All generated SQL is then handed off to a database execution class. I want to write a parsing service for the data execution class that will take a query like this: SELECT field1, field2, field3 FROM tablename WHERE foo=1 AND bar="baz" and... | Refactor now. You're fooling yourself if you think this one abstraction layer is going to be able to come in quicker and easier. Deep down, you know it increases risk and uncertainty on the project, but you want to kill the SQL injection problem or whatever problem you are fighting with a magic bullet. The time you wou... | Parsing T-SQL to Parameterize a Query The application I am currently working on generates a lot of SQL inline queries. All generated SQL is then handed off to a database execution class. I want to write a parsing service for the data execution class that will take a query like this: SELECT field1, field2, field3 FROM t... | TITLE:
Parsing T-SQL to Parameterize a Query
QUESTION:
The application I am currently working on generates a lot of SQL inline queries. All generated SQL is then handed off to a database execution class. I want to write a parsing service for the data execution class that will take a query like this: SELECT field1, fie... | [
".net",
"sql-server",
"parsing"
] | 2 | 2 | 1,303 | 6 | 0 | 2008-10-04T19:00:17.417000 | 2008-10-06T01:16:58.623000 |
170,854 | 171,187 | Emulating user input for java.util.Scanner | I'm writing a game in Java, and I want the user to be able to provide input from both the command line and my GUI. Currently, I use this method to get input: static String getInput(){ System.out.println("Your move:"); Scanner sc = new Scanner(System.in); return sc.nextLine(); } I want to keep using this, but let a mous... | This is possible - the easiest substitution for System.in would be a PipedInputStream. This must be hooked up to a PipedOutputStream that writes from another thread (in this case, the Swing thread). public class GameInput {
private Scanner scanner;
/**CLI constructor*/ public GameInput() { scanner = new Scanner(Syste... | Emulating user input for java.util.Scanner I'm writing a game in Java, and I want the user to be able to provide input from both the command line and my GUI. Currently, I use this method to get input: static String getInput(){ System.out.println("Your move:"); Scanner sc = new Scanner(System.in); return sc.nextLine(); ... | TITLE:
Emulating user input for java.util.Scanner
QUESTION:
I'm writing a game in Java, and I want the user to be able to provide input from both the command line and my GUI. Currently, I use this method to get input: static String getInput(){ System.out.println("Your move:"); Scanner sc = new Scanner(System.in); retu... | [
"java",
"input",
"java.util.scanner"
] | 1 | 1 | 5,478 | 4 | 0 | 2008-10-04T19:02:59.753000 | 2008-10-04T23:34:52.090000 |
170,907 | 170,915 | Is there a downside to adding an anonymous empty delegate on event declaration? | I have seen a few mentions of this idiom (including on SO ): // Deliberately empty subscriber public event EventHandler AskQuestion = delegate {}; The upside is clear - it avoids the need to check for null before raising the event. However, I am keen to understand if there are any downsides. For example, is it somethin... | The only downside is a very slight performance penalty as you are calling extra empty delegate. Other than that there is no maintenance penalty or other drawback. | Is there a downside to adding an anonymous empty delegate on event declaration? I have seen a few mentions of this idiom (including on SO ): // Deliberately empty subscriber public event EventHandler AskQuestion = delegate {}; The upside is clear - it avoids the need to check for null before raising the event. However,... | TITLE:
Is there a downside to adding an anonymous empty delegate on event declaration?
QUESTION:
I have seen a few mentions of this idiom (including on SO ): // Deliberately empty subscriber public event EventHandler AskQuestion = delegate {}; The upside is clear - it avoids the need to check for null before raising t... | [
"c#",
"coding-style",
"delegates",
"events",
"idioms"
] | 85 | 36 | 12,699 | 9 | 0 | 2008-10-04T19:41:15.103000 | 2008-10-04T19:53:48.183000 |
170,909 | 170,929 | Making a Nonblocking socket for WinSocks and *nix | In C/C++, how would I turn a blocking socket into a non blocking socket in both WinSocks and *nix; so that select() would work correctly. You can use the pre-processor for the platform specific code. | On linux: fcntl(fd, F_SETFL, O_NONBLOCK); Windows: u_long on = 1; ioctlsocket(fd, FIONBIO, &on); | Making a Nonblocking socket for WinSocks and *nix In C/C++, how would I turn a blocking socket into a non blocking socket in both WinSocks and *nix; so that select() would work correctly. You can use the pre-processor for the platform specific code. | TITLE:
Making a Nonblocking socket for WinSocks and *nix
QUESTION:
In C/C++, how would I turn a blocking socket into a non blocking socket in both WinSocks and *nix; so that select() would work correctly. You can use the pre-processor for the platform specific code.
ANSWER:
On linux: fcntl(fd, F_SETFL, O_NONBLOCK); W... | [
"c++",
"c",
"asynchronous",
"sockets",
"nonblocking"
] | 6 | 7 | 3,436 | 2 | 0 | 2008-10-04T19:45:29.637000 | 2008-10-04T20:05:10.063000 |
170,913 | 170,958 | Is SVNAutoversioning directive in apache subversion imporant? | If so why? I know setting this on will result in more number of automatically committed revisions. Is it good to have more auto commits? | You can turn this on to offer WebDav mappings, most OSes can make network mappings to http(s):// URLs. If SVNAutoversioning is off, files cannot be saved to these mappings. | Is SVNAutoversioning directive in apache subversion imporant? If so why? I know setting this on will result in more number of automatically committed revisions. Is it good to have more auto commits? | TITLE:
Is SVNAutoversioning directive in apache subversion imporant?
QUESTION:
If so why? I know setting this on will result in more number of automatically committed revisions. Is it good to have more auto commits?
ANSWER:
You can turn this on to offer WebDav mappings, most OSes can make network mappings to http(s):... | [
"svn",
"apache",
"auto-versioning"
] | 0 | 1 | 650 | 1 | 0 | 2008-10-04T19:49:58.067000 | 2008-10-04T20:37:57.627000 |
170,937 | 171,333 | Is it reasonable to use John Resig's Processing.js? | I am thinking about making a website with some fairly intense JavaScript/canvas usage and I have been looking at Processing.js and it seems to me that it would make manipulating the canvas significantly easier. Does anyone know any reasons why I shouldn't use Processing.js? I understand that older browsers won't be abl... | As mentioned, IE is not supported by Processing.js (including IE8 beta). I've also found processing.js to be a bit slow in terms of performance, compared to just using canvas (especially if you're parsing a string with Processing language, instead of using the javascript API). I personally prefer the canvas API over th... | Is it reasonable to use John Resig's Processing.js? I am thinking about making a website with some fairly intense JavaScript/canvas usage and I have been looking at Processing.js and it seems to me that it would make manipulating the canvas significantly easier. Does anyone know any reasons why I shouldn't use Processi... | TITLE:
Is it reasonable to use John Resig's Processing.js?
QUESTION:
I am thinking about making a website with some fairly intense JavaScript/canvas usage and I have been looking at Processing.js and it seems to me that it would make manipulating the canvas significantly easier. Does anyone know any reasons why I shou... | [
"javascript",
"graphics",
"canvas"
] | 9 | 3 | 3,210 | 5 | 0 | 2008-10-04T20:17:06.717000 | 2008-10-05T01:41:47.483000 |
170,938 | 170,941 | What is the default time after which an HTTP request is deemed to have timed out? | For PHP, what is the default time after which an HTTP request is deemed to have timed out? I'm using the PECL HTTP extension to make HTTP requests. I can set a timeout limit when making a request, however I'd like to know what the default is if nothing is explicitly specified. I've hunted through the PHP manual to no a... | I'm quite sure what you're looking for is the default_socket_timeout php.ini option. It appears the default is 60 seconds. | What is the default time after which an HTTP request is deemed to have timed out? For PHP, what is the default time after which an HTTP request is deemed to have timed out? I'm using the PECL HTTP extension to make HTTP requests. I can set a timeout limit when making a request, however I'd like to know what the default... | TITLE:
What is the default time after which an HTTP request is deemed to have timed out?
QUESTION:
For PHP, what is the default time after which an HTTP request is deemed to have timed out? I'm using the PECL HTTP extension to make HTTP requests. I can set a timeout limit when making a request, however I'd like to kno... | [
"php",
"http",
"timeout"
] | 4 | 5 | 10,600 | 2 | 0 | 2008-10-04T20:19:59.067000 | 2008-10-04T20:23:29.560000 |
170,962 | 171,017 | What's the difference between session.Merge and session.SaveOrUpdate? | I notice sometimes with my parent/child objects or many-to-many relationships, I need to call either SaveOrUpdate or Merge. Usually, when I need to call SaveOrUpdate, the exception I get on calling Merge has to do with transient objects not being saved first. Please explain the difference between the two. | This is from section 10.7. Automatic state detection of the Hibernate Reference Documentation: saveOrUpdate() does the following: if the object is already persistent in this session, do nothing if another object associated with the session has the same identifier, throw an exception if the object has no identifier prop... | What's the difference between session.Merge and session.SaveOrUpdate? I notice sometimes with my parent/child objects or many-to-many relationships, I need to call either SaveOrUpdate or Merge. Usually, when I need to call SaveOrUpdate, the exception I get on calling Merge has to do with transient objects not being sav... | TITLE:
What's the difference between session.Merge and session.SaveOrUpdate?
QUESTION:
I notice sometimes with my parent/child objects or many-to-many relationships, I need to call either SaveOrUpdate or Merge. Usually, when I need to call SaveOrUpdate, the exception I get on calling Merge has to do with transient obj... | [
"nhibernate",
"session"
] | 89 | 161 | 96,374 | 6 | 0 | 2008-10-04T20:40:10.197000 | 2008-10-04T21:20:09.290000 |
170,964 | 171,718 | One to One database relation? | In my free time I started writing a small multiplayer game with a database backend. I was looking to separate player login information from other in game information (inventory, stats, and status) and a friend brought up this might not be the best idea. Would it be better to lump everything together in one table? | Start by ignoring performance, and just create the most logical and easy-to-understand database design that you can. If players and game objects (swords? chess pieces?) are separate things conceptually, then put them in separate tables. If a player can carry things, you put a foreign key in the "things" table that refe... | One to One database relation? In my free time I started writing a small multiplayer game with a database backend. I was looking to separate player login information from other in game information (inventory, stats, and status) and a friend brought up this might not be the best idea. Would it be better to lump everythin... | TITLE:
One to One database relation?
QUESTION:
In my free time I started writing a small multiplayer game with a database backend. I was looking to separate player login information from other in game information (inventory, stats, and status) and a friend brought up this might not be the best idea. Would it be better... | [
"sql",
"mysql",
"database",
"one-to-one"
] | 5 | 10 | 3,749 | 10 | 0 | 2008-10-04T20:40:48.073000 | 2008-10-05T08:52:18.470000 |
170,986 | 171,007 | What is the best way to add options to a select from a JavaScript object with jQuery? | What is the best method for adding options to a from a JavaScript object using jQuery? I'm looking for something that I don't need a plugin to do, but I would also be interested in the plugins that are out there. This is what I did: selectValues = { "1": "test 1", "2": "test 2" };
for (key in selectValues) { if (typeo... | The same as other answers, in a jQuery fashion: $.each(selectValues, function(key, value) { $('#mySelect').append($(" ").attr("value", key).text(value)); }); | What is the best way to add options to a select from a JavaScript object with jQuery? What is the best method for adding options to a from a JavaScript object using jQuery? I'm looking for something that I don't need a plugin to do, but I would also be interested in the plugins that are out there. This is what I did: s... | TITLE:
What is the best way to add options to a select from a JavaScript object with jQuery?
QUESTION:
What is the best method for adding options to a from a JavaScript object using jQuery? I'm looking for something that I don't need a plugin to do, but I would also be interested in the plugins that are out there. Thi... | [
"javascript",
"jquery",
"html-select"
] | 1,491 | 1,485 | 1,140,832 | 37 | 0 | 2008-10-04T20:58:46.400000 | 2008-10-04T21:12:02.037000 |
170,997 | 171,006 | What is the best way to remove a table row with jQuery? | What is the best method for removing a table row with jQuery? | You're right: $('#myTableRow').remove(); This works fine if your row has an id, such as: blah If you don't have an id, you can use any of jQuery's plethora of selectors. | What is the best way to remove a table row with jQuery? What is the best method for removing a table row with jQuery? | TITLE:
What is the best way to remove a table row with jQuery?
QUESTION:
What is the best method for removing a table row with jQuery?
ANSWER:
You're right: $('#myTableRow').remove(); This works fine if your row has an id, such as: blah If you don't have an id, you can use any of jQuery's plethora of selectors. | [
"javascript",
"jquery",
"html-table"
] | 345 | 484 | 670,634 | 18 | 0 | 2008-10-04T21:04:08.947000 | 2008-10-04T21:11:49.897000 |
171,000 | 171,418 | How do I make an onclientclick post back using jQuery with asp.net | I want to recreate the the update panel postback without using an update panel to do the postback. What is the generic method for doing this? For example, on Stackoverflow, when you vote up or down on a question it does a postback to update the database and I would bet they didn't use an update panel. What do I have? I... | The way that Stack Overflow works differs in two important ways from that CodeProject article. Stack Overflow is making its AJAX request against an ASP.NET MVC controller action, not a standalone ASPX page. You might consider this as the MVC analogue of an ASP.NET AJAX page method. In both cases, the ASPX method will l... | How do I make an onclientclick post back using jQuery with asp.net I want to recreate the the update panel postback without using an update panel to do the postback. What is the generic method for doing this? For example, on Stackoverflow, when you vote up or down on a question it does a postback to update the database... | TITLE:
How do I make an onclientclick post back using jQuery with asp.net
QUESTION:
I want to recreate the the update panel postback without using an update panel to do the postback. What is the generic method for doing this? For example, on Stackoverflow, when you vote up or down on a question it does a postback to u... | [
"asp.net",
"javascript",
"jquery",
"postback"
] | 12 | 17 | 13,785 | 2 | 0 | 2008-10-04T21:06:25.090000 | 2008-10-05T03:13:37.717000 |
171,003 | 171,223 | iphone <-> real world connection | Any pointers on how to initiate serial communication with the iphone? Or any other idea to interact with external hardware? | The only supported way to connect external hardware to the iPhone is through the iPod accessory protocol, through the 30-pin connector. Details on that program are at http://developer.apple.com/ipod/accessories.html. It isn't a free program and the 30-pin connector only supports certain features, but it's the only opti... | iphone <-> real world connection Any pointers on how to initiate serial communication with the iphone? Or any other idea to interact with external hardware? | TITLE:
iphone <-> real world connection
QUESTION:
Any pointers on how to initiate serial communication with the iphone? Or any other idea to interact with external hardware?
ANSWER:
The only supported way to connect external hardware to the iPhone is through the iPod accessory protocol, through the 30-pin connector. ... | [
"iphone",
"serial-communication"
] | 4 | 3 | 1,604 | 3 | 0 | 2008-10-04T21:09:43.037000 | 2008-10-05T00:12:25.773000 |
171,027 | 171,049 | Adding a table row in jQuery | I'm using jQuery to add an additional row to a table as the last row. I have done it this way: $('#myTable').append(' my data more data '); Are there limitations to what you can add to a table like this (such as inputs, selects, number of rows)? Is there a different way to do it? | The approach you suggest is not guaranteed to give you the result you're looking for - what if you had a tbody for example:...... You would end up with the following:......... I would therefore recommend this approach instead: $('#myTable tr:last').after('...... '); You can include anything within the after() method as... | Adding a table row in jQuery I'm using jQuery to add an additional row to a table as the last row. I have done it this way: $('#myTable').append(' my data more data '); Are there limitations to what you can add to a table like this (such as inputs, selects, number of rows)? Is there a different way to do it? | TITLE:
Adding a table row in jQuery
QUESTION:
I'm using jQuery to add an additional row to a table as the last row. I have done it this way: $('#myTable').append(' my data more data '); Are there limitations to what you can add to a table like this (such as inputs, selects, number of rows)? Is there a different way to... | [
"javascript",
"jquery",
"html-table"
] | 2,659 | 2,308 | 2,019,301 | 42 | 0 | 2008-10-04T21:33:10.247000 | 2008-10-04T21:49:32.520000 |
171,044 | 171,185 | Creating a stage environment on network with port 80 blocked | I currently use my local web server to allow costumers to preview some applications and also to allow downloads of "nightly builds" of my open source library. Problem is I changed my ISP and now my port 80 is blocked. Altough I know I could easily change the port on the Apache server, I'd like to avoid that unless ther... | What I'd like is for the costumer to type http://myaddress.com/hello/there?a=1&b=2 and it get translated to http://mylocalserver.com:8080/hello/there?a=1&b=2 and back again to the costumer on a transparent way. I believe this is the Apache RewriteRule you're looking for to redirect any URL: RewriteRule ^(.*)$ http://my... | Creating a stage environment on network with port 80 blocked I currently use my local web server to allow costumers to preview some applications and also to allow downloads of "nightly builds" of my open source library. Problem is I changed my ISP and now my port 80 is blocked. Altough I know I could easily change the ... | TITLE:
Creating a stage environment on network with port 80 blocked
QUESTION:
I currently use my local web server to allow costumers to preview some applications and also to allow downloads of "nightly builds" of my open source library. Problem is I changed my ISP and now my port 80 is blocked. Altough I know I could ... | [
"language-agnostic",
"mod-rewrite",
"hosting",
"infrastructure"
] | 1 | 1 | 815 | 7 | 0 | 2008-10-04T21:46:27.893000 | 2008-10-04T23:29:49.497000 |
171,054 | 527,690 | Adobe Air and .NET | I Adobe Air completly JavaScript? Can't I use a.NET language like VB.NET or C#.NET? Thanks | Yes you can use.NET with Adobe AIR, visit: tutorial Also stay tuned to Adobe's site as they can announce a plug in for Visual Studio 2008 any time (that supports Flex) meanwhile you can use this another supported plugin | Adobe Air and .NET I Adobe Air completly JavaScript? Can't I use a.NET language like VB.NET or C#.NET? Thanks | TITLE:
Adobe Air and .NET
QUESTION:
I Adobe Air completly JavaScript? Can't I use a.NET language like VB.NET or C#.NET? Thanks
ANSWER:
Yes you can use.NET with Adobe AIR, visit: tutorial Also stay tuned to Adobe's site as they can announce a plug in for Visual Studio 2008 any time (that supports Flex) meanwhile you c... | [
".net",
"air",
"adobe"
] | 5 | 1 | 5,278 | 5 | 0 | 2008-10-04T21:50:36.810000 | 2009-02-09T10:42:25.600000 |
171,089 | 171,104 | onmousemove in firefox | How do you implement onmousemove in Firefox? I have it working in IE7 but no alert pops in Firefox. Is is not supported or done differently? | I thinkk the problem is that you need to put something inside your alert(), such as: I just tried this and it worked in FF: | onmousemove in firefox How do you implement onmousemove in Firefox? I have it working in IE7 but no alert pops in Firefox. Is is not supported or done differently? | TITLE:
onmousemove in firefox
QUESTION:
How do you implement onmousemove in Firefox? I have it working in IE7 but no alert pops in Firefox. Is is not supported or done differently?
ANSWER:
I thinkk the problem is that you need to put something inside your alert(), such as: I just tried this and it worked in FF: | [
"javascript",
"firefox",
"events",
"esri"
] | 0 | 3 | 1,811 | 1 | 0 | 2008-10-04T22:07:19.567000 | 2008-10-04T22:13:50.757000 |
171,097 | 224,143 | How do I change the "level" of validation that Ant's XMLValidate task provides? | I am attempting to use Ant's XMLValidate task to validate an XML document against a DTD. The problem is not that it doesn't work, but that it works too well. My DTD contains an xref element with an "@linkend" attribute of type IDREF. Most of these reference IDs outside of the current document. Because of this, my build... | Your problem derives from the difference between two interpretations of the DTD: yours, and the spec's:-). IDREFs must refer to ids in the same document, whereas yours refer to elements across documents. My suggestion is to create your own version of the DTD that specifies NMTOKEN instead of IDREF for that attribute, a... | How do I change the "level" of validation that Ant's XMLValidate task provides? I am attempting to use Ant's XMLValidate task to validate an XML document against a DTD. The problem is not that it doesn't work, but that it works too well. My DTD contains an xref element with an "@linkend" attribute of type IDREF. Most o... | TITLE:
How do I change the "level" of validation that Ant's XMLValidate task provides?
QUESTION:
I am attempting to use Ant's XMLValidate task to validate an XML document against a DTD. The problem is not that it doesn't work, but that it works too well. My DTD contains an xref element with an "@linkend" attribute of ... | [
"java",
"xml",
"ant",
"dtd"
] | 0 | 2 | 844 | 2 | 0 | 2008-10-04T22:11:35.130000 | 2008-10-22T01:18:53.233000 |
171,099 | 171,186 | Sensible HTTP POST timeout values to use when programmatically issuing requests? | When programmatically issuing HTTP POST requests, what timeout values would be sensible? In my case, I'm looking to set 'sensible' timeout values when making POST requests in PHP, however this applies to any language. I need to be able to issue a set of requests, each to a user-specified URL. If I do need to process re... | I would recommend setting up a test, as there are too many factors involved to give a value that will always be sensible. A POST request sends data to be processed. How long with the processing take? This will be application/data specific. Where is the host? The user is supplying the URL, so that will be unknown. We ca... | Sensible HTTP POST timeout values to use when programmatically issuing requests? When programmatically issuing HTTP POST requests, what timeout values would be sensible? In my case, I'm looking to set 'sensible' timeout values when making POST requests in PHP, however this applies to any language. I need to be able to ... | TITLE:
Sensible HTTP POST timeout values to use when programmatically issuing requests?
QUESTION:
When programmatically issuing HTTP POST requests, what timeout values would be sensible? In my case, I'm looking to set 'sensible' timeout values when making POST requests in PHP, however this applies to any language. I n... | [
"http",
"post",
"timeout"
] | 10 | 6 | 15,352 | 2 | 0 | 2008-10-04T22:12:31.837000 | 2008-10-04T23:31:57.243000 |
171,112 | 171,122 | Allowing users to post pictures to web application via mobile phone? | There are several web applications which allow you to send photos from your mobile phone and post them to web site/application. How do these work and what sort of technologies would one use to implement such a feature? Is it an MMS server or does one need to get into socket programming? For example, some applications p... | I think you have three options to support this: MMS - you would need an MMS gateway to recieve MMS messages. This can be software/hardware that you run yourself, or there are services were you pay per message. You would likely need to write your own handling of the message at the application end. Email - you just provi... | Allowing users to post pictures to web application via mobile phone? There are several web applications which allow you to send photos from your mobile phone and post them to web site/application. How do these work and what sort of technologies would one use to implement such a feature? Is it an MMS server or does one ... | TITLE:
Allowing users to post pictures to web application via mobile phone?
QUESTION:
There are several web applications which allow you to send photos from your mobile phone and post them to web site/application. How do these work and what sort of technologies would one use to implement such a feature? Is it an MMS s... | [
"mobile"
] | 0 | 6 | 898 | 2 | 0 | 2008-10-04T22:21:27.653000 | 2008-10-04T22:32:11.687000 |
171,115 | 171,495 | Standard connection libraries for MySQL, MSSQL, and Oracle in PHP | I'm looking for a standard way to connect to databases in PHP. We've all been there - first start with some rudimentary code to connect/query/iterate/insert/disconnect, then the code grew as the program grew, and it ended up with a mess that's hardly reusable. I know there are many PEAR, PECL, and other PHP libraries/c... | I'm supprised Zend_Db hasn't been mentioned yet... PEAR's MDB2: very stable, also provides a layer that implements all MDB2 -supported features in all databases where it can at least be simulated. I've used this one for years with much success. Zend Framework's Zend_Db: I've just started using the higher levels of Zend... | Standard connection libraries for MySQL, MSSQL, and Oracle in PHP I'm looking for a standard way to connect to databases in PHP. We've all been there - first start with some rudimentary code to connect/query/iterate/insert/disconnect, then the code grew as the program grew, and it ended up with a mess that's hardly reu... | TITLE:
Standard connection libraries for MySQL, MSSQL, and Oracle in PHP
QUESTION:
I'm looking for a standard way to connect to databases in PHP. We've all been there - first start with some rudimentary code to connect/query/iterate/insert/disconnect, then the code grew as the program grew, and it ended up with a mess... | [
"php",
"database"
] | 4 | 2 | 1,557 | 5 | 0 | 2008-10-04T22:24:01.967000 | 2008-10-05T04:36:59.657000 |
171,121 | 171,141 | Integrating AJAX and PHP | I've been writing PHP web applications for some time, and have come across very nice Javascript frameworks, such as JQuery, ExtJS, Scriptaculous, etc. I can't say the same about the PHP side - I always coded that part of the client-server dialog from scratch. I've used CodeIgniter ( http://codeigniter.com/ ) and it is ... | The Zend Framework is integrated with Dojo Toolkit. I haven't used the latest Zend Framework yet, but I do know that in the past, it has proven to be reliable. | Integrating AJAX and PHP I've been writing PHP web applications for some time, and have come across very nice Javascript frameworks, such as JQuery, ExtJS, Scriptaculous, etc. I can't say the same about the PHP side - I always coded that part of the client-server dialog from scratch. I've used CodeIgniter ( http://code... | TITLE:
Integrating AJAX and PHP
QUESTION:
I've been writing PHP web applications for some time, and have come across very nice Javascript frameworks, such as JQuery, ExtJS, Scriptaculous, etc. I can't say the same about the PHP side - I always coded that part of the client-server dialog from scratch. I've used CodeIgn... | [
"php",
"ajax",
"frameworks",
"integration"
] | 8 | 9 | 3,032 | 9 | 0 | 2008-10-04T22:31:04.060000 | 2008-10-04T22:50:36.610000 |
171,173 | 171,193 | How do I flip a bit in SQL Server? | I'm trying to perform a bitwise NOT in SQL Server. I'd like to do something like this: update foo set Sync = NOT @IsNew Note: I started writing this and found out the answer to my own question before I finished. I still wanted to share with the community, since this piece of documentation was lacking on MSDN (until I a... | Yes, the ~ operator will work. update foo set Sync = ~@IsNew | How do I flip a bit in SQL Server? I'm trying to perform a bitwise NOT in SQL Server. I'd like to do something like this: update foo set Sync = NOT @IsNew Note: I started writing this and found out the answer to my own question before I finished. I still wanted to share with the community, since this piece of documenta... | TITLE:
How do I flip a bit in SQL Server?
QUESTION:
I'm trying to perform a bitwise NOT in SQL Server. I'd like to do something like this: update foo set Sync = NOT @IsNew Note: I started writing this and found out the answer to my own question before I finished. I still wanted to share with the community, since this ... | [
"sql",
"sql-server",
"bit-manipulation"
] | 89 | 134 | 31,794 | 5 | 0 | 2008-10-04T23:21:24.770000 | 2008-10-04T23:40:54.060000 |
171,177 | 290,232 | Has anyone here worked on KOFAX-SharePoint 2007 integration? | We want to be able to advance our business by utilizing both of the power of KOFAX and SharePoint 2007. Any pointers Development-wise? | We looked into doing something like this a couple of years ago. We were thinking of having printed documents scanned in, converted with OCR, and organized digitally in a type of repository. We actually did an analysis of OCR tools and repository / collaboration tools and which would be the easiest to integrate. We chec... | Has anyone here worked on KOFAX-SharePoint 2007 integration? We want to be able to advance our business by utilizing both of the power of KOFAX and SharePoint 2007. Any pointers Development-wise? | TITLE:
Has anyone here worked on KOFAX-SharePoint 2007 integration?
QUESTION:
We want to be able to advance our business by utilizing both of the power of KOFAX and SharePoint 2007. Any pointers Development-wise?
ANSWER:
We looked into doing something like this a couple of years ago. We were thinking of having printe... | [
"sharepoint",
"ecm",
"kofax"
] | 2 | 2 | 1,282 | 3 | 0 | 2008-10-04T23:22:20.180000 | 2008-11-14T14:32:32.603000 |
171,205 | 497,757 | Java maximum memory on Windows XP | I've always been able to allocate 1400 megabytes for Java SE running on 32-bit Windows XP (Java 1.4, 1.5 and 1.6). java -Xmx1400m... Today I tried the same option on a new Windows XP machine using Java 1.5_16 and 1.6.0_07 and got the error: Error occurred during initialization of VM Could not reserve enough space for o... | Keep in mind that Windows has virtual memory management and the JVM only needs memory that is contiguous in its address space. So, other programs running on the system shouldn't necessarily impact your heap size. What will get in your way are DLL's that get loaded in to your address space. Unfortunately optimizations i... | Java maximum memory on Windows XP I've always been able to allocate 1400 megabytes for Java SE running on 32-bit Windows XP (Java 1.4, 1.5 and 1.6). java -Xmx1400m... Today I tried the same option on a new Windows XP machine using Java 1.5_16 and 1.6.0_07 and got the error: Error occurred during initialization of VM Co... | TITLE:
Java maximum memory on Windows XP
QUESTION:
I've always been able to allocate 1400 megabytes for Java SE running on 32-bit Windows XP (Java 1.4, 1.5 and 1.6). java -Xmx1400m... Today I tried the same option on a new Windows XP machine using Java 1.5_16 and 1.6.0_07 and got the error: Error occurred during initi... | [
"java",
"windows",
"memory"
] | 105 | 130 | 151,549 | 13 | 0 | 2008-10-05T00:02:04.110000 | 2009-01-31T00:02:39.267000 |
171,213 | 171,220 | How to block running two instances of the same program? | I need to make sure that user can run only one instance of my program at a time. Which means, that I have to check programatically, whether the same program is already running, and quit in such case. The first thing that came to my mind was to create a file somewhere, when the program starts. Then, each other instance ... | There are several methods you can use to accomplish only allowing one instance of your application: Method 1: Global synchronization object or memory It's usually done by creating a named global mutex or event. If it is already created, then you know the program is already running. For example in windows you could do: ... | How to block running two instances of the same program? I need to make sure that user can run only one instance of my program at a time. Which means, that I have to check programatically, whether the same program is already running, and quit in such case. The first thing that came to my mind was to create a file somewh... | TITLE:
How to block running two instances of the same program?
QUESTION:
I need to make sure that user can run only one instance of my program at a time. Which means, that I have to check programatically, whether the same program is already running, and quit in such case. The first thing that came to my mind was to cr... | [
"c++"
] | 30 | 37 | 16,836 | 8 | 0 | 2008-10-05T00:05:44.977000 | 2008-10-05T00:10:42.610000 |
171,230 | 382,932 | PHP access to iTunes tags in an RSS feed | I need to get access to the iTunes tags in an RSS feed using PHP. I've used simplepie before for podcast feeds, but I'm not sure how to get the iTunes tags using it. Is there a way to use simplepie to do it or is there a better way? Okay I tried Simple XML. All this (the code below) seems to work $feed = simplexml_load... | This code works for me: //$pie is a SimplePie object $iTunesCategories=$pie->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES,'category'); if ($iTunesCategories) { foreach ($iTunesCategories as $iTunesCategory) { $category=$iTunesCategory['attribs']['']['text']; $subcat=$iTunesCategory['child']["http://www.itunes.com/dtds/p... | PHP access to iTunes tags in an RSS feed I need to get access to the iTunes tags in an RSS feed using PHP. I've used simplepie before for podcast feeds, but I'm not sure how to get the iTunes tags using it. Is there a way to use simplepie to do it or is there a better way? Okay I tried Simple XML. All this (the code be... | TITLE:
PHP access to iTunes tags in an RSS feed
QUESTION:
I need to get access to the iTunes tags in an RSS feed using PHP. I've used simplepie before for podcast feeds, but I'm not sure how to get the iTunes tags using it. Is there a way to use simplepie to do it or is there a better way? Okay I tried Simple XML. All... | [
"rss",
"itunes",
"podcast",
"simplepie"
] | 3 | 1 | 6,963 | 5 | 0 | 2008-10-05T00:16:51.070000 | 2008-12-20T04:45:29.853000 |
171,237 | 171,255 | Apache Webserver security and optimization tips | I'm about to deal with managing and running my first Internet connected Apache webserver and I was wondering if there are any sys admins and developers out there that would like to share some of their knowledge regarding security and optimization tips for running Apache webserver. Maybe you can share your top five (or ... | Basic Be sure to have the latest stable version installed. Running old or unstable version of Apache could expose your system to security flaws or untested solutions Be sure only the intended requests are actually processed. You should consider who has to access the web resources exposed by Apache and how. Avoid runnin... | Apache Webserver security and optimization tips I'm about to deal with managing and running my first Internet connected Apache webserver and I was wondering if there are any sys admins and developers out there that would like to share some of their knowledge regarding security and optimization tips for running Apache w... | TITLE:
Apache Webserver security and optimization tips
QUESTION:
I'm about to deal with managing and running my first Internet connected Apache webserver and I was wondering if there are any sys admins and developers out there that would like to share some of their knowledge regarding security and optimization tips fo... | [
"apache",
"security",
"optimization",
"webserver"
] | 5 | 9 | 1,842 | 6 | 0 | 2008-10-05T00:19:23.077000 | 2008-10-05T00:32:36.123000 |
171,251 | 171,256 | How can I merge properties of two JavaScript objects? | I need to be able to merge two (very simple) JavaScript objects at runtime. For example I'd like to: var obj1 = { food: 'pizza', car: 'ford' } var obj2 = { animal: 'dog' }
obj1.merge(obj2);
//obj1 now has three properties: food, car, and animal Is there a built in way to do this? I do not need recursion, and I do not... | ECMAScript 2018 Standard Method You would use object spread: let merged = {...obj1,...obj2}; merged is now the union of obj1 and obj2. Properties in obj2 will overwrite those in obj1. /** There's no limit to the number of objects you can merge. * Later properties overwrite earlier properties with the same name. */ cons... | How can I merge properties of two JavaScript objects? I need to be able to merge two (very simple) JavaScript objects at runtime. For example I'd like to: var obj1 = { food: 'pizza', car: 'ford' } var obj2 = { animal: 'dog' }
obj1.merge(obj2);
//obj1 now has three properties: food, car, and animal Is there a built in... | TITLE:
How can I merge properties of two JavaScript objects?
QUESTION:
I need to be able to merge two (very simple) JavaScript objects at runtime. For example I'd like to: var obj1 = { food: 'pizza', car: 'ford' } var obj2 = { animal: 'dog' }
obj1.merge(obj2);
//obj1 now has three properties: food, car, and animal I... | [
"javascript",
"javascript-objects"
] | 3,291 | 4,063 | 1,988,585 | 69 | 0 | 2008-10-05T00:30:54.833000 | 2008-10-05T00:33:25.077000 |
171,259 | 171,266 | Can you use javascript to modify onmousedown of div at runtime | I want to write some JavaScript that will change the onmousedown of a div at runtime. So on load a mouse down on the div will do one thing and if a JavaScript function is called a mouse down on the div will do something else. Is this possible? | You can just assign the onMouseDown property. document.getElementById('myDiv').onmousedown = function() { alert('New mouse down handler.'); }; Keep in mind that javascript properties are case-sensitive. "onmousedown" is all lower-case. | Can you use javascript to modify onmousedown of div at runtime I want to write some JavaScript that will change the onmousedown of a div at runtime. So on load a mouse down on the div will do one thing and if a JavaScript function is called a mouse down on the div will do something else. Is this possible? | TITLE:
Can you use javascript to modify onmousedown of div at runtime
QUESTION:
I want to write some JavaScript that will change the onmousedown of a div at runtime. So on load a mouse down on the div will do one thing and if a JavaScript function is called a mouse down on the div will do something else. Is this possi... | [
"javascript",
"events"
] | 4 | 13 | 11,826 | 1 | 0 | 2008-10-05T00:36:43.777000 | 2008-10-05T00:41:52.253000 |
171,267 | 171,294 | UNIX shell written in a reasonable language? | Has anyone ever heard of a UNIX shell written in a reasonable language, like Python? | Eshell is a Bash-like shell in Emacs Lisp. IPython can be used as a system shell, though the syntax is a bit weird (supporting all of Python plus basic sh constructs). fish has a core written in C, but much of its functionality is implemented in itself. Unlike many rare shells, it can be used as your login shell. Hotwi... | UNIX shell written in a reasonable language? Has anyone ever heard of a UNIX shell written in a reasonable language, like Python? | TITLE:
UNIX shell written in a reasonable language?
QUESTION:
Has anyone ever heard of a UNIX shell written in a reasonable language, like Python?
ANSWER:
Eshell is a Bash-like shell in Emacs Lisp. IPython can be used as a system shell, though the syntax is a bit weird (supporting all of Python plus basic sh construc... | [
"python",
"unix",
"shell"
] | 9 | 24 | 3,437 | 7 | 0 | 2008-10-05T00:42:54.263000 | 2008-10-05T01:08:31.170000 |
171,268 | 171,300 | Silverlight: Empty Storyboard vs BackgroundWorker | Which one performs better to run a game main loop? | There's a new option in RC0, it's the CompositionTarget.Rendering event. It seems to have promise for being the best option. As for other game loop methods, it's generally accepted that the empty Storyboard is best. So I'd recommend the new Rendering event first, and if that seems to have issues, go with the empty Stor... | Silverlight: Empty Storyboard vs BackgroundWorker Which one performs better to run a game main loop? | TITLE:
Silverlight: Empty Storyboard vs BackgroundWorker
QUESTION:
Which one performs better to run a game main loop?
ANSWER:
There's a new option in RC0, it's the CompositionTarget.Rendering event. It seems to have promise for being the best option. As for other game loop methods, it's generally accepted that the em... | [
"silverlight",
"multithreading"
] | 1 | 3 | 676 | 1 | 0 | 2008-10-05T00:42:58.460000 | 2008-10-05T01:11:15.703000 |
171,283 | 171,940 | merb_auth_password_slice does not maintain the session | Having integrated merb_auth_password_slice as per the README, I can successfully login as redirect_after_login is being triggered, although session.authenticated? returns false. Just trying the basic auth strategy for now (password form), can't seem to get it working, any ideas? My init file: require 'dm-validations'
... | # before(nil,:only => [:update,:destroy]) { session.abandon! } This is the culprit in the slice's session controller | merb_auth_password_slice does not maintain the session Having integrated merb_auth_password_slice as per the README, I can successfully login as redirect_after_login is being triggered, although session.authenticated? returns false. Just trying the basic auth strategy for now (password form), can't seem to get it worki... | TITLE:
merb_auth_password_slice does not maintain the session
QUESTION:
Having integrated merb_auth_password_slice as per the README, I can successfully login as redirect_after_login is being triggered, although session.authenticated? returns false. Just trying the basic auth strategy for now (password form), can't se... | [
"ruby",
"merb",
"merb-auth"
] | 1 | 1 | 162 | 1 | 0 | 2008-10-05T01:00:08.050000 | 2008-10-05T13:03:01.040000 |
171,301 | 171,320 | What's the fastest way to divide an integer by 3? | int x = n / 3; // <-- make this faster
// for instance
int a = n * 3; // <-- normal integer multiplication
int b = (n << 1) + n; // <-- potentially faster multiplication | This is the fastest as the compiler will optimize it if it can depending on the output processor. int a; int b;
a = some value; b = a / 3; | What's the fastest way to divide an integer by 3? int x = n / 3; // <-- make this faster
// for instance
int a = n * 3; // <-- normal integer multiplication
int b = (n << 1) + n; // <-- potentially faster multiplication | TITLE:
What's the fastest way to divide an integer by 3?
QUESTION:
int x = n / 3; // <-- make this faster
// for instance
int a = n * 3; // <-- normal integer multiplication
int b = (n << 1) + n; // <-- potentially faster multiplication
ANSWER:
This is the fastest as the compiler will optimize it if it can dependi... | [
"optimization",
"bit-manipulation",
"division"
] | 45 | 61 | 52,987 | 12 | 0 | 2008-10-05T01:13:19.537000 | 2008-10-05T01:30:32.840000 |
171,326 | 429,465 | How can I increase the key repeat rate beyond the OS's limit? | I have a bad habit of using the cursor keys of my keyboard to navigate source code. It's something I've done for 15 years and this of course means that my navigating speed is limited by the speed of the keyboard. On both Vista and OS X (I dual boot a MacBook), I have my key repeat rate turned all the way up. But in Vis... | On Mac OS X, open the Global Preferences plist open ~/Library/Preferences/.GlobalPreferences.plist Then change the InitialKeyRepeat field. Smaller numbers will speed up your cursor rate. The settings dialog will only set it to a minimum of 2, so if you go to 0 or 1, you'll get a faster cursor. I had to reboot for this ... | How can I increase the key repeat rate beyond the OS's limit? I have a bad habit of using the cursor keys of my keyboard to navigate source code. It's something I've done for 15 years and this of course means that my navigating speed is limited by the speed of the keyboard. On both Vista and OS X (I dual boot a MacBook... | TITLE:
How can I increase the key repeat rate beyond the OS's limit?
QUESTION:
I have a bad habit of using the cursor keys of my keyboard to navigate source code. It's something I've done for 15 years and this of course means that my navigating speed is limited by the speed of the keyboard. On both Vista and OS X (I d... | [
"windows",
"visual-studio",
"macos",
"keyboard"
] | 61 | 33 | 52,716 | 15 | 0 | 2008-10-05T01:33:28.903000 | 2009-01-09T19:54:56.417000 |
171,332 | 171,337 | Accessing internal members via System.Reflection? | I'm trying to Unit Test a class that has many internal functions. These obviously need testing too, but my Tests project is seperate, mainly because it covers many small, related projects. What I have so far is: FieldInfo[] _fields = typeof(ButtonedForm.TitleButton).GetFields( BindingFlags.NonPublic | BindingFlags.Inst... | It would be more appropriate to use the InternalsVisibleTo attribute to grant access to the internal members of the assembly to your unit test assembly. Here is a link with some helpful additional info and a walk through: The Wonders Of InternalsVisibleTo To actually answer your question... Internal and protected are n... | Accessing internal members via System.Reflection? I'm trying to Unit Test a class that has many internal functions. These obviously need testing too, but my Tests project is seperate, mainly because it covers many small, related projects. What I have so far is: FieldInfo[] _fields = typeof(ButtonedForm.TitleButton).Get... | TITLE:
Accessing internal members via System.Reflection?
QUESTION:
I'm trying to Unit Test a class that has many internal functions. These obviously need testing too, but my Tests project is seperate, mainly because it covers many small, related projects. What I have so far is: FieldInfo[] _fields = typeof(ButtonedFor... | [
"c#",
".net",
"reflection",
"internal"
] | 24 | 32 | 17,854 | 5 | 0 | 2008-10-05T01:41:23.317000 | 2008-10-05T01:44:30.940000 |
171,343 | 171,377 | What is the best way to validate a terminal command has run successfully in Rails? | I'm writing a quick Rails app and was wondering how I can validate the success an exec'd command. The two commands I'm running are and SVN update, and a cp from one directory to another. | If you use the Kernel.system() method it will return a boolean indicating the success of the command. result = system("cp -r dir1 dir2") if(result) #do the next thing else # handle the error There is a good comparison of different ruby system commands here. | What is the best way to validate a terminal command has run successfully in Rails? I'm writing a quick Rails app and was wondering how I can validate the success an exec'd command. The two commands I'm running are and SVN update, and a cp from one directory to another. | TITLE:
What is the best way to validate a terminal command has run successfully in Rails?
QUESTION:
I'm writing a quick Rails app and was wondering how I can validate the success an exec'd command. The two commands I'm running are and SVN update, and a cp from one directory to another.
ANSWER:
If you use the Kernel.s... | [
"ruby-on-rails",
"ruby",
"validation",
"terminal",
"system"
] | 6 | 8 | 1,225 | 4 | 0 | 2008-10-05T01:51:07.307000 | 2008-10-05T02:32:54.133000 |
171,352 | 171,488 | c# store user settings in database | Is there an easy method to store a person's user settings in a sql 2000 database. Ideally all settings in one field so I don't keep having to edit the table every time I add a setting. I am thinking along the lines of serialize a settings class if anyone has an example. The reason I don't want to use the built in.NET u... | The VS designer keeps property settings in the ApplicationSettingsBase class. By default, these properties are serialized/deserialized into a per user XML file. You can override this behavior by using a custom SettingsProvider which is where you can add your database functionality. Just add the SettingsProvider attribu... | c# store user settings in database Is there an easy method to store a person's user settings in a sql 2000 database. Ideally all settings in one field so I don't keep having to edit the table every time I add a setting. I am thinking along the lines of serialize a settings class if anyone has an example. The reason I d... | TITLE:
c# store user settings in database
QUESTION:
Is there an easy method to store a person's user settings in a sql 2000 database. Ideally all settings in one field so I don't keep having to edit the table every time I add a setting. I am thinking along the lines of serialize a settings class if anyone has an examp... | [
"c#",
".net",
"database",
"repost"
] | 5 | 4 | 7,948 | 4 | 0 | 2008-10-05T02:06:34.780000 | 2008-10-05T04:32:11.693000 |
171,363 | 171,394 | Third party data delivery of lots of data | Does anyone know how sites that have a real-time feed of a lot of data work? I am referring to something like a stock site, where they can tell you in real time (well, 20 minute delay mostly, but still real-time - 20 minutes as I understand it). They have thousands of data pieces delivered to them every second, I would... | Generally there is a server/client protocol defined between the 2 parties. In the company I work for the connection is maintained at all times. Here is info on real time data feeds to go with your stock example NYSE, NASDAQ It is common for data providers to also have FTP sites with (delayed) batched data. One that com... | Third party data delivery of lots of data Does anyone know how sites that have a real-time feed of a lot of data work? I am referring to something like a stock site, where they can tell you in real time (well, 20 minute delay mostly, but still real-time - 20 minutes as I understand it). They have thousands of data piec... | TITLE:
Third party data delivery of lots of data
QUESTION:
Does anyone know how sites that have a real-time feed of a lot of data work? I am referring to something like a stock site, where they can tell you in real time (well, 20 minute delay mostly, but still real-time - 20 minutes as I understand it). They have thou... | [
"real-time"
] | 0 | 4 | 299 | 4 | 0 | 2008-10-05T02:22:35.560000 | 2008-10-05T02:50:54.097000 |
171,365 | 172,077 | Strategies for pushing updates to an ASP.NET webfarm? | How do most people handle updating ASP.NET applications running in a webfarm? I am having the problem that because the app is in use and the request affitnity is not sticky, when we push the update users run into errors as the process requests the request might be handled by the wrong version of the application. How do... | This is what we do: Drain the active sessions off a particular server in the farm no new traffic will be routed to that server during the time. Apply the patch to the drained server Drain the sessons off the remaining servers Allow traffic back to the original server As the other servers are drained, apply the patch an... | Strategies for pushing updates to an ASP.NET webfarm? How do most people handle updating ASP.NET applications running in a webfarm? I am having the problem that because the app is in use and the request affitnity is not sticky, when we push the update users run into errors as the process requests the request might be h... | TITLE:
Strategies for pushing updates to an ASP.NET webfarm?
QUESTION:
How do most people handle updating ASP.NET applications running in a webfarm? I am having the problem that because the app is in use and the request affitnity is not sticky, when we push the update users run into errors as the process requests the ... | [
"asp.net",
"iis",
"deployment",
"server-push",
"web-farm"
] | 2 | 2 | 518 | 2 | 0 | 2008-10-05T02:25:05.693000 | 2008-10-05T14:39:28.100000 |
171,366 | 171,385 | What is Reflection? | I am VERY new to ASP.NET. I come from a VB6 / ASP (classic) / SQL Server 2000 background. I am reading a lot about Visual Studio 2008 (have installed it and am poking around). I have read about "reflection" and would like someone to explain, as best as you can to an older developer of the technologies I've written abov... | Reflection lets you programmatically load an assembly, get a list of all the types in an assembly, get a list of all the properties and methods in these types, etc. As an example: myobject.GetType().GetProperty("MyProperty").SetValue(myobject, "wicked!", null) | What is Reflection? I am VERY new to ASP.NET. I come from a VB6 / ASP (classic) / SQL Server 2000 background. I am reading a lot about Visual Studio 2008 (have installed it and am poking around). I have read about "reflection" and would like someone to explain, as best as you can to an older developer of the technologi... | TITLE:
What is Reflection?
QUESTION:
I am VERY new to ASP.NET. I come from a VB6 / ASP (classic) / SQL Server 2000 background. I am reading a lot about Visual Studio 2008 (have installed it and am poking around). I have read about "reflection" and would like someone to explain, as best as you can to an older developer... | [
"reflection",
"metaprogramming"
] | 6 | 3 | 1,223 | 6 | 0 | 2008-10-05T02:26:06.287000 | 2008-10-05T02:40:47.753000 |
171,367 | 171,406 | Can I save a record in a Windows Gadget in a file or other storage (database, etc.)? | I'm planning to create a simple gadget to create a TO DO list application. This is just for practice and to explore Windows Gadget. How can I store the values in the database? As much as possible, I don't want to set up a local http handler file to be a means to store value to file or database. Note: I tag this with ht... | Once installed, gadgets run with all the permissions of the logged in user. So you should be able to access the local file system and instantiate COM objects such as ADO to connect to a database. The chap here wrote a gadget settings persistence manager to allow gadgets to save their settings between being uninstalled ... | Can I save a record in a Windows Gadget in a file or other storage (database, etc.)? I'm planning to create a simple gadget to create a TO DO list application. This is just for practice and to explore Windows Gadget. How can I store the values in the database? As much as possible, I don't want to set up a local http ha... | TITLE:
Can I save a record in a Windows Gadget in a file or other storage (database, etc.)?
QUESTION:
I'm planning to create a simple gadget to create a TO DO list application. This is just for practice and to explore Windows Gadget. How can I store the values in the database? As much as possible, I don't want to set ... | [
"javascript",
"html",
"windows-desktop-gadgets"
] | 3 | 3 | 1,382 | 1 | 0 | 2008-10-05T02:26:11.450000 | 2008-10-05T03:02:01.720000 |
171,399 | 171,402 | When to use Fixed Point these days | For intense number-crunching i'm considering using fixed point instead of floating point. Of course it'll matter how many bytes the fixed point type is in size, on what CPU it'll be running on, if i can use (for Intel) the MMX or SSE or whatever new things come up... I'm wondering if these days when floating point runs... | It's still worth it. Floating point is faster than in the past, but fixed-point is also. And fixed is still the only way to go if you care about precision beyond that guaranteed by IEEE 754. | When to use Fixed Point these days For intense number-crunching i'm considering using fixed point instead of floating point. Of course it'll matter how many bytes the fixed point type is in size, on what CPU it'll be running on, if i can use (for Intel) the MMX or SSE or whatever new things come up... I'm wondering if ... | TITLE:
When to use Fixed Point these days
QUESTION:
For intense number-crunching i'm considering using fixed point instead of floating point. Of course it'll matter how many bytes the fixed point type is in size, on what CPU it'll be running on, if i can use (for Intel) the MMX or SSE or whatever new things come up...... | [
"optimization",
"floating-point",
"performance",
"numerical",
"fixed-point"
] | 24 | 18 | 4,428 | 7 | 0 | 2008-10-05T02:53:37.087000 | 2008-10-05T02:55:34.323000 |
171,435 | 171,449 | Portability of #warning preprocessor directive | I know that the #warning directive is not standard C /C++, but several compilers support it, including gcc/g++. But for those that don't support it, will they silently ignore it or will it result in a compile failure? In other words, can I safely use it in my project without breaking the build for compilers that don't ... | It is likely that if a compiler doesn't support #warning, then it will issue an error. Unlike #pragma, there is no recommendation that the preprocessor ignore directives it doesn't understand. Having said that, I've used compilers on various different (reasonably common) platforms and they have all supported #warning. | Portability of #warning preprocessor directive I know that the #warning directive is not standard C /C++, but several compilers support it, including gcc/g++. But for those that don't support it, will they silently ignore it or will it result in a compile failure? In other words, can I safely use it in my project witho... | TITLE:
Portability of #warning preprocessor directive
QUESTION:
I know that the #warning directive is not standard C /C++, but several compilers support it, including gcc/g++. But for those that don't support it, will they silently ignore it or will it result in a compile failure? In other words, can I safely use it i... | [
"c++",
"compiler-construction",
"warnings",
"c-preprocessor",
"portability"
] | 65 | 31 | 49,315 | 6 | 0 | 2008-10-05T03:40:47.103000 | 2008-10-05T03:53:13.550000 |
171,439 | 171,451 | Automatically opening a file using Windows shell script | I have a Windows shell script that opens an application. I'd like to modify it to make it open a file automatically upon opening the application. I know it uses VBscript but I'm not familiar with the language; all the tutorials I found just talked about using VBS for web pages, not for Windows scripts. I know the synta... | You need to quote the filename so that any spaces in the path don't cause problems. Instead of just using & filename to append the filename, use: & Chr(34) & filename & Chr(34) This behaviour will also rely on the application accepting a file to open on the command line, which whilst common isn't mandatory. An alternat... | Automatically opening a file using Windows shell script I have a Windows shell script that opens an application. I'd like to modify it to make it open a file automatically upon opening the application. I know it uses VBscript but I'm not familiar with the language; all the tutorials I found just talked about using VBS ... | TITLE:
Automatically opening a file using Windows shell script
QUESTION:
I have a Windows shell script that opens an application. I'd like to modify it to make it open a file automatically upon opening the application. I know it uses VBscript but I'm not familiar with the language; all the tutorials I found just talke... | [
"windows",
"vbscript"
] | 1 | 4 | 2,510 | 1 | 0 | 2008-10-05T03:43:03.087000 | 2008-10-05T03:54:44.093000 |
171,457 | 171,471 | User32 API calls in .NET | I'm currently planning out a project involving creating a shell replacement for Windows (based on Blackbox, bblean specifically). However I wish to leverage the power of.NET to do so. Many of the API calls I'll need are housed within the User32 library. I can of course use P/Invoke and create a static class to handle t... | I was recently experimenting with creating my own windowing system, really just create new borders around all the windows, but it required a lot of functions from the Win32 API that I add to P/Invoke in. But there is a ready to-go library in.NET that wraps most of the Win32 API already found here | User32 API calls in .NET I'm currently planning out a project involving creating a shell replacement for Windows (based on Blackbox, bblean specifically). However I wish to leverage the power of.NET to do so. Many of the API calls I'll need are housed within the User32 library. I can of course use P/Invoke and create a... | TITLE:
User32 API calls in .NET
QUESTION:
I'm currently planning out a project involving creating a shell replacement for Windows (based on Blackbox, bblean specifically). However I wish to leverage the power of.NET to do so. Many of the API calls I'll need are housed within the User32 library. I can of course use P/I... | [
".net",
"managed",
"user32"
] | 4 | 3 | 1,639 | 2 | 0 | 2008-10-05T03:59:17.347000 | 2008-10-05T04:10:20.817000 |
171,474 | 171,477 | What do you use to create flowcharts? | I'm curious what tools people have found useful for building flowcharts. Obviously MS Visio and OmniGraffle come to mind but they both feel so bloated and also tend to emphasize the document formatting/printing side and less on helping to organize the actual logic. Is there anything else out there that fellow developer... | Though you list it as bloated I nonetheless use OmniGraffle. For quick flowcharting a series of boxes with lines to magnets in the boxes is sufficient, but the rest of the formatting options are good to have later. I find that any flowchart I take the time to draw generally ends up in a document somewhere. Even when I'... | What do you use to create flowcharts? I'm curious what tools people have found useful for building flowcharts. Obviously MS Visio and OmniGraffle come to mind but they both feel so bloated and also tend to emphasize the document formatting/printing side and less on helping to organize the actual logic. Is there anythin... | TITLE:
What do you use to create flowcharts?
QUESTION:
I'm curious what tools people have found useful for building flowcharts. Obviously MS Visio and OmniGraffle come to mind but they both feel so bloated and also tend to emphasize the document formatting/printing side and less on helping to organize the actual logic... | [
"flowchart"
] | 5 | 2 | 3,432 | 10 | 0 | 2008-10-05T04:13:38.703000 | 2008-10-05T04:18:36.480000 |
171,480 | 171,499 | RegEx: Grabbing values between quotation marks | I have a value like this: "Foo Bar" "Another Value" something else What regex will return the values enclosed in the quotation marks (e.g. Foo Bar and Another Value )? | I've been using the following with great success: (["'])(?:(?=(\\?))\2.)*?\1 It supports nested quotes as well. For those who want a deeper explanation of how this works, here's an explanation from user ephemient: ([""']) match a quote; ((?=(\\?))\2.) if backslash exists, gobble it, and whether or not that happens, mat... | RegEx: Grabbing values between quotation marks I have a value like this: "Foo Bar" "Another Value" something else What regex will return the values enclosed in the quotation marks (e.g. Foo Bar and Another Value )? | TITLE:
RegEx: Grabbing values between quotation marks
QUESTION:
I have a value like this: "Foo Bar" "Another Value" something else What regex will return the values enclosed in the quotation marks (e.g. Foo Bar and Another Value )?
ANSWER:
I've been using the following with great success: (["'])(?:(?=(\\?))\2.)*?\1 I... | [
"regex"
] | 365 | 488 | 642,572 | 20 | 0 | 2008-10-05T04:22:06.520000 | 2008-10-05T04:40:14.453000 |
171,489 | 171,531 | Explicit Type Conversion in Scala | Lets say I have the following code: abstract class Animal case class Dog(name:String) extends Animal var foo:Animal = Dog("rover") var bar:Dog = foo //ERROR! How do I fix the last line of this code? Basically, I just want to do what, in a C-like language would be done: var bar:Dog = (Dog) foo | I figured this out myself. There are two solutions: 1) Do the explicit cast: var bar:Dog = foo.asInstanceOf[Dog] 2) Use pattern matching to cast it for you, this also catches errors: var bar:Dog = foo match { case x:Dog => x case _ => { // Error handling code here } } | Explicit Type Conversion in Scala Lets say I have the following code: abstract class Animal case class Dog(name:String) extends Animal var foo:Animal = Dog("rover") var bar:Dog = foo //ERROR! How do I fix the last line of this code? Basically, I just want to do what, in a C-like language would be done: var bar:Dog = (D... | TITLE:
Explicit Type Conversion in Scala
QUESTION:
Lets say I have the following code: abstract class Animal case class Dog(name:String) extends Animal var foo:Animal = Dog("rover") var bar:Dog = foo //ERROR! How do I fix the last line of this code? Basically, I just want to do what, in a C-like language would be done... | [
"scala",
"type-conversion"
] | 78 | 149 | 70,642 | 1 | 0 | 2008-10-05T04:32:52.847000 | 2008-10-05T05:09:59.450000 |
171,490 | 172,759 | Getting 256 colors out of ruby-ncurses | I've got 256 colors working great in my terminal ( test scripts here ), but it stops working when I use ncurses (via Ruby-ncurses). Printing the escape sequences given on that page works fine, but when I initialize ncurses 'puts' stops working and I can't output the colors with any of the various ncurses color changing... | njsf: You were partially right here, and after tinkering a lot more I eventually got it to work. Thanks for your help. The story: XTerm (and rxvt, and Eterm) support 256 colors via escape sequences (what I was seeing) but 'tput colors' will say '8' and ncurses won't be able to get at them, because ncurses is playing ni... | Getting 256 colors out of ruby-ncurses I've got 256 colors working great in my terminal ( test scripts here ), but it stops working when I use ncurses (via Ruby-ncurses). Printing the escape sequences given on that page works fine, but when I initialize ncurses 'puts' stops working and I can't output the colors with an... | TITLE:
Getting 256 colors out of ruby-ncurses
QUESTION:
I've got 256 colors working great in my terminal ( test scripts here ), but it stops working when I use ncurses (via Ruby-ncurses). Printing the escape sequences given on that page works fine, but when I initialize ncurses 'puts' stops working and I can't output ... | [
"ruby",
"ncurses",
"terminal",
"256color"
] | 8 | 5 | 4,496 | 3 | 0 | 2008-10-05T04:33:15.937000 | 2008-10-05T22:18:14.617000 |
171,506 | 171,534 | Make and build utilities on CentOS/RHEL? | I've been unsuccessfully searching for a way to install make utility on my CentOS 5.2. I've looked through some RPM repositories and online, with no avail. Installing gcc, gcc-c++ didn't help! Package build-essential is not made for CentOS/RHEL. I have RPMFORGE repo enabled in YUM. | I just double checked and CentOS 5.2 already includes make! I found it also in one of the online mirrors, if it is easier for you: http://centos.cogentcloud.com/5.2/os/i386/CentOS/make-3.81-3.el5.i386.rpm if you installed the 64 bit version: http://centos.cogentcloud.com/5.2/os/x86_64/CentOS/make-3.81-3.el5.x86_64.rpm | Make and build utilities on CentOS/RHEL? I've been unsuccessfully searching for a way to install make utility on my CentOS 5.2. I've looked through some RPM repositories and online, with no avail. Installing gcc, gcc-c++ didn't help! Package build-essential is not made for CentOS/RHEL. I have RPMFORGE repo enabled in Y... | TITLE:
Make and build utilities on CentOS/RHEL?
QUESTION:
I've been unsuccessfully searching for a way to install make utility on my CentOS 5.2. I've looked through some RPM repositories and online, with no avail. Installing gcc, gcc-c++ didn't help! Package build-essential is not made for CentOS/RHEL. I have RPMFORGE... | [
"build",
"centos",
"utilities",
"rhel"
] | 38 | 11 | 114,746 | 5 | 0 | 2008-10-05T04:45:39.047000 | 2008-10-05T05:12:37.057000 |
171,512 | 171,672 | How would I implement a bit map? | I wish to implement a 2d bit map class in Python. The class would have the following requirements: Allow the creating of arbitrarily sized 2d bitmaps. i.e. to create an 8 x 8 bitmap (8 bytes), something like: bitmap = Bitmap(8,8) provide an API to access the bits in this 2d map as boolean or even integer values, i.e.: ... | Bit-Packing numpy ( SciPY ) arrays does what you are looking for. The example shows 4x3 bit (Boolean) array packed into 4 8-bit bytes. unpackbits unpacks uint8 arrays into a Boolean output array that you can use in computations. >>> a = np.array([[[1,0,1],... [0,1,0]],... [[1,1,0],... [0,0,1]]]) >>> b = np.packbits(a,a... | How would I implement a bit map? I wish to implement a 2d bit map class in Python. The class would have the following requirements: Allow the creating of arbitrarily sized 2d bitmaps. i.e. to create an 8 x 8 bitmap (8 bytes), something like: bitmap = Bitmap(8,8) provide an API to access the bits in this 2d map as boole... | TITLE:
How would I implement a bit map?
QUESTION:
I wish to implement a 2d bit map class in Python. The class would have the following requirements: Allow the creating of arbitrarily sized 2d bitmaps. i.e. to create an 8 x 8 bitmap (8 bytes), something like: bitmap = Bitmap(8,8) provide an API to access the bits in th... | [
"python",
"class"
] | 5 | 8 | 18,483 | 2 | 0 | 2008-10-05T04:51:11.967000 | 2008-10-05T08:16:06.890000 |
171,516 | 177,250 | Accessing HttpApplicationState during Session_End | In my ASP.NET application using InProc sessions, Session_End calls a static method in another object to do session-specific clean up. This clean up uses a shared database connection that I am storing in application state. The problem is that I cannot see how to access the application state without passing it (or rather... | Where are you creating the "NeedsCleanup" instances? If it's in Session_Start, it makes sense that your global class would know how/when to both create and destroy these instance. I understand you'd like to decouple the cleanup of NeedsCleanup from its caller. Perhaps a cleaner way would to pass in the "HttpApplication... | Accessing HttpApplicationState during Session_End In my ASP.NET application using InProc sessions, Session_End calls a static method in another object to do session-specific clean up. This clean up uses a shared database connection that I am storing in application state. The problem is that I cannot see how to access t... | TITLE:
Accessing HttpApplicationState during Session_End
QUESTION:
In my ASP.NET application using InProc sessions, Session_End calls a static method in another object to do session-specific clean up. This clean up uses a shared database connection that I am storing in application state. The problem is that I cannot s... | [
"asp.net",
"application-state"
] | 0 | 0 | 2,747 | 3 | 0 | 2008-10-05T04:52:14.010000 | 2008-10-07T04:38:43.363000 |
171,519 | 172,042 | Authenticating in PHP using LDAP through Active Directory | I'm looking for a way to authenticate users through LDAP with PHP (with Active Directory being the provider). Ideally, it should be able to run on IIS 7 ( adLDAP does it on Apache). Anyone had done anything similar, with success? Edit: I'd prefer a library/class with code that's ready to go... It'd be silly to invent t... | Importing a whole library seems inefficient when all you need is essentially two lines of code... $ldap = ldap_connect("ldap.example.com"); if ($bind = ldap_bind($ldap, $_POST['username'], $_POST['password'])) { // log them in! } else { // error message } | Authenticating in PHP using LDAP through Active Directory I'm looking for a way to authenticate users through LDAP with PHP (with Active Directory being the provider). Ideally, it should be able to run on IIS 7 ( adLDAP does it on Apache). Anyone had done anything similar, with success? Edit: I'd prefer a library/class... | TITLE:
Authenticating in PHP using LDAP through Active Directory
QUESTION:
I'm looking for a way to authenticate users through LDAP with PHP (with Active Directory being the provider). Ideally, it should be able to run on IIS 7 ( adLDAP does it on Apache). Anyone had done anything similar, with success? Edit: I'd pref... | [
"php",
"authentication",
"active-directory",
"ldap"
] | 112 | 176 | 200,421 | 6 | 0 | 2008-10-05T04:59:11.640000 | 2008-10-05T14:10:07.097000 |
171,529 | 173,169 | acts_as_tree does not destroy the model's children | I have this Task model: class Task < ActiveRecord::Base acts_as_tree:order => 'sort_order' end And I have this test class TaskTest < Test::Unit::TestCase def setup @root = create_root end
def test_destroying_a_task_should_destroy_all_of_its_descendants d1 = create_task(:parent_id => @root.id,:sort_order => 2) d2 = cre... | I found the bug. The line d1 = create_task(:parent_id => @root.id,:sort_order => 2) creates d1. This calls the before_save callback, which in turn calls self.children. As Orion pointed out, this caches the children of d1. However, at this point, d1 doesn't have any children yet. So d1's cache of children is empty. Thus... | acts_as_tree does not destroy the model's children I have this Task model: class Task < ActiveRecord::Base acts_as_tree:order => 'sort_order' end And I have this test class TaskTest < Test::Unit::TestCase def setup @root = create_root end
def test_destroying_a_task_should_destroy_all_of_its_descendants d1 = create_tas... | TITLE:
acts_as_tree does not destroy the model's children
QUESTION:
I have this Task model: class Task < ActiveRecord::Base acts_as_tree:order => 'sort_order' end And I have this test class TaskTest < Test::Unit::TestCase def setup @root = create_root end
def test_destroying_a_task_should_destroy_all_of_its_descendan... | [
"ruby-on-rails",
"ruby",
"acts-as-tree"
] | 5 | 4 | 1,035 | 2 | 0 | 2008-10-05T05:08:50.527000 | 2008-10-06T04:02:30.317000 |
171,541 | 171,652 | How do I obtain a list of the application domains my application has created? | I have a service app that creates AppDomain's during the course of its use for long running tasks. I've been tracking these by storing them in a Hashtable with a unique ID. After a task is completed the service app then unloads the AppDomain allocated to that task and then it's removed it from the appdomain Hashtable. ... | AFAIK, you need to keep your own list - like you are already. | How do I obtain a list of the application domains my application has created? I have a service app that creates AppDomain's during the course of its use for long running tasks. I've been tracking these by storing them in a Hashtable with a unique ID. After a task is completed the service app then unloads the AppDomain ... | TITLE:
How do I obtain a list of the application domains my application has created?
QUESTION:
I have a service app that creates AppDomain's during the course of its use for long running tasks. I've been tracking these by storing them in a Hashtable with a unique ID. After a task is completed the service app then unlo... | [
"c#",
".net",
"clr",
"appdomain"
] | 2 | 2 | 2,098 | 2 | 0 | 2008-10-05T05:21:33.140000 | 2008-10-05T07:57:59.250000 |
171,542 | 171,632 | Proper IE6 HTML element dimensions | I'm trying to set the width and height of an element with javascript to cover the entire browser viewport, and I'm successful using document.body.clientHeight but in IE6 it seems that I always get horizontal and vertical scrollbars because the element must be slightly too big. Now, I really don't want to use browser sp... | have you considered using jQuery? it abstracts most of the browser specific functionality away into a common interface. var width = $(document).width(); var height = $(document.height();
$('#mySpecialElement').width(width).height(height); | Proper IE6 HTML element dimensions I'm trying to set the width and height of an element with javascript to cover the entire browser viewport, and I'm successful using document.body.clientHeight but in IE6 it seems that I always get horizontal and vertical scrollbars because the element must be slightly too big. Now, I ... | TITLE:
Proper IE6 HTML element dimensions
QUESTION:
I'm trying to set the width and height of an element with javascript to cover the entire browser viewport, and I'm successful using document.body.clientHeight but in IE6 it seems that I always get horizontal and vertical scrollbars because the element must be slightl... | [
"javascript",
"internet-explorer"
] | 1 | 3 | 1,859 | 3 | 0 | 2008-10-05T05:22:56.397000 | 2008-10-05T07:33:24.340000 |
171,548 | 172,123 | Best way to document AJAX + PHP code? | I have always been for documenting code, but when it comes to AJAX + PHP, it's not always easy: the code is really spread out! Logic, data, presentation - you name it - are split and mixed between server-side and client-side code. Sometimes there's also database-side code (stored procedures, views, etc) doing part of t... | I think it's best to take a hierarchical approach. For api-level documentation like on the function and class level, write inline documentation in the code and generate html documentation out of them using the many documentation tools out there ( JSDoc, phpDocumentor, OraDoclet, etc). Bonus points if your doc tools can... | Best way to document AJAX + PHP code? I have always been for documenting code, but when it comes to AJAX + PHP, it's not always easy: the code is really spread out! Logic, data, presentation - you name it - are split and mixed between server-side and client-side code. Sometimes there's also database-side code (stored p... | TITLE:
Best way to document AJAX + PHP code?
QUESTION:
I have always been for documenting code, but when it comes to AJAX + PHP, it's not always easy: the code is really spread out! Logic, data, presentation - you name it - are split and mixed between server-side and client-side code. Sometimes there's also database-s... | [
"php",
"ajax",
"documentation"
] | 10 | 3 | 2,961 | 4 | 0 | 2008-10-05T05:41:06.937000 | 2008-10-05T15:15:17.747000 |
171,565 | 172,401 | Javascript memory profiler for Firefox | Is there a tool/plugin/function for Firefox that'll dump out a memory usage of Javascript objects that you create in a page/script? I know about Firebug's profiler but I'd like something more than just times. Something akin to what Yourkit has for Java profiling of memory usage. Reason is that a co-worker is using id's... | I haven't tried the Sofware verify tools, but Mozilla has tools that track overall memory consumed by firefox for the purpose of stemming leaks: http://www.mozilla.org/performance/tools.html and: https://wiki.mozilla.org/Performance:Leak_Tools There's also this guy saying to avoid large arrays in the context of closure... | Javascript memory profiler for Firefox Is there a tool/plugin/function for Firefox that'll dump out a memory usage of Javascript objects that you create in a page/script? I know about Firebug's profiler but I'd like something more than just times. Something akin to what Yourkit has for Java profiling of memory usage. R... | TITLE:
Javascript memory profiler for Firefox
QUESTION:
Is there a tool/plugin/function for Firefox that'll dump out a memory usage of Javascript objects that you create in a page/script? I know about Firebug's profiler but I'd like something more than just times. Something akin to what Yourkit has for Java profiling ... | [
"javascript",
"firefox",
"memory",
"profiling"
] | 51 | 11 | 35,784 | 5 | 0 | 2008-10-05T06:10:00.483000 | 2008-10-05T18:27:41.960000 |
171,578 | 171,819 | Best practices for migrating web application from Netscape to IIS? | We are in the process of developing a.NET based IIS hosted web application as part of a re-platforming project. The original web app is on a Netscape server, in the process of migration we need to point the dns to the IIS server so that the requests are responded by IIS. at the same time we would still need the Netscap... | Maybe this link can help: Migrating a Web Server to IIS: Basic Steps It discussed the steps you can take to get ready for Internet Information Services (IIS). In this article, the author takes a "nuts and bolts" approach to migrating an individual Web server. You'll find detailed information about migrating configurati... | Best practices for migrating web application from Netscape to IIS? We are in the process of developing a.NET based IIS hosted web application as part of a re-platforming project. The original web app is on a Netscape server, in the process of migration we need to point the dns to the IIS server so that the requests are... | TITLE:
Best practices for migrating web application from Netscape to IIS?
QUESTION:
We are in the process of developing a.NET based IIS hosted web application as part of a re-platforming project. The original web app is on a Netscape server, in the process of migration we need to point the dns to the IIS server so tha... | [
"migration",
"dns"
] | 0 | 0 | 273 | 1 | 0 | 2008-10-05T06:29:41.737000 | 2008-10-05T10:55:39.580000 |
171,588 | 171,737 | Is there a command to refresh environment variables from the command prompt in Windows? | If I modify or add an environment variable I have to restart the command prompt. Is there a command I could execute that would do this without restarting CMD? | You can capture the system environment variables with a vbs script, but you need a bat script to actually change the current environment variables, so this is a combined solution. Create a file named resetvars.vbs containing this code, and save it on the path: Set oShell = WScript.CreateObject("WScript.Shell") filename... | Is there a command to refresh environment variables from the command prompt in Windows? If I modify or add an environment variable I have to restart the command prompt. Is there a command I could execute that would do this without restarting CMD? | TITLE:
Is there a command to refresh environment variables from the command prompt in Windows?
QUESTION:
If I modify or add an environment variable I have to restart the command prompt. Is there a command I could execute that would do this without restarting CMD?
ANSWER:
You can capture the system environment variabl... | [
"windows",
"cmd",
"environment-variables"
] | 693 | 155 | 837,773 | 30 | 0 | 2008-10-05T06:49:38.407000 | 2008-10-05T09:10:28.247000 |
171,590 | 171,598 | Is it possible to deploy an already built Drupal site? | I'm a Drupal newbie. Is it possible to set up everything and deploy Drupal on the server? I mean things like putting in the content, setting up the modules, etc..., then you put it all up to the production server? | Of course. copy all the files edit the database credentials (sites/default/settings.php) export the database content via mysqldump or phpMyAdmin (supposing you use MySQL) import the database content at the target server I've done it several times. | Is it possible to deploy an already built Drupal site? I'm a Drupal newbie. Is it possible to set up everything and deploy Drupal on the server? I mean things like putting in the content, setting up the modules, etc..., then you put it all up to the production server? | TITLE:
Is it possible to deploy an already built Drupal site?
QUESTION:
I'm a Drupal newbie. Is it possible to set up everything and deploy Drupal on the server? I mean things like putting in the content, setting up the modules, etc..., then you put it all up to the production server?
ANSWER:
Of course. copy all the ... | [
"deployment",
"drupal"
] | 3 | 6 | 311 | 1 | 0 | 2008-10-05T06:50:56.577000 | 2008-10-05T06:59:04.813000 |
171,624 | 193,334 | LINQ Benchmarks in multitiered environment | I am involved in development of a tiered application that uses LINQ2SQL separated from the web server with a NET.TCP Binding on WCF. My questions are: What sort of measures should I take to achieve the best performance? Since the entity objects returned by the LINQ need to be converted to a IEnumerable list to be seria... | 1) Concentrate on a properly normalized database design. I would say that when you are forced to make design tradeoffs in your code vs. database design, if performance is your goal, make tradeoffs in your object design instead of your database design. Understand that you aren't going to be able to do a proper supertype... | LINQ Benchmarks in multitiered environment I am involved in development of a tiered application that uses LINQ2SQL separated from the web server with a NET.TCP Binding on WCF. My questions are: What sort of measures should I take to achieve the best performance? Since the entity objects returned by the LINQ need to be ... | TITLE:
LINQ Benchmarks in multitiered environment
QUESTION:
I am involved in development of a tiered application that uses LINQ2SQL separated from the web server with a NET.TCP Binding on WCF. My questions are: What sort of measures should I take to achieve the best performance? Since the entity objects returned by th... | [
"wcf",
"linq-to-sql",
"benchmarking"
] | 0 | 1 | 321 | 2 | 0 | 2008-10-05T07:21:32.647000 | 2008-10-10T23:28:21.013000 |
171,631 | 171,683 | Change min/max/close buttons theme | im currently overiding the WM_NCPAINT, WM_NCCALCSIZE and WM_NCACTIVATE to paint my own color/themed title bar for an application im working on. Now this is working great however the min, max and close buttons still are xp default theme. I looked into what controls them and the mouse messages do. However they also conto... | I think your best bet here is to disable the buttons and redraw them with something akin to to the code I posted in this answer. It's in C# with WinForms, but the vast majority of it is overloaded WndProc() anyway, which you should be able to use almost copy/paste into MFC. Implementing click handlers to do what you wa... | Change min/max/close buttons theme im currently overiding the WM_NCPAINT, WM_NCCALCSIZE and WM_NCACTIVATE to paint my own color/themed title bar for an application im working on. Now this is working great however the min, max and close buttons still are xp default theme. I looked into what controls them and the mouse m... | TITLE:
Change min/max/close buttons theme
QUESTION:
im currently overiding the WM_NCPAINT, WM_NCCALCSIZE and WM_NCACTIVATE to paint my own color/themed title bar for an application im working on. Now this is working great however the min, max and close buttons still are xp default theme. I looked into what controls th... | [
"windows",
"mfc"
] | 3 | 2 | 2,642 | 3 | 0 | 2008-10-05T07:32:32.343000 | 2008-10-05T08:21:01.497000 |
171,633 | 172,035 | Accessing crash logs on iPhones used for ad hoc distribution | When using one's own iPhone for development it's easy enough to access any crash logs via XCode->Organizer->Crash Logs. How does one access crash logs on another person's phone if they don't have it set up for development in XCode, as would likely be the case if you were distributing your app to them via ad hoc distrib... | Two ways: iTunes syncs all crash reports during a regular sync. They can be found in Library/Logs/CrashReporter/MobileDevice on a Mac and probably somewhere in %APPDATA% on Windows. You can use the iPhone Configuration Utility for Mac OS X on any Mac to access the phone's console and crash logs. Note: the iPhone Web Co... | Accessing crash logs on iPhones used for ad hoc distribution When using one's own iPhone for development it's easy enough to access any crash logs via XCode->Organizer->Crash Logs. How does one access crash logs on another person's phone if they don't have it set up for development in XCode, as would likely be the case... | TITLE:
Accessing crash logs on iPhones used for ad hoc distribution
QUESTION:
When using one's own iPhone for development it's easy enough to access any crash logs via XCode->Organizer->Crash Logs. How does one access crash logs on another person's phone if they don't have it set up for development in XCode, as would ... | [
"iphone",
"logging"
] | 16 | 21 | 18,828 | 5 | 0 | 2008-10-05T07:34:50.797000 | 2008-10-05T14:06:17.400000 |
171,641 | 171,644 | Should there be a difference between an empty BSTR and a NULL BSTR? | When maintaining a COM interface should an empty BSTR be treated the same way as NULL? In other words should these two function calls produce the same result? // Empty BSTR CComBSTR empty(L""); // Or SysAllocString(L"") someObj->Foo(empty);
// NULL BSTR someObj->Foo(NULL); | Yes - a NULL BSTR is the same as an empty one. I remember we had all sorts of bugs that were uncovered when we switched from VS6 to 2003 - the CComBSTR class had a change to the default constructor that allocated it using NULL rather than an empty string. This happens when you for example treat a BSTR as a regular C st... | Should there be a difference between an empty BSTR and a NULL BSTR? When maintaining a COM interface should an empty BSTR be treated the same way as NULL? In other words should these two function calls produce the same result? // Empty BSTR CComBSTR empty(L""); // Or SysAllocString(L"") someObj->Foo(empty);
// NULL BS... | TITLE:
Should there be a difference between an empty BSTR and a NULL BSTR?
QUESTION:
When maintaining a COM interface should an empty BSTR be treated the same way as NULL? In other words should these two function calls produce the same result? // Empty BSTR CComBSTR empty(L""); // Or SysAllocString(L"") someObj->Foo(e... | [
"com",
"string",
"bstr"
] | 10 | 14 | 9,797 | 2 | 0 | 2008-10-05T07:45:02.257000 | 2008-10-05T07:50:55.710000 |
171,664 | 171,668 | How to turn these 3 methods into one using C# generics? | I have not used generics much and so cannot figure out if it is possible to turn the following three methods into one using generics to reduce duplication. Actually my code currently has six methods but if you can solve it for the three then the rest should just work anyway with the same solution. private object Evalua... | Generics doesn't natively support arithmetic. However, it can be done with.NET 3.5, like so. The Operator class is part of MiscUtil. This then becomes: public T Evaluate (T x, T y) { switch (Operation) { case BinaryOp.Add: return Operator.Add(x, y); case BinaryOp.Subtract: return Operator.Subtract(x, y);... etc Since y... | How to turn these 3 methods into one using C# generics? I have not used generics much and so cannot figure out if it is possible to turn the following three methods into one using generics to reduce duplication. Actually my code currently has six methods but if you can solve it for the three then the rest should just w... | TITLE:
How to turn these 3 methods into one using C# generics?
QUESTION:
I have not used generics much and so cannot figure out if it is possible to turn the following three methods into one using generics to reduce duplication. Actually my code currently has six methods but if you can solve it for the three then the ... | [
"c#",
"generics"
] | 6 | 9 | 1,273 | 2 | 0 | 2008-10-05T08:10:08.867000 | 2008-10-05T08:14:59.827000 |
171,673 | 171,704 | How to create a Windows Media Player plugin in Visual Studio 2008 | I've been trying to create a Windows Media Player plugin in Visual Studio 2008, and am having great difficulty finding the correct template. MSDN provides advice here, but it does not appear to be relevant to VS2008. Can anyone suggest how to start a WMP plugin in Visual Studio? EDIT: Ive accepted this answer because i... | download the platfrom SDK, it has a bunch of example examples. But none of them are likely to be updated for VS2008, but that doesn't matter too much, its easy to convert the projects. | How to create a Windows Media Player plugin in Visual Studio 2008 I've been trying to create a Windows Media Player plugin in Visual Studio 2008, and am having great difficulty finding the correct template. MSDN provides advice here, but it does not appear to be relevant to VS2008. Can anyone suggest how to start a WMP... | TITLE:
How to create a Windows Media Player plugin in Visual Studio 2008
QUESTION:
I've been trying to create a Windows Media Player plugin in Visual Studio 2008, and am having great difficulty finding the correct template. MSDN provides advice here, but it does not appear to be relevant to VS2008. Can anyone suggest ... | [
"visual-studio-2008",
"windows-media-player"
] | 2 | 1 | 7,881 | 2 | 0 | 2008-10-05T08:16:22.130000 | 2008-10-05T08:38:58.280000 |
171,676 | 171,682 | Linking against a specific shared library version in linux | My build process consists of Qt's qmake Makefile generator and the typical make utility bundled with linux. My application consists of a few shared libraries and the main application is linked against them. How can I apply the typical linux versioning scheme on my libraries? (Use version 2 -> link against foo.so.2 that... | Your library should be named libfoo.so.2.y.z, with symlinks of libfoo.so.2 and libfoo.so both pointing to that. The library should be created using -soname libfoo.so.2 in the linker command line (or -Wl,-soname,libfoo.so.2 on the gcc command line). Hope that helps! | Linking against a specific shared library version in linux My build process consists of Qt's qmake Makefile generator and the typical make utility bundled with linux. My application consists of a few shared libraries and the main application is linked against them. How can I apply the typical linux versioning scheme on... | TITLE:
Linking against a specific shared library version in linux
QUESTION:
My build process consists of Qt's qmake Makefile generator and the typical make utility bundled with linux. My application consists of a few shared libraries and the main application is linked against them. How can I apply the typical linux ve... | [
"linux",
"build-process",
"linker"
] | 4 | 8 | 3,848 | 1 | 0 | 2008-10-05T08:16:53.720000 | 2008-10-05T08:20:43.793000 |
171,694 | 184,571 | Applying a common font scheme to multiple objects in wxPython | Many times I will use the same font scheme for static text in a wxPython application. Currently I am making a SetFont() call for each static text object but that seems like a lot of unnecessary work. However, the wxPython demo and wxPython In Action book don't discuss this. Is there a way to easily apply the same SetFo... | You can do this by calling SetFont on the parent window (Frame, Dialog, etc) before adding any widgets. The child widgets will inherit the font. | Applying a common font scheme to multiple objects in wxPython Many times I will use the same font scheme for static text in a wxPython application. Currently I am making a SetFont() call for each static text object but that seems like a lot of unnecessary work. However, the wxPython demo and wxPython In Action book don... | TITLE:
Applying a common font scheme to multiple objects in wxPython
QUESTION:
Many times I will use the same font scheme for static text in a wxPython application. Currently I am making a SetFont() call for each static text object but that seems like a lot of unnecessary work. However, the wxPython demo and wxPython ... | [
"python",
"fonts",
"wxpython"
] | 3 | 5 | 1,636 | 4 | 0 | 2008-10-05T08:27:57.193000 | 2008-10-08T19:55:40.720000 |
171,699 | 171,712 | NHibernate session management in Windows Service applications | I'm developing and application that runs as a Windows service. There are other components which include a few WCF services, a client GUI and so on - but it is the Windows service that access the database. So, the application is a long-running server, and I'd like to improve its performance and scalability, I was lookin... | There seems to be a great lack of documentation / discussion for non-web app designs. This has also been my experience. However, the model you are following seems correct to me. You should always open a session, commit changes, then close it again. | NHibernate session management in Windows Service applications I'm developing and application that runs as a Windows service. There are other components which include a few WCF services, a client GUI and so on - but it is the Windows service that access the database. So, the application is a long-running server, and I'd... | TITLE:
NHibernate session management in Windows Service applications
QUESTION:
I'm developing and application that runs as a Windows service. There are other components which include a few WCF services, a client GUI and so on - but it is the Windows service that access the database. So, the application is a long-runni... | [
"nhibernate"
] | 12 | 7 | 6,228 | 5 | 0 | 2008-10-05T08:33:02.580000 | 2008-10-05T08:45:23.773000 |
171,708 | 171,754 | LaTeX Beamer package, change frame title in \againframe | Is it possible to change the frame title when using \againframe from the Beamer package, in LaTeX? I would like to have a previous frame displayed, at a specific slide inside the frame, but with a different title this time. Thanks. | Try doing the following: \begin{frame}[label=my_frame] \frametitle<1>{Title to be displayed the first time} \frametitle<2>{Title to be displayed the second time} %Other frame contents \end{frame}
\againframe<2>{my_frame} This is known as using "overlay specifications." Refer to section 3.10 of the Beamer User Guide (v... | LaTeX Beamer package, change frame title in \againframe Is it possible to change the frame title when using \againframe from the Beamer package, in LaTeX? I would like to have a previous frame displayed, at a specific slide inside the frame, but with a different title this time. Thanks. | TITLE:
LaTeX Beamer package, change frame title in \againframe
QUESTION:
Is it possible to change the frame title when using \againframe from the Beamer package, in LaTeX? I would like to have a previous frame displayed, at a specific slide inside the frame, but with a different title this time. Thanks.
ANSWER:
Try d... | [
"latex",
"beamer"
] | 16 | 25 | 11,411 | 1 | 0 | 2008-10-05T08:41:54.827000 | 2008-10-05T09:31:34.133000 |
171,717 | 171,728 | Using Java-classes with C# | I have a project written in Java (>1.5). Is it possible to write parts of the project with C#? For instance the GUI and calling the methods and instantiate the classes written in java? If yes, how? | There is something called Java Language Conversion Assistant for.NET. You can convert your Java classes to c# and start coding. There is also something called JNBridge (not free). | Using Java-classes with C# I have a project written in Java (>1.5). Is it possible to write parts of the project with C#? For instance the GUI and calling the methods and instantiate the classes written in java? If yes, how? | TITLE:
Using Java-classes with C#
QUESTION:
I have a project written in Java (>1.5). Is it possible to write parts of the project with C#? For instance the GUI and calling the methods and instantiate the classes written in java? If yes, how?
ANSWER:
There is something called Java Language Conversion Assistant for.NET... | [
"c#",
"java"
] | 4 | 6 | 27,272 | 6 | 0 | 2008-10-05T08:52:15.117000 | 2008-10-05T09:02:24.067000 |
171,727 | 1,734,570 | Delete all tables in Derby DB | How do i delete all the tables in the schema on Apache Derby DB using JDBC? | For actual code that does this, check CleanDatabaseTestSetup.java in the Derby test suite section of the Derby distribution. | Delete all tables in Derby DB How do i delete all the tables in the schema on Apache Derby DB using JDBC? | TITLE:
Delete all tables in Derby DB
QUESTION:
How do i delete all the tables in the schema on Apache Derby DB using JDBC?
ANSWER:
For actual code that does this, check CleanDatabaseTestSetup.java in the Derby test suite section of the Derby distribution. | [
"java",
"sql",
"jdbc",
"derby"
] | 14 | 5 | 32,615 | 11 | 0 | 2008-10-05T09:01:52.197000 | 2009-11-14T15:32:05.087000 |
171,730 | 171,795 | Interface "recursion" and reference counting | I have a small problem with interfaces. Here it is in Pseudo code: type Interface1 = interface end;
Interface2 = interface end;
TParentClass = class(TInterfacedObject, Interface1) private fChild: Interface2; public procedure AddChild(aChild: Interface2); end;
TChildClass = class(TInterfacedObject, Interface2) privat... | A reference-counted reference has two semantics: it acts as a share of ownership as well as a means of navigating the object graph. Typically, you don't need both of these semantics on all links in a cycle in the graph of references. Perhaps only parents own children, and not the other way around? If that is the case, ... | Interface "recursion" and reference counting I have a small problem with interfaces. Here it is in Pseudo code: type Interface1 = interface end;
Interface2 = interface end;
TParentClass = class(TInterfacedObject, Interface1) private fChild: Interface2; public procedure AddChild(aChild: Interface2); end;
TChildClass ... | TITLE:
Interface "recursion" and reference counting
QUESTION:
I have a small problem with interfaces. Here it is in Pseudo code: type Interface1 = interface end;
Interface2 = interface end;
TParentClass = class(TInterfacedObject, Interface1) private fChild: Interface2; public procedure AddChild(aChild: Interface2); ... | [
"delphi",
"oop",
"interface"
] | 4 | 10 | 928 | 4 | 0 | 2008-10-05T09:04:20.413000 | 2008-10-05T10:23:13.793000 |
171,765 | 171,784 | What is the best way to get all the divisors of a number? | Here's the very dumb way: def divisorGenerator(n): for i in xrange(1,n/2+1): if n%i == 0: yield i yield n The result I'd like to get is similar to this one, but I'd like a smarter algorithm (this one it's too much slow and dumb:-) I can find prime factors and their multiplicity fast enough. I've an generator that gener... | Given your factorGenerator function, here is a divisorGen that should work: def divisorGen(n): factors = list(factorGenerator(n)) nfactors = len(factors) f = [0] * nfactors while True: yield reduce(lambda x, y: x*y, [factors[x][0]**f[x] for x in range(nfactors)], 1) i = 0 while True: f[i] += 1 if f[i] <= factors[i][1]:... | What is the best way to get all the divisors of a number? Here's the very dumb way: def divisorGenerator(n): for i in xrange(1,n/2+1): if n%i == 0: yield i yield n The result I'd like to get is similar to this one, but I'd like a smarter algorithm (this one it's too much slow and dumb:-) I can find prime factors and th... | TITLE:
What is the best way to get all the divisors of a number?
QUESTION:
Here's the very dumb way: def divisorGenerator(n): for i in xrange(1,n/2+1): if n%i == 0: yield i yield n The result I'd like to get is similar to this one, but I'd like a smarter algorithm (this one it's too much slow and dumb:-) I can find pr... | [
"python",
"algorithm",
"math"
] | 137 | 83 | 231,087 | 18 | 0 | 2008-10-05T09:48:58.480000 | 2008-10-05T10:09:20.127000 |
171,771 | 173,273 | How can I force a complete load along a navigation relationship in Entity Framework? | Okay, so I'm doing my first foray into using the ADO.NET Entity Framework. My test case right now includes a SQL Server 2008 database with 2 tables, Member and Profile, with a 1:1 relationship. I then used the Entity Data Model wizard to auto-generate the EDM from the database. It generated a model with the correct ass... | Okay I managed to find the answer I needed here http://msdn.microsoft.com/en-us/magazine/cc507640.aspx. The following query will make sure that the Profile entity is loaded: IQueryable membersQuery = from m in members.Include("Profile") select m; | How can I force a complete load along a navigation relationship in Entity Framework? Okay, so I'm doing my first foray into using the ADO.NET Entity Framework. My test case right now includes a SQL Server 2008 database with 2 tables, Member and Profile, with a 1:1 relationship. I then used the Entity Data Model wizard ... | TITLE:
How can I force a complete load along a navigation relationship in Entity Framework?
QUESTION:
Okay, so I'm doing my first foray into using the ADO.NET Entity Framework. My test case right now includes a SQL Server 2008 database with 2 tables, Member and Profile, with a 1:1 relationship. I then used the Entity ... | [
"linq",
"entity-framework",
"ado.net"
] | 2 | 6 | 3,481 | 3 | 0 | 2008-10-05T09:55:37.203000 | 2008-10-06T05:36:45.993000 |
171,776 | 171,803 | Where is the benefit in using the Strategy Pattern? | I've looked at this explanation on Wikipedia, specifically the C++ sample, and fail to recognize the difference between just defining 3 classes, creating instances and calling them, and that example. What I saw was just placing two other classes into the process and cannot see where there would be a benefit. Now I'm su... | The point is to separate algorithms into classes that can be plugged in at runtime. For instance, let's say you have an application that includes a clock. There are many different ways that you can draw a clock, but for the most part the underlying functionality is the same. So you can create a clock display interface:... | Where is the benefit in using the Strategy Pattern? I've looked at this explanation on Wikipedia, specifically the C++ sample, and fail to recognize the difference between just defining 3 classes, creating instances and calling them, and that example. What I saw was just placing two other classes into the process and c... | TITLE:
Where is the benefit in using the Strategy Pattern?
QUESTION:
I've looked at this explanation on Wikipedia, specifically the C++ sample, and fail to recognize the difference between just defining 3 classes, creating instances and calling them, and that example. What I saw was just placing two other classes into... | [
"design-patterns",
"strategy-pattern"
] | 12 | 21 | 10,962 | 8 | 0 | 2008-10-05T10:00:00.097000 | 2008-10-05T10:37:32.143000 |
171,778 | 171,786 | nhibernate - sort null at end | Using NHibernate from C# and only HQL (not SQL) in a way that is compatible with MS SQL Server 2005/2008 (and preferably Oracle). Is there a way to write the order by clause so that nulls will sort at the end of the query results while the non-null results will be sorted in ascending order? Based on the answer to the q... | I don't know if this helps or not, but there's another question asking the same thing about how to do this with MySQL. Perhaps the same logic could be applied to HQL? edit: this got accepted, so apparently, yes it can. Here's the accepted answer from that question (by Bill Karwin ): SELECT * FROM myTable WHERE... ORDER... | nhibernate - sort null at end Using NHibernate from C# and only HQL (not SQL) in a way that is compatible with MS SQL Server 2005/2008 (and preferably Oracle). Is there a way to write the order by clause so that nulls will sort at the end of the query results while the non-null results will be sorted in ascending order... | TITLE:
nhibernate - sort null at end
QUESTION:
Using NHibernate from C# and only HQL (not SQL) in a way that is compatible with MS SQL Server 2005/2008 (and preferably Oracle). Is there a way to write the order by clause so that nulls will sort at the end of the query results while the non-null results will be sorted ... | [
"nhibernate"
] | 1 | 0 | 1,469 | 2 | 0 | 2008-10-05T10:02:02.480000 | 2008-10-05T10:13:46.840000 |
171,785 | 173,715 | How do you organize Python modules? | When it comes to organizing python modules, my Mac OS X system is a mess. I've packages lying around everywhere on my hdd and no particular system to organize them. How do you keep everything manageable? | My advice: Read Installing Python Modules. Read Distributing Python Modules. Start using easy_install from setuptools. Read the documentation for setuptools. Always use virtualenv. My site-packages directory contains setuptools and virtualenv only. Check out Ian Bicking's new project pyinstall. Follow everything Ian Bi... | How do you organize Python modules? When it comes to organizing python modules, my Mac OS X system is a mess. I've packages lying around everywhere on my hdd and no particular system to organize them. How do you keep everything manageable? | TITLE:
How do you organize Python modules?
QUESTION:
When it comes to organizing python modules, my Mac OS X system is a mess. I've packages lying around everywhere on my hdd and no particular system to organize them. How do you keep everything manageable?
ANSWER:
My advice: Read Installing Python Modules. Read Distr... | [
"python",
"module"
] | 14 | 13 | 7,127 | 8 | 0 | 2008-10-05T10:09:28.113000 | 2008-10-06T09:48:54.330000 |
171,805 | 172,332 | TSVN DNS error: The requested name is valid, but no data of the requested type was found | I've updated my TortoiseSVN client and now I'm getting the error when trying to update or commit to different repositories: The requested name is valid, but no data of the requested type was found Any ideas on how I can solve this? Internet Explorer shows up appropriate URL just fine. TortoiseSVN 1.5.3, Build 13783. | Guys, thanks for your answers. Everything was fixed by yet another reboot (2 reboots after TSVN update). Still I can't explain what happened.:) | TSVN DNS error: The requested name is valid, but no data of the requested type was found I've updated my TortoiseSVN client and now I'm getting the error when trying to update or commit to different repositories: The requested name is valid, but no data of the requested type was found Any ideas on how I can solve this?... | TITLE:
TSVN DNS error: The requested name is valid, but no data of the requested type was found
QUESTION:
I've updated my TortoiseSVN client and now I'm getting the error when trying to update or commit to different repositories: The requested name is valid, but no data of the requested type was found Any ideas on how... | [
"svn",
"dns",
"tortoisesvn"
] | 4 | 2 | 28,532 | 8 | 0 | 2008-10-05T10:38:24.590000 | 2008-10-05T17:34:00.400000 |
171,816 | 172,001 | VC9 and VC8 lib compatibility | (The original question was asked there: http://www.ogre3d.org/phpBB2/viewtopic.php?t=44832 ) Someone asked: "While I would like to build everything in vs2008 (VC9), the PhysX SDK is built with vs2005 (VC8). Would this cause any problems, using all vc9 compiled libs and used in combination with this vc8 lib?" I answered... | The lib format is COFF ( http://msdn.microsoft.com/en-us/library/7ykb2k5f(VS.71).aspx ), also COFF is used in the PE format. Thus I would expect that most if not all libraries built with vc8 to be linkable with vc9. However I found a thread on msdn where MS seems not to guarantee that the libs compiled with VC8 will li... | VC9 and VC8 lib compatibility (The original question was asked there: http://www.ogre3d.org/phpBB2/viewtopic.php?t=44832 ) Someone asked: "While I would like to build everything in vs2008 (VC9), the PhysX SDK is built with vs2005 (VC8). Would this cause any problems, using all vc9 compiled libs and used in combination ... | TITLE:
VC9 and VC8 lib compatibility
QUESTION:
(The original question was asked there: http://www.ogre3d.org/phpBB2/viewtopic.php?t=44832 ) Someone asked: "While I would like to build everything in vs2008 (VC9), the PhysX SDK is built with vs2005 (VC8). Would this cause any problems, using all vc9 compiled libs and us... | [
"c++",
"dll",
"visual-c++-2008",
"vc8"
] | 3 | 3 | 5,992 | 2 | 0 | 2008-10-05T10:55:32.263000 | 2008-10-05T13:43:09.210000 |
171,824 | 172,082 | Programmatically showing a View from an Eclipse Plug-in | I have a plug-in to an Eclipse RCP application that has a view. After an event occurs in the RCP application, the plug-in is instantiated, its methods are called to populate the plug-in's model, but I cannot find how to make the view appear without going to the "Show View..." menu. I would think that there would be som... | You are probably looking for this: PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("viewId"); | Programmatically showing a View from an Eclipse Plug-in I have a plug-in to an Eclipse RCP application that has a view. After an event occurs in the RCP application, the plug-in is instantiated, its methods are called to populate the plug-in's model, but I cannot find how to make the view appear without going to the "S... | TITLE:
Programmatically showing a View from an Eclipse Plug-in
QUESTION:
I have a plug-in to an Eclipse RCP application that has a view. After an event occurs in the RCP application, the plug-in is instantiated, its methods are called to populate the plug-in's model, but I cannot find how to make the view appear witho... | [
"eclipse",
"eclipse-plugin",
"eclipse-rcp",
"rcp",
"eclipse-pde"
] | 33 | 48 | 24,975 | 4 | 0 | 2008-10-05T11:00:10.617000 | 2008-10-05T14:44:33.003000 |
171,828 | 171,927 | How best to store Subversion version information in EAR's? | When receiving a bug report or an it-doesnt-work message one of my initials questions is always what version? With a different builds being at many stages of testing, planning and deploying this is often a non-trivial question. I the case of releasing Java JAR (ear, jar, rar, war) files I would like to be able to look ... | Use the svnversion command in your Ant script to get the revision number: Then use the ${svnversion} property somewhere in your EAR. We put it in the EAR file name, but you could also put it in a readme or version file inside the EAR, or specify the version in the EAR's META-INF/manifest.mf: | How best to store Subversion version information in EAR's? When receiving a bug report or an it-doesnt-work message one of my initials questions is always what version? With a different builds being at many stages of testing, planning and deploying this is often a non-trivial question. I the case of releasing Java JAR ... | TITLE:
How best to store Subversion version information in EAR's?
QUESTION:
When receiving a bug report or an it-doesnt-work message one of my initials questions is always what version? With a different builds being at many stages of testing, planning and deploying this is often a non-trivial question. I the case of r... | [
"java",
"svn",
"ant",
"release"
] | 8 | 5 | 6,152 | 9 | 0 | 2008-10-05T11:11:00.983000 | 2008-10-05T12:52:18.377000 |
171,830 | 171,844 | Double buffer child controls in custom control (C#) | I want to double buffer a custom control which contains buttons. I have tried various ways to double buffer the control; SetStyle, BufferedGraphicsContext, and drawing to a bitmap. These all work fine for the custom drawing of the control, but none of them handle drawing the button to a back buffer. How do I achieve th... | Technically you can't, and you really shouldn't need to if they're standard.NET WinForms buttons. The buttons themselves control that through the protected DoubleBuffered property. The only way to access this would be to derive a new class from S.W.F.Button, and implement code to enable the DoubleBuffered property on i... | Double buffer child controls in custom control (C#) I want to double buffer a custom control which contains buttons. I have tried various ways to double buffer the control; SetStyle, BufferedGraphicsContext, and drawing to a bitmap. These all work fine for the custom drawing of the control, but none of them handle draw... | TITLE:
Double buffer child controls in custom control (C#)
QUESTION:
I want to double buffer a custom control which contains buttons. I have tried various ways to double buffer the control; SetStyle, BufferedGraphicsContext, and drawing to a bitmap. These all work fine for the custom drawing of the control, but none o... | [
"c#",
"winforms",
"drawing",
"doublebuffered"
] | 5 | 2 | 3,094 | 1 | 0 | 2008-10-05T11:13:48.483000 | 2008-10-05T11:37:46.657000 |
171,835 | 171,856 | Which Python book would you recommend for a Linux Sysadmin? | Python for Unix and Linux System Administration is aimed at sysadmins. Any other favorites besides this. | Mark Pilgrim's http://www.diveintopython.net/ is very good and clear. | Which Python book would you recommend for a Linux Sysadmin? Python for Unix and Linux System Administration is aimed at sysadmins. Any other favorites besides this. | TITLE:
Which Python book would you recommend for a Linux Sysadmin?
QUESTION:
Python for Unix and Linux System Administration is aimed at sysadmins. Any other favorites besides this.
ANSWER:
Mark Pilgrim's http://www.diveintopython.net/ is very good and clear. | [
"python",
"linux",
"system-administration"
] | 1 | 3 | 7,909 | 8 | 0 | 2008-10-05T11:28:15.427000 | 2008-10-05T11:54:40.397000 |
171,840 | 171,847 | Problem using the ASP.NET FileUpload control in an UpdatePanel? | I'm running into an issue where I have a FileUpload control in an UpdatePanel. When I attempt to save changes and upload the file, no file is found. If I remove the UpdatePanel everything seems to work fine. Any ideas why this might be happening? And is there a work-around? | To upload a file you need to perform a full ASP.NET page postback, it does not operate over the partial postback method. You'll need to register the button which "uploads" your file as a PostBackTrigger of the UpdatePanel's triggers. There are lots of free (and non-free) AJAX file upload solutions, or you can easily cr... | Problem using the ASP.NET FileUpload control in an UpdatePanel? I'm running into an issue where I have a FileUpload control in an UpdatePanel. When I attempt to save changes and upload the file, no file is found. If I remove the UpdatePanel everything seems to work fine. Any ideas why this might be happening? And is th... | TITLE:
Problem using the ASP.NET FileUpload control in an UpdatePanel?
QUESTION:
I'm running into an issue where I have a FileUpload control in an UpdatePanel. When I attempt to save changes and upload the file, no file is found. If I remove the UpdatePanel everything seems to work fine. Any ideas why this might be ha... | [
"asp.net",
"ajax",
"file"
] | 5 | 10 | 2,792 | 1 | 0 | 2008-10-05T11:33:34.603000 | 2008-10-05T11:46:21.147000 |
171,849 | 172,057 | Excel 2003 XML format - AutoFitWidth not working | I have a program that spits out an Excel workbook in Excel 2003 XML format. It works fine with one problem, I cannot get the column widths to set automatically. A snippet of what I produce: Database This does not set the column to autofit. I have tried not setting width, I have tried many things and I am stuck. Thanks. | Only date and number values are autofitted:-( quote: "... We do not autofit textual values" http://msdn.microsoft.com/en-us/library/aa140066.aspx#odc_xmlss_ss:column | Excel 2003 XML format - AutoFitWidth not working I have a program that spits out an Excel workbook in Excel 2003 XML format. It works fine with one problem, I cannot get the column widths to set automatically. A snippet of what I produce: Database This does not set the column to autofit. I have tried not setting width,... | TITLE:
Excel 2003 XML format - AutoFitWidth not working
QUESTION:
I have a program that spits out an Excel workbook in Excel 2003 XML format. It works fine with one problem, I cannot get the column widths to set automatically. A snippet of what I produce: Database This does not set the column to autofit. I have tried ... | [
"xml",
"excel",
"openxml"
] | 12 | 28 | 30,648 | 4 | 0 | 2008-10-05T11:49:10.203000 | 2008-10-05T14:22:21.533000 |
171,855 | 194,691 | Detecting appearance/disappearance of volumes on osx | I want to update a list of storage devices as the user inserts USB keys, adds external disks and mounts disk images. IOKit's IOServiceAddInterestNotification looks like the way to go, but the obvious use of registering general interest in kIOMediaClass only gives you notifications for unmounting of volumes and then onl... | The following calls in DiskArbitration.h do exactly what I want: DARegisterDiskAppearedCallback DARegisterDiskDisappearedCallback DARegisterDiskDescriptionChangedCallback These cover insertion, removal (even of unmountable volumes) metadata change events. P.S. Don't forget to add your DASession to a runloop or you won'... | Detecting appearance/disappearance of volumes on osx I want to update a list of storage devices as the user inserts USB keys, adds external disks and mounts disk images. IOKit's IOServiceAddInterestNotification looks like the way to go, but the obvious use of registering general interest in kIOMediaClass only gives you... | TITLE:
Detecting appearance/disappearance of volumes on osx
QUESTION:
I want to update a list of storage devices as the user inserts USB keys, adds external disks and mounts disk images. IOKit's IOServiceAddInterestNotification looks like the way to go, but the obvious use of registering general interest in kIOMediaCl... | [
"macos",
"volume",
"device",
"iokit",
"diskarbitration"
] | 1 | 3 | 1,412 | 4 | 0 | 2008-10-05T11:53:12.583000 | 2008-10-11T21:35:33.343000 |
171,862 | 171,869 | Namespaces and Operator Overloading in C++ | When authoring a library in a particular namespace, it's often convenient to provide overloaded operators for the classes in that namespace. It seems (at least with g++) that the overloaded operators can be implemented either in the library's namespace: namespace Lib { class A { };
A operator+(const A&, const A&); } /... | You should define them in the library namespace. The compiler will find them anyway through argument dependant lookup. No need to pollute the global namespace. | Namespaces and Operator Overloading in C++ When authoring a library in a particular namespace, it's often convenient to provide overloaded operators for the classes in that namespace. It seems (at least with g++) that the overloaded operators can be implemented either in the library's namespace: namespace Lib { class A... | TITLE:
Namespaces and Operator Overloading in C++
QUESTION:
When authoring a library in a particular namespace, it's often convenient to provide overloaded operators for the classes in that namespace. It seems (at least with g++) that the overloaded operators can be implemented either in the library's namespace: names... | [
"c++",
"operator-overloading",
"namespaces"
] | 42 | 41 | 24,271 | 3 | 0 | 2008-10-05T11:58:04.850000 | 2008-10-05T12:03:24.857000 |
171,868 | 171,870 | How to find and tail the Oracle alert log | When you take your first look at an Oracle database, one of the first questions is often "where's the alert log?". Grid Control can tell you, but its often not available in the environment. I posted some bash and Perl scripts to find and tail the alert log on my blog some time back, and I'm surprised to see that post s... | Am sure it will work in 11g, that parameter has been around for a long time. Seems like the correct way to find it to me. If the background_dump_dest parameter isn't set, the alert.log will be put in $ORACLE_HOME/RDBMS/trace | How to find and tail the Oracle alert log When you take your first look at an Oracle database, one of the first questions is often "where's the alert log?". Grid Control can tell you, but its often not available in the environment. I posted some bash and Perl scripts to find and tail the alert log on my blog some time ... | TITLE:
How to find and tail the Oracle alert log
QUESTION:
When you take your first look at an Oracle database, one of the first questions is often "where's the alert log?". Grid Control can tell you, but its often not available in the environment. I posted some bash and Perl scripts to find and tail the alert log on ... | [
"database",
"perl",
"oracle",
"bash"
] | 7 | 8 | 43,828 | 2 | 0 | 2008-10-05T12:03:08.197000 | 2008-10-05T12:04:18.473000 |
171,873 | 249,153 | KSH scripting: how to split on ',' when values have escaped commas? | I try to write KSH script for processing a file consisting of name-value pairs, several of them on each line. Format is: NAME1 VALUE1,NAME2 VALUE2,NAME3 VALUE3, etc Suppose I write: read l IFS="," set -A nvls $l echo "$nvls[2]" This will give me second name-value pair, nice and easy. Now, suppose that the task is exten... | You can also change the \, pattern to something else that is known not to appear in any of your strings, and then change it back after you've split the input into an array. You can use the ksh builtin pattern-substitution syntax to do this, you don't need to use sed or awk or anything. read l l=${l//\\,/!!} IFS="," set... | KSH scripting: how to split on ',' when values have escaped commas? I try to write KSH script for processing a file consisting of name-value pairs, several of them on each line. Format is: NAME1 VALUE1,NAME2 VALUE2,NAME3 VALUE3, etc Suppose I write: read l IFS="," set -A nvls $l echo "$nvls[2]" This will give me second... | TITLE:
KSH scripting: how to split on ',' when values have escaped commas?
QUESTION:
I try to write KSH script for processing a file consisting of name-value pairs, several of them on each line. Format is: NAME1 VALUE1,NAME2 VALUE2,NAME3 VALUE3, etc Suppose I write: read l IFS="," set -A nvls $l echo "$nvls[2]" This w... | [
"arrays",
"shell",
"ksh",
"quoting"
] | 2 | 0 | 10,684 | 2 | 0 | 2008-10-05T12:07:03.477000 | 2008-10-30T02:54:06.837000 |
171,876 | 544,634 | How do two-phase commits prevent last-second failure? | I am studying how two-phase commit works across a distributed transaction. It is my understanding that in the last part of the phase the transaction coordinator asks each node whether it is ready to commit. If everyone agreed, then it tells them to go ahead and commit. What prevents the following failure? All nodes res... | Summarizing everyone's answers: One cannot use normal databases with distributed transactions. The database must explicitly support a transaction coordinator. The nodes are not instructed to roll back because some of the nodes have already committed. What happens is that when the crashed node comes back, the transactio... | How do two-phase commits prevent last-second failure? I am studying how two-phase commit works across a distributed transaction. It is my understanding that in the last part of the phase the transaction coordinator asks each node whether it is ready to commit. If everyone agreed, then it tells them to go ahead and comm... | TITLE:
How do two-phase commits prevent last-second failure?
QUESTION:
I am studying how two-phase commit works across a distributed transaction. It is my understanding that in the last part of the phase the transaction coordinator asks each node whether it is ready to commit. If everyone agreed, then it tells them to... | [
"database",
"distributed-transactions"
] | 99 | 33 | 12,461 | 5 | 0 | 2008-10-05T12:12:06.710000 | 2009-02-13T03:49:45.453000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.