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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
134,694 | 134,732 | Linq To SQL caching VS multi-user application | We develop Win32 application that access to SQL 2005 database through Linq to SQL. The issue is when 2 users access to same record (View and Edit)… User 1 update record (DataContext.SubmitChanges()), User 2 will continue to see old information until he restart application. So, we would like to update context of user 2…... | I've noticed that Refresh can be really nasty depending on the data you've already grabbed from an entity, another solution is to reset the context you are using to a new instance. context = new MyDataContext(ConnectionString); This, at least in the scenarios where I am using it is less overhead and less DB calls. | Linq To SQL caching VS multi-user application We develop Win32 application that access to SQL 2005 database through Linq to SQL. The issue is when 2 users access to same record (View and Edit)… User 1 update record (DataContext.SubmitChanges()), User 2 will continue to see old information until he restart application. ... | TITLE:
Linq To SQL caching VS multi-user application
QUESTION:
We develop Win32 application that access to SQL 2005 database through Linq to SQL. The issue is when 2 users access to same record (View and Edit)… User 1 update record (DataContext.SubmitChanges()), User 2 will continue to see old information until he res... | [
"linq"
] | 1 | 4 | 1,045 | 1 | 0 | 2008-09-25T17:25:19.220000 | 2008-09-25T17:33:15.223000 |
134,698 | 134,766 | Catching exceptions as expected program execution flow control? | I always felt that expecting exceptions to be thrown on a regular basis and using them as flow logic was a bad thing. Exceptions feel like they should be, well, the " exception ". If you're expecting and planning for an exception, that would seem to indicate that your code should be refactored, at least in.NET... Howev... | Wow, First off, can you please distill the question down a bit, while it was nice to read a well thought out and explained question, that was quite a lot to digest. The short answer is "yes", but it can depend. We have some applications where we have lots of business logic tied up in the SQL queries (not my design Gov!... | Catching exceptions as expected program execution flow control? I always felt that expecting exceptions to be thrown on a regular basis and using them as flow logic was a bad thing. Exceptions feel like they should be, well, the " exception ". If you're expecting and planning for an exception, that would seem to indica... | TITLE:
Catching exceptions as expected program execution flow control?
QUESTION:
I always felt that expecting exceptions to be thrown on a regular basis and using them as flow logic was a bad thing. Exceptions feel like they should be, well, the " exception ". If you're expecting and planning for an exception, that wo... | [
".net",
"sql",
"sql-server",
"exception"
] | 12 | 4 | 1,506 | 8 | 0 | 2008-09-25T17:25:52.730000 | 2008-09-25T17:37:53.107000 |
134,712 | 135,115 | How can I sort a 2-D array in MATLAB with respect to one column? | I would like to sort a matrix according to a particular column. There is a sort function, but it sorts all columns independently. For example, if my matrix data is: 1 3 5 7 -1 4 Then the desired output (sorting by the first column) would be: -1 4 1 3 5 7 But the output of sort(data) is: -1 3 1 4 5 7 How can I sort this... | I think the sortrows function is what you're looking for. >> sortrows(data,1)
ans =
-1 4 1 3 5 7 | How can I sort a 2-D array in MATLAB with respect to one column? I would like to sort a matrix according to a particular column. There is a sort function, but it sorts all columns independently. For example, if my matrix data is: 1 3 5 7 -1 4 Then the desired output (sorting by the first column) would be: -1 4 1 3 5 7 ... | TITLE:
How can I sort a 2-D array in MATLAB with respect to one column?
QUESTION:
I would like to sort a matrix according to a particular column. There is a sort function, but it sorts all columns independently. For example, if my matrix data is: 1 3 5 7 -1 4 Then the desired output (sorting by the first column) would... | [
"matlab",
"sorting",
"matrix",
"octave"
] | 45 | 76 | 65,959 | 2 | 0 | 2008-09-25T17:30:02.143000 | 2008-09-25T18:34:42.987000 |
134,727 | 577,778 | What's the key difference between HTML 4 and HTML 5? | What are the key differences between HTML4 and HTML5 draft? Please keep the answers related to changed syntax and added/removed html elements. | HTML5 has several goals which differentiate it from HTML4. Consistency in Handling Malformed Documents The primary one is consistent, defined error handling. As you know, HTML purposely supports 'tag soup', or the ability to write malformed code and have it corrected into a valid document. The problem is that the rules... | What's the key difference between HTML 4 and HTML 5? What are the key differences between HTML4 and HTML5 draft? Please keep the answers related to changed syntax and added/removed html elements. | TITLE:
What's the key difference between HTML 4 and HTML 5?
QUESTION:
What are the key differences between HTML4 and HTML5 draft? Please keep the answers related to changed syntax and added/removed html elements.
ANSWER:
HTML5 has several goals which differentiate it from HTML4. Consistency in Handling Malformed Docu... | [
"html",
"html4"
] | 150 | 206 | 307,158 | 8 | 0 | 2008-09-25T17:32:19.953000 | 2009-02-23T14:22:08.227000 |
134,728 | 157,052 | Generic Object in VB.NET | I have a class declared as follows: Public MustInherit Container(Of T As {New, BaseClass}) Inherits ArrayList(Of T) I have classes that inherit this class. I have another class that I must pass instances in this method: Public Sub LoadCollection(Of T As {BaseClass, New})(ByRef Collection As Container(Of T)) I need to s... | Sorry haven't got time to expand on this right now, but I think this link describes your underlying problem and a solution. (You might also find this interesting.) | Generic Object in VB.NET I have a class declared as follows: Public MustInherit Container(Of T As {New, BaseClass}) Inherits ArrayList(Of T) I have classes that inherit this class. I have another class that I must pass instances in this method: Public Sub LoadCollection(Of T As {BaseClass, New})(ByRef Collection As Con... | TITLE:
Generic Object in VB.NET
QUESTION:
I have a class declared as follows: Public MustInherit Container(Of T As {New, BaseClass}) Inherits ArrayList(Of T) I have classes that inherit this class. I have another class that I must pass instances in this method: Public Sub LoadCollection(Of T As {BaseClass, New})(ByRef... | [
"vb.net",
"generics"
] | 2 | 2 | 1,148 | 3 | 0 | 2008-09-25T17:32:39.797000 | 2008-10-01T10:40:49.243000 |
134,731 | 134,777 | Returning a const reference to an object instead of a copy | Whilst refactoring some code I came across some getter methods that returns a std::string. Something like this for example: class foo { private: std::string name_; public: std::string name() { return name_; } }; Surely the getter would be better returning a const std::string&? The current method is returning a copy whi... | The only way this can cause a problem is if the caller stores the reference, rather than copy the string, and tries to use it after the object is destroyed. Like this: foo *pFoo = new foo; const std::string &myName = pFoo->getName(); delete pFoo; cout << myName; // error! dangling reference However, since your existing... | Returning a const reference to an object instead of a copy Whilst refactoring some code I came across some getter methods that returns a std::string. Something like this for example: class foo { private: std::string name_; public: std::string name() { return name_; } }; Surely the getter would be better returning a con... | TITLE:
Returning a const reference to an object instead of a copy
QUESTION:
Whilst refactoring some code I came across some getter methods that returns a std::string. Something like this for example: class foo { private: std::string name_; public: std::string name() { return name_; } }; Surely the getter would be bett... | [
"c++",
"constants"
] | 75 | 60 | 101,130 | 12 | 0 | 2008-09-25T17:33:15.037000 | 2008-09-25T17:41:03.863000 |
134,741 | 134,752 | Bind ASP.NET DropDownList DataTextField to method? | Is there anyway to have items in an ASP.NET DropDownList have either their Text or Value bound to a method on the source rather than a property? | The only way to do it is to handle the Databinding event of the DropDownList, call the method and set the values in the DropDownList item yourself. | Bind ASP.NET DropDownList DataTextField to method? Is there anyway to have items in an ASP.NET DropDownList have either their Text or Value bound to a method on the source rather than a property? | TITLE:
Bind ASP.NET DropDownList DataTextField to method?
QUESTION:
Is there anyway to have items in an ASP.NET DropDownList have either their Text or Value bound to a method on the source rather than a property?
ANSWER:
The only way to do it is to handle the Databinding event of the DropDownList, call the method and... | [
"asp.net",
"data-binding",
"drop-down-menu"
] | 6 | 0 | 9,919 | 5 | 0 | 2008-09-25T17:34:22.430000 | 2008-09-25T17:35:59.103000 |
134,742 | 135,958 | Server-side DataTable Sorting in RichFaces | I have a data table with a variable number of columns and a data scroller. How can I enable server side sorting? I prefer that it be fired by the user clicking the column header. I already have a method on the bean for executing the sort. public void sort(int column) | I ended up doing it manually. I adding a support tag to the header text tag, like so. To get the ascending/descending arrows, I added a css class. | Server-side DataTable Sorting in RichFaces I have a data table with a variable number of columns and a data scroller. How can I enable server side sorting? I prefer that it be fired by the user clicking the column header. I already have a method on the bean for executing the sort. public void sort(int column) | TITLE:
Server-side DataTable Sorting in RichFaces
QUESTION:
I have a data table with a variable number of columns and a data scroller. How can I enable server side sorting? I prefer that it be fired by the user clicking the column header. I already have a method on the bean for executing the sort. public void sort(int... | [
"java",
"ajax",
"jsf",
"richfaces"
] | 8 | 6 | 19,898 | 5 | 0 | 2008-09-25T17:34:26.047000 | 2008-09-25T20:46:33.543000 |
134,746 | 134,771 | What is the difference between bool and Boolean types in C# | What is the difference between bool and Boolean types in C#? | bool is an alias for System.Boolean just as int is an alias for System.Int32. See a full list of aliases here: Built-In Types Table (C# Reference). | What is the difference between bool and Boolean types in C# What is the difference between bool and Boolean types in C#? | TITLE:
What is the difference between bool and Boolean types in C#
QUESTION:
What is the difference between bool and Boolean types in C#?
ANSWER:
bool is an alias for System.Boolean just as int is an alias for System.Int32. See a full list of aliases here: Built-In Types Table (C# Reference). | [
"c#",
"types",
"boolean"
] | 397 | 433 | 229,126 | 15 | 0 | 2008-09-25T17:35:27.857000 | 2008-09-25T17:39:20.950000 |
134,791 | 135,037 | Why pool Stateless session beans? | Stateless beans in Java do not keep their state between two calls from the client. So in a nutshell we might consider them as objects with business methods. Each method takes parameters and return results. When the method is invoked some local variables are being created in execution stack. When the method returns the ... | Pooling does several things. One, by having one bean per instance, you're guaranteed to be threads safe (Servlets, for example, are not thread safe). Two, you reduce any potential startup time that a bean might have. While Session Beans are "stateless", they only need to be stateless with regards to the client. For exa... | Why pool Stateless session beans? Stateless beans in Java do not keep their state between two calls from the client. So in a nutshell we might consider them as objects with business methods. Each method takes parameters and return results. When the method is invoked some local variables are being created in execution s... | TITLE:
Why pool Stateless session beans?
QUESTION:
Stateless beans in Java do not keep their state between two calls from the client. So in a nutshell we might consider them as objects with business methods. Each method takes parameters and return results. When the method is invoked some local variables are being crea... | [
"java",
"ejb",
"pooling",
"stateless-session-bean"
] | 29 | 29 | 15,611 | 5 | 0 | 2008-09-25T17:43:30.050000 | 2008-09-25T18:24:22.357000 |
134,796 | 1,085,245 | Automatically stop Visual C++ 2008 build at first compile error? | I know I can compile individual source files, but sometimes -- say, when editing a header file used by many.cpp files -- multiple source files need to be recompiled. That's what Build is for. Default behavior of the "Build" command in VC9 (Visual C++ 2008) is to attempt to compile all files that need it. Sometimes this... | I came up with a better macro guys. It stops immediately after the first error/s (soon as build window is updated). Visual Studio -> Tools -> Macros -> Macro IDE... (or ALT+F11) Private Sub OutputWindowEvents_OnPaneUpdated(ByVal pPane As OutputWindowPane) Handles OutputWindowEvents.PaneUpdated If Not (pPane.Name = "Bui... | Automatically stop Visual C++ 2008 build at first compile error? I know I can compile individual source files, but sometimes -- say, when editing a header file used by many.cpp files -- multiple source files need to be recompiled. That's what Build is for. Default behavior of the "Build" command in VC9 (Visual C++ 2008... | TITLE:
Automatically stop Visual C++ 2008 build at first compile error?
QUESTION:
I know I can compile individual source files, but sometimes -- say, when editing a header file used by many.cpp files -- multiple source files need to be recompiled. That's what Build is for. Default behavior of the "Build" command in VC... | [
"c++",
"visual-studio",
"visual-studio-2008",
"visual-c++",
"visual-studio-2005"
] | 48 | 28 | 19,488 | 6 | 0 | 2008-09-25T17:44:38.067000 | 2009-07-06T03:03:53.247000 |
134,805 | 134,822 | Trying to get a Windows Service to run an executable on a shared drive | I have c# that will run in a windows service. I'm trying to use the Process and ProcessStartInfo classes to run an executable. If the executable is on the local drive, no problem. However, I need to run an executable on a shared drive. I've tried using the UNC notation (//machine_name/share_name/directory/runme.exe), b... | The account your service is running as likely does not have permission to access the shared drive. Try configuring it to run as a user with permission to the network via the services applet. Right click on the service, choose properties and set the account in the login tab. | Trying to get a Windows Service to run an executable on a shared drive I have c# that will run in a windows service. I'm trying to use the Process and ProcessStartInfo classes to run an executable. If the executable is on the local drive, no problem. However, I need to run an executable on a shared drive. I've tried us... | TITLE:
Trying to get a Windows Service to run an executable on a shared drive
QUESTION:
I have c# that will run in a windows service. I'm trying to use the Process and ProcessStartInfo classes to run an executable. If the executable is on the local drive, no problem. However, I need to run an executable on a shared dr... | [
"executable",
"unc",
"windows-share"
] | 3 | 3 | 4,343 | 4 | 0 | 2008-09-25T17:47:22.227000 | 2008-09-25T17:51:00.003000 |
134,815 | 134,839 | Javascript: Trigger action on function exit | Is there a way to listen for a javascript function to exit? A trigger that could be setup when a function has completed? I am attempting to use a user interface obfuscation technique (BlockUI) while an AJAX object is retrieving data from the DB, but the function doesn't necessarily execute last, even if you put it at t... | However you're accomplishing your Ajax routines, what you need is a "callback" function that will run once it's complete: function ajaxCall(callback){ //do ajax stuff... callback(); } Then: function doStuff(){ blockUI(); ajaxCall(unblockUI); } | Javascript: Trigger action on function exit Is there a way to listen for a javascript function to exit? A trigger that could be setup when a function has completed? I am attempting to use a user interface obfuscation technique (BlockUI) while an AJAX object is retrieving data from the DB, but the function doesn't neces... | TITLE:
Javascript: Trigger action on function exit
QUESTION:
Is there a way to listen for a javascript function to exit? A trigger that could be setup when a function has completed? I am attempting to use a user interface obfuscation technique (BlockUI) while an AJAX object is retrieving data from the DB, but the func... | [
"javascript",
"triggers",
"function-exit"
] | 3 | 4 | 2,803 | 6 | 0 | 2008-09-25T17:48:35.937000 | 2008-09-25T17:53:22.260000 |
134,821 | 134,851 | Bug Fixing Time Allocation | We've been asked by a client to give us a time estimate on each and every bug we have. Though we do have a set schedule for bug fixing and have allocated time for it, we don't have a time allocation on each of the bugs we have. Simply, we have prioritized our bugs and have ensured that Highest priority bugs will be fix... | The only answer I can give is to be extremely conservative. Guess how long it will take, and multiple your guess by four. Use that as your estimate. As you said, it's very difficult to figure out how long things will take to fix, and it's better to say it will take longer than it actually does than to be caught "breaki... | Bug Fixing Time Allocation We've been asked by a client to give us a time estimate on each and every bug we have. Though we do have a set schedule for bug fixing and have allocated time for it, we don't have a time allocation on each of the bugs we have. Simply, we have prioritized our bugs and have ensured that Highes... | TITLE:
Bug Fixing Time Allocation
QUESTION:
We've been asked by a client to give us a time estimate on each and every bug we have. Though we do have a set schedule for bug fixing and have allocated time for it, we don't have a time allocation on each of the bugs we have. Simply, we have prioritized our bugs and have e... | [
"bug-tracking"
] | 6 | 5 | 2,401 | 8 | 0 | 2008-09-25T17:50:38.070000 | 2008-09-25T17:55:08.963000 |
134,825 | 134,922 | On a WPF ComboBox, is it possible to set a different Foreground color for the textbox and the popup? | Basically my problem stems from a desire to have the textbox portion be white, and the drop down to be black. When I set the text to white, the drop down appears as I want it, but the text in the textbox itself is hardly readable. Setting the Foreground to black makes the drop down unreadable. Is there a good way to ha... | Edit the ControlTemplate, You will see a TextBlock and another PopUp which again has a set of controls. Have a different ForeGround/Background for this TextBox, | On a WPF ComboBox, is it possible to set a different Foreground color for the textbox and the popup? Basically my problem stems from a desire to have the textbox portion be white, and the drop down to be black. When I set the text to white, the drop down appears as I want it, but the text in the textbox itself is hardl... | TITLE:
On a WPF ComboBox, is it possible to set a different Foreground color for the textbox and the popup?
QUESTION:
Basically my problem stems from a desire to have the textbox portion be white, and the drop down to be black. When I set the text to white, the drop down appears as I want it, but the text in the textb... | [
"wpf",
"xaml",
"combobox"
] | 5 | 3 | 2,961 | 2 | 0 | 2008-09-25T17:51:10.687000 | 2008-09-25T18:04:10.750000 |
134,833 | 134,893 | How do I find the MIME type of a file with PHP? | I have an index.php file which has to process many different file types. How do I guess the filetype based on the REQUEST_URI? If I request http://site/image.jpg, and all requests redirect through index.php, which looks like this How would I make that work correctly? Should I test based on the extension of the file req... | If you are sure you're only ever working with images, you can check out the exif_imagetype() PHP function, which attempts to return the image MIME type. If you don't mind external dependencies, you can also check out the excellent getID3 library which can determine the MIME type of many different file types. Lastly, yo... | How do I find the MIME type of a file with PHP? I have an index.php file which has to process many different file types. How do I guess the filetype based on the REQUEST_URI? If I request http://site/image.jpg, and all requests redirect through index.php, which looks like this How would I make that work correctly? Shou... | TITLE:
How do I find the MIME type of a file with PHP?
QUESTION:
I have an index.php file which has to process many different file types. How do I guess the filetype based on the REQUEST_URI? If I request http://site/image.jpg, and all requests redirect through index.php, which looks like this How would I make that wo... | [
"php",
"filesystems",
"http-headers",
"content-type"
] | 49 | 51 | 114,459 | 13 | 0 | 2008-09-25T17:51:52.247000 | 2008-09-25T17:59:56.347000 |
134,847 | 135,232 | Sounds for build error/success in Visual C++? | On long Visual C++ builds, it would be really helpful to hear some sort of (optional) sounds for such build/compile results as: individual compile error file compile success/failure build success/failure batch build success/failure Does anyone know how to enable sounds for these kinds of build occurrences in Visual C++... | CJM is almost right. In VC++ 9 (Visual Studio 2008) Go to Control Panel's Sounds applet (Control Panel/Hardware and Sounds/Sounds in Vista). Under the Sounds tab scroll to "Build Succeeded" under "Microsoft Visual Studio" and set a sound for this event. If you have (or had) multiple VS on this PC (I have 6.0, 2003, 200... | Sounds for build error/success in Visual C++? On long Visual C++ builds, it would be really helpful to hear some sort of (optional) sounds for such build/compile results as: individual compile error file compile success/failure build success/failure batch build success/failure Does anyone know how to enable sounds for ... | TITLE:
Sounds for build error/success in Visual C++?
QUESTION:
On long Visual C++ builds, it would be really helpful to hear some sort of (optional) sounds for such build/compile results as: individual compile error file compile success/failure build success/failure batch build success/failure Does anyone know how to ... | [
"windows",
"visual-studio",
"visual-studio-2008",
"visual-c++",
"visual-studio-2005"
] | 11 | 11 | 3,067 | 4 | 0 | 2008-09-25T17:54:35.533000 | 2008-09-25T18:56:59.237000 |
134,858 | 134,889 | What's the simplest way to make a HTTP GET request in Perl? | I have some code I've written in PHP for consuming our simple webservice, which I'd also like to provide in Perl for users who may prefer that language. What's the simplest method of making a HTTP request to do that? In PHP I can do it in one line with file_get_contents(). Here's the entire code I want to port to Perl:... | LWP::Simple: use LWP::Simple; $contents = get("http://YOUR_URL_HERE"); | What's the simplest way to make a HTTP GET request in Perl? I have some code I've written in PHP for consuming our simple webservice, which I'd also like to provide in Perl for users who may prefer that language. What's the simplest method of making a HTTP request to do that? In PHP I can do it in one line with file_ge... | TITLE:
What's the simplest way to make a HTTP GET request in Perl?
QUESTION:
I have some code I've written in PHP for consuming our simple webservice, which I'd also like to provide in Perl for users who may prefer that language. What's the simplest method of making a HTTP request to do that? In PHP I can do it in one... | [
"perl",
"web-services",
"http"
] | 49 | 82 | 94,455 | 8 | 0 | 2008-09-25T17:55:57.213000 | 2008-09-25T17:59:43.163000 |
134,866 | 134,928 | WinDbg Dr. Watson minidump - requires pdb/dll originally built for installed version? | I have a mindmp file from a target's application crash. Is it possible for me to rebuild the dll/pdb files for a version of software and have windbg load symbols correctly? My problem is that our pdb files are only kept for major releases (unfortunately). This is a daily build, which I can rebuild myself, but I'm getti... | In my experience probably not. If you have the exact build directory and build with the exact same compiler settings then this might work. You definitely will not be able to load symbols from a debug build against a release crash dump. You will need to turn on the 'load anything' options:.symopt+0x40 to get windbg to i... | WinDbg Dr. Watson minidump - requires pdb/dll originally built for installed version? I have a mindmp file from a target's application crash. Is it possible for me to rebuild the dll/pdb files for a version of software and have windbg load symbols correctly? My problem is that our pdb files are only kept for major rele... | TITLE:
WinDbg Dr. Watson minidump - requires pdb/dll originally built for installed version?
QUESTION:
I have a mindmp file from a target's application crash. Is it possible for me to rebuild the dll/pdb files for a version of software and have windbg load symbols correctly? My problem is that our pdb files are only k... | [
"windows",
"debugging",
"dll",
"windbg",
"dr.watson"
] | 3 | 8 | 8,249 | 5 | 0 | 2008-09-25T17:57:18.927000 | 2008-09-25T18:05:06.943000 |
134,871 | 134,932 | What's the best way to implement an API in ASP.NET using MVC? | I've been a longtime ASP.NET developer in the web forms model, and am using a new project as an opportunity to get my feet wet with ASP.NET MVC. The application will need an API so that a group of other apps can communicate with it. I've always built API's out just using a standard web service prior to this. As a siden... | I'd agree with Kilhoffer. Try using a "Facade" wrapper class that inherits from an "IFacade". In your Facade class put your code to consume your web service. In this way your controllers will simply make calls to the Facade. The plus side of this being that you can swap a "DummyFacade" that implements the same IFacade ... | What's the best way to implement an API in ASP.NET using MVC? I've been a longtime ASP.NET developer in the web forms model, and am using a new project as an opportunity to get my feet wet with ASP.NET MVC. The application will need an API so that a group of other apps can communicate with it. I've always built API's o... | TITLE:
What's the best way to implement an API in ASP.NET using MVC?
QUESTION:
I've been a longtime ASP.NET developer in the web forms model, and am using a new project as an opportunity to get my feet wet with ASP.NET MVC. The application will need an API so that a group of other apps can communicate with it. I've al... | [
"asp.net",
"asp.net-mvc",
"web-services"
] | 7 | 8 | 305 | 2 | 0 | 2008-09-25T17:57:53.510000 | 2008-09-25T18:06:04.320000 |
134,872 | 135,053 | Databinding 2 WPF ComboBoxes to 1 source without being "linked" | I have a master-detail scenario where I have 1 ComboBox listing companies from an ObjectDataSourceProvider. Under that I have 2 ComboBoxes binding to the Contacts property from the current Company object. I need to be able to select a different contact in each ComboBox; however, as soon as I change selection in one lis... | Change your " IsSynchronizedWithCurrentItem " attributes to "False". | Databinding 2 WPF ComboBoxes to 1 source without being "linked" I have a master-detail scenario where I have 1 ComboBox listing companies from an ObjectDataSourceProvider. Under that I have 2 ComboBoxes binding to the Contacts property from the current Company object. I need to be able to select a different contact in ... | TITLE:
Databinding 2 WPF ComboBoxes to 1 source without being "linked"
QUESTION:
I have a master-detail scenario where I have 1 ComboBox listing companies from an ObjectDataSourceProvider. Under that I have 2 ComboBoxes binding to the Contacts property from the current Company object. I need to be able to select a dif... | [
"wpf",
"data-binding",
"xaml"
] | 5 | 4 | 5,670 | 1 | 0 | 2008-09-25T17:58:02.747000 | 2008-09-25T18:25:25.973000 |
134,882 | 135,614 | Undoing a git rebase | How do I easily undo a git rebase? A lengthy manual method is: checkout the commit parent to both of the branches create and checkout a temporary branch cherry-pick all commits by hand reset the faulty rebased branch to point to the temporary branch In my current situation, this works because I can easily spot commits ... | The easiest way would be to find the head commit of the branch as it was immediately before the rebase started in the reflog... git reflog and to reset the current branch to it (with the usual caveats about being absolutely sure before reseting with the --hard option). Suppose the old commit was HEAD@{2} in the ref log... | Undoing a git rebase How do I easily undo a git rebase? A lengthy manual method is: checkout the commit parent to both of the branches create and checkout a temporary branch cherry-pick all commits by hand reset the faulty rebased branch to point to the temporary branch In my current situation, this works because I can... | TITLE:
Undoing a git rebase
QUESTION:
How do I easily undo a git rebase? A lengthy manual method is: checkout the commit parent to both of the branches create and checkout a temporary branch cherry-pick all commits by hand reset the faulty rebased branch to point to the temporary branch In my current situation, this w... | [
"git",
"rebase",
"git-rebase",
"undo"
] | 4,310 | 5,948 | 2,038,784 | 20 | 0 | 2008-09-25T17:59:22.230000 | 2008-09-25T19:56:28.343000 |
134,883 | 140,248 | Why isn't Selenium capturing my keystrokes? | I'm trying out the recorder of the latest Selenium IDE Firefox extension on win32/ff3. On one page, currently I have to hit Enter to go to the next page, but it's not on a submit button, it's captured manually. This is not picked up by the recorder. I know I can enter it manually myself after recording, but why isn't t... | From the Selenium FAQ: http://wiki.openqa.org/display/SIDE/FAQ "Not every event will be recorded by Selenium IDE. Usually the ones that won't be recorded are those that involve complex HTML and/or AJAX. We hope to improve this over time, but there will always be situations where the IDE can't record everything because ... | Why isn't Selenium capturing my keystrokes? I'm trying out the recorder of the latest Selenium IDE Firefox extension on win32/ff3. On one page, currently I have to hit Enter to go to the next page, but it's not on a submit button, it's captured manually. This is not picked up by the recorder. I know I can enter it manu... | TITLE:
Why isn't Selenium capturing my keystrokes?
QUESTION:
I'm trying out the recorder of the latest Selenium IDE Firefox extension on win32/ff3. On one page, currently I have to hit Enter to go to the next page, but it's not on a submit button, it's captured manually. This is not picked up by the recorder. I know I... | [
"firefox",
"testing",
"selenium"
] | 2 | 2 | 1,772 | 2 | 0 | 2008-09-25T17:59:24.007000 | 2008-09-26T15:31:53.780000 |
134,887 | 137,774 | When to use ' (or quote) in Lisp? | After making it through the major parts of an introductory Lisp book, I still couldn't understand what the special operator (quote) (or equivalent ' ) function does, yet this has been all over Lisp code that I've seen. What does it do? | Short answer Bypass the default evaluation rules and do not evaluate the expression (symbol or s-exp), passing it along to the function exactly as typed. Long Answer: The Default Evaluation Rule When a regular (I'll come to that later) function is invoked, all arguments passed to it are evaluated. This means you can wr... | When to use ' (or quote) in Lisp? After making it through the major parts of an introductory Lisp book, I still couldn't understand what the special operator (quote) (or equivalent ' ) function does, yet this has been all over Lisp code that I've seen. What does it do? | TITLE:
When to use ' (or quote) in Lisp?
QUESTION:
After making it through the major parts of an introductory Lisp book, I still couldn't understand what the special operator (quote) (or equivalent ' ) function does, yet this has been all over Lisp code that I've seen. What does it do?
ANSWER:
Short answer Bypass the... | [
"lisp",
"quote"
] | 136 | 204 | 50,901 | 10 | 0 | 2008-09-25T17:59:42.400000 | 2008-09-26T04:27:46.213000 |
134,905 | 134,982 | Return XML from a controller's action in as an ActionResult? | What is the best way to return XML from a controller's action in ASP.NET MVC? There is a nice way to return JSON, but not for XML. Do I really need to route the XML through a View, or should I do the not-best-practice way of Response.Write-ing it? | Use MVCContrib 's XmlResult Action. For reference here is their code: public class XmlResult: ActionResult { private object objectToSerialize;
/// /// Initializes a new instance of the class. /// /// The object to serialize to XML. public XmlResult(object objectToSerialize) { this.objectToSerialize = objectToSerialize... | Return XML from a controller's action in as an ActionResult? What is the best way to return XML from a controller's action in ASP.NET MVC? There is a nice way to return JSON, but not for XML. Do I really need to route the XML through a View, or should I do the not-best-practice way of Response.Write-ing it? | TITLE:
Return XML from a controller's action in as an ActionResult?
QUESTION:
What is the best way to return XML from a controller's action in ASP.NET MVC? There is a nice way to return JSON, but not for XML. Do I really need to route the XML through a View, or should I do the not-best-practice way of Response.Write-i... | [
"asp.net",
".net",
"xml",
"asp.net-mvc"
] | 148 | 116 | 107,288 | 11 | 0 | 2008-09-25T18:01:13.097000 | 2008-09-25T18:14:03.193000 |
134,906 | 137,173 | How do I list all cron jobs for all users? | Is there a command or an existing script that will let me view all of a *NIX system's scheduled cron jobs at once? I'd like it to include all of the user crontabs, as well as /etc/crontab, and whatever's in /etc/cron.d. It would also be nice to see the specific commands run by run-parts in /etc/crontab. Ideally, I'd li... | I ended up writing a script (I'm trying to teach myself the finer points of bash scripting, so that's why you don't see something like Perl here). It's not exactly a simple affair, but it does most of what I need. It uses Kyle's suggestion for looking up individual users' crontabs, but also deals with /etc/crontab (inc... | How do I list all cron jobs for all users? Is there a command or an existing script that will let me view all of a *NIX system's scheduled cron jobs at once? I'd like it to include all of the user crontabs, as well as /etc/crontab, and whatever's in /etc/cron.d. It would also be nice to see the specific commands run by... | TITLE:
How do I list all cron jobs for all users?
QUESTION:
Is there a command or an existing script that will let me view all of a *NIX system's scheduled cron jobs at once? I'd like it to include all of the user crontabs, as well as /etc/crontab, and whatever's in /etc/cron.d. It would also be nice to see the specif... | [
"unix",
"cron"
] | 996 | 346 | 1,082,470 | 25 | 0 | 2008-09-25T18:01:31.083000 | 2008-09-26T00:50:39.277000 |
134,914 | 135,005 | In Source Safe is there a way to protect crucial files being modified by some developers | I'd sooner not just permanently have a bunch of files checked out to me, but I'd like a way to prevent some really critical files being changed without my being aware of it. PS Yes I know SourceSafe is terrible. | You can only set access rights on a project by project basis. This is done by running the the Source Safe Administration application and then go to Tools > Rights By Project. Select the required project and then give a users the required priveledges. In order to protect a subset of files place them in a seperate projec... | In Source Safe is there a way to protect crucial files being modified by some developers I'd sooner not just permanently have a bunch of files checked out to me, but I'd like a way to prevent some really critical files being changed without my being aware of it. PS Yes I know SourceSafe is terrible. | TITLE:
In Source Safe is there a way to protect crucial files being modified by some developers
QUESTION:
I'd sooner not just permanently have a bunch of files checked out to me, but I'd like a way to prevent some really critical files being changed without my being aware of it. PS Yes I know SourceSafe is terrible.
... | [
"version-control",
"visual-sourcesafe"
] | 1 | 2 | 208 | 3 | 0 | 2008-09-25T18:02:57.243000 | 2008-09-25T18:17:34.837000 |
134,934 | 134,951 | Display number with leading zeros | How do I display a leading zero for all numbers with less than two digits? 1 → 01 10 → 10 100 → 100 | In Python 2 (and Python 3) you can do: number = 1 print("%02d" % (number,)) Basically % is like printf or sprintf (see docs ). For Python 3.+, the same behavior can also be achieved with format: number = 1 print("{:02d}".format(number)) For Python 3.6+ the same behavior can be achieved with f-strings: number = 1 print(... | Display number with leading zeros How do I display a leading zero for all numbers with less than two digits? 1 → 01 10 → 10 100 → 100 | TITLE:
Display number with leading zeros
QUESTION:
How do I display a leading zero for all numbers with less than two digits? 1 → 01 10 → 10 100 → 100
ANSWER:
In Python 2 (and Python 3) you can do: number = 1 print("%02d" % (number,)) Basically % is like printf or sprintf (see docs ). For Python 3.+, the same behavio... | [
"python",
"integer",
"string-formatting"
] | 1,412 | 1,882 | 1,540,424 | 19 | 0 | 2008-09-25T18:06:06.487000 | 2008-09-25T18:08:21.363000 |
134,948 | 135,052 | Best practice for placement of display logic in a view in CakePHP | I have a CakePHP 1.2 application. I'm running into the case where I need to do some logic to render things correctly in the view. Example: I have a table called Types. There are flags for various types, so each row has one or more BOOL fields set. For one type of type, I store the contents of an RTF in another field. S... | i'd suggest keeping that logic in the view, building HTML in your model breaks the whole view/model separation. i don't think there's anything wrong with view logic, personally i tend to constrain it to basic conditionals. ultimately i think the idea is figuring out where this logic best fits. in this case, the logic i... | Best practice for placement of display logic in a view in CakePHP I have a CakePHP 1.2 application. I'm running into the case where I need to do some logic to render things correctly in the view. Example: I have a table called Types. There are flags for various types, so each row has one or more BOOL fields set. For on... | TITLE:
Best practice for placement of display logic in a view in CakePHP
QUESTION:
I have a CakePHP 1.2 application. I'm running into the case where I need to do some logic to render things correctly in the view. Example: I have a table called Types. There are flags for various types, so each row has one or more BOOL ... | [
"php",
"cakephp",
"cakephp-1.2"
] | 0 | 1 | 584 | 2 | 0 | 2008-09-25T18:08:08.370000 | 2008-09-25T18:25:24.490000 |
134,950 | 134,980 | What is a good alternative for SourceSafe on a USB Drive? | I like to keep my source files on a USB drive for the portability. To date I have been using Visual SourceSafe for this purpose. What is a good alternative to VSS that fulfils these criteria: Entire database can be held on a USB "pen" drive Code / documentation duplicated on local drives Does not require a central serv... | I would use SVN (Subversion). You can use SVN in "file" mode (w/o using the network). combine this with tortoiseSVN, which integrates to explorer, and you have a nice little portable repository. For Visual Studio integration, there is the commercial($49) VisualSVN (which I believe is the setup used to develop StackOver... | What is a good alternative for SourceSafe on a USB Drive? I like to keep my source files on a USB drive for the portability. To date I have been using Visual SourceSafe for this purpose. What is a good alternative to VSS that fulfils these criteria: Entire database can be held on a USB "pen" drive Code / documentation ... | TITLE:
What is a good alternative for SourceSafe on a USB Drive?
QUESTION:
I like to keep my source files on a USB drive for the portability. To date I have been using Visual SourceSafe for this purpose. What is a good alternative to VSS that fulfils these criteria: Entire database can be held on a USB "pen" drive Cod... | [
"version-control"
] | 6 | 8 | 1,095 | 6 | 0 | 2008-09-25T18:08:19.570000 | 2008-09-25T18:13:55.877000 |
134,956 | 153,423 | How do you perform address validation? | Is it even possible to perform address (physical, not e-mail) validation? It seems like the sheer number of address formats, even in the US alone, would make this a fairly difficult task. On the other hand it seems like a task that would be necessary for several business requirements. | Here's a free and sort of "outside the box" way to do it. Not 100% perfect, but it should reject blatantly non-existent addresses. Submit the entire address to Google's geocoding web service. This service attempts to return the exact coordinates of the location you feed it, i.e. latitude and longitude. In my experience... | How do you perform address validation? Is it even possible to perform address (physical, not e-mail) validation? It seems like the sheer number of address formats, even in the US alone, would make this a fairly difficult task. On the other hand it seems like a task that would be necessary for several business requireme... | TITLE:
How do you perform address validation?
QUESTION:
Is it even possible to perform address (physical, not e-mail) validation? It seems like the sheer number of address formats, even in the US alone, would make this a fairly difficult task. On the other hand it seems like a task that would be necessary for several ... | [
"validation",
"street-address"
] | 96 | 29 | 170,349 | 20 | 0 | 2008-09-25T18:09:12.767000 | 2008-09-30T14:57:10.943000 |
134,958 | 135,977 | Get top results for each group (in Oracle) | How would I be able to get N results for several groups in an oracle query. For example, given the following table: |--------+------------+------------| | emp_id | name | occupation | |--------+------------+------------| | 1 | John Smith | Accountant | | 2 | Jane Doe | Engineer | | 3 | Jack Black | Funnyman | |--------... | This produces what you want, and it uses no vendor-specific SQL features like TOP N or RANK(). SELECT MAX(e.name) AS name, MAX(e.occupation) AS occupation FROM emp e LEFT OUTER JOIN emp e2 ON (e.occupation = e2.occupation AND e.emp_id <= e2.emp_id) GROUP BY e.emp_id HAVING COUNT(*) <= 3 ORDER BY occupation; In this exa... | Get top results for each group (in Oracle) How would I be able to get N results for several groups in an oracle query. For example, given the following table: |--------+------------+------------| | emp_id | name | occupation | |--------+------------+------------| | 1 | John Smith | Accountant | | 2 | Jane Doe | Enginee... | TITLE:
Get top results for each group (in Oracle)
QUESTION:
How would I be able to get N results for several groups in an oracle query. For example, given the following table: |--------+------------+------------| | emp_id | name | occupation | |--------+------------+------------| | 1 | John Smith | Accountant | | 2 | ... | [
"sql",
"oracle",
"greatest-n-per-group"
] | 17 | 13 | 75,667 | 5 | 0 | 2008-09-25T18:09:32.687000 | 2008-09-25T20:48:29.903000 |
134,969 | 134,994 | Ruby - equivalent of Python __str__() method? | In Ruby, is there the equivalent of the __str__() method that you can define on Python classes? | You could use to_s. http://briancarper.net/2006/09/26/ruby-to_s-vs-to_str/ | Ruby - equivalent of Python __str__() method? In Ruby, is there the equivalent of the __str__() method that you can define on Python classes? | TITLE:
Ruby - equivalent of Python __str__() method?
QUESTION:
In Ruby, is there the equivalent of the __str__() method that you can define on Python classes?
ANSWER:
You could use to_s. http://briancarper.net/2006/09/26/ruby-to_s-vs-to_str/ | [
"ruby"
] | 5 | 15 | 3,607 | 3 | 0 | 2008-09-25T18:11:19.640000 | 2008-09-25T18:15:41.253000 |
134,976 | 135,189 | How do I find the number of references that exist for a particular object? | I have a bit of code that passes around a ton of objects and I want to determine if there are any references still lingering around that I am unaware of and where it is those references are located. Any idea of how I can do this? My understanding is that the watch window only allows me to see items available to the cur... | A profiler will allow you to do this. CLR Profiler or ANTS Profiler are two examples. | How do I find the number of references that exist for a particular object? I have a bit of code that passes around a ton of objects and I want to determine if there are any references still lingering around that I am unaware of and where it is those references are located. Any idea of how I can do this? My understandin... | TITLE:
How do I find the number of references that exist for a particular object?
QUESTION:
I have a bit of code that passes around a ton of objects and I want to determine if there are any references still lingering around that I am unaware of and where it is those references are located. Any idea of how I can do thi... | [
"c#",
".net",
"vb.net",
"visual-studio-2008"
] | 0 | 1 | 235 | 3 | 0 | 2008-09-25T18:12:52.523000 | 2008-09-25T18:49:17.070000 |
134,988 | 135,025 | Secure only Login.aspx for a site | Is it possible to secure only the Login.aspx page (and the postback) and not the whole site in IIS? We are looking to do this specifically with a SharePoint site running Forms Based Authentication against our Active Directory. Links to this will be helpful. This is what we have done so far: 1. Setup SharePoint to use F... | There's not a whole lot of point. If the only thing that's encrypted is the Login.aspx page, that would mean that someone could sniff all the traffic that was not sent through the login page. Which might prevent people from getting user:pass, but all your other data is exposed. | Secure only Login.aspx for a site Is it possible to secure only the Login.aspx page (and the postback) and not the whole site in IIS? We are looking to do this specifically with a SharePoint site running Forms Based Authentication against our Active Directory. Links to this will be helpful. This is what we have done so... | TITLE:
Secure only Login.aspx for a site
QUESTION:
Is it possible to secure only the Login.aspx page (and the postback) and not the whole site in IIS? We are looking to do this specifically with a SharePoint site running Forms Based Authentication against our Active Directory. Links to this will be helpful. This is wh... | [
"sharepoint",
"iis",
"ssl",
"authentication",
"security"
] | 2 | 3 | 1,573 | 3 | 0 | 2008-09-25T18:14:59.943000 | 2008-09-25T18:22:45.213000 |
134,992 | 135,018 | Best way to check if server is reachable in .NET? | I have created a timeclock application in C# that connects to a web service on our server in order to clock employees in/out. The application resides in the system tray and clocks users out if they shut down/suspend their machines or if they are idle for more than three hours to which it clocks them out at the time of ... | The best way is going to be to actually try to make the connection and catch the errors. You can ping the machine, but that will only tell you if the machine is running and on the network, which doesn't necessarily reflect on whether the webservice is running and available. | Best way to check if server is reachable in .NET? I have created a timeclock application in C# that connects to a web service on our server in order to clock employees in/out. The application resides in the system tray and clocks users out if they shut down/suspend their machines or if they are idle for more than three... | TITLE:
Best way to check if server is reachable in .NET?
QUESTION:
I have created a timeclock application in C# that connects to a web service on our server in order to clock employees in/out. The application resides in the system tray and clocks users out if they shut down/suspend their machines or if they are idle f... | [
"c#",
".net",
"web-services"
] | 2 | 3 | 2,693 | 5 | 0 | 2008-09-25T18:15:37.230000 | 2008-09-25T18:19:46.937000 |
135,000 | 135,982 | How to prevent blank xmlns attributes in output from .NET's XmlDocument? | When generating XML from XmlDocument in.NET, a blank xmlns attribute appears the first time an element without an associated namespace is inserted; how can this be prevented? Example: XmlDocument xml = new XmlDocument(); xml.AppendChild(xml.CreateElement("root", "whatever:name-space-1.0")); xml.DocumentElement.AppendCh... | Thanks to Jeremy Lew's answer and a bit more playing around, I figured out how to remove blank xmlns attributes: pass in the root node's namespace when creating any child node you want not to have a prefix on. Using a namespace without a prefix at the root means that you need to use that same namespace on child element... | How to prevent blank xmlns attributes in output from .NET's XmlDocument? When generating XML from XmlDocument in.NET, a blank xmlns attribute appears the first time an element without an associated namespace is inserted; how can this be prevented? Example: XmlDocument xml = new XmlDocument(); xml.AppendChild(xml.Create... | TITLE:
How to prevent blank xmlns attributes in output from .NET's XmlDocument?
QUESTION:
When generating XML from XmlDocument in.NET, a blank xmlns attribute appears the first time an element without an associated namespace is inserted; how can this be prevented? Example: XmlDocument xml = new XmlDocument(); xml.Appe... | [
"c#",
".net",
"xml",
"xml-namespaces",
"xmldocument"
] | 128 | 119 | 79,755 | 7 | 0 | 2008-09-25T18:16:38.380000 | 2008-09-25T20:49:13.163000 |
135,010 | 135,190 | How can I script a no-cost notification of batch file errors/returns? | I have a problem with stopping a service and starting it again and want to be notified when the process runs and let me know what the result is. Here's the scenario, I have a text file output of an "sc" command. I want to send that file but not as an attachment. Also, I want to see the initial status quickly in the sub... | Here's how I'm doing this. First I got blat mail (public domain smtp mailer) and dropped it into d:\blat directory. My Exchange server allows me to email without id/password and just assumes that I am the person in the 'from' field of the blat command. @echo off sc start Alerter >servstop.txt SetLocal EnableDelayedExpa... | How can I script a no-cost notification of batch file errors/returns? I have a problem with stopping a service and starting it again and want to be notified when the process runs and let me know what the result is. Here's the scenario, I have a text file output of an "sc" command. I want to send that file but not as an... | TITLE:
How can I script a no-cost notification of batch file errors/returns?
QUESTION:
I have a problem with stopping a service and starting it again and want to be notified when the process runs and let me know what the result is. Here's the scenario, I have a text file output of an "sc" command. I want to send that ... | [
"windows",
"command-line",
"batch-file",
"blat"
] | 0 | 1 | 2,087 | 2 | 0 | 2008-09-25T18:18:19.250000 | 2008-09-25T18:49:20.657000 |
135,020 | 135,038 | Advantages to Using Private Static Methods | When creating a class that has internal private methods, usually to reduce code duplication, that don't require the use of any instance fields, are there performance or memory advantages to declaring the method as static? Example: foreach (XmlElement element in xmlDoc.DocumentElement.SelectNodes("sample")) { string fir... | From the FxCop rule page on this: After you mark the methods as static, the compiler will emit non-virtual call sites to these members. Emitting non-virtual call sites will prevent a check at runtime for each call that ensures that the current object pointer is non-null. This can result in a measurable performance gain... | Advantages to Using Private Static Methods When creating a class that has internal private methods, usually to reduce code duplication, that don't require the use of any instance fields, are there performance or memory advantages to declaring the method as static? Example: foreach (XmlElement element in xmlDoc.Document... | TITLE:
Advantages to Using Private Static Methods
QUESTION:
When creating a class that has internal private methods, usually to reduce code duplication, that don't require the use of any instance fields, are there performance or memory advantages to declaring the method as static? Example: foreach (XmlElement element ... | [
"c#",
"performance"
] | 250 | 260 | 123,374 | 8 | 0 | 2008-09-25T18:20:54.267000 | 2008-09-25T18:24:24.523000 |
135,035 | 135,051 | Python Library Path | In ruby the library path is provided in $:, in perl it's in @INC - how do you get the list of paths that Python searches for modules when you do an import? | I think you're looking for sys.path import sys print (sys.path) | Python Library Path In ruby the library path is provided in $:, in perl it's in @INC - how do you get the list of paths that Python searches for modules when you do an import? | TITLE:
Python Library Path
QUESTION:
In ruby the library path is provided in $:, in perl it's in @INC - how do you get the list of paths that Python searches for modules when you do an import?
ANSWER:
I think you're looking for sys.path import sys print (sys.path) | [
"python"
] | 85 | 101 | 297,795 | 4 | 0 | 2008-09-25T18:23:50.733000 | 2008-09-25T18:25:18.390000 |
135,041 | 135,114 | Should you always favor xrange() over range()? | Why or why not? | For performance, especially when you're iterating over a large range, xrange() is usually better. However, there are still a few cases why you might prefer range(): In python 3, range() does what xrange() used to do and xrange() does not exist. If you want to write code that will run on both Python 2 and Python 3, you ... | Should you always favor xrange() over range()? Why or why not? | TITLE:
Should you always favor xrange() over range()?
QUESTION:
Why or why not?
ANSWER:
For performance, especially when you're iterating over a large range, xrange() is usually better. However, there are still a few cases why you might prefer range(): In python 3, range() does what xrange() used to do and xrange() d... | [
"python",
"range",
"xrange"
] | 463 | 447 | 214,725 | 12 | 0 | 2008-09-25T18:24:37.893000 | 2008-09-25T18:34:38.977000 |
135,047 | 136,556 | Interview questions for Flash developers | For an interview in a few, I'm not at all familiar with Flash development. What would you ask? | Honestly, if you yourself aren't a flash developer, I'd caution against interviewing a potential Flash developer, unless you're only doing it to get a sense of their character (as opposed to their skill level). Experience in working with the technology is going to give you a much more realistic perspective - blindly as... | Interview questions for Flash developers For an interview in a few, I'm not at all familiar with Flash development. What would you ask? | TITLE:
Interview questions for Flash developers
QUESTION:
For an interview in a few, I'm not at all familiar with Flash development. What would you ask?
ANSWER:
Honestly, if you yourself aren't a flash developer, I'd caution against interviewing a potential Flash developer, unless you're only doing it to get a sense ... | [
"flash"
] | 6 | 5 | 20,349 | 8 | 0 | 2008-09-25T18:24:56.177000 | 2008-09-25T22:20:01.337000 |
135,057 | 135,191 | Internet Explorer 8 and Internet Explorer 6 side by side | Possible Duplicate: Running Internet Explorer 6, Internet Explorer 7, and Internet Explorer 8 on the same machine Is there a way to have Internet Explorer 8 and Internet Explorer 6 side by side without virtualizing? I used Multiple IEs which works fine with Internet Explorer 7, but since I installed Internet Explorer 8... | I also use virtualisation. I've got Virtual PC 2007, which is a free download from here, on my machine and have downloaded the Internet Explorer Virual PC images from Microsoft. You can get the images here. | Internet Explorer 8 and Internet Explorer 6 side by side Possible Duplicate: Running Internet Explorer 6, Internet Explorer 7, and Internet Explorer 8 on the same machine Is there a way to have Internet Explorer 8 and Internet Explorer 6 side by side without virtualizing? I used Multiple IEs which works fine with Inter... | TITLE:
Internet Explorer 8 and Internet Explorer 6 side by side
QUESTION:
Possible Duplicate: Running Internet Explorer 6, Internet Explorer 7, and Internet Explorer 8 on the same machine Is there a way to have Internet Explorer 8 and Internet Explorer 6 side by side without virtualizing? I used Multiple IEs which wor... | [
"internet-explorer",
"internet-explorer-8",
"internet-explorer-7",
"internet-explorer-6",
"superpreview"
] | 28 | 21 | 30,374 | 11 | 0 | 2008-09-25T18:26:54.457000 | 2008-09-25T18:49:21.673000 |
135,069 | 135,454 | #ifdef vs #if - which is better/safer as a method for enabling/disabling compilation of particular sections of code? | This may be a matter of style, but there's a bit of a divide in our dev team and I wondered if anyone else had any ideas on the matter... Basically, we have some debug print statements which we turn off during normal development. Personally I prefer to do the following: //---- SomeSourceFile.cpp ----
#define DEBUG_ENA... | My initial reaction was #ifdef, of course, but I think #if actually has some significant advantages for this - here's why: First, you can use DEBUG_ENABLED in preprocessor and compiled tests. Example - Often, I want longer timeouts when debug is enabled, so using #if, I can write this DoSomethingSlowWithTimeout(DEBUG_E... | #ifdef vs #if - which is better/safer as a method for enabling/disabling compilation of particular sections of code? This may be a matter of style, but there's a bit of a divide in our dev team and I wondered if anyone else had any ideas on the matter... Basically, we have some debug print statements which we turn off ... | TITLE:
#ifdef vs #if - which is better/safer as a method for enabling/disabling compilation of particular sections of code?
QUESTION:
This may be a matter of style, but there's a bit of a divide in our dev team and I wondered if anyone else had any ideas on the matter... Basically, we have some debug print statements ... | [
"c++",
"c",
"if-statement",
"coding-style",
"c-preprocessor"
] | 134 | 92 | 120,848 | 21 | 0 | 2008-09-25T18:28:04.717000 | 2008-09-25T19:28:50.547000 |
135,076 | 141,587 | Why do Chrome, Firefox and IE all render fixed-width SELECT controls differently? | I am losing hair on this one... it seems that when I fix width an HTML SELECT control it renders its width differently depending on the browser. Any idea how to to standardize this without having to turn to multiple style sheets? Here is what I am working with:.combo { padding: 2px; width: 200px; }.text { padding: 2px;... | Form controls will always be less obedient to styling attempts,in particular selects and file inputs, so the only way to reliably style them cross-browser and with future-proofing in mind, is to replace them with JavaScript or Flash and mimic their functionality | Why do Chrome, Firefox and IE all render fixed-width SELECT controls differently? I am losing hair on this one... it seems that when I fix width an HTML SELECT control it renders its width differently depending on the browser. Any idea how to to standardize this without having to turn to multiple style sheets? Here is ... | TITLE:
Why do Chrome, Firefox and IE all render fixed-width SELECT controls differently?
QUESTION:
I am losing hair on this one... it seems that when I fix width an HTML SELECT control it renders its width differently depending on the browser. Any idea how to to standardize this without having to turn to multiple styl... | [
"html",
"cross-browser"
] | 10 | 3 | 11,203 | 9 | 0 | 2008-09-25T18:29:01.410000 | 2008-09-26T19:56:58.277000 |
135,105 | 135,562 | How can you make a DataGridView scroll one item at a time using the mouse wheel? | We'd like to override DataGridView's default behavior when using a mouse wheel with this control. By default, the DataGridView scrolls a number of rows equal the SystemInformation.MouseWheelScrollLines setting. What we'd like to do is scroll just one item at a time. (We display images in the DataGridView, which are som... | I just did a little scrounging and testing of my own. I used Reflector to investigate and discovered a couple things. The MouseWheel event provides a MouseEventArgs parameter, but the OnMouseWheel() override in DataGridView casts it to Handled MouseEventArgs. This also works when handling the MouseWheel event. OnMouseW... | How can you make a DataGridView scroll one item at a time using the mouse wheel? We'd like to override DataGridView's default behavior when using a mouse wheel with this control. By default, the DataGridView scrolls a number of rows equal the SystemInformation.MouseWheelScrollLines setting. What we'd like to do is scro... | TITLE:
How can you make a DataGridView scroll one item at a time using the mouse wheel?
QUESTION:
We'd like to override DataGridView's default behavior when using a mouse wheel with this control. By default, the DataGridView scrolls a number of rows equal the SystemInformation.MouseWheelScrollLines setting. What we'd ... | [
"c#",
".net",
"datagridview"
] | 8 | 4 | 11,442 | 5 | 0 | 2008-09-25T18:33:07.483000 | 2008-09-25T19:48:21.187000 |
135,112 | 137,838 | Java Developer meets Objective-C on Mac OS | I have developed in C++ many years ago, but these days I am primarily a Java software engineer. Given I own an iPhone, am ready to spring for a MacBook next month, and am generally interested in getting started with Mac OS developmentmt (using Objective C), I thought I would just put this question out there: What Next?... | Having purchased both of the books in your question, I recommend Cocoa Programming for Mac OS X as a quick way to learn the language and the Cocoa framework, and is probably the fastest way to start producing real applications in Cocoa. I highly recommend it. Programming in Objective-C 2.0 is a great reference book, bu... | Java Developer meets Objective-C on Mac OS I have developed in C++ many years ago, but these days I am primarily a Java software engineer. Given I own an iPhone, am ready to spring for a MacBook next month, and am generally interested in getting started with Mac OS developmentmt (using Objective C), I thought I would j... | TITLE:
Java Developer meets Objective-C on Mac OS
QUESTION:
I have developed in C++ many years ago, but these days I am primarily a Java software engineer. Given I own an iPhone, am ready to spring for a MacBook next month, and am generally interested in getting started with Mac OS developmentmt (using Objective C), I... | [
"java",
"c++",
"objective-c",
"cocoa",
"macos"
] | 12 | 11 | 3,892 | 6 | 0 | 2008-09-25T18:34:23.470000 | 2008-09-26T04:52:40.083000 |
135,121 | 135,137 | How can I use an event to cause a method to run? | So in my documentation it says: public event TreeViewPlusNodeCheckedEventHandler NodeChecked() You can use this event to run cause a method to run whenever the check-box for a node is checked on the tree. So how do I add a method to my code behind file that will run when a node is checked? The method I want to run is: ... | You need to assign a delegate to the event and have it run the method you want. Something like: TreeViewControl.NodeChecked += new TreeViewPlusNodeCheckedEventHandler(TOCNodeCheckedServer) | How can I use an event to cause a method to run? So in my documentation it says: public event TreeViewPlusNodeCheckedEventHandler NodeChecked() You can use this event to run cause a method to run whenever the check-box for a node is checked on the tree. So how do I add a method to my code behind file that will run when... | TITLE:
How can I use an event to cause a method to run?
QUESTION:
So in my documentation it says: public event TreeViewPlusNodeCheckedEventHandler NodeChecked() You can use this event to run cause a method to run whenever the check-box for a node is checked on the tree. So how do I add a method to my code behind file ... | [
"c#",
".net",
"events",
"methods"
] | 0 | 5 | 490 | 4 | 0 | 2008-09-25T18:35:50.427000 | 2008-09-25T18:39:03.570000 |
135,122 | 135,567 | Hosted CRM system with an API? | I apologize if this is slightly off-topic. I'm hoping to find a software-as-a-service CRM system that can be easily integrated with our custom user management application. Fundamentally, we have user our own accounts and provide services to these registered users; frequently, we have email conversations with people tha... | Salesforce.com has an extensive SOAP API for what I understand. http://www.salesforce.com/developer/ | Hosted CRM system with an API? I apologize if this is slightly off-topic. I'm hoping to find a software-as-a-service CRM system that can be easily integrated with our custom user management application. Fundamentally, we have user our own accounts and provide services to these registered users; frequently, we have emai... | TITLE:
Hosted CRM system with an API?
QUESTION:
I apologize if this is slightly off-topic. I'm hoping to find a software-as-a-service CRM system that can be easily integrated with our custom user management application. Fundamentally, we have user our own accounts and provide services to these registered users; freque... | [
"web-services",
"email",
"crm"
] | 0 | 3 | 415 | 5 | 0 | 2008-09-25T18:35:57.290000 | 2008-09-25T19:48:44.370000 |
135,129 | 135,152 | Should one prefer STL algorithms over hand-rolled loops? | I seem to be seeing more 'for' loops over iterators in questions & answers here than I do for_each(), transform(), and the like. Scott Meyers suggests that stl algorithms are preferred, or at least he did in 2001. Of course, using them often means moving the loop body into a function or function object. Some may feel t... | It depends on: Whether high-performance is required The readability of the loop Whether the algorithm is complex If the loop isn't the bottleneck, and the algorithm is simple (like for_each), then for the current C++ standard, I'd prefer a hand-rolled loop for readability. (Locality of logic is key.) However, now that ... | Should one prefer STL algorithms over hand-rolled loops? I seem to be seeing more 'for' loops over iterators in questions & answers here than I do for_each(), transform(), and the like. Scott Meyers suggests that stl algorithms are preferred, or at least he did in 2001. Of course, using them often means moving the loop... | TITLE:
Should one prefer STL algorithms over hand-rolled loops?
QUESTION:
I seem to be seeing more 'for' loops over iterators in questions & answers here than I do for_each(), transform(), and the like. Scott Meyers suggests that stl algorithms are preferred, or at least he did in 2001. Of course, using them often mea... | [
"c++",
"algorithm",
"stl"
] | 27 | 20 | 10,490 | 11 | 0 | 2008-09-25T18:37:13.353000 | 2008-09-25T18:42:23.077000 |
135,149 | 135,178 | How can I discover if there are other devices on my local sub-net? | I'm trying to confirm a user a unplugged my embedded device from a network before performing some maintenance. I'm considering "ping"ing all IP address on my sub-net, but that sounds crude. Is there a broadcast/ARP method that might work better? | If you can't get reliable link state information from your Ethernet device (which most chipsets should support these days, BTW...), sending an ARP request for each IP on your local subnet is a decent substitute. The overhead is minimal, and as soon as you get a single response, you can be sure you're still connected to... | How can I discover if there are other devices on my local sub-net? I'm trying to confirm a user a unplugged my embedded device from a network before performing some maintenance. I'm considering "ping"ing all IP address on my sub-net, but that sounds crude. Is there a broadcast/ARP method that might work better? | TITLE:
How can I discover if there are other devices on my local sub-net?
QUESTION:
I'm trying to confirm a user a unplugged my embedded device from a network before performing some maintenance. I'm considering "ping"ing all IP address on my sub-net, but that sounds crude. Is there a broadcast/ARP method that might wo... | [
"networking"
] | 1 | 0 | 532 | 7 | 0 | 2008-09-25T18:41:37.573000 | 2008-09-25T18:47:30.427000 |
135,151 | 135,216 | What's the best way to remove <br> tags from the end of a string? | The.NET web system I'm working on allows the end user to input HTML formatted text in some situations. In some of those places, we want to leave all the tags, but strip off any trailing break tags (but leave any breaks inside the body of the text.) What's the best way to do this? (I can think of ways to do this, but I'... | As @ Mitch said, // using System.Text.RegularExpressions;
/// /// Regular expression built for C# on: Thu, Sep 25, 2008, 02:01:36 PM /// Using Expresso Version: 2.1.2150, http://www.ultrapico.com /// /// A description of the regular expression: /// /// Match expression but don't capture it. [\ ], any number of repetit... | What's the best way to remove <br> tags from the end of a string? The.NET web system I'm working on allows the end user to input HTML formatted text in some situations. In some of those places, we want to leave all the tags, but strip off any trailing break tags (but leave any breaks inside the body of the text.) What'... | TITLE:
What's the best way to remove <br> tags from the end of a string?
QUESTION:
The.NET web system I'm working on allows the end user to input HTML formatted text in some situations. In some of those places, we want to leave all the tags, but strip off any trailing break tags (but leave any breaks inside the body o... | [
".net",
"asp.net",
"xhtml",
"string"
] | 6 | 12 | 9,163 | 7 | 0 | 2008-09-25T18:42:22.733000 | 2008-09-25T18:53:39.227000 |
135,158 | 137,270 | How can I call a long-running external program from Excel / VBA? | What is the best way to run an external program from excel. It might run for several minutes. What's the best-practice about how to to this. Ideally, A model dialog box that let's the user know that the process is executing. If the executable fails, the user should receive a notification. A timeout should be enforced. ... | You should check out these two Microsoft KB articles How to launch a Win32 Application from Visual Basic and How To Use a 32-Bit Application to Determine When a Shelled Process Ends They both quickly give you the framework to launch a process and then check on its completion. Each of the KB articles have some additiona... | How can I call a long-running external program from Excel / VBA? What is the best way to run an external program from excel. It might run for several minutes. What's the best-practice about how to to this. Ideally, A model dialog box that let's the user know that the process is executing. If the executable fails, the u... | TITLE:
How can I call a long-running external program from Excel / VBA?
QUESTION:
What is the best way to run an external program from excel. It might run for several minutes. What's the best-practice about how to to this. Ideally, A model dialog box that let's the user know that the process is executing. If the execu... | [
"windows",
"excel",
"spreadsheet",
"vba"
] | 3 | 6 | 8,188 | 1 | 0 | 2008-09-25T18:43:09.783000 | 2008-09-26T01:32:03.950000 |
135,169 | 1,394,831 | Is Google App Engine a worthy platform for a Lifestreaming app? | I'm building a Lifestreaming app that will involve pulling down lots of feeds for lots of users, and performing data-mining, and machine learning algorithms on the results. GAE's load balanced and scalable hosting sounds like a good fit for a system that could eventually be moving around a LOT of data, but it's lack of... | While I can not answer your question directly, my experience of building Microupdater (a news aggregator collecting a few hundred feeds on AppEngine) may give you a little insight. Fetching feeds. Fetching lots of feeds by cron jobs (it was the only solution until SDK 1.2.5) is not efficient and scalable, which has low... | Is Google App Engine a worthy platform for a Lifestreaming app? I'm building a Lifestreaming app that will involve pulling down lots of feeds for lots of users, and performing data-mining, and machine learning algorithms on the results. GAE's load balanced and scalable hosting sounds like a good fit for a system that c... | TITLE:
Is Google App Engine a worthy platform for a Lifestreaming app?
QUESTION:
I'm building a Lifestreaming app that will involve pulling down lots of feeds for lots of users, and performing data-mining, and machine learning algorithms on the results. GAE's load balanced and scalable hosting sounds like a good fit f... | [
"python",
"django",
"google-app-engine",
"web-applications"
] | 7 | 3 | 1,112 | 7 | 0 | 2008-09-25T18:46:15.360000 | 2009-09-08T16:03:31.760000 |
135,173 | 135,252 | Merging contacts in SQL table without creating duplicate entries | I have a table that holds only two columns - a ListID and PersonID. When a person is merged with another in the system, I was to update all references from the "source" person to be references to the "destination" person. Ideally, I would like to call something simple like UPDATE MailingListSubscription SET PersonID = ... | --out with the bad DELETE FROM MailingListSubscription WHERE PersonId = @SourcePerson and ListID in (SELECT ListID FROM MailingListSubscription WHERE PersonID = @DestPerson)
--update the rest (good) UPDATE MailingListSubscription SET PersonId = @DestPerson WHERE PersonId = @SourcePerson | Merging contacts in SQL table without creating duplicate entries I have a table that holds only two columns - a ListID and PersonID. When a person is merged with another in the system, I was to update all references from the "source" person to be references to the "destination" person. Ideally, I would like to call som... | TITLE:
Merging contacts in SQL table without creating duplicate entries
QUESTION:
I have a table that holds only two columns - a ListID and PersonID. When a person is merged with another in the system, I was to update all references from the "source" person to be references to the "destination" person. Ideally, I woul... | [
"sql",
"t-sql",
"duplicate-data"
] | 1 | 3 | 907 | 4 | 0 | 2008-09-25T18:46:49.743000 | 2008-09-25T19:00:42.003000 |
135,183 | 135,227 | MS Access Data Access Limitations | I have a project right now where I'd like to be able to pull rows out of an Access database that a 3rd party product uses to store its information. There will likely be a small number of users hitting this database at the same time my "export" process does, so I'm a little concerned about data integrity and concurrent ... | There should no problem. Problems can occur only on concurrent write operations. The locking from MS Access based on file locks in the ldb file. The locks occur only on pages and not on the completely file. Because the locks are in the ldb file and not in the mdb file that there are no problems with parallel reading. | MS Access Data Access Limitations I have a project right now where I'd like to be able to pull rows out of an Access database that a 3rd party product uses to store its information. There will likely be a small number of users hitting this database at the same time my "export" process does, so I'm a little concerned ab... | TITLE:
MS Access Data Access Limitations
QUESTION:
I have a project right now where I'd like to be able to pull rows out of an Access database that a 3rd party product uses to store its information. There will likely be a small number of users hitting this database at the same time my "export" process does, so I'm a l... | [
"database",
"ms-access",
"ado.net",
"concurrency",
"data-access"
] | 1 | 3 | 728 | 3 | 0 | 2008-09-25T18:48:06.713000 | 2008-09-25T18:55:51.360000 |
135,188 | 206,477 | Source Control on the IBM i (iSeries) | On the web side we are working on getting source control. Now, I want to see what can be done for the iSeries side. What is your favorite source control application for iSeries and why? I am looking for low-cost if possible. | The two most common source control packages for the iSeries are Turnover and Aldon. Neither are low cost but integrate well with the iSeries. I prefer Turnover. It flawlessly handles production installs to both a local and remote iSeries. | Source Control on the IBM i (iSeries) On the web side we are working on getting source control. Now, I want to see what can be done for the iSeries side. What is your favorite source control application for iSeries and why? I am looking for low-cost if possible. | TITLE:
Source Control on the IBM i (iSeries)
QUESTION:
On the web side we are working on getting source control. Now, I want to see what can be done for the iSeries side. What is your favorite source control application for iSeries and why? I am looking for low-cost if possible.
ANSWER:
The two most common source con... | [
"version-control",
"ibm-midrange",
"rpgle"
] | 7 | 4 | 3,446 | 4 | 0 | 2008-09-25T18:49:16.663000 | 2008-10-15T21:01:51.617000 |
135,203 | 135,226 | What's the difference between JavaScript and JScript? | I have always wondered WHaT tHE HecK?!? is the difference between JScript and JavaScript. | Just different names for what is really ECMAScript. John Resig has a good explanation. Here's the full version breakdown: IE 6-7 support JScript 5 (which is equivalent to ECMAScript 3, JavaScript 1.5) IE 8 supports JScript 6 (which is equivalent to ECMAScript 3, JavaScript 1.5 - more bug fixes over JScript 5) Firefox 1... | What's the difference between JavaScript and JScript? I have always wondered WHaT tHE HecK?!? is the difference between JScript and JavaScript. | TITLE:
What's the difference between JavaScript and JScript?
QUESTION:
I have always wondered WHaT tHE HecK?!? is the difference between JScript and JavaScript.
ANSWER:
Just different names for what is really ECMAScript. John Resig has a good explanation. Here's the full version breakdown: IE 6-7 support JScript 5 (w... | [
"javascript",
"jscript"
] | 127 | 90 | 124,162 | 13 | 0 | 2008-09-25T18:52:02.430000 | 2008-09-25T18:55:38.287000 |
135,234 | 135,257 | Difference between ref and out parameters in .NET | What is the difference between ref and out parameters in.NET? What are the situations where one can be more useful than the other? What would be a code snippet where one can be used and another can't? | They're pretty much the same - the only difference is that a variable you pass as an out parameter doesn't need to be initialized but passing it as a ref parameter it has to be set to something. int x; Foo(out x); // OK
int y; Foo(ref y); // Error: y should be initialized before calling the method Ref parameters are f... | Difference between ref and out parameters in .NET What is the difference between ref and out parameters in.NET? What are the situations where one can be more useful than the other? What would be a code snippet where one can be used and another can't? | TITLE:
Difference between ref and out parameters in .NET
QUESTION:
What is the difference between ref and out parameters in.NET? What are the situations where one can be more useful than the other? What would be a code snippet where one can be used and another can't?
ANSWER:
They're pretty much the same - the only di... | [
"c#",
".net"
] | 411 | 510 | 271,370 | 17 | 0 | 2008-09-25T18:57:27.393000 | 2008-09-25T19:01:08.757000 |
135,243 | 135,251 | What's the best ASP.NET file type for a (non-SOAP, non-WSDL) web services project? | Haven't done ASP.NET development since VS 2003, so I'd like to save some time and learn from other's mistakes. Writing a web services app, but not a WSDL/SOAP/etc. -- more like REST + XML. Which of the many "New Item" options (Web Form, Generic Handler, ASP.NET Handler, etc.) makes the most sense if I want to handle di... | If you're not using the built in web services (.asmx), then you should probably use a generic handler (.ashx). | What's the best ASP.NET file type for a (non-SOAP, non-WSDL) web services project? Haven't done ASP.NET development since VS 2003, so I'd like to save some time and learn from other's mistakes. Writing a web services app, but not a WSDL/SOAP/etc. -- more like REST + XML. Which of the many "New Item" options (Web Form, ... | TITLE:
What's the best ASP.NET file type for a (non-SOAP, non-WSDL) web services project?
QUESTION:
Haven't done ASP.NET development since VS 2003, so I'd like to save some time and learn from other's mistakes. Writing a web services app, but not a WSDL/SOAP/etc. -- more like REST + XML. Which of the many "New Item" o... | [
"c#",
"asp.net",
"web-services"
] | 0 | 2 | 512 | 4 | 0 | 2008-09-25T18:59:08.340000 | 2008-09-25T19:00:29.150000 |
135,246 | 135,311 | Reading 32bit Packed Binary Data On 64bit System | I'm attempting to write a Python C extension that reads packed binary data (it is stored as structs of structs) and then parses it out into Python objects. Everything works as expected on a 32 bit machine (the binary files are always written on 32bit architecture), but not on a 64 bit box. Is there a "preferred" way of... | Explicitly specify that your data types (e.g. integers) are 32-bit. Otherwise if you have two integers next to each other when you read them they will be read as one 64-bit integer. When you are dealing with cross-platform issues, the two main things to watch out for are: Bitness. If your packed data is written with 32... | Reading 32bit Packed Binary Data On 64bit System I'm attempting to write a Python C extension that reads packed binary data (it is stored as structs of structs) and then parses it out into Python objects. Everything works as expected on a 32 bit machine (the binary files are always written on 32bit architecture), but n... | TITLE:
Reading 32bit Packed Binary Data On 64bit System
QUESTION:
I'm attempting to write a Python C extension that reads packed binary data (it is stored as structs of structs) and then parses it out into Python objects. Everything works as expected on a 32 bit machine (the binary files are always written on 32bit ar... | [
"python",
"c",
"64-bit"
] | 2 | 4 | 2,833 | 5 | 0 | 2008-09-25T18:59:41.990000 | 2008-09-25T19:07:22.487000 |
135,262 | 135,294 | How to preserve stack space with good design? | I'm programming in C for RAM limited embedded microcontroller with RTOS. I regularly break my code to short functions, but every function calling require to more stack memory. Every task needs his stack, and this is one of the significant memory consumers in the project. Is there an alternative to keep the code well or... | Try to make the call stack flatter, so instead of a() calling b() which calls c() which calls d(), have a() call b(), c(), and d() itself. If a function is only referenced once, mark it inline (assuming your compiler supports this). | How to preserve stack space with good design? I'm programming in C for RAM limited embedded microcontroller with RTOS. I regularly break my code to short functions, but every function calling require to more stack memory. Every task needs his stack, and this is one of the significant memory consumers in the project. Is... | TITLE:
How to preserve stack space with good design?
QUESTION:
I'm programming in C for RAM limited embedded microcontroller with RTOS. I regularly break my code to short functions, but every function calling require to more stack memory. Every task needs his stack, and this is one of the significant memory consumers ... | [
"c",
"memory",
"embedded",
"stack",
"rtos"
] | 12 | 11 | 3,330 | 10 | 0 | 2008-09-25T19:01:32.173000 | 2008-09-25T19:05:28.920000 |
135,269 | 135,298 | Can I run ASP.NET 2.0 and 3.5 code on the same website? | Can I run ASP.NET 2.0 and 3.5 code on the same website?...or, do I need to separate them by applications, and/or servers? | .NET 3.5 is 2.0 with a few extra libraries. So the answer is yes you can run them on the same web site. In fact you cannot even set a web application to run under 3.5. It just runs under 2.0. You can check the ASP.NET tab in the properties of an IIS site to see that there isn't even an option to run your application un... | Can I run ASP.NET 2.0 and 3.5 code on the same website? Can I run ASP.NET 2.0 and 3.5 code on the same website?...or, do I need to separate them by applications, and/or servers? | TITLE:
Can I run ASP.NET 2.0 and 3.5 code on the same website?
QUESTION:
Can I run ASP.NET 2.0 and 3.5 code on the same website?...or, do I need to separate them by applications, and/or servers?
ANSWER:
.NET 3.5 is 2.0 with a few extra libraries. So the answer is yes you can run them on the same web site. In fact you... | [
"asp.net"
] | 9 | 14 | 4,743 | 9 | 0 | 2008-09-25T19:02:10.457000 | 2008-09-25T19:05:36.237000 |
135,296 | 267,840 | Is MSVCRT under Windows like glibc (libc) under *nix? | I frequently come across Windows programs that bundle in MSVCRT (or their more current equivalents) with the program executables. On a typical PC, I would find many copies of the same.DLL's. My understanding is that MSVCRT is the C runtime library, somewhat analogous to glibc/libc.so under *nix. Why do Windows programs... | [I'm the current maintainer of the Native SxS technology at Microsoft] New versions of MSVCRT are released with new versions of Visual Studio, and reflect changes to the C++ toolset. So that programs compiled with versions of VS released after a particular version of Windows continue can work downlevel (such as VS 2008... | Is MSVCRT under Windows like glibc (libc) under *nix? I frequently come across Windows programs that bundle in MSVCRT (or their more current equivalents) with the program executables. On a typical PC, I would find many copies of the same.DLL's. My understanding is that MSVCRT is the C runtime library, somewhat analogou... | TITLE:
Is MSVCRT under Windows like glibc (libc) under *nix?
QUESTION:
I frequently come across Windows programs that bundle in MSVCRT (or their more current equivalents) with the program executables. On a typical PC, I would find many copies of the same.DLL's. My understanding is that MSVCRT is the C runtime library,... | [
"msvcrt",
"libc"
] | 31 | 21 | 13,034 | 4 | 0 | 2008-09-25T19:05:32.927000 | 2008-11-06T07:17:51.337000 |
135,299 | 135,457 | Sprite / Character animation in Silverlight (v2) | We have a Silverlight 2 project (game) that will require a lot of character animation. Can anyone suggest a good way to do this. Currently we plan to build the art in Illustrator, imported to Silverlight via Mike Snow's plug-in as this matches the skills our artists have. Is key framing the animations our only option h... | You can use the Clip property on the image itself or on a container for the image to display a specific piece of a larger image, like a sprite sheet. This may or may not be more performant than swapping pngs. Also you could use the ImageBrush on a Rectangle to show just what you want, this would probably be a bit more ... | Sprite / Character animation in Silverlight (v2) We have a Silverlight 2 project (game) that will require a lot of character animation. Can anyone suggest a good way to do this. Currently we plan to build the art in Illustrator, imported to Silverlight via Mike Snow's plug-in as this matches the skills our artists have... | TITLE:
Sprite / Character animation in Silverlight (v2)
QUESTION:
We have a Silverlight 2 project (game) that will require a lot of character animation. Can anyone suggest a good way to do this. Currently we plan to build the art in Illustrator, imported to Silverlight via Mike Snow's plug-in as this matches the skill... | [
"silverlight",
"animation",
"silverlight-2.0"
] | 4 | 3 | 2,196 | 3 | 0 | 2008-09-25T19:05:43.770000 | 2008-09-25T19:29:12.480000 |
135,303 | 135,318 | How can I closely achieve ?: from C++/C# in Python? | In C# I could easily write the following: string stringValue = string.IsNullOrEmpty( otherString )? defaultString: otherString; Is there a quick way of doing the same thing in Python or am I stuck with an 'if' statement? | In Python 2.5, there is A if C else B which behaves a lot like?: in C. However, it's frowned upon for two reasons: readability, and the fact that there's usually a simpler way to approach the problem. For instance, in your case: stringValue = otherString or defaultString | How can I closely achieve ?: from C++/C# in Python? In C# I could easily write the following: string stringValue = string.IsNullOrEmpty( otherString )? defaultString: otherString; Is there a quick way of doing the same thing in Python or am I stuck with an 'if' statement? | TITLE:
How can I closely achieve ?: from C++/C# in Python?
QUESTION:
In C# I could easily write the following: string stringValue = string.IsNullOrEmpty( otherString )? defaultString: otherString; Is there a quick way of doing the same thing in Python or am I stuck with an 'if' statement?
ANSWER:
In Python 2.5, there... | [
"python",
"syntax",
"ternary-operator",
"syntax-rules"
] | 12 | 24 | 1,383 | 9 | 0 | 2008-09-25T19:06:03.630000 | 2008-09-25T19:08:31.470000 |
135,314 | 135,380 | Which list<Object> implementation will be the fastest for one pass write, read, then destroy? | What is the fastest list implementation (in java) in a scenario where the list will be created one element at a time then at a later point be read one element at a time? The reads will be done with an iterator and then the list will then be destroyed. I know that the Big O notation for get is O(1) and add is O(1) for a... | It depends largely on whether you know the maximum size of each list up front. If you do, use ArrayList; it will certainly be faster. Otherwise, you'll probably have to profile. While access to the ArrayList is O(1), creating it is not as simple, because of dynamic resizing. Another point to consider is that the space-... | Which list<Object> implementation will be the fastest for one pass write, read, then destroy? What is the fastest list implementation (in java) in a scenario where the list will be created one element at a time then at a later point be read one element at a time? The reads will be done with an iterator and then the lis... | TITLE:
Which list<Object> implementation will be the fastest for one pass write, read, then destroy?
QUESTION:
What is the fastest list implementation (in java) in a scenario where the list will be created one element at a time then at a later point be read one element at a time? The reads will be done with an iterato... | [
"java",
"list",
"collections",
"big-o"
] | 27 | 30 | 43,572 | 8 | 0 | 2008-09-25T19:07:53.047000 | 2008-09-25T19:19:27.870000 |
135,317 | 208,792 | CherryPy server name tag | When running a CherryPy app it will send server name tag something like CherryPy/version. Is it possible to rename/overwrite that from the app without modifying CherryPy so it will show something else? Maybe something like MyAppName/version (CherryPy/version) | Actually asking on IRC on their official channel fumanchu gived me a more clean way to do this (using latest svn): import cherrypy from cherrypy import _cpwsgi_server class HelloWorld(object): def index(self): return "Hello World!" index.exposed = True
serverTag = "MyApp/%s (CherryPy/%s)" % ("1.2.3", cherrypy.__versio... | CherryPy server name tag When running a CherryPy app it will send server name tag something like CherryPy/version. Is it possible to rename/overwrite that from the app without modifying CherryPy so it will show something else? Maybe something like MyAppName/version (CherryPy/version) | TITLE:
CherryPy server name tag
QUESTION:
When running a CherryPy app it will send server name tag something like CherryPy/version. Is it possible to rename/overwrite that from the app without modifying CherryPy so it will show something else? Maybe something like MyAppName/version (CherryPy/version)
ANSWER:
Actually... | [
"cherrypy"
] | 7 | 5 | 2,418 | 3 | 0 | 2008-09-25T19:08:27.837000 | 2008-10-16T14:31:55.973000 |
135,330 | 138,033 | Mathematica Downvalue Lhs | Does anybody know if there is a built-in function in Mathematica for getting the lhs of downvalue rules (without any holding)? I know how to write the code to do it, but it seems basic enough for a built-in For example: a[1]=2; a[2]=3; BuiltInIDoNotKnowOf[a] returns {1,2} | This seems to work; not sure how useful it is, though: a[1] = 2 a[2] = 3 a[3] = 5 a[6] = 8 Part[DownValues[a], All, 1, 1, 1] | Mathematica Downvalue Lhs Does anybody know if there is a built-in function in Mathematica for getting the lhs of downvalue rules (without any holding)? I know how to write the code to do it, but it seems basic enough for a built-in For example: a[1]=2; a[2]=3; BuiltInIDoNotKnowOf[a] returns {1,2} | TITLE:
Mathematica Downvalue Lhs
QUESTION:
Does anybody know if there is a built-in function in Mathematica for getting the lhs of downvalue rules (without any holding)? I know how to write the code to do it, but it seems basic enough for a built-in For example: a[1]=2; a[2]=3; BuiltInIDoNotKnowOf[a] returns {1,2}
AN... | [
"wolfram-mathematica"
] | 10 | 9 | 2,514 | 2 | 0 | 2008-09-25T19:10:20.157000 | 2008-09-26T06:28:02.943000 |
135,339 | 135,508 | LinqToSql and WCF | Within an n-tier app that makes use of a WCF service to interact with the database, what is the best practice way of making use of LinqToSql classes throughout the app? I've seen it done a couple of different ways but they seemed like they burned a lot of hours creating extra interfaces, message classes, and the like w... | LINQ to SQL isn't really suitable for use with a distributed app. The change tracking and lazy loading is part of the DataContext which is tied to the database so cannot travel across the wire. You can move L2S entities across the wire, modify them, move them back and update the database by reattaching them to the Data... | LinqToSql and WCF Within an n-tier app that makes use of a WCF service to interact with the database, what is the best practice way of making use of LinqToSql classes throughout the app? I've seen it done a couple of different ways but they seemed like they burned a lot of hours creating extra interfaces, message class... | TITLE:
LinqToSql and WCF
QUESTION:
Within an n-tier app that makes use of a WCF service to interact with the database, what is the best practice way of making use of LinqToSql classes throughout the app? I've seen it done a couple of different ways but they seemed like they burned a lot of hours creating extra interfa... | [
"wcf",
"linq-to-sql"
] | 2 | 2 | 389 | 2 | 0 | 2008-09-25T19:10:53.820000 | 2008-09-25T19:37:10.543000 |
135,347 | 135,374 | Most common examples of misuse of singleton class | When should you NOT use a singleton class although it might be very tempting to do so? It would be very nice if we had a list of most common instances of 'singletonitis' that we should take care to avoid. | Do not use a singleton for something that might evolve into a multipliable resource. This probably sounds silly, but if you declare something a singleton you're making a very strong statement that it is absolutely unique. You're building code around it, more and more. And when you then find out after thousands of lines... | Most common examples of misuse of singleton class When should you NOT use a singleton class although it might be very tempting to do so? It would be very nice if we had a list of most common instances of 'singletonitis' that we should take care to avoid. | TITLE:
Most common examples of misuse of singleton class
QUESTION:
When should you NOT use a singleton class although it might be very tempting to do so? It would be very nice if we had a list of most common instances of 'singletonitis' that we should take care to avoid.
ANSWER:
Do not use a singleton for something t... | [
"language-agnostic",
"design-patterns",
"singleton"
] | 13 | 11 | 2,661 | 11 | 0 | 2008-09-25T19:12:16.140000 | 2008-09-25T19:18:42.007000 |
135,365 | 135,376 | Classic asp - When to use Response.flush? | We have a painfully slow report.I added a Response.flush and it seems a great deal better. What are some of the caveats of using this method. | If Response.Buffer is not set to true, then you'll get a run-time error. Also, If the Flush method is called on an ASP page, the server does not honor Keep-Alive requests for that page. You'll also want to look out if you're using a table-based design as it won't render in some browsers until the entire table is sent..... | Classic asp - When to use Response.flush? We have a painfully slow report.I added a Response.flush and it seems a great deal better. What are some of the caveats of using this method. | TITLE:
Classic asp - When to use Response.flush?
QUESTION:
We have a painfully slow report.I added a Response.flush and it seems a great deal better. What are some of the caveats of using this method.
ANSWER:
If Response.Buffer is not set to true, then you'll get a run-time error. Also, If the Flush method is called ... | [
"asp-classic"
] | 9 | 9 | 24,564 | 4 | 0 | 2008-09-25T19:16:55.177000 | 2008-09-25T19:19:08.747000 |
135,373 | 135,394 | Would performance suffer using autoload in php and searching for the class file? | I've always struggled with how to best include classes into my php code. Pathing is usually an issue but a few minutes ago i found this question which dramatically helps that. Now I'm reading about __autoload and thinking that it could make the process of developing my applications much easier. The problem is i like to... | __autoload is great, but the cost of stating all the files in a recursive search function is expensive. You might want to look at building a tree of files to use for autoloading. In my framework, I consistently name files for their classes and use a map that is cached for the data. Check out http://trac.framewerk.org/c... | Would performance suffer using autoload in php and searching for the class file? I've always struggled with how to best include classes into my php code. Pathing is usually an issue but a few minutes ago i found this question which dramatically helps that. Now I'm reading about __autoload and thinking that it could mak... | TITLE:
Would performance suffer using autoload in php and searching for the class file?
QUESTION:
I've always struggled with how to best include classes into my php code. Pathing is usually an issue but a few minutes ago i found this question which dramatically helps that. Now I'm reading about __autoload and thinking... | [
"php",
"performance"
] | 9 | 6 | 5,678 | 7 | 0 | 2008-09-25T19:18:34.923000 | 2008-09-25T19:21:36.260000 |
135,375 | 135,951 | How do I make a WPF data template fill the entire width of the listbox? | I have a ListBox DataTemplate in WPF. I want one item to be tight against the left side of the ListBox and another item to be tight against the right side, but I can't figure out how to do this. So far I have a Grid with three columns, the left and right ones have content and the center is a placeholder with it's width... | I also had to set: HorizontalContentAlignment="Stretch" on the containing ListBox. | How do I make a WPF data template fill the entire width of the listbox? I have a ListBox DataTemplate in WPF. I want one item to be tight against the left side of the ListBox and another item to be tight against the right side, but I can't figure out how to do this. So far I have a Grid with three columns, the left and... | TITLE:
How do I make a WPF data template fill the entire width of the listbox?
QUESTION:
I have a ListBox DataTemplate in WPF. I want one item to be tight against the left side of the ListBox and another item to be tight against the right side, but I can't figure out how to do this. So far I have a Grid with three col... | [
"wpf",
"layout",
"listbox",
"datatemplate"
] | 66 | 152 | 60,720 | 8 | 0 | 2008-09-25T19:18:44.520000 | 2008-09-25T20:45:33.467000 |
135,384 | 139,401 | How can I build Slickedit tags on command line? | I want to be able to generate slickedit tags on the commmand line, as soon as I sync a project from revision control - so via a script. Any way to do this? | See this topic http://community.slickedit.com/index.php?topic=253.0 | How can I build Slickedit tags on command line? I want to be able to generate slickedit tags on the commmand line, as soon as I sync a project from revision control - so via a script. Any way to do this? | TITLE:
How can I build Slickedit tags on command line?
QUESTION:
I want to be able to generate slickedit tags on the commmand line, as soon as I sync a project from revision control - so via a script. Any way to do this?
ANSWER:
See this topic http://community.slickedit.com/index.php?topic=253.0 | [
"tags",
"slickedit"
] | 1 | 1 | 931 | 1 | 0 | 2008-09-25T19:20:25.980000 | 2008-09-26T13:09:51.003000 |
135,412 | 135,589 | How can I design an ASP.NET website delaying the style/theme? | I need to build a prototype for an intranet website, and I want to focus on usability (layout, navigability, etc) and leave the theme for later (I have very bad taste, so this will probably be done by someone else) I know about ASP.NET's capability of switching themes instantly, but how do I have to design the WebForms... | If you're planning on using ASP.NET Themes, then you can design all of the controls generically and add Skins later on. Depending on the complexity of the design (meaning how many different styles you have for textboxes or gridviews, etc), this might not save you a lot of work, but it's one way to use the built-in.Net ... | How can I design an ASP.NET website delaying the style/theme? I need to build a prototype for an intranet website, and I want to focus on usability (layout, navigability, etc) and leave the theme for later (I have very bad taste, so this will probably be done by someone else) I know about ASP.NET's capability of switch... | TITLE:
How can I design an ASP.NET website delaying the style/theme?
QUESTION:
I need to build a prototype for an intranet website, and I want to focus on usability (layout, navigability, etc) and leave the theme for later (I have very bad taste, so this will probably be done by someone else) I know about ASP.NET's ca... | [
"asp.net"
] | 3 | 2 | 640 | 4 | 0 | 2008-09-25T19:22:55.490000 | 2008-09-25T19:52:01.023000 |
135,427 | 135,497 | Rails and Flex to build an RIA | Any thoughts on using Flex to build an RIA for administering a complex rails app? We are starting to find it difficult using ajax to keep our admin section intuitive and easy for users to work with. | You've got RoR guys working on this program and you've managed to develop a complex rails app that has enough subtleties that the admin section is difficult to use. The answer to this problem is not to use a different programming language to create a whole nother kinda app to do the admin. It will help more to get assi... | Rails and Flex to build an RIA Any thoughts on using Flex to build an RIA for administering a complex rails app? We are starting to find it difficult using ajax to keep our admin section intuitive and easy for users to work with. | TITLE:
Rails and Flex to build an RIA
QUESTION:
Any thoughts on using Flex to build an RIA for administering a complex rails app? We are starting to find it difficult using ajax to keep our admin section intuitive and easy for users to work with.
ANSWER:
You've got RoR guys working on this program and you've managed ... | [
"ruby-on-rails",
"ruby",
"apache-flex"
] | 3 | 4 | 362 | 5 | 0 | 2008-09-25T19:24:46.907000 | 2008-09-25T19:35:27.163000 |
135,443 | 135,482 | How do I use reflection to invoke a private method? | There are a group of private methods in my class, and I need to call one dynamically based on an input value. Both the invoking code and the target methods are in the same instance. The code looks like this: MethodInfo dynMethod = this.GetType().GetMethod("Draw_" + itemType); dynMethod.Invoke(this, new object[] { metho... | Simply change your code to use the overloaded version of GetMethod that accepts BindingFlags: MethodInfo dynMethod = this.GetType().GetMethod("Draw_" + itemType, BindingFlags.NonPublic | BindingFlags.Instance); dynMethod.Invoke(this, new object[] { methodParams }); Here's the BindingFlags enumeration documentation. | How do I use reflection to invoke a private method? There are a group of private methods in my class, and I need to call one dynamically based on an input value. Both the invoking code and the target methods are in the same instance. The code looks like this: MethodInfo dynMethod = this.GetType().GetMethod("Draw_" + it... | TITLE:
How do I use reflection to invoke a private method?
QUESTION:
There are a group of private methods in my class, and I need to call one dynamically based on an input value. Both the invoking code and the target methods are in the same instance. The code looks like this: MethodInfo dynMethod = this.GetType().GetM... | [
"c#",
".net",
"reflection",
"private-methods"
] | 383 | 596 | 225,846 | 12 | 0 | 2008-09-25T19:26:14.377000 | 2008-09-25T19:33:11.583000 |
135,445 | 135,763 | How can I detect if there is a floppy in a drive? | I tried to use DriveInfo.IsReady, but it returns false if an unformatted floppy is in the drive. | You can always try to read a sector from the floppy and see if it succeeds or not. I have no clue how to do it in.NET, but here is the C/C++ equivalent. SetLastError(0); HANDLE h = CreateFile("\\\\.\\A:",...); if (!ReadFile(h, buf, 512, &bytes_read, 0)) { DWORD err = GetLastError(); } CreateFile, ReadFile | How can I detect if there is a floppy in a drive? I tried to use DriveInfo.IsReady, but it returns false if an unformatted floppy is in the drive. | TITLE:
How can I detect if there is a floppy in a drive?
QUESTION:
I tried to use DriveInfo.IsReady, but it returns false if an unformatted floppy is in the drive.
ANSWER:
You can always try to read a sector from the floppy and see if it succeeds or not. I have no clue how to do it in.NET, but here is the C/C++ equiv... | [
".net"
] | 5 | 3 | 1,350 | 7 | 0 | 2008-09-25T19:26:28.790000 | 2008-09-25T20:17:37.030000 |
135,448 | 136,411 | How do I check if an object has a specific property in JavaScript? | How do I check if an object has a specific property in JavaScript? Consider: x = {'key': 1}; if ( x.hasOwnProperty('key') ) { //Do this } Is that the best way to do it? | 2022 UPDATE Object.hasOwn() Object.hasOwn() is recommended over Object.hasOwnProperty() because it works for objects created using Object.create(null) and with objects that have overridden the inherited hasOwnProperty() method. While it is possible to workaround these problems by calling Object.prototype.hasOwnProperty... | How do I check if an object has a specific property in JavaScript? How do I check if an object has a specific property in JavaScript? Consider: x = {'key': 1}; if ( x.hasOwnProperty('key') ) { //Do this } Is that the best way to do it? | TITLE:
How do I check if an object has a specific property in JavaScript?
QUESTION:
How do I check if an object has a specific property in JavaScript? Consider: x = {'key': 1}; if ( x.hasOwnProperty('key') ) { //Do this } Is that the best way to do it?
ANSWER:
2022 UPDATE Object.hasOwn() Object.hasOwn() is recommende... | [
"javascript"
] | 1,841 | 1,727 | 1,369,448 | 33 | 0 | 2008-09-25T19:27:06.980000 | 2008-09-25T21:52:02.747000 |
135,451 | 135,464 | Can I use a List<T> as a collection of method pointers? (C#) | I want to create a list of methods to execute. Each method has the same signature. I thought about putting delegates in a generic collection, but I keep getting this error: 'method' is a 'variable' but is used like a 'method' In theory, here is what I would like to do: List methodsToExecute;
int Add(int x, int y) { re... | You need to cast the object in the list to a BinaryOp, or, better, use a more specific type parameter for the list: delegate int BinaryOp(int x, int y);
List methodsToExecute = new List ();
methodsToExecute.add(Add); methodsToExecute.add(Subtract);
foreach(BinaryOp method in methodsToExecute) { method(1,2); } | Can I use a List<T> as a collection of method pointers? (C#) I want to create a list of methods to execute. Each method has the same signature. I thought about putting delegates in a generic collection, but I keep getting this error: 'method' is a 'variable' but is used like a 'method' In theory, here is what I would l... | TITLE:
Can I use a List<T> as a collection of method pointers? (C#)
QUESTION:
I want to create a list of methods to execute. Each method has the same signature. I thought about putting delegates in a generic collection, but I keep getting this error: 'method' is a 'variable' but is used like a 'method' In theory, here... | [
"c#",
"generics",
"delegates"
] | 6 | 15 | 532 | 7 | 0 | 2008-09-25T19:27:25.870000 | 2008-09-25T19:29:48.953000 |
135,458 | 135,922 | Will pthread_detach manage my memory for me? | Suppose I have the following code: while(TRUE) { pthread_t *thread = (pthread_t *) malloc(sizeof(pthread_t)); pthread_create(thread, NULL, someFunction, someArgument); pthread_detach(*thread); sleep(10); } Will the detached thread free the memory allocated by malloc, or is that something I now have to do? | No. pthread_create() has no way of knowing that the thread pointer passed to it was dynamically allocated. pthreads doesn't use this value internally; it simply returns the new thread id to the caller. You don't need to dynamically allocate that value; you can pass the address of a local variable instead: pthread_t thr... | Will pthread_detach manage my memory for me? Suppose I have the following code: while(TRUE) { pthread_t *thread = (pthread_t *) malloc(sizeof(pthread_t)); pthread_create(thread, NULL, someFunction, someArgument); pthread_detach(*thread); sleep(10); } Will the detached thread free the memory allocated by malloc, or is t... | TITLE:
Will pthread_detach manage my memory for me?
QUESTION:
Suppose I have the following code: while(TRUE) { pthread_t *thread = (pthread_t *) malloc(sizeof(pthread_t)); pthread_create(thread, NULL, someFunction, someArgument); pthread_detach(*thread); sleep(10); } Will the detached thread free the memory allocated ... | [
"c",
"multithreading",
"memory-management",
"malloc",
"pthreads"
] | 3 | 10 | 1,856 | 2 | 0 | 2008-09-25T19:29:13.400000 | 2008-09-25T20:43:08.870000 |
135,474 | 137,850 | What happens when you try to free() already freed memory in c? | For example: char * myString = malloc(sizeof(char)*STRING_BUFFER_SIZE); free(myString); free(myString); Are there any adverse side effects of doing this? | Here's the chapter and verse. If the argument [to the free function] does not match a pointer earlier returned by the calloc, malloc, or realloc function, or if the space has been deallocated by a call to free or realloc, the behavior is undefined. ( ISO 9899:1999 - Programming languages — C, Section 7.20.3.2) | What happens when you try to free() already freed memory in c? For example: char * myString = malloc(sizeof(char)*STRING_BUFFER_SIZE); free(myString); free(myString); Are there any adverse side effects of doing this? | TITLE:
What happens when you try to free() already freed memory in c?
QUESTION:
For example: char * myString = malloc(sizeof(char)*STRING_BUFFER_SIZE); free(myString); free(myString); Are there any adverse side effects of doing this?
ANSWER:
Here's the chapter and verse. If the argument [to the free function] does no... | [
"c",
"memory",
"memory-management"
] | 37 | 41 | 21,946 | 14 | 0 | 2008-09-25T19:32:21.070000 | 2008-09-26T04:59:28.553000 |
135,478 | 135,502 | How do you measure the progress of a web service call? | I have an ASP.NET web service which does some heavy lifting, like say,some file operations, or generating Excel Sheets from a bunch of crystal reports. I don't want to be blocked by calling this web service, so i want to make the web service call asynchronous. Also, I want to call this web service from a web page, and ... | Write a separate method on the server that you can query by passing the ID of the job that has been scheduled and which returns an approximate value between 0-100 (or 0.0 and 1.0, or whatever) of how far along it is. E.g. in REST-style, you could make a GET request to http://yourserver.com/app/jobstatus/4133/ which wou... | How do you measure the progress of a web service call? I have an ASP.NET web service which does some heavy lifting, like say,some file operations, or generating Excel Sheets from a bunch of crystal reports. I don't want to be blocked by calling this web service, so i want to make the web service call asynchronous. Also... | TITLE:
How do you measure the progress of a web service call?
QUESTION:
I have an ASP.NET web service which does some heavy lifting, like say,some file operations, or generating Excel Sheets from a bunch of crystal reports. I don't want to be blocked by calling this web service, so i want to make the web service call ... | [
"ajax",
"web-services",
"asp.net-ajax",
"asynchronous"
] | 6 | 4 | 10,118 | 6 | 0 | 2008-09-25T19:32:37.730000 | 2008-09-25T19:36:14.960000 |
135,518 | 135,638 | Using WPF, what is the best method to update the background for a custom button control? | In WPF, we are creating custom controls that inherit from button with completely drawn-from-scratch xaml graphics. We have a border around the entire button xaml and we'd like to use that as the location for updating the background when MouseOver=True in a trigger. What we need to know is how do we update the backgroun... | In your ControlTemplate, give the Border a Name and you can then reference that part of its visual tree in the triggers. Here's a very brief example of restyling a normal Button: If that doesn't help, we'll need to know more, probably seeing your own XAML. Your description doesn't make it very clear to me what your act... | Using WPF, what is the best method to update the background for a custom button control? In WPF, we are creating custom controls that inherit from button with completely drawn-from-scratch xaml graphics. We have a border around the entire button xaml and we'd like to use that as the location for updating the background... | TITLE:
Using WPF, what is the best method to update the background for a custom button control?
QUESTION:
In WPF, we are creating custom controls that inherit from button with completely drawn-from-scratch xaml graphics. We have a border around the entire button xaml and we'd like to use that as the location for updat... | [
"wpf",
"button",
"triggers",
"mouseover"
] | 1 | 3 | 2,542 | 2 | 0 | 2008-09-25T19:39:51.893000 | 2008-09-25T19:59:26.557000 |
135,526 | 135,945 | In Access 2003, problem with a memo field if and only if there is a filter on the PK and a sub query is joined | I have a problem in a query in Acess 2003 (SP3). I have a query that includes some tables and a sub query. The sub query and tables are all joined to a main table. The query uses some aggregate functions and there is a HAVING clause that filters the result on the primary key (PK). Under these conditions, a memo field o... | MSAccess Memo fields truncated to 255 characters (before Access 2000, wouldn't work at all) in GROUP BY queries. However, to take care of the apparent bug try this: Instead of MemoField use Left([MemoField,255) | In Access 2003, problem with a memo field if and only if there is a filter on the PK and a sub query is joined I have a problem in a query in Acess 2003 (SP3). I have a query that includes some tables and a sub query. The sub query and tables are all joined to a main table. The query uses some aggregate functions and t... | TITLE:
In Access 2003, problem with a memo field if and only if there is a filter on the PK and a sub query is joined
QUESTION:
I have a problem in a query in Acess 2003 (SP3). I have a query that includes some tables and a sub query. The sub query and tables are all joined to a main table. The query uses some aggrega... | [
"sql",
"ms-access"
] | 0 | 2 | 2,274 | 1 | 0 | 2008-09-25T19:40:36.290000 | 2008-09-25T20:45:06.307000 |
135,530 | 135,724 | Will my index be used if all columns are not used? | I have an index on columns A, B, C, D of table T I have a query that pulls from T with A, B, C in the WHERE clause. Will the index be used or will a separate index be needed that only includes A, B, C? | David B is right that you should check the execution plan to verify the index is being used. Will the index be used or will a separate index be needed that only includes A, B, C? To answer this last part of the question, which I think is the core underlying topic (as opposed to the immediate solution), there is *almost... | Will my index be used if all columns are not used? I have an index on columns A, B, C, D of table T I have a query that pulls from T with A, B, C in the WHERE clause. Will the index be used or will a separate index be needed that only includes A, B, C? | TITLE:
Will my index be used if all columns are not used?
QUESTION:
I have an index on columns A, B, C, D of table T I have a query that pulls from T with A, B, C in the WHERE clause. Will the index be used or will a separate index be needed that only includes A, B, C?
ANSWER:
David B is right that you should check t... | [
"sql",
"sql-server",
"sql-execution-plan"
] | 22 | 16 | 10,647 | 8 | 0 | 2008-09-25T19:42:28.220000 | 2008-09-25T20:11:25.327000 |
135,533 | 427,321 | MS CRM Development Projects | The shop that I am working part time with is new to Microsoft CRM. I just want to survey what projects have developers done to the system to extend its capabilities. | I can break the work I did into four sections: Tailoring - Simple field level changes. A lot of this is just making sure the fields and language suited the business I was developing for. Customisation - More complex changes, generally needing JavaScript and maybe ASP.NET. Some examples would be to use an IFrame and pas... | MS CRM Development Projects The shop that I am working part time with is new to Microsoft CRM. I just want to survey what projects have developers done to the system to extend its capabilities. | TITLE:
MS CRM Development Projects
QUESTION:
The shop that I am working part time with is new to Microsoft CRM. I just want to survey what projects have developers done to the system to extend its capabilities.
ANSWER:
I can break the work I did into four sections: Tailoring - Simple field level changes. A lot of thi... | [
"integration",
"dynamics-crm"
] | 0 | 1 | 640 | 5 | 0 | 2008-09-25T19:42:42.947000 | 2009-01-09T07:28:39.690000 |
135,534 | 135,795 | How would you easily validate a JSP option pick list? | I need to validate this simple pick list: Select an option... Lorem ipsum dolor sit amet So the user would never submit the form with the, excuse the repetition, "Select an option..." option selected. In principle I'm allowed to use JavaScript but It'd be interesting to learn how to solve it within JSP too. | You can never really satisfy the condition 'never submit a given value' because you don't have control over the client side. The user can always manipulate HTML to submit whatever they want. It is a good approach is to use JavaScript to do client-side validation and give the user quick feedback and catch 99%+ of the ca... | How would you easily validate a JSP option pick list? I need to validate this simple pick list: Select an option... Lorem ipsum dolor sit amet So the user would never submit the form with the, excuse the repetition, "Select an option..." option selected. In principle I'm allowed to use JavaScript but It'd be interestin... | TITLE:
How would you easily validate a JSP option pick list?
QUESTION:
I need to validate this simple pick list: Select an option... Lorem ipsum dolor sit amet So the user would never submit the form with the, excuse the repetition, "Select an option..." option selected. In principle I'm allowed to use JavaScript but ... | [
"java",
"validation",
"jsp",
"xhtml",
"forms"
] | 1 | 2 | 3,687 | 3 | 0 | 2008-09-25T19:42:50.343000 | 2008-09-25T20:24:26.373000 |
135,535 | 135,633 | What are the benefits of OO programming? Will it help me write better code? | I'm a PHPer, and am not writing object-oriented code. What are the advantages of OO over procedural code, and where can I learn how to apply these ideas to PHP? | It doesn't help you automatically. You can write worse "OO" programs than structural programs, and vice versa. OOP is a tool which allows you to create more powerful abstractions. As with every powerful tool, you have to use it properly. As with every powerful tool, it takes time to learn how to use it properly. As wit... | What are the benefits of OO programming? Will it help me write better code? I'm a PHPer, and am not writing object-oriented code. What are the advantages of OO over procedural code, and where can I learn how to apply these ideas to PHP? | TITLE:
What are the benefits of OO programming? Will it help me write better code?
QUESTION:
I'm a PHPer, and am not writing object-oriented code. What are the advantages of OO over procedural code, and where can I learn how to apply these ideas to PHP?
ANSWER:
It doesn't help you automatically. You can write worse "... | [
"php",
"oop"
] | 28 | 42 | 6,615 | 19 | 0 | 2008-09-25T19:42:52.340000 | 2008-09-25T19:59:02.253000 |
135,539 | 135,572 | Best place to Sort a List of Tasks | Im building a web application which is a process management app. Several different employee types will be shown a list of Tasks to do and as each one completes a task then it is moved on to the next employee to work on. The Task hierarchy is Batch > Load > Assembly > Part > Task. There are currently 8 rules for determi... | It is difficult to determine from the details in the question. However, putting your logic in a business logic (middle) layer will mean that your business rules can continue to use the same code no matter what the back-end database may be. At the moment you specify T-SQL but is it possible that in the future you will m... | Best place to Sort a List of Tasks Im building a web application which is a process management app. Several different employee types will be shown a list of Tasks to do and as each one completes a task then it is moved on to the next employee to work on. The Task hierarchy is Batch > Load > Assembly > Part > Task. Ther... | TITLE:
Best place to Sort a List of Tasks
QUESTION:
Im building a web application which is a process management app. Several different employee types will be shown a list of Tasks to do and as each one completes a task then it is moved on to the next employee to work on. The Task hierarchy is Batch > Load > Assembly >... | [
"oop",
"data-structures",
"sorting",
"collections"
] | 0 | 3 | 158 | 2 | 0 | 2008-09-25T19:43:40.370000 | 2008-09-25T19:49:30.390000 |
135,543 | 135,631 | How can I repair "upgraded" subversion working directories? | It may sound stupid, but sometimes I run into version conflicts between two versions of subversion. I mount a directory on a development server with sshfs and then edit the code with my local Vim. For subversion stuff like updating, committing etc. I ssh on the server and do it there. However, sometimes I mix up my she... | Maybe this FAQ-entry could be helpful: http://subversion.tigris.org/faq.html#working-copy-format-change | How can I repair "upgraded" subversion working directories? It may sound stupid, but sometimes I run into version conflicts between two versions of subversion. I mount a directory on a development server with sshfs and then edit the code with my local Vim. For subversion stuff like updating, committing etc. I ssh on th... | TITLE:
How can I repair "upgraded" subversion working directories?
QUESTION:
It may sound stupid, but sometimes I run into version conflicts between two versions of subversion. I mount a directory on a development server with sshfs and then edit the code with my local Vim. For subversion stuff like updating, committin... | [
"svn",
"version",
"conflict"
] | 1 | 1 | 1,237 | 2 | 0 | 2008-09-25T19:44:20.557000 | 2008-09-25T19:58:33.347000 |
135,556 | 138,481 | How do I interpret error codes from FrontPage Extensions? | Wrong answer was autoselected by the stupid bounty system. I'm using front page extensions to interact with SharePoint Services 3.0 as described here. In most samples I have seen the client simply looks for particular English strings in the result and uses that to determine if an error has occurred. However, I am writi... | I guess it refers to this list of "standard" system error codes: http://msdn.microsoft.com/en-us/library/ms681381(VS.85).aspx | How do I interpret error codes from FrontPage Extensions? Wrong answer was autoselected by the stupid bounty system. I'm using front page extensions to interact with SharePoint Services 3.0 as described here. In most samples I have seen the client simply looks for particular English strings in the result and uses that ... | TITLE:
How do I interpret error codes from FrontPage Extensions?
QUESTION:
Wrong answer was autoselected by the stupid bounty system. I'm using front page extensions to interact with SharePoint Services 3.0 as described here. In most samples I have seen the client simply looks for particular English strings in the res... | [
"asp.net",
"sharepoint",
"error-handling",
"frontpage"
] | 5 | 3 | 1,010 | 1 | 0 | 2008-09-25T19:46:07.713000 | 2008-09-26T09:35:21.417000 |
135,591 | 135,627 | How can I track the sales rank of an item on Amazon programmatically? | I've seen several products that will track the sales rank of an item on Amazon. Does Amazon have any web-services published that I can use to get the sales rank of a particular item? I've looked through the AWS and didn't see anything of that nature. | You should be able to determine the Sales Rank by querying for the SalesRank response group when doing an ItemLookup with the Amazon Associates Web Service. Example query: http://ecs.amazonaws.com/onca/xml? Service=AWSECommerceService& AWSAccessKeyId=[AWS Access Key ID]& Operation=ItemLookup& ItemId=0976925524& Respons... | How can I track the sales rank of an item on Amazon programmatically? I've seen several products that will track the sales rank of an item on Amazon. Does Amazon have any web-services published that I can use to get the sales rank of a particular item? I've looked through the AWS and didn't see anything of that nature. | TITLE:
How can I track the sales rank of an item on Amazon programmatically?
QUESTION:
I've seen several products that will track the sales rank of an item on Amazon. Does Amazon have any web-services published that I can use to get the sales rank of a particular item? I've looked through the AWS and didn't see anythi... | [
"amazon-web-services"
] | 3 | 5 | 5,295 | 2 | 0 | 2008-09-25T19:52:25.623000 | 2008-09-25T19:57:47.280000 |
135,600 | 135,924 | Reproducing the blocked exe "unblock" option in file properties in windows 2003 | When I download my program from my website to my windows 2003 machine, it has a block on it and you have to right click on the exe, then properties, then select the button "Unblock". I would like to add detection in my installer for when the file is blocked and hence doesn't have enough permissions. But I can't eaisly ... | This is done using NTFS File Streams. There is a stream named "Zone.Identifier" added to downloaded files. When IE7 downloads certain types of file that stream contains: [ZoneTransfer] ZoneId=3 The simplest way to set it is to create a text file with those contents in it, and use more to add it to the alternate stream.... | Reproducing the blocked exe "unblock" option in file properties in windows 2003 When I download my program from my website to my windows 2003 machine, it has a block on it and you have to right click on the exe, then properties, then select the button "Unblock". I would like to add detection in my installer for when th... | TITLE:
Reproducing the blocked exe "unblock" option in file properties in windows 2003
QUESTION:
When I download my program from my website to my windows 2003 machine, it has a block on it and you have to right click on the exe, then properties, then select the button "Unblock". I would like to add detection in my ins... | [
"security",
"windows-server-2003",
"nsis"
] | 10 | 21 | 9,670 | 3 | 0 | 2008-09-25T19:53:28.087000 | 2008-09-25T20:43:09.357000 |
135,628 | 136,236 | What's the difference between a midlet and a corelet? | It's my understanding that a corelet is a Motorola-ism, but does anyone know what the difference is? Do corelets have certain abilities that midlets don't? | I believe a corelet is a midlet that has full read access to the phone's internal file system... There's probably something else, but I can't remember it... I'll see if I can find any further info After searching around, it seems they basically add functionality to the phone, rather than run on top of it as a separate ... | What's the difference between a midlet and a corelet? It's my understanding that a corelet is a Motorola-ism, but does anyone know what the difference is? Do corelets have certain abilities that midlets don't? | TITLE:
What's the difference between a midlet and a corelet?
QUESTION:
It's my understanding that a corelet is a Motorola-ism, but does anyone know what the difference is? Do corelets have certain abilities that midlets don't?
ANSWER:
I believe a corelet is a midlet that has full read access to the phone's internal f... | [
"java",
"java-me",
"midlet"
] | 0 | 3 | 353 | 1 | 0 | 2008-09-25T19:57:51.273000 | 2008-09-25T21:22:35.453000 |
135,634 | 135,684 | Class design vs. IDE: Are nonmember nonfriend functions really worth it? | In the (otherwise) excellent book C++ Coding Standards, Item 44, titled "Prefer writing nonmember nonfriend functions", Sutter and Alexandrescu recommend that only functions that really need access to the members of a class be themselves members of that class. All other operations which can be written by using only mem... | I'm going to have to disagree with Sutter and Alexandrescu on this one. I think if the behavior of function foo() falls within the realm of class Bar 's responsibilities, then foo() should be part of bar(). The fact that foo() doesn't need direct access to Bar 's member data doesn't mean it isn't conceptually part of B... | Class design vs. IDE: Are nonmember nonfriend functions really worth it? In the (otherwise) excellent book C++ Coding Standards, Item 44, titled "Prefer writing nonmember nonfriend functions", Sutter and Alexandrescu recommend that only functions that really need access to the members of a class be themselves members o... | TITLE:
Class design vs. IDE: Are nonmember nonfriend functions really worth it?
QUESTION:
In the (otherwise) excellent book C++ Coding Standards, Item 44, titled "Prefer writing nonmember nonfriend functions", Sutter and Alexandrescu recommend that only functions that really need access to the members of a class be th... | [
"c++",
"ide",
"function",
"class-design",
"friend"
] | 5 | 3 | 926 | 7 | 0 | 2008-09-25T19:59:16.433000 | 2008-09-25T20:06:27.680000 |
135,642 | 135,681 | how to add a simple message to a php-gtk statusbar? | I have a simple GtkStatusBar created with glade,and want to add a simple message with the date of the last update of the database (just a simple and plain date). I don't want to use the whole stacks, context and all the other things that gtk developers put on the statusbar code. (I could simply use a label but I would ... | try http://www.kksou.com/php-gtk2/articles/have-a-status-area-using-GtkStatusbar.php To display a message, we need to first get a message id with GtkStatusbar::get_context_id(), then display the message with GtkStatusbar::push(). | how to add a simple message to a php-gtk statusbar? I have a simple GtkStatusBar created with glade,and want to add a simple message with the date of the last update of the database (just a simple and plain date). I don't want to use the whole stacks, context and all the other things that gtk developers put on the stat... | TITLE:
how to add a simple message to a php-gtk statusbar?
QUESTION:
I have a simple GtkStatusBar created with glade,and want to add a simple message with the date of the last update of the database (just a simple and plain date). I don't want to use the whole stacks, context and all the other things that gtk develope... | [
"gtk2",
"php-gtk"
] | 0 | 0 | 520 | 1 | 0 | 2008-09-25T20:00:07.023000 | 2008-09-25T20:06:03.360000 |
135,653 | 135,692 | Difference between drop table and truncate table? | I have some tables that I build as a part of my report rollup. I don't need them afterwards at all. Someone mentioned to truncate them as it would be faster. | Deleting records from a table logs every deletion and executes delete triggers for the records deleted. Truncate is a more powerful command that empties a table without logging each row. SQL Server prevents you from truncating a table with foreign keys referencing it, because of the need to check the foreign keys on ea... | Difference between drop table and truncate table? I have some tables that I build as a part of my report rollup. I don't need them afterwards at all. Someone mentioned to truncate them as it would be faster. | TITLE:
Difference between drop table and truncate table?
QUESTION:
I have some tables that I build as a part of my report rollup. I don't need them afterwards at all. Someone mentioned to truncate them as it would be faster.
ANSWER:
Deleting records from a table logs every deletion and executes delete triggers for th... | [
"sql",
"sql-server",
"sybase"
] | 83 | 105 | 207,113 | 19 | 0 | 2008-09-25T20:02:31.760000 | 2008-09-25T20:07:38.177000 |
135,661 | 135,800 | What are the Pros and Cons of using Global.asax? | Let's collect some tips for evaluating the appropriate use of global.asax. | It's simple to use if your session and application initialization code is very small and application-specific. Using an HttpModule is more useful if you want to reuse code, such as setting up rules for URL rewriting, redirects or auth. An HttpModule can cover everything a Global.asax file can. They can also be removed ... | What are the Pros and Cons of using Global.asax? Let's collect some tips for evaluating the appropriate use of global.asax. | TITLE:
What are the Pros and Cons of using Global.asax?
QUESTION:
Let's collect some tips for evaluating the appropriate use of global.asax.
ANSWER:
It's simple to use if your session and application initialization code is very small and application-specific. Using an HttpModule is more useful if you want to reuse co... | [
"asp.net"
] | 7 | 3 | 1,753 | 10 | 0 | 2008-09-25T20:03:51.680000 | 2008-09-25T20:24:55.280000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.