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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
36,197 | 36,253 | ASP.NET MVC: Structuring Controllers | So I'm embarking on an ASP.NET MVC project and while the experience has been a good one overall, I'm not quite as pleased with the spaghetti mess that my controllers have become. I've looked around online (CodeCampServer, etc...) and they all seem to suffer the same issue wherein controller methods violate SRP (single ... | ASP.NET Preview 5 (available on CodePlex ) has an answer for this: the [AcceptVerbs] attribute. Phil Haack has a blog post discussion how it's used. As for the view data magic key question, it's an interesting problem. If you think of a view as being a bunch of semi-independent components (especially in light of the ne... | ASP.NET MVC: Structuring Controllers So I'm embarking on an ASP.NET MVC project and while the experience has been a good one overall, I'm not quite as pleased with the spaghetti mess that my controllers have become. I've looked around online (CodeCampServer, etc...) and they all seem to suffer the same issue wherein co... | TITLE:
ASP.NET MVC: Structuring Controllers
QUESTION:
So I'm embarking on an ASP.NET MVC project and while the experience has been a good one overall, I'm not quite as pleased with the spaghetti mess that my controllers have become. I've looked around online (CodeCampServer, etc...) and they all seem to suffer the sam... | [
"c#",
"asp.net-mvc"
] | 10 | 9 | 1,307 | 2 | 0 | 2008-08-30T17:44:52.807000 | 2008-08-30T18:52:47.230000 |
36,239 | 217,348 | What should we do to prepare for 2038? | I would like to think that some of the software I'm writing today will be used in 30 years. But I am also aware that a lot of it is based upon the UNIX tradition of exposing time as the number of seconds since 1970. #include #include #include void print(time_t rt) { struct tm * t = gmtime(&rt); puts(asctime(t)); }
int... | I have written portable replacement for time.h (currently just localtime(), gmtime(), mktime() and timegm()) which uses 64 bit time even on 32 bit machines. It is intended to be dropped into C projects as a replacement for time.h. It is being used in Perl and I intend to fix Ruby and Python's 2038 problems with it as w... | What should we do to prepare for 2038? I would like to think that some of the software I'm writing today will be used in 30 years. But I am also aware that a lot of it is based upon the UNIX tradition of exposing time as the number of seconds since 1970. #include #include #include void print(time_t rt) { struct tm * t ... | TITLE:
What should we do to prepare for 2038?
QUESTION:
I would like to think that some of the software I'm writing today will be used in 30 years. But I am also aware that a lot of it is based upon the UNIX tradition of exposing time as the number of seconds since 1970. #include #include #include void print(time_t rt... | [
"unix",
"time",
"maintainability",
"year2038"
] | 67 | 49 | 9,771 | 11 | 0 | 2008-08-30T18:42:57.067000 | 2008-10-20T02:05:35.667000 |
36,260 | 36,527 | Dealing with circular dependencies in OCaml | I'm writing an interpreter for an experimental language. Three of the main constructs of the language are definitions, statements, and expressions. Definitions can contain statements and expressions, statements can contain definitions and expressions, and one kind of expression can contain statements. I represent all o... | Recursive definitions need to appear in the same file. If you want to separate definitions, statements, and expressions into separate modules, you can do so using recursive modules, but they will still need to appear in the same file. DAG-ifying inter-file dependencies is one of the annoyances of OCaml. | Dealing with circular dependencies in OCaml I'm writing an interpreter for an experimental language. Three of the main constructs of the language are definitions, statements, and expressions. Definitions can contain statements and expressions, statements can contain definitions and expressions, and one kind of expressi... | TITLE:
Dealing with circular dependencies in OCaml
QUESTION:
I'm writing an interpreter for an experimental language. Three of the main constructs of the language are definitions, statements, and expressions. Definitions can contain statements and expressions, statements can contain definitions and expressions, and on... | [
"ocaml"
] | 17 | 16 | 4,066 | 3 | 0 | 2008-08-30T19:06:44.077000 | 2008-08-31T01:00:05.537000 |
36,262 | 36,284 | How much should one DataSet represent? | How much should one DataSet represent? Using the example of an ordering system: While showing your order I also show a list of items similar to one of yours as well as a list of our most popular items. While your items are tangled in a web of relationships involving you and your past orders, preferred suppliers, and th... | This is why I don't use datasets. If you use strongly-typed datasets you benefit from the strong typing but you pay for it in terms of the time it takes to create one even if you're just using part of it and its extensibility in terms of the code base. If you want to modify an existing one and you modify a row definiti... | How much should one DataSet represent? How much should one DataSet represent? Using the example of an ordering system: While showing your order I also show a list of items similar to one of yours as well as a list of our most popular items. While your items are tangled in a web of relationships involving you and your p... | TITLE:
How much should one DataSet represent?
QUESTION:
How much should one DataSet represent? Using the example of an ordering system: While showing your order I also show a list of items similar to one of yours as well as a list of our most popular items. While your items are tangled in a web of relationships involv... | [
".net",
"dataset"
] | 1 | 1 | 268 | 2 | 0 | 2008-08-30T19:08:50.047000 | 2008-08-30T19:25:42.657000 |
36,274 | 36,297 | What is Lazy Loading? | What is Lazy Loading? [Edit after reading a few answers] Why do people use this term so often? Say you just use a ASP/ADO recordset and load it with data or ADO.NET Datasource for a gridview. I guess I should have asked why people use the term Lazy Loading, what "other" types are their? | It's called lazy loading because, like a lazy person, you are putting off doing something you don't want to. The opposite is Eager Loading, where you load something right away, long before you need it. If you are curious why people might use lazy loading, consider an application that takes a LOOOOONG time to start. Thi... | What is Lazy Loading? What is Lazy Loading? [Edit after reading a few answers] Why do people use this term so often? Say you just use a ASP/ADO recordset and load it with data or ADO.NET Datasource for a gridview. I guess I should have asked why people use the term Lazy Loading, what "other" types are their? | TITLE:
What is Lazy Loading?
QUESTION:
What is Lazy Loading? [Edit after reading a few answers] Why do people use this term so often? Say you just use a ASP/ADO recordset and load it with data or ADO.NET Datasource for a gridview. I guess I should have asked why people use the term Lazy Loading, what "other" types are... | [
"data-binding",
"lazy-loading"
] | 95 | 231 | 77,623 | 13 | 0 | 2008-08-30T19:20:04.933000 | 2008-08-30T19:44:05.653000 |
36,294 | 36,393 | F# language - hints for newbie | Looks like here in StackOveflow there is a group of F# enthusiasts. I'd like to know better this language, so, apart from the functional programming theory, can you point me to the better starting points to start using the F# language? I mean, tutorials, how-tos, but first of all working samples to have the chance to s... | Not to whore myself horribly but I wrote a couple F# overview posts on my blog here and here. Chris Smith (guy on the F# team at MS) has an article called 'F# in 20 minutes' - part 1 and part 2. Note you have to be careful as the latest CTP of F# (version 1.9.6.0) has some seriously breaking changes compared to previou... | F# language - hints for newbie Looks like here in StackOveflow there is a group of F# enthusiasts. I'd like to know better this language, so, apart from the functional programming theory, can you point me to the better starting points to start using the F# language? I mean, tutorials, how-tos, but first of all working ... | TITLE:
F# language - hints for newbie
QUESTION:
Looks like here in StackOveflow there is a group of F# enthusiasts. I'd like to know better this language, so, apart from the functional programming theory, can you point me to the better starting points to start using the F# language? I mean, tutorials, how-tos, but fir... | [
"f#"
] | 19 | 31 | 2,258 | 7 | 0 | 2008-08-30T19:42:24.927000 | 2008-08-30T22:09:05.697000 |
36,314 | 36,321 | What is 'Currying'? | I've seen references to curried functions in several articles and blogs but I can't find a good explanation (or at least one that makes sense!) | Currying is when you break down a function that takes multiple arguments into a series of functions that each take only one argument. Here's an example in JavaScript: function add (a, b) { return a + b; }
add(3, 4); // returns 7 This is a function that takes two arguments, a and b, and returns their sum. We will now c... | What is 'Currying'? I've seen references to curried functions in several articles and blogs but I can't find a good explanation (or at least one that makes sense!) | TITLE:
What is 'Currying'?
QUESTION:
I've seen references to curried functions in several articles and blogs but I can't find a good explanation (or at least one that makes sense!)
ANSWER:
Currying is when you break down a function that takes multiple arguments into a series of functions that each take only one argum... | [
"javascript",
"functional-programming",
"terminology",
"definition",
"currying"
] | 821 | 1,095 | 239,298 | 25 | 0 | 2008-08-30T20:12:55.867000 | 2008-08-30T20:19:51.187000 |
36,315 | 36,552 | Alternative to HttpUtility for .NET 3.5 SP1 client framework? | It'd be really nice to target my Windows Forms app to the.NET 3.5 SP1 client framework. But, right now I'm using the HttpUtility.HtmlDecode and HttpUtility.UrlDecode functions, and the MSDN documentation doesn't point to any alternatives inside of, say, System.Net or something. So, short from reflectoring the source co... | I’d strongly not recommend rolling your own encoding. I’d use the Microsoft Anti-Cross Site Scripting Library which is very small (v1.5 is ~30kb) if HttpUtility.HtmlEncode isn’t available. As for decoding, maybe you could use the decoding routine from Mono? | Alternative to HttpUtility for .NET 3.5 SP1 client framework? It'd be really nice to target my Windows Forms app to the.NET 3.5 SP1 client framework. But, right now I'm using the HttpUtility.HtmlDecode and HttpUtility.UrlDecode functions, and the MSDN documentation doesn't point to any alternatives inside of, say, Syst... | TITLE:
Alternative to HttpUtility for .NET 3.5 SP1 client framework?
QUESTION:
It'd be really nice to target my Windows Forms app to the.NET 3.5 SP1 client framework. But, right now I'm using the HttpUtility.HtmlDecode and HttpUtility.UrlDecode functions, and the MSDN documentation doesn't point to any alternatives in... | [
".net",
"deployment",
".net-3.5",
".net-client-profile"
] | 13 | 3 | 17,195 | 7 | 0 | 2008-08-30T20:13:32.667000 | 2008-08-31T01:41:17.013000 |
36,324 | 36,327 | "The system cannot find the file specified" when invoking subprocess.Popen in python | I'm trying to use svnmerge.py to merge some files. Under the hood it uses python, and when I use it I get an error - "The system cannot find the file specified". Colleagues at work are running the same version of svnmerge.py, and of python (2.5.2, specifically r252:60911) without an issue. I found this link, which desc... | It's a bug, see the documentation of subprocess.Popen. There either needs to be a "shell=True " option, or the first argument needs to be a sequence ['svn', '--version']. As it is now, Popen is looking for an executable named, literally, "svn --version" which it doesn't find. I don't know why it would work for your col... | "The system cannot find the file specified" when invoking subprocess.Popen in python I'm trying to use svnmerge.py to merge some files. Under the hood it uses python, and when I use it I get an error - "The system cannot find the file specified". Colleagues at work are running the same version of svnmerge.py, and of py... | TITLE:
"The system cannot find the file specified" when invoking subprocess.Popen in python
QUESTION:
I'm trying to use svnmerge.py to merge some files. Under the hood it uses python, and when I use it I get an error - "The system cannot find the file specified". Colleagues at work are running the same version of svnm... | [
"python",
"svn-merge"
] | 13 | 23 | 16,398 | 1 | 0 | 2008-08-30T20:24:38.037000 | 2008-08-30T20:34:35.877000 |
36,326 | 36,332 | How can I store user-tweakable configuration in app.config? | I know it is a good idea to store configuration data in app.config (e.g. database connection strings) instead of hardcoing it, even if I am writing an application just for myself. But is there a way to update the configuration data stored in app.config from the program that is using it? | If you use the Settings for the project, you can mark each setting as either application or user. If they're set as user, they will be stored per-user and when you call the Save method it will be updated in the config for that user. Code project has a really detailed article on saving all types of settings. | How can I store user-tweakable configuration in app.config? I know it is a good idea to store configuration data in app.config (e.g. database connection strings) instead of hardcoing it, even if I am writing an application just for myself. But is there a way to update the configuration data stored in app.config from th... | TITLE:
How can I store user-tweakable configuration in app.config?
QUESTION:
I know it is a good idea to store configuration data in app.config (e.g. database connection strings) instead of hardcoing it, even if I am writing an application just for myself. But is there a way to update the configuration data stored in ... | [
"c#",
".net",
"app-config"
] | 4 | 6 | 1,651 | 2 | 0 | 2008-08-30T20:34:18.060000 | 2008-08-30T20:40:42.307000 |
36,333 | 36,339 | Preview theme in WordPress | In the latest version of WordPress, it gives you the opportunity to view a preview of what your site would look like using a different theme. You basically just click on the theme, it takes over the screen and you have a chance to activate or close it (and return to the previous screen, which is grayed out in the backg... | It's open source - use the source, Luke. Look in wp-admin/js/theme-preview.js | Preview theme in WordPress In the latest version of WordPress, it gives you the opportunity to view a preview of what your site would look like using a different theme. You basically just click on the theme, it takes over the screen and you have a chance to activate or close it (and return to the previous screen, which... | TITLE:
Preview theme in WordPress
QUESTION:
In the latest version of WordPress, it gives you the opportunity to view a preview of what your site would look like using a different theme. You basically just click on the theme, it takes over the screen and you have a chance to activate or close it (and return to the prev... | [
"jquery",
"html",
"wordpress"
] | 5 | 5 | 304 | 1 | 0 | 2008-08-30T20:41:02.337000 | 2008-08-30T21:02:11.037000 |
36,347 | 36,364 | What are the differences between "generic" types in C++ and Java? | Java has generics and C++ provides a very strong programming model with template s. So then, what is the difference between C++ and Java generics? | There is a big difference between them. In C++ you don't have to specify a class or an interface for the generic type. That's why you can create truly generic functions and classes, with the caveat of a looser typing. template T sum(T a, T b) { return a + b; } The method above adds two objects of the same type, and can... | What are the differences between "generic" types in C++ and Java? Java has generics and C++ provides a very strong programming model with template s. So then, what is the difference between C++ and Java generics? | TITLE:
What are the differences between "generic" types in C++ and Java?
QUESTION:
Java has generics and C++ provides a very strong programming model with template s. So then, what is the difference between C++ and Java generics?
ANSWER:
There is a big difference between them. In C++ you don't have to specify a class... | [
"java",
"c++",
"generics",
"templates",
"language-features"
] | 175 | 170 | 116,540 | 13 | 0 | 2008-08-30T21:14:27.623000 | 2008-08-30T21:34:05.967000 |
36,350 | 36,367 | How to pass a single object[] to a params object[] | I have a method which takes params object[] such as: void Foo(params object[] items) { Console.WriteLine(items[0]); } When I pass two object arrays to this method, it works fine: Foo(new object[]{ (object)"1", (object)"2" }, new object[]{ (object)"3", (object)"4" } ); // Output: System.Object[] But when I pass a single... | A simple typecast will ensure the compiler knows what you mean in this case. Foo((object)new object[]{ (object)"1", (object)"2" })); As an array is a subtype of object, this all works out. Bit of an odd solution though, I'll agree. | How to pass a single object[] to a params object[] I have a method which takes params object[] such as: void Foo(params object[] items) { Console.WriteLine(items[0]); } When I pass two object arrays to this method, it works fine: Foo(new object[]{ (object)"1", (object)"2" }, new object[]{ (object)"3", (object)"4" } ); ... | TITLE:
How to pass a single object[] to a params object[]
QUESTION:
I have a method which takes params object[] such as: void Foo(params object[] items) { Console.WriteLine(items[0]); } When I pass two object arrays to this method, it works fine: Foo(new object[]{ (object)"1", (object)"2" }, new object[]{ (object)"3",... | [
"c#",
"arrays"
] | 128 | 103 | 139,784 | 7 | 0 | 2008-08-30T21:22:06.433000 | 2008-08-30T21:36:59.377000 |
36,406 | 36,423 | Relative Root with Visual Studio ASP.NET debugger | I am working on an ASP.NET project which is physically located at C:\Projects\MyStuff\WebSite2. When I run the app with the Visual Studio debugger it seems that the built in web server considers "C:\Projects\MyStuff\" to be the relative root, not "C:\Projects\MyStuff\WebSite2". Is there a web.config setting or somethin... | you can try this trick that Scott Guthrie posted on his blog http://weblogs.asp.net/scottgu/archive/2006/12/19/tip-trick-how-to-run-a-root-site-with-the-local-web-server-using-vs-2005-sp1.aspx to cut to the fix: select your project/solution in solution explorer and then open the Properties tab like you would if you wer... | Relative Root with Visual Studio ASP.NET debugger I am working on an ASP.NET project which is physically located at C:\Projects\MyStuff\WebSite2. When I run the app with the Visual Studio debugger it seems that the built in web server considers "C:\Projects\MyStuff\" to be the relative root, not "C:\Projects\MyStuff\We... | TITLE:
Relative Root with Visual Studio ASP.NET debugger
QUESTION:
I am working on an ASP.NET project which is physically located at C:\Projects\MyStuff\WebSite2. When I run the app with the Visual Studio debugger it seems that the built in web server considers "C:\Projects\MyStuff\" to be the relative root, not "C:\P... | [
"asp.net"
] | 3 | 2 | 973 | 1 | 0 | 2008-08-30T22:22:50.360000 | 2008-08-30T22:31:01.790000 |
36,407 | 36,419 | Firefox add-ons | What Firefox add-ons do you use that are useful for programmers? | I guess it's silly to mention Firebug -- doubt any of us could live without it. Other than that I use the following (only listing dev-related): Console 2: next-generation error console DOM inspector: as the title might indicate, allows you to browse the DOM Edit Cookies: change cookies on the fly Execute JS: ad-hoc Jav... | Firefox add-ons What Firefox add-ons do you use that are useful for programmers? | TITLE:
Firefox add-ons
QUESTION:
What Firefox add-ons do you use that are useful for programmers?
ANSWER:
I guess it's silly to mention Firebug -- doubt any of us could live without it. Other than that I use the following (only listing dev-related): Console 2: next-generation error console DOM inspector: as the title... | [
"firefox",
"add-on"
] | 20 | 18 | 1,997 | 19 | 0 | 2008-08-30T22:23:42.010000 | 2008-08-30T22:28:50.580000 |
36,417 | 36,444 | PHP best practices? | What is a good way to remove the code from display pages when developing with PHP. Often the pages I work on need to be editted by an outside person. This person is often confused by lots of blocks of PHP, and also likes to break my code. I've tried moving blocks of code out into functions, so now there are functions s... | You don't need a "system" to do templating. You can do it on your own by keeping presentation & logic separate. This way the designer can screw up the display, but not the logic behind it. Here's a simple example: Now here's the people.php file (which you give your designer): Person: | PHP best practices? What is a good way to remove the code from display pages when developing with PHP. Often the pages I work on need to be editted by an outside person. This person is often confused by lots of blocks of PHP, and also likes to break my code. I've tried moving blocks of code out into functions, so now t... | TITLE:
PHP best practices?
QUESTION:
What is a good way to remove the code from display pages when developing with PHP. Often the pages I work on need to be editted by an outside person. This person is often confused by lots of blocks of PHP, and also likes to break my code. I've tried moving blocks of code out into f... | [
"php"
] | 14 | 19 | 1,980 | 9 | 0 | 2008-08-30T22:27:15.653000 | 2008-08-30T22:53:41.207000 |
36,430 | 39,103 | What are the important Ruby commands? | I'm not sure of all of them, but what are the commands to do things like update Ruby, download a new gem, or update an existing gem? What other important things are there? Since it might matter, I'm running Windows. | Useful command: Rake In addition to the commands listed by Joseph Pecoraro, the 'rake' command is also pretty standard when working with Ruby. Rake makes it easy to automate (simple) tasks; like building a RubyGem or running your unit tests. With rake, the only important command to remember is 'rake -T', which shows a ... | What are the important Ruby commands? I'm not sure of all of them, but what are the commands to do things like update Ruby, download a new gem, or update an existing gem? What other important things are there? Since it might matter, I'm running Windows. | TITLE:
What are the important Ruby commands?
QUESTION:
I'm not sure of all of them, but what are the commands to do things like update Ruby, download a new gem, or update an existing gem? What other important things are there? Since it might matter, I'm running Windows.
ANSWER:
Useful command: Rake In addition to the... | [
"ruby"
] | 8 | 11 | 11,010 | 6 | 0 | 2008-08-30T22:36:52.697000 | 2008-09-02T09:37:49.753000 |
36,498 | 36,500 | How do I Send Email from the Command Line? | I would like to quickly send email from the command line. I realize there are probably a number of different ways to do this. I'm looking for a simple way to do this from a linux terminal (likely a bash shell but anything should do) and an alternative way to do this on Windows. I want to be able to whip up an email rig... | You can use mail: $mail -s You then type your message and end it with a line that has only a period. This signals you are done and sends the message. You can also pipe your email in from STDIN and it will be sent as the text of an email: $ | mail -s One small note with this approach - unless your computer is connected ... | How do I Send Email from the Command Line? I would like to quickly send email from the command line. I realize there are probably a number of different ways to do this. I'm looking for a simple way to do this from a linux terminal (likely a bash shell but anything should do) and an alternative way to do this on Windows... | TITLE:
How do I Send Email from the Command Line?
QUESTION:
I would like to quickly send email from the command line. I realize there are probably a number of different ways to do this. I'm looking for a simple way to do this from a linux terminal (likely a bash shell but anything should do) and an alternative way to ... | [
"linux",
"email",
"command-line"
] | 21 | 11 | 21,827 | 8 | 0 | 2008-08-31T00:06:37.257000 | 2008-08-31T00:12:15.323000 |
36,502 | 36,529 | How can I disable DLL Caching in Windows Vista via CMD? | I know Windows Vista (and XP) cache recently loaded DLL's in memory... How can this be disabled via the command prompt? | The only thing you can do is disable SuperFetch, which can be done from the command prompt with this command (there has to be a space between the = sign and disabled). sc config Superfetch start= disabled There is a myth out there that you can disable DLL caching, but that only worked for systems prior to Windows 2000.... | How can I disable DLL Caching in Windows Vista via CMD? I know Windows Vista (and XP) cache recently loaded DLL's in memory... How can this be disabled via the command prompt? | TITLE:
How can I disable DLL Caching in Windows Vista via CMD?
QUESTION:
I know Windows Vista (and XP) cache recently loaded DLL's in memory... How can this be disabled via the command prompt?
ANSWER:
The only thing you can do is disable SuperFetch, which can be done from the command prompt with this command (there h... | [
"windows-vista",
"command-prompt"
] | 0 | 6 | 2,250 | 3 | 0 | 2008-08-31T00:18:55.993000 | 2008-08-31T01:04:14.653000 |
36,504 | 36,513 | Why functional languages? | I see a lot of talk on here about functional languages and stuff. Why would you use one over a "traditional" language? What do they do better? What are they worse at? What's the ideal functional programming application? | Functional languages use a different paradigm than imperative and object-oriented languages. They use side-effect-free functions as a basic building block in the language. This enables lots of things and makes a lot of things more difficult (or in most cases different from what people are used to). One of the biggest a... | Why functional languages? I see a lot of talk on here about functional languages and stuff. Why would you use one over a "traditional" language? What do they do better? What are they worse at? What's the ideal functional programming application? | TITLE:
Why functional languages?
QUESTION:
I see a lot of talk on here about functional languages and stuff. Why would you use one over a "traditional" language? What do they do better? What are they worse at? What's the ideal functional programming application?
ANSWER:
Functional languages use a different paradigm t... | [
"programming-languages",
"functional-programming"
] | 346 | 223 | 191,584 | 47 | 0 | 2008-08-31T00:21:51.900000 | 2008-08-31T00:38:05.340000 |
36,515 | 42,792 | Fixed Legend in Google Maps Mashup | I have a page with a Google Maps mashup that has pushpins that are color-coded by day (Monday, Tuesday, etc.) The IFrame containing the map is dynamically sized, so it gets resized when the browser window is resized. I'd like to put a legend in the corner of the map window that tells the user what each color means. The... | You can add your own Custom Control and use it as a legend. This code will add a box 150w x 100h (Gray Border/ with White Background) and the words "Hello World" inside of it. You swap out the text for any HTML you would like in the legend. This will stay Anchored to the Top Right (G_ANCHOR_TOP_RIGHT) 10px down and 50p... | Fixed Legend in Google Maps Mashup I have a page with a Google Maps mashup that has pushpins that are color-coded by day (Monday, Tuesday, etc.) The IFrame containing the map is dynamically sized, so it gets resized when the browser window is resized. I'd like to put a legend in the corner of the map window that tells ... | TITLE:
Fixed Legend in Google Maps Mashup
QUESTION:
I have a page with a Google Maps mashup that has pushpins that are color-coded by day (Monday, Tuesday, etc.) The IFrame containing the map is dynamically sized, so it gets resized when the browser window is resized. I'd like to put a legend in the corner of the map ... | [
"javascript",
"html",
"google-maps",
"google-maps-api-2"
] | 9 | 10 | 15,031 | 2 | 0 | 2008-08-31T00:41:03.070000 | 2008-09-03T23:06:29.817000 |
36,533 | 36,684 | Vista speech recognition in multiple languages | my primary language is spanish, but I use all my software in english, including windows; however I'd like to use speech recognition in spanish. Do you know if there's a way to use vista's speech recognition in other language than the primary os language? | Citation from Vista speech recognition blog: In Windows Vista, Windows Speech Recognition works in the current language of the OS. That means that in order to use another language for speech recognition, you have to have the appropriate language pack installed. Language packs are available as free downloads through Win... | Vista speech recognition in multiple languages my primary language is spanish, but I use all my software in english, including windows; however I'd like to use speech recognition in spanish. Do you know if there's a way to use vista's speech recognition in other language than the primary os language? | TITLE:
Vista speech recognition in multiple languages
QUESTION:
my primary language is spanish, but I use all my software in english, including windows; however I'd like to use speech recognition in spanish. Do you know if there's a way to use vista's speech recognition in other language than the primary os language?
... | [
"windows-vista",
"nlp",
"speech-recognition",
"multilingual"
] | 3 | 8 | 5,647 | 6 | 0 | 2008-08-31T01:08:48.493000 | 2008-08-31T08:11:57.620000 |
36,534 | 36,545 | Website Hardware Scaling | So I was listening to the latest Stackoverflow podcast ( episode 19 ), and Jeff and Joel talked a bit about scaling server hardware as a website grows. From what Joel was saying, the first few steps are pretty standard: One server running both the webserver and the database (the current Stackoverflow setup) One webserv... | A reasonable setup supporting an "average" web application might evolve as follows: Single combined application/database server Separate database on a different machine Second application server with DNS round-robin (poor man's load balancing) or, e.g. Perlbal Second, replicated database server (for read loads, require... | Website Hardware Scaling So I was listening to the latest Stackoverflow podcast ( episode 19 ), and Jeff and Joel talked a bit about scaling server hardware as a website grows. From what Joel was saying, the first few steps are pretty standard: One server running both the webserver and the database (the current Stackov... | TITLE:
Website Hardware Scaling
QUESTION:
So I was listening to the latest Stackoverflow podcast ( episode 19 ), and Jeff and Joel talked a bit about scaling server hardware as a website grows. From what Joel was saying, the first few steps are pretty standard: One server running both the webserver and the database (t... | [
"hardware",
"scaling"
] | 3 | 10 | 843 | 6 | 0 | 2008-08-31T01:11:47.740000 | 2008-08-31T01:36:08.150000 |
36,563 | 36,577 | Is there an easy way to do transparent forms in a VB .NET app? | I'm writing a simple app that's going to have a tiny form sitting in one corner of the screen, updating itself. I'd really love for that form to be transparent and to have the transparency be user-configurable. Is there any easy way to achieve this? | You could try using the Opacity property of the Form. Here's the relevant snippet from the MSDN page: private Sub CreateMyOpaqueForm() ' Create a new form. Dim form2 As New Form() ' Set the text displayed in the caption. form2.Text = "My Form" ' Set the opacity to 75%. form2.Opacity = 0.75 ' Size the form to be 300 pix... | Is there an easy way to do transparent forms in a VB .NET app? I'm writing a simple app that's going to have a tiny form sitting in one corner of the screen, updating itself. I'd really love for that form to be transparent and to have the transparency be user-configurable. Is there any easy way to achieve this? | TITLE:
Is there an easy way to do transparent forms in a VB .NET app?
QUESTION:
I'm writing a simple app that's going to have a tiny form sitting in one corner of the screen, updating itself. I'd really love for that form to be transparent and to have the transparency be user-configurable. Is there any easy way to ach... | [
"vb.net",
"transparency"
] | 2 | 4 | 1,966 | 4 | 0 | 2008-08-31T02:05:03.587000 | 2008-08-31T02:29:41.843000 |
36,567 | 38,203 | Beginner Digital Synth | I'm looking into writing a audio syntesizer in Java, and was wondering if anybody has any advice or good resources for writing such a program. I'm looking for info on generating raw sound waves, how to output them into a usable form (playing over speakers), as well as general theory on the topic. Thanks guys. | This problem is basically about mapping functions to arrays of numbers. A language that supports first-class functions would come in really handy here. Check out http://www.harmony-central.com/Computer/Programming and http://www.developer.com/java/other/article.php/3071021 for some Java-related info. If you don't know ... | Beginner Digital Synth I'm looking into writing a audio syntesizer in Java, and was wondering if anybody has any advice or good resources for writing such a program. I'm looking for info on generating raw sound waves, how to output them into a usable form (playing over speakers), as well as general theory on the topic.... | TITLE:
Beginner Digital Synth
QUESTION:
I'm looking into writing a audio syntesizer in Java, and was wondering if anybody has any advice or good resources for writing such a program. I'm looking for info on generating raw sound waves, how to output them into a usable form (playing over speakers), as well as general th... | [
"java",
"synthesizer"
] | 5 | 6 | 3,293 | 4 | 0 | 2008-08-31T02:08:47.867000 | 2008-09-01T17:48:33.683000 |
36,568 | 36,572 | Automated Builds | I currently use subversion for my version control via AhnkSVN and Visual Studio. I recently started using Tree Surgeon to set up my projects. It creates a build script automatically using NAnt. I would like to be able to automate builds regularly projects within SVN. I like the idea of doing a build on every check in b... | You could use CruiseControl.Net, which can do a build on every check in, nightly builds, or however you want to do it. A quick google search suggests CC.Net has some integration with NAnt already. | Automated Builds I currently use subversion for my version control via AhnkSVN and Visual Studio. I recently started using Tree Surgeon to set up my projects. It creates a build script automatically using NAnt. I would like to be able to automate builds regularly projects within SVN. I like the idea of doing a build on... | TITLE:
Automated Builds
QUESTION:
I currently use subversion for my version control via AhnkSVN and Visual Studio. I recently started using Tree Surgeon to set up my projects. It creates a build script automatically using NAnt. I would like to be able to automate builds regularly projects within SVN. I like the idea o... | [
"svn",
"build-automation",
"nant"
] | 8 | 5 | 2,588 | 10 | 0 | 2008-08-31T02:09:49.800000 | 2008-08-31T02:14:33.080000 |
36,575 | 36,591 | Add service reference to Amazon service fails | Add service reference to Amazon service fails, saying "Could not load file or assembly "System.Core, Version=3.5.0.0,...' or one or more of it dependencies. The module was expected to contain an assembly manifest." This is in VS 2008, haven't installed SP1 on this machine yet. Any ideas? | This can happen if ASP.NET isn't installed. Go to Add/Remove Windows Components and look under IIS; make sure that ASP.NET is checked (meaning that it's installed.) That should clear up your problem! | Add service reference to Amazon service fails Add service reference to Amazon service fails, saying "Could not load file or assembly "System.Core, Version=3.5.0.0,...' or one or more of it dependencies. The module was expected to contain an assembly manifest." This is in VS 2008, haven't installed SP1 on this machine y... | TITLE:
Add service reference to Amazon service fails
QUESTION:
Add service reference to Amazon service fails, saying "Could not load file or assembly "System.Core, Version=3.5.0.0,...' or one or more of it dependencies. The module was expected to contain an assembly manifest." This is in VS 2008, haven't installed SP1... | [
"asp.net",
"amazon-web-services"
] | 1 | 1 | 194 | 1 | 0 | 2008-08-31T02:23:57.130000 | 2008-08-31T02:50:00.030000 |
36,600 | 36,615 | Viewing DirectX application remotely | We're working on an application that displays information through a Direct3D visualisation. A late client request is the ability to view this application via some Remote Desktop solution. Has anyone done anything similar? What options are available / unavailable? I'm thinking RDC, VNC, Citrix... Any advice? | I think you can still use all of the normal D3D tools, but you won't be able to render to a surface associated with the screen. You'll have to render to a DIB (or some such) and Blt it with GDI to a normal window HDC. RDC/VNC/Citrix should all work with this technique. Performance will definitely suffer - but that's go... | Viewing DirectX application remotely We're working on an application that displays information through a Direct3D visualisation. A late client request is the ability to view this application via some Remote Desktop solution. Has anyone done anything similar? What options are available / unavailable? I'm thinking RDC, V... | TITLE:
Viewing DirectX application remotely
QUESTION:
We're working on an application that displays information through a Direct3D visualisation. A late client request is the ability to view this application via some Remote Desktop solution. Has anyone done anything similar? What options are available / unavailable? I... | [
"directx",
"remote-desktop"
] | 6 | 2 | 3,431 | 3 | 0 | 2008-08-31T03:05:52.457000 | 2008-08-31T03:39:53.280000 |
36,605 | 36,612 | IE 6 CSS Hover non Anchor Tag | What is the simplest and most elegant way to simulate the hover pseudo-class for non-Anchor tags in IE6? I am specifically trying to change the cursor in this instance to that of a pointer. | I would say that the simplest method would be to add onmouseover/out Javascript functions. | IE 6 CSS Hover non Anchor Tag What is the simplest and most elegant way to simulate the hover pseudo-class for non-Anchor tags in IE6? I am specifically trying to change the cursor in this instance to that of a pointer. | TITLE:
IE 6 CSS Hover non Anchor Tag
QUESTION:
What is the simplest and most elegant way to simulate the hover pseudo-class for non-Anchor tags in IE6? I am specifically trying to change the cursor in this instance to that of a pointer.
ANSWER:
I would say that the simplest method would be to add onmouseover/out Java... | [
"css",
"internet-explorer-6"
] | 8 | 4 | 6,764 | 8 | 0 | 2008-08-31T03:14:56.727000 | 2008-08-31T03:30:09.810000 |
36,608 | 36,618 | How can I count the number of records that have a unique value in a particular field in ROR? | I have a record set that includes a date field, and want to determine how many unique dates are represented in the record set. Something like: Record.find(:all).date.unique.count but of course, that doesn't seem to work. | What you're going for is the following SQL: SELECT COUNT(DISTINCT date) FROM records ActiveRecord has this built in: Record.count('date',:distinct => true) | How can I count the number of records that have a unique value in a particular field in ROR? I have a record set that includes a date field, and want to determine how many unique dates are represented in the record set. Something like: Record.find(:all).date.unique.count but of course, that doesn't seem to work. | TITLE:
How can I count the number of records that have a unique value in a particular field in ROR?
QUESTION:
I have a record set that includes a date field, and want to determine how many unique dates are represented in the record set. Something like: Record.find(:all).date.unique.count but of course, that doesn't se... | [
"ruby-on-rails",
"ruby",
"activerecord"
] | 69 | 85 | 87,269 | 7 | 0 | 2008-08-31T03:19:33.157000 | 2008-08-31T03:52:26.200000 |
36,621 | 36,705 | How to catch undefined functions with set_error_handler in PHP | I'm taking the leap: my PHP scripts will ALL fail gracefully! At least, that's what I'm hoping for...` I don't want to wrap (practically) every single line in try...catch statements, so I think my best bet is to make a custom error handler for the beginning of my files. I'm testing it out on a practice page: function c... | set_error_handler is designed to handle errors with codes of: E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE. This is because set_error_handler is meant to be a method of reporting errors thrown by the user error function trigger_error. However, I did find this comment in the manual that may help you: "The following err... | How to catch undefined functions with set_error_handler in PHP I'm taking the leap: my PHP scripts will ALL fail gracefully! At least, that's what I'm hoping for...` I don't want to wrap (practically) every single line in try...catch statements, so I think my best bet is to make a custom error handler for the beginning... | TITLE:
How to catch undefined functions with set_error_handler in PHP
QUESTION:
I'm taking the leap: my PHP scripts will ALL fail gracefully! At least, that's what I'm hoping for...` I don't want to wrap (practically) every single line in try...catch statements, so I think my best bet is to make a custom error handler... | [
"php"
] | 13 | 15 | 12,204 | 7 | 0 | 2008-08-31T03:57:29.947000 | 2008-08-31T09:23:12.473000 |
36,646 | 36,687 | Do you use Phing? | Does anyone use Phing to deploy PHP applications, and if so how do you use it? We currently have a hand-written "setup" script that we run whenever we deploy a new instance of our project. We just check out from SVN and run it. It sets some basic configuration variables, installs or reloads the database, and generates ... | From Federico Cargnelutti's blog post: Features include file transformations (e.g. token replacement, XSLT transformation, Smarty template transformations), file system operations, interactive build support, SQL execution, CVS operations, tools for creating PEAR packages, and much more. Of course you could write custom... | Do you use Phing? Does anyone use Phing to deploy PHP applications, and if so how do you use it? We currently have a hand-written "setup" script that we run whenever we deploy a new instance of our project. We just check out from SVN and run it. It sets some basic configuration variables, installs or reloads the databa... | TITLE:
Do you use Phing?
QUESTION:
Does anyone use Phing to deploy PHP applications, and if so how do you use it? We currently have a hand-written "setup" script that we run whenever we deploy a new instance of our project. We just check out from SVN and run it. It sets some basic configuration variables, installs or ... | [
"php",
"deployment",
"build-process",
"build-automation",
"phing"
] | 25 | 16 | 7,535 | 5 | 0 | 2008-08-31T05:04:34.950000 | 2008-08-31T08:22:20.370000 |
36,647 | 36,648 | Unit tests in Python | Does Python have a unit testing framework compatible with the standard xUnit style of test framework? If so, what is it, where is it, and is it any good? | Python has several testing frameworks, including unittest, doctest, and nose. The most xUnit-like is unittest, which is documented on Python.org. unittest documentation doctest documentation | Unit tests in Python Does Python have a unit testing framework compatible with the standard xUnit style of test framework? If so, what is it, where is it, and is it any good? | TITLE:
Unit tests in Python
QUESTION:
Does Python have a unit testing framework compatible with the standard xUnit style of test framework? If so, what is it, where is it, and is it any good?
ANSWER:
Python has several testing frameworks, including unittest, doctest, and nose. The most xUnit-like is unittest, which i... | [
"python",
"unit-testing"
] | 22 | 25 | 9,362 | 9 | 0 | 2008-08-31T05:07:41.603000 | 2008-08-31T05:09:33.813000 |
36,656 | 36,658 | How do I keep whitespace formatting using PHP/HTML? | I'm parsing text from a file and storing it in a string. The problem is that some of the text in the original files contains ASCII art and whatnot that I would like to preserve. When I print out the string on the HTML page, even if it does have the same formatting and everything since it is in HTML, the spacing and lin... | use the tag (pre formatted), that will use a mono spaced font (for your art) and keep all the white space text goes here and here and here and here Some out here ▄ ▄█▄ █▄ ▄ ▄█▀█▓ ▄▓▀▀█▀ ▀▀▀█▓▀▀ ▀▀ ▄█▀█▓▀▀▀▀▀▓▄▀██▀▀ ██ ██ ▀██▄▄ ▄█ ▀ ░▒ ░▒ ██ ██ ▄█▄ █▀ ██ █▓▄▀██ ▄ ▀█▌▓█ ▒▓ ▒▓ █▓▄▀██ ▓█ ▀▄ █▓ █▒ █▓ ██▄▓▀ ▀█▄▄█▄▓█ ▓█ █▒ █▓... | How do I keep whitespace formatting using PHP/HTML? I'm parsing text from a file and storing it in a string. The problem is that some of the text in the original files contains ASCII art and whatnot that I would like to preserve. When I print out the string on the HTML page, even if it does have the same formatting and... | TITLE:
How do I keep whitespace formatting using PHP/HTML?
QUESTION:
I'm parsing text from a file and storing it in a string. The problem is that some of the text in the original files contains ASCII art and whatnot that I would like to preserve. When I print out the string on the HTML page, even if it does have the s... | [
"php",
"html",
"ascii"
] | 33 | 60 | 51,465 | 5 | 0 | 2008-08-31T05:55:12.330000 | 2008-08-31T05:58:01.747000 |
36,682 | 36,689 | Why do .Net WPF DependencyProperties have to be static members of the class | Learning WPF nowadays. Found something new today with.Net dependency properties. What they bring to the table is Support for Callbacks (Validation, Change, etc) Property inheritance Attached properties among others. But my question here is why do they need to be declared as static in the containing class? The recommmen... | I see 2 reasons behind that requirement: You can't register same DP twice. To comply with this constraint you should use static variable, it will be initialized only one time thus you will register DP one time only. DP should be registered before any class (which uses that DB) instance created | Why do .Net WPF DependencyProperties have to be static members of the class Learning WPF nowadays. Found something new today with.Net dependency properties. What they bring to the table is Support for Callbacks (Validation, Change, etc) Property inheritance Attached properties among others. But my question here is why ... | TITLE:
Why do .Net WPF DependencyProperties have to be static members of the class
QUESTION:
Learning WPF nowadays. Found something new today with.Net dependency properties. What they bring to the table is Support for Callbacks (Validation, Change, etc) Property inheritance Attached properties among others. But my que... | [
".net",
"wpf"
] | 4 | 2 | 425 | 3 | 0 | 2008-08-31T08:08:35.570000 | 2008-08-31T08:26:55.913000 |
36,693 | 155,600 | How can I render a PNG image (as a memory stream) onto a .NET ReportViewer report surface | I have a dynamically created image that I am saving to a stream so that I can display it on a ReportViewer surface. Setup: Windows Client application (not WebForms) Report datasource is an object datasource, with a dynamically generated stream as a property (CustomImage) Report.EnableExternalImages = true Image.Source ... | I am doing something similar in order to have a changing logo on reports however I utilise report parameters to pass the value. I don't see any reason why this general method wouldn't work if the images were part of the data. Essentially the images are passed over two fields. The first field is the MIME Type value and ... | How can I render a PNG image (as a memory stream) onto a .NET ReportViewer report surface I have a dynamically created image that I am saving to a stream so that I can display it on a ReportViewer surface. Setup: Windows Client application (not WebForms) Report datasource is an object datasource, with a dynamically gen... | TITLE:
How can I render a PNG image (as a memory stream) onto a .NET ReportViewer report surface
QUESTION:
I have a dynamically created image that I am saving to a stream so that I can display it on a ReportViewer surface. Setup: Windows Client application (not WebForms) Report datasource is an object datasource, with... | [
".net",
"image",
"reportviewer"
] | 13 | 34 | 16,446 | 1 | 0 | 2008-08-31T08:42:17.797000 | 2008-09-30T23:37:10.057000 |
36,701 | 36,734 | Struct like objects in Java | Is it completely against the Java way to create struct like objects? class SomeData1 { public int x; public int y; } I can see a class with accessors and mutators being more Java like. class SomeData2 { int getX(); void setX(int x);
int getY(); void setY(int y);
private int x; private int y; } The class from the firs... | This is a commonly discussed topic. The drawback of creating public fields in objects is that you have no control over the values that are set to it. In group projects where there are many programmers using the same code, it's important to avoid side effects. Besides, sometimes it's better to return a copy of field's o... | Struct like objects in Java Is it completely against the Java way to create struct like objects? class SomeData1 { public int x; public int y; } I can see a class with accessors and mutators being more Java like. class SomeData2 { int getX(); void setX(int x);
int getY(); void setY(int y);
private int x; private int ... | TITLE:
Struct like objects in Java
QUESTION:
Is it completely against the Java way to create struct like objects? class SomeData1 { public int x; public int y; } I can see a class with accessors and mutators being more Java like. class SomeData2 { int getX(); void setX(int x);
int getY(); void setY(int y);
private i... | [
"java",
"oop",
"struct"
] | 199 | 62 | 359,225 | 20 | 0 | 2008-08-31T09:17:01.737000 | 2008-08-31T09:50:48.210000 |
36,706 | 36,856 | How can I improve my programming experience on my Linux Desktop? | How can I improve the look and feel of my Linux desktop to suit my programming needs? I found Compiz and it makes switching between my workspaces (which is something I do all the time to make the most of my 13.3" screen laptop) easy and look great - so what else don't I know about that make my programming environment m... | I've used by Ubuntu desktop for some coding sessions. I haven't settled on an IDE, but if I'm not using gedit, I'll use emacs as my editor. Sometimes I need to ssh to a remote server and edit from there, in which case emacs is preferred. I'm just not the vi(m) type. Maybe I'll try out Eclipse one day... I love Compiz, ... | How can I improve my programming experience on my Linux Desktop? How can I improve the look and feel of my Linux desktop to suit my programming needs? I found Compiz and it makes switching between my workspaces (which is something I do all the time to make the most of my 13.3" screen laptop) easy and look great - so wh... | TITLE:
How can I improve my programming experience on my Linux Desktop?
QUESTION:
How can I improve the look and feel of my Linux desktop to suit my programming needs? I found Compiz and it makes switching between my workspaces (which is something I do all the time to make the most of my 13.3" screen laptop) easy and ... | [
"linux",
"desktop",
"compiz"
] | 0 | 0 | 779 | 3 | 0 | 2008-08-31T09:26:51.450000 | 2008-08-31T13:33:27.863000 |
36,707 | 36,714 | Should a function have only one return statement? | Are there good reasons why it's a better practice to have only one return statement in a function? Or is it okay to return from a function as soon as it is logically correct to do so, meaning there may be many return statements in the function? | I often have several statements at the start of a method to return for "easy" situations. For example, this: public void DoStuff(Foo foo) { if (foo!= null) {... } }... can be made more readable (IMHO) like this: public void DoStuff(Foo foo) { if (foo == null) return;... } So yes, I think it's fine to have multiple "exi... | Should a function have only one return statement? Are there good reasons why it's a better practice to have only one return statement in a function? Or is it okay to return from a function as soon as it is logically correct to do so, meaning there may be many return statements in the function? | TITLE:
Should a function have only one return statement?
QUESTION:
Are there good reasons why it's a better practice to have only one return statement in a function? Or is it okay to return from a function as soon as it is logically correct to do so, meaning there may be many return statements in the function?
ANSWER... | [
"language-agnostic",
"coding-style"
] | 780 | 741 | 371,394 | 50 | 0 | 2008-08-31T09:26:55.660000 | 2008-08-31T09:31:40.143000 |
36,709 | 36,836 | Is there a good yacc/bison type LALR parser generator for .NET? | Is there a good yacc/bison type LALR parser generator for.NET? | Antlr supports C# code generation, though it is LL(k) not technically LALR. Its tree rewriting rules are an interesting feature though. | Is there a good yacc/bison type LALR parser generator for .NET? Is there a good yacc/bison type LALR parser generator for.NET? | TITLE:
Is there a good yacc/bison type LALR parser generator for .NET?
QUESTION:
Is there a good yacc/bison type LALR parser generator for.NET?
ANSWER:
Antlr supports C# code generation, though it is LL(k) not technically LALR. Its tree rewriting rules are an interesting feature though. | [
".net",
"yacc",
"lalr"
] | 7 | 5 | 2,729 | 5 | 0 | 2008-08-31T09:28:51.397000 | 2008-08-31T12:44:52.363000 |
36,733 | 36,777 | Redirecting users from edit page back to calling page | I am working on a project management web application. The user has a variety of ways to display a list of tasks. When viewing a list page, they click on task and are redirected to the task edit page. Since they are coming from a variety of ways, I am just curious as to the best way to redirect the user back to the call... | I would store the referring URL using the ViewState. Storing this outside the scope of the page (i.e. in the Session state or cookie) may cause problems if more than one browser window is open. The example below validates that the page was called internally (i.e. not requested directly) and bounces back to the referrin... | Redirecting users from edit page back to calling page I am working on a project management web application. The user has a variety of ways to display a list of tasks. When viewing a list page, they click on task and are redirected to the task edit page. Since they are coming from a variety of ways, I am just curious as... | TITLE:
Redirecting users from edit page back to calling page
QUESTION:
I am working on a project management web application. The user has a variety of ways to display a list of tasks. When viewing a list page, they click on task and are redirected to the task edit page. Since they are coming from a variety of ways, I ... | [
"asp.net",
"redirect"
] | 7 | 5 | 4,069 | 4 | 0 | 2008-08-31T09:49:18.010000 | 2008-08-31T11:21:17.603000 |
36,760 | 36,762 | SQL Query, Count with 0 count | I have three tables: page, attachment, page-attachment I have data like this: page ID NAME 1 first page 2 second page 3 third page 4 fourth page
attachment ID NAME 1 foo.word 2 test.xsl 3 mm.ppt
page-attachment ID PAGE-ID ATTACHMENT-ID 1 2 1 2 2 2 3 3 3 I would like to get the number of attachments per page also when... | Change your "inner join" to a "left outer join", which means "get me all the rows on the left of the join, even if there isn't a matching row on the right." select page.name, count(page-attachment.id) as attachmentsnumber from page left outer join page-attachment on page.id=page-id group by page.name | SQL Query, Count with 0 count I have three tables: page, attachment, page-attachment I have data like this: page ID NAME 1 first page 2 second page 3 third page 4 fourth page
attachment ID NAME 1 foo.word 2 test.xsl 3 mm.ppt
page-attachment ID PAGE-ID ATTACHMENT-ID 1 2 1 2 2 2 3 3 3 I would like to get the number of ... | TITLE:
SQL Query, Count with 0 count
QUESTION:
I have three tables: page, attachment, page-attachment I have data like this: page ID NAME 1 first page 2 second page 3 third page 4 fourth page
attachment ID NAME 1 foo.word 2 test.xsl 3 mm.ppt
page-attachment ID PAGE-ID ATTACHMENT-ID 1 2 1 2 2 2 3 3 3 I would like to ... | [
"sql",
"count"
] | 14 | 33 | 34,480 | 6 | 0 | 2008-08-31T10:39:58.230000 | 2008-08-31T10:41:16.793000 |
36,778 | 36,914 | Firefox vs. IE: innerHTML handling | After hours of debugging, it appears to me that in FireFox, the innerHTML of a DOM reflects what is actually in the markup, but in IE, the innerHTML reflects what's in the markup PLUS any changes made by the user or dynamically (i.e. via Javascript). Has anyone else found this to be true? Any interesting work-arounds t... | I agree with Pat. At this point in the game, writing your own code to deal with cross-browser compatibility given the available Javascript frameworks doesn't make a lot of sense. There's a framework for nearly any taste (some really quite tiny) and they've focused on really abstracting out all of the differences betwee... | Firefox vs. IE: innerHTML handling After hours of debugging, it appears to me that in FireFox, the innerHTML of a DOM reflects what is actually in the markup, but in IE, the innerHTML reflects what's in the markup PLUS any changes made by the user or dynamically (i.e. via Javascript). Has anyone else found this to be t... | TITLE:
Firefox vs. IE: innerHTML handling
QUESTION:
After hours of debugging, it appears to me that in FireFox, the innerHTML of a DOM reflects what is actually in the markup, but in IE, the innerHTML reflects what's in the markup PLUS any changes made by the user or dynamically (i.e. via Javascript). Has anyone else ... | [
"javascript",
"internet-explorer",
"firefox",
"dom"
] | 6 | 9 | 3,790 | 4 | 0 | 2008-08-31T11:23:46.147000 | 2008-08-31T15:28:15.027000 |
36,812 | 36,935 | How do I add data to an existing model in Django? | Currently, I am writing up a bit of a product-based CMS as my first project. Here is my question. How can I add additional data (products) to my Product model? I have added '/admin/products/add' to my urls.py, but I don't really know where to go from there. How would i build both my view and my template? Please keep in... | You will want to wire your URL to the Django create_object generic view, and pass it either "model" (the model you want to create) or "form_class" (a customized ModelForm class). There are a number of other arguments you can also pass to override default behaviors. Sample URLconf for the simplest case: from django.conf... | How do I add data to an existing model in Django? Currently, I am writing up a bit of a product-based CMS as my first project. Here is my question. How can I add additional data (products) to my Product model? I have added '/admin/products/add' to my urls.py, but I don't really know where to go from there. How would i ... | TITLE:
How do I add data to an existing model in Django?
QUESTION:
Currently, I am writing up a bit of a product-based CMS as my first project. Here is my question. How can I add additional data (products) to my Product model? I have added '/admin/products/add' to my urls.py, but I don't really know where to go from t... | [
"python",
"django"
] | 7 | 7 | 4,715 | 3 | 0 | 2008-08-31T12:11:10.320000 | 2008-08-31T15:59:11.473000 |
36,813 | 36,927 | Table Stats gathering for Oracle | When and how should table stats gathering be performed for Oracle, version 9 and up? How would you go about gathering stats for a large database, where stats gathering would collide with "business hours". | Gathering stats should be done whenever there has been large changes to the data content, for example a large number of deletes or inserts. If the table structure has changed you should gather stats also. It is advisable to use the 'ESTIMATE' option. Do this as an automated process out of business hours if possible, or... | Table Stats gathering for Oracle When and how should table stats gathering be performed for Oracle, version 9 and up? How would you go about gathering stats for a large database, where stats gathering would collide with "business hours". | TITLE:
Table Stats gathering for Oracle
QUESTION:
When and how should table stats gathering be performed for Oracle, version 9 and up? How would you go about gathering stats for a large database, where stats gathering would collide with "business hours".
ANSWER:
Gathering stats should be done whenever there has been ... | [
"oracle",
"table-statistics"
] | 3 | 1 | 9,299 | 4 | 0 | 2008-08-31T12:11:42.690000 | 2008-08-31T15:48:19.910000 |
36,825 | 37,071 | Integrating Perl and Oracle Advanced Queuing | Is there any way to listen to an Oracle AQ using a Perl process as the listener. | This Introduction to Oracle Advanced Queuing states that you can interface to it through "Internet access using HTTP, HTTPS, and SMTP" so it should be straightforward to do that using a Perl script. | Integrating Perl and Oracle Advanced Queuing Is there any way to listen to an Oracle AQ using a Perl process as the listener. | TITLE:
Integrating Perl and Oracle Advanced Queuing
QUESTION:
Is there any way to listen to an Oracle AQ using a Perl process as the listener.
ANSWER:
This Introduction to Oracle Advanced Queuing states that you can interface to it through "Internet access using HTTP, HTTPS, and SMTP" so it should be straightforward ... | [
"perl",
"oracle",
"messaging",
"advanced-queuing"
] | 0 | 1 | 858 | 1 | 0 | 2008-08-31T12:29:38.700000 | 2008-08-31T20:18:43.973000 |
36,831 | 36,841 | How do you parse an IP address string to a uint value in C#? | I'm writing C# code that uses the windows IP Helper API. One of the functions I'm trying to call is " GetBestInterface " that takes a 'uint' representation of an IP. What I need is to parse a textual representation of the IP to create the 'uint' representation. I've found some examples via Google, like this one or this... | MSDN says that IPAddress.Address property (which returns numeric representation of IP address) is obsolete and you should use GetAddressBytes method. You can convert IP address to numeric value using following code: var ipAddress = IPAddress.Parse("some.ip.address"); var ipBytes = ipAddress.GetAddressBytes(); var ip = ... | How do you parse an IP address string to a uint value in C#? I'm writing C# code that uses the windows IP Helper API. One of the functions I'm trying to call is " GetBestInterface " that takes a 'uint' representation of an IP. What I need is to parse a textual representation of the IP to create the 'uint' representatio... | TITLE:
How do you parse an IP address string to a uint value in C#?
QUESTION:
I'm writing C# code that uses the windows IP Helper API. One of the functions I'm trying to call is " GetBestInterface " that takes a 'uint' representation of an IP. What I need is to parse a textual representation of the IP to create the 'u... | [
"c#",
".net",
"winapi",
"networking",
"iphelper"
] | 8 | 13 | 25,216 | 9 | 0 | 2008-08-31T12:35:30.310000 | 2008-08-31T12:55:45.380000 |
36,832 | 75,654 | Virtual functions in constructors, why do languages differ? | In C++ when a virtual function is called from within a constructor it doesn't behave like a virtual function. I think everyone who encountered this behavior for the first time was surprised but on second thought it made sense: As long as the derived constructor has not been executed the object is not yet a derived inst... | There's a fundamental difference in how the languages define an object's life time. In Java and.Net the object members are zero/null initialized before any constructor is run and is at this point that the object life time begins. So when you enter the constructor you've already got an initialized object. In C++ the obj... | Virtual functions in constructors, why do languages differ? In C++ when a virtual function is called from within a constructor it doesn't behave like a virtual function. I think everyone who encountered this behavior for the first time was surprised but on second thought it made sense: As long as the derived constructo... | TITLE:
Virtual functions in constructors, why do languages differ?
QUESTION:
In C++ when a virtual function is called from within a constructor it doesn't behave like a virtual function. I think everyone who encountered this behavior for the first time was surprised but on second thought it made sense: As long as the ... | [
"java",
".net",
"c++",
"language-agnostic"
] | 12 | 11 | 3,909 | 6 | 0 | 2008-08-31T12:37:24.067000 | 2008-09-16T18:49:55.313000 |
36,861 | 36,869 | Strange boo language syntax | I've run into a strange syntax in Boo Language Guide: setter = { value | a = value } What does the | operator mean? | The documentation of Boo seems to be lacking in this area -- it seems that setter = { value | a = value } is shorthand for setter = def(value): a = value | Strange boo language syntax I've run into a strange syntax in Boo Language Guide: setter = { value | a = value } What does the | operator mean? | TITLE:
Strange boo language syntax
QUESTION:
I've run into a strange syntax in Boo Language Guide: setter = { value | a = value } What does the | operator mean?
ANSWER:
The documentation of Boo seems to be lacking in this area -- it seems that setter = { value | a = value } is shorthand for setter = def(value): a = v... | [
"closures",
"boo"
] | 3 | 5 | 1,127 | 4 | 0 | 2008-08-31T13:52:56.613000 | 2008-08-31T14:10:07.383000 |
36,862 | 37,006 | How do you organise multiple git repositories, so that all of them are backed up together? | With SVN, I had a single big repository I kept on a server, and checked-out on a few machines. This was a pretty good backup system, and allowed me easily work on any of the machines. I could checkout a specific project, commit and it updated the 'master' project, or I could checkout the entire thing. Now, I have a bun... | I would strongly advise against putting unrelated data in a given Git repository. The overhead of creating new repositories is quite low, and that is a feature that makes it possible to keep different lineages completely separate. Fighting that idea means ending up with unnecessarily tangled history, which renders admi... | How do you organise multiple git repositories, so that all of them are backed up together? With SVN, I had a single big repository I kept on a server, and checked-out on a few machines. This was a pretty good backup system, and allowed me easily work on any of the machines. I could checkout a specific project, commit a... | TITLE:
How do you organise multiple git repositories, so that all of them are backed up together?
QUESTION:
With SVN, I had a single big repository I kept on a server, and checked-out on a few machines. This was a pretty good backup system, and allowed me easily work on any of the machines. I could checkout a specific... | [
"git",
"backup"
] | 101 | 75 | 52,541 | 6 | 0 | 2008-08-31T13:54:20.590000 | 2008-08-31T18:17:07.027000 |
36,876 | 36,879 | Conditional Redirect on Login | I am using forms authentication. My users are redirected to a page (written in web.config) when they login, but some of them may not have the privilages to access this default page. In this case, I want them to redirect to another page but RedirectFromLoginPage method always redirects to the default page in web.config.... | The SetAuthCookie allows you to issue the auth cookie but retain control over the navigation. After that method is called you can run your logic to do a typical ASP.NET redirect to wherever you want. | Conditional Redirect on Login I am using forms authentication. My users are redirected to a page (written in web.config) when they login, but some of them may not have the privilages to access this default page. In this case, I want them to redirect to another page but RedirectFromLoginPage method always redirects to t... | TITLE:
Conditional Redirect on Login
QUESTION:
I am using forms authentication. My users are redirected to a page (written in web.config) when they login, but some of them may not have the privilages to access this default page. In this case, I want them to redirect to another page but RedirectFromLoginPage method alw... | [
"asp.net",
"forms-authentication"
] | 1 | 5 | 1,369 | 2 | 0 | 2008-08-31T14:27:32.023000 | 2008-08-31T14:32:39.187000 |
36,877 | 36,885 | How do you set up use HttpOnly cookies in PHP | How can I set the cookies in my PHP apps as HttpOnly cookies? | For your cookies, see this answer. For PHP's own session cookie ( PHPSESSID, by default), see @richie's answer The setcookie() and setrawcookie() functions, introduced the boolean httponly parameter, back in the dark ages of PHP 5.2.0, making this nice and easy. Simply set the 7th parameter to true, as per the syntax F... | How do you set up use HttpOnly cookies in PHP How can I set the cookies in my PHP apps as HttpOnly cookies? | TITLE:
How do you set up use HttpOnly cookies in PHP
QUESTION:
How can I set the cookies in my PHP apps as HttpOnly cookies?
ANSWER:
For your cookies, see this answer. For PHP's own session cookie ( PHPSESSID, by default), see @richie's answer The setcookie() and setrawcookie() functions, introduced the boolean httpo... | [
"php",
"security",
"cookies",
"xss",
"httponly"
] | 107 | 105 | 152,288 | 11 | 0 | 2008-08-31T14:27:50.337000 | 2008-08-31T14:38:41.730000 |
36,881 | 68,078 | Updating Android Tab Icons | I have an activity that has a TabHost containing a set of TabSpecs each with a listview containing the items to be displayed by the tab. When each TabSpec is created, I set an icon to be displayed in the tab header. The TabSpecs are created in this way within a setupTabs() method which loops to create the appropriate n... | The short answer is, you're not missing anything. The Android SDK doesn't provide a direct method to change the indicator of a TabHost after it's been created. The TabSpec is only used to build the tab, so changing the TabSpec after the fact will have no effect. I think there's a workaround, though. Call mTabs.getTabWi... | Updating Android Tab Icons I have an activity that has a TabHost containing a set of TabSpecs each with a listview containing the items to be displayed by the tab. When each TabSpec is created, I set an icon to be displayed in the tab header. The TabSpecs are created in this way within a setupTabs() method which loops ... | TITLE:
Updating Android Tab Icons
QUESTION:
I have an activity that has a TabHost containing a set of TabSpecs each with a listview containing the items to be displayed by the tab. When each TabSpec is created, I set an icon to be displayed in the tab header. The TabSpecs are created in this way within a setupTabs() m... | [
"java",
"android",
"android-tabhost"
] | 44 | 37 | 40,621 | 5 | 0 | 2008-08-31T14:36:11.610000 | 2008-09-15T23:59:28.807000 |
36,889 | 37,066 | Memcache control panel? | We've been running eAccelerator on each of 3 webservers and are looking to move to a memcache pool across all 3, hopefully reducing by about 2/3 our db lookups. One of the handy things about eAccelerator is the web-based control interface ( control.php ), which has proved very useful when we've had to flush the cache u... | memcache.php may be what you're looking for. memcache.php that you can get stats and dump from multiple memcache servers. Can delete keys and flush servers. | Memcache control panel? We've been running eAccelerator on each of 3 webservers and are looking to move to a memcache pool across all 3, hopefully reducing by about 2/3 our db lookups. One of the handy things about eAccelerator is the web-based control interface ( control.php ), which has proved very useful when we've ... | TITLE:
Memcache control panel?
QUESTION:
We've been running eAccelerator on each of 3 webservers and are looking to move to a memcache pool across all 3, hopefully reducing by about 2/3 our db lookups. One of the handy things about eAccelerator is the web-based control interface ( control.php ), which has proved very ... | [
"caching",
"memcached",
"controlpanel",
"eaccelerator"
] | 6 | 7 | 13,800 | 4 | 0 | 2008-08-31T14:41:46.857000 | 2008-08-31T20:13:51.083000 |
36,890 | 42,467 | Changing a CORBA interface without recompiling | I'd like to add a method to my existing server's CORBA interface. Will that require recompiling all clients? I'm using TAO. | Recompilation of clients is not required (and should not be, regardless of the ORB that you use). As Adam indicated, lookups are done by operation name (a straight text comparison). I've done what you're describing with our ACE/TAO-based system, and encountered no issues (servers were in ACE/TAO C++, clients were ACE/T... | Changing a CORBA interface without recompiling I'd like to add a method to my existing server's CORBA interface. Will that require recompiling all clients? I'm using TAO. | TITLE:
Changing a CORBA interface without recompiling
QUESTION:
I'd like to add a method to my existing server's CORBA interface. Will that require recompiling all clients? I'm using TAO.
ANSWER:
Recompilation of clients is not required (and should not be, regardless of the ORB that you use). As Adam indicated, looku... | [
"c++",
"corba",
"idl",
"tao"
] | 4 | 4 | 519 | 5 | 0 | 2008-08-31T14:44:18.457000 | 2008-09-03T20:11:36.880000 |
36,901 | 36,908 | What does ** (double star/asterisk) and * (star/asterisk) do for parameters? | What do *args and **kwargs mean in these function definitions? def foo(x, y, *args): pass
def bar(x, y, **kwargs): pass See What do ** (double star/asterisk) and * (star/asterisk) mean in a function call? for the complementary question about arguments. | The *args and **kwargs are common idioms to allow an arbitrary number of arguments to functions, as described in the section more on defining functions in the Python tutorial. The *args will give you all positional arguments as a tuple: def foo(*args): for a in args: print(a)
foo(1) # 1
foo(1, 2, 3) # 1 # 2 # 3 The *... | What does ** (double star/asterisk) and * (star/asterisk) do for parameters? What do *args and **kwargs mean in these function definitions? def foo(x, y, *args): pass
def bar(x, y, **kwargs): pass See What do ** (double star/asterisk) and * (star/asterisk) mean in a function call? for the complementary question about ... | TITLE:
What does ** (double star/asterisk) and * (star/asterisk) do for parameters?
QUESTION:
What do *args and **kwargs mean in these function definitions? def foo(x, y, *args): pass
def bar(x, y, **kwargs): pass See What do ** (double star/asterisk) and * (star/asterisk) mean in a function call? for the complementa... | [
"python",
"syntax",
"parameter-passing",
"variadic-functions",
"argument-unpacking"
] | 3,381 | 3,226 | 1,388,483 | 28 | 0 | 2008-08-31T15:04:35.350000 | 2008-08-31T15:17:31.137000 |
36,906 | 36,942 | What is the fastest way to swap values in C? | I want to swap two integers, and I want to know which of these two implementations will be faster: The obvious way with a temp variable: void swap(int* a, int* b) { int temp = *a; *a = *b; *b = temp; } Or the xor version that I'm sure most people have seen: void swap(int* a, int* b) { *a ^= *b; *b ^= *a; *a ^= *b; } It... | The XOR method fails if a and b point to the same address. The first XOR will clear all of the bits at the memory address pointed to by both variables, so once the function returns (*a == *b == 0), regardless of the initial value. More info on the Wiki page: XOR swap algorithm Although it's not likely that this issue w... | What is the fastest way to swap values in C? I want to swap two integers, and I want to know which of these two implementations will be faster: The obvious way with a temp variable: void swap(int* a, int* b) { int temp = *a; *a = *b; *b = temp; } Or the xor version that I'm sure most people have seen: void swap(int* a,... | TITLE:
What is the fastest way to swap values in C?
QUESTION:
I want to swap two integers, and I want to know which of these two implementations will be faster: The obvious way with a temp variable: void swap(int* a, int* b) { int temp = *a; *a = *b; *b = temp; } Or the xor version that I'm sure most people have seen:... | [
"c",
"performance"
] | 76 | 93 | 67,520 | 21 | 0 | 2008-08-31T15:12:35.503000 | 2008-08-31T16:17:17.577000 |
36,915 | 36,917 | Is there any way to "sticky" a file in subversion? | We have been working with CVS for years, and frequently find it useful to "sticky" a single file here and there. Is there any way to do this in subversion, specifically from TortoiseSVN? | Short answer: no. Long answer: Working copies are sticky to a branch by definition, as changing to a different branch means changing the base-Subversion-URL used to access the repository. However sticky-revision files... that's not a concept that Subversion has. See: Subversion update command reference Appendix A of th... | Is there any way to "sticky" a file in subversion? We have been working with CVS for years, and frequently find it useful to "sticky" a single file here and there. Is there any way to do this in subversion, specifically from TortoiseSVN? | TITLE:
Is there any way to "sticky" a file in subversion?
QUESTION:
We have been working with CVS for years, and frequently find it useful to "sticky" a single file here and there. Is there any way to do this in subversion, specifically from TortoiseSVN?
ANSWER:
Short answer: no. Long answer: Working copies are stick... | [
"svn"
] | 1 | 2 | 1,794 | 2 | 0 | 2008-08-31T15:29:34.137000 | 2008-08-31T15:33:49.430000 |
36,916 | 36,931 | Communication between pages | I want to enable an user to be able to communicate with other users through a site. I know that ASP.net is stateless, but what can I use for this synced communication? Java servlets? | I don't think you need to set up Java just to use a servlet for this. I would use AJAX and the database. I don't know ASP.NET but I PHP is similar in this case, being also basically "stateless". If you want to display some kind of asynchronous communication between two different users, say, from two different sessions,... | Communication between pages I want to enable an user to be able to communicate with other users through a site. I know that ASP.net is stateless, but what can I use for this synced communication? Java servlets? | TITLE:
Communication between pages
QUESTION:
I want to enable an user to be able to communicate with other users through a site. I know that ASP.net is stateless, but what can I use for this synced communication? Java servlets?
ANSWER:
I don't think you need to set up Java just to use a servlet for this. I would use ... | [
"asp.net"
] | 1 | 2 | 792 | 5 | 0 | 2008-08-31T15:31:39.857000 | 2008-08-31T15:52:32.863000 |
36,932 | 1,695,250 | How can I represent an 'Enum' in Python? | I'm mainly a C# developer, but I'm currently working on a project in Python. How can I represent the equivalent of an Enum in Python? | Enums have been added to Python 3.4 as described in PEP 435. It has also been backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4 on pypi. For more advanced Enum techniques try the aenum library (2.7, 3.3+, same author as enum34. Code is not perfectly compatible between py2 and py3, e.g. you'll need __order__ in python... | How can I represent an 'Enum' in Python? I'm mainly a C# developer, but I'm currently working on a project in Python. How can I represent the equivalent of an Enum in Python? | TITLE:
How can I represent an 'Enum' in Python?
QUESTION:
I'm mainly a C# developer, but I'm currently working on a project in Python. How can I represent the equivalent of an Enum in Python?
ANSWER:
Enums have been added to Python 3.4 as described in PEP 435. It has also been backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2... | [
"python",
"python-3.x",
"enums"
] | 1,141 | 2,990 | 1,285,129 | 43 | 0 | 2008-08-31T15:55:47.910000 | 2009-11-08T03:15:28.320000 |
36,949 | 36,990 | How do I use ADAM to run unit tests? | I writing a web site that uses Active Directory to validate users. I don't have access to an Active Directory instance that I can edit in any way. I've heard that some people are using Active Directory Application Mode (ADAM) to create AD data to be used in Unit and Integration Testing. Has anyone else done this? Are t... | I don't think this is a good idea just like reading files or accessing the database in unit tests isn't a good idea. Your tests will become dependent on the state of an external piece of software. Or you will have a lot of setup and teardown code. If you write tests this way you can expect you'll spend a lot of extra t... | How do I use ADAM to run unit tests? I writing a web site that uses Active Directory to validate users. I don't have access to an Active Directory instance that I can edit in any way. I've heard that some people are using Active Directory Application Mode (ADAM) to create AD data to be used in Unit and Integration Test... | TITLE:
How do I use ADAM to run unit tests?
QUESTION:
I writing a web site that uses Active Directory to validate users. I don't have access to an Active Directory instance that I can edit in any way. I've heard that some people are using Active Directory Application Mode (ADAM) to create AD data to be used in Unit an... | [
"testing",
"active-directory",
"adam"
] | 3 | 4 | 252 | 1 | 0 | 2008-08-31T16:41:54.367000 | 2008-08-31T17:38:43.357000 |
36,959 | 3,588,796 | How do you use script variables in psql? | In MS SQL Server, I create my scripts to use customizable variables: DECLARE @somevariable int SELECT @somevariable = -1
INSERT INTO foo VALUES ( @somevariable ) I'll then change the value of @somevariable at runtime, depending on the value that I want in the particular situation. Since it's at the top of the script i... | Postgres variables are created through the \set command, for example... \set myvariable value... and can then be substituted, for example, as... SELECT * FROM:myvariable.table1;... or... SELECT * FROM table1 WHERE:myvariable IS NULL; edit: As of psql 9.1, variables can be expanded in quotes as in: \set myvariable value... | How do you use script variables in psql? In MS SQL Server, I create my scripts to use customizable variables: DECLARE @somevariable int SELECT @somevariable = -1
INSERT INTO foo VALUES ( @somevariable ) I'll then change the value of @somevariable at runtime, depending on the value that I want in the particular situati... | TITLE:
How do you use script variables in psql?
QUESTION:
In MS SQL Server, I create my scripts to use customizable variables: DECLARE @somevariable int SELECT @somevariable = -1
INSERT INTO foo VALUES ( @somevariable ) I'll then change the value of @somevariable at runtime, depending on the value that I want in the ... | [
"sql",
"postgresql",
"variables",
"psql"
] | 197 | 242 | 340,195 | 13 | 0 | 2008-08-31T16:54:33.183000 | 2010-08-27T23:40:58.287000 |
36,968 | 36,976 | Designing Panels without a parent Form in VS? | Are there any tools or plugins to design a Panel independently of a Form (Windows, not Web Form) within Visual Studio? I've been using the designer and manually extracting the bits I want from the source, but surely there is a nicer way. | You could do all the design work inside of a UserControl. If you go that route, instead of just copying the bits out of the user control, simply use the user control itself. | Designing Panels without a parent Form in VS? Are there any tools or plugins to design a Panel independently of a Form (Windows, not Web Form) within Visual Studio? I've been using the designer and manually extracting the bits I want from the source, but surely there is a nicer way. | TITLE:
Designing Panels without a parent Form in VS?
QUESTION:
Are there any tools or plugins to design a Panel independently of a Form (Windows, not Web Form) within Visual Studio? I've been using the designer and manually extracting the bits I want from the source, but surely there is a nicer way.
ANSWER:
You could... | [
"visual-studio"
] | 1 | 1 | 143 | 3 | 0 | 2008-08-31T17:07:39.533000 | 2008-08-31T17:13:33.620000 |
36,984 | 36,993 | Is there a standard way to return values from custom dialogs in Windows Forms? | So right now my project has a few custom dialogs that do things like prompt the user for his birthday, or whatever. Right now they're just doing things like setting a this.Birthday property once they get an answer (which is of type DateTime?, with the null indicating a "Cancel"). Then the caller inspects the Birthday p... | I would say exposing properties on your custom dialog is the idiomatic way to go because that is how standard dialogs (like the Select/OpenFileDialog) do it. Someone could argue it is more explicit and intention revealing to have a ShowBirthdayDialog() method that returns the result you're looking for, but following th... | Is there a standard way to return values from custom dialogs in Windows Forms? So right now my project has a few custom dialogs that do things like prompt the user for his birthday, or whatever. Right now they're just doing things like setting a this.Birthday property once they get an answer (which is of type DateTime?... | TITLE:
Is there a standard way to return values from custom dialogs in Windows Forms?
QUESTION:
So right now my project has a few custom dialogs that do things like prompt the user for his birthday, or whatever. Right now they're just doing things like setting a this.Birthday property once they get an answer (which is... | [
".net",
"winforms",
"user-interface"
] | 6 | 9 | 386 | 5 | 0 | 2008-08-31T17:28:11.497000 | 2008-08-31T17:50:56.620000 |
36,991 | 37,001 | Do you have to register a Dialog Box? | So, I am a total beginner in any kind of Windows related programming. I have been playing around with the Windows API and came across a couple of examples on how to initialize create windows and such. One example creates a regular window (I abbreviated some of the code): int WINAPI WinMain( [...] ) {
[...]
// Windows... | You do not have to register a dialog box. Dialog boxes are predefined so (as you noted) there is no reference to a window class when you create a dialog. If you want more control of a dialog (like you get when you create your own window class) you would subclass the dialog which is a method by which you replace the dia... | Do you have to register a Dialog Box? So, I am a total beginner in any kind of Windows related programming. I have been playing around with the Windows API and came across a couple of examples on how to initialize create windows and such. One example creates a regular window (I abbreviated some of the code): int WINAPI... | TITLE:
Do you have to register a Dialog Box?
QUESTION:
So, I am a total beginner in any kind of Windows related programming. I have been playing around with the Windows API and came across a couple of examples on how to initialize create windows and such. One example creates a regular window (I abbreviated some of the... | [
"c++",
"winapi"
] | 1 | 2 | 1,695 | 2 | 0 | 2008-08-31T17:45:46.227000 | 2008-08-31T18:12:07.443000 |
36,999 | 37,012 | Best practices for versioning your services with WCF? | I'm starting to work with my model almost exclusively in WCF and wanted to get some practical approaches to versioning these services over time. Can anyone point me in the right direction? | There is a good writeup on Craig McMurtry's WebLog. Its from 2006, but most of it is still relevant. As well as a decision tree to walk through the choices, he shows how to implement those changes using Windows Communication Foundation | Best practices for versioning your services with WCF? I'm starting to work with my model almost exclusively in WCF and wanted to get some practical approaches to versioning these services over time. Can anyone point me in the right direction? | TITLE:
Best practices for versioning your services with WCF?
QUESTION:
I'm starting to work with my model almost exclusively in WCF and wanted to get some practical approaches to versioning these services over time. Can anyone point me in the right direction?
ANSWER:
There is a good writeup on Craig McMurtry's WebLog... | [
"wcf",
"versioning",
"backwards-compatibility"
] | 27 | 25 | 11,464 | 3 | 0 | 2008-08-31T18:05:49.207000 | 2008-08-31T18:23:22.237000 |
37,011 | 37,021 | Should you ever use protected member variables? | Should you ever use protected member variables? What are the the advantages and what issues can this cause? | Should you ever use protected member variables? Depends on how picky you are about hiding state. If you don't want any leaking of internal state, then declaring all your member variables private is the way to go. If you don't really care that subclasses can access internal state, then protected is good enough. If a dev... | Should you ever use protected member variables? Should you ever use protected member variables? What are the the advantages and what issues can this cause? | TITLE:
Should you ever use protected member variables?
QUESTION:
Should you ever use protected member variables? What are the the advantages and what issues can this cause?
ANSWER:
Should you ever use protected member variables? Depends on how picky you are about hiding state. If you don't want any leaking of interna... | [
"oop",
"protected"
] | 109 | 86 | 75,870 | 10 | 0 | 2008-08-31T18:22:46.230000 | 2008-08-31T18:34:54.003000 |
37,026 | 37,046 | Java: notify() vs. notifyAll() all over again | If one Googles for "difference between notify() and notifyAll() " then a lot of explanations will pop up (leaving apart the javadoc paragraphs). It all boils down to the number of waiting threads being waken up: one in notify() and all in notifyAll(). However (if I do understand the difference between these methods rig... | However (if I do understand the difference between these methods right), only one thread is always selected for further monitor acquisition. That is not correct. o.notifyAll() wakes all of the threads that are blocked in o.wait() calls. The threads are only allowed to return from o.wait() one-by-one, but they each will... | Java: notify() vs. notifyAll() all over again If one Googles for "difference between notify() and notifyAll() " then a lot of explanations will pop up (leaving apart the javadoc paragraphs). It all boils down to the number of waiting threads being waken up: one in notify() and all in notifyAll(). However (if I do under... | TITLE:
Java: notify() vs. notifyAll() all over again
QUESTION:
If one Googles for "difference between notify() and notifyAll() " then a lot of explanations will pop up (leaving apart the javadoc paragraphs). It all boils down to the number of waiting threads being waken up: one in notify() and all in notifyAll(). Howe... | [
"java",
"multithreading"
] | 424 | 269 | 235,058 | 26 | 0 | 2008-08-31T18:47:12.850000 | 2008-08-31T19:25:22.790000 |
37,030 | 37,035 | How to best implement software updates on windows? | I want to implement an "automatic update" system for a windows application. Right now I'm semi-manually creating an "appcast" which my program checks, and notifies the user that a new version is available. (I'm using NSIS for my installers). Is there software that I can use that will handle the "automatic" part of the ... | There is no solution quite as smooth as Sparkle (that I know of). If you need an easy means of deployment and updating applications, ClickOnce is an option. Unfortunately, it's inflexible (e.g., no per-machine installation instead of per-user), opaque (you have very little influence and clarity and control over how its... | How to best implement software updates on windows? I want to implement an "automatic update" system for a windows application. Right now I'm semi-manually creating an "appcast" which my program checks, and notifies the user that a new version is available. (I'm using NSIS for my installers). Is there software that I ca... | TITLE:
How to best implement software updates on windows?
QUESTION:
I want to implement an "automatic update" system for a windows application. Right now I'm semi-manually creating an "appcast" which my program checks, and notifies the user that a new version is available. (I'm using NSIS for my installers). Is there ... | [
"windows",
"installation"
] | 23 | 7 | 7,998 | 9 | 0 | 2008-08-31T18:57:29.050000 | 2008-08-31T19:10:46.227000 |
37,041 | 37,093 | Exposing a remote interface or object model | I have a question on the best way of exposing an asynchronous remote interface. The conditions are as follows: The protocol is asynchronous A third party can modify the data at any time The command round-trip can be significant The model should be well suited for UI interaction The protocol supports queries over certai... | For the asynchronous bit, I would suggest checking into java.util.concurrent, and especially the Future interface. The future interface is used to represent objects which are not ready yet, but are being created in a separate thread. You say that objects can be modified at any time by a third party, but I would still s... | Exposing a remote interface or object model I have a question on the best way of exposing an asynchronous remote interface. The conditions are as follows: The protocol is asynchronous A third party can modify the data at any time The command round-trip can be significant The model should be well suited for UI interacti... | TITLE:
Exposing a remote interface or object model
QUESTION:
I have a question on the best way of exposing an asynchronous remote interface. The conditions are as follows: The protocol is asynchronous A third party can modify the data at any time The command round-trip can be significant The model should be well suite... | [
"java",
"eclipse",
"osgi",
"oop"
] | 2 | 2 | 571 | 5 | 0 | 2008-08-31T19:21:27.200000 | 2008-08-31T20:52:01.193000 |
37,043 | 37,566 | Flex MVC Frameworks | I'm currently using and enjoying using the Flex MVC framework PureMVC. I have heard some good things about Cairngorm, which is supported by Adobe and has first-to-market momentum. And there is a new player called Mate, which has a good deal of buzz. Has anyone tried two or three of these frameworks and formed an opinio... | Mate is my pick. The first and foremost reason is that it is completely unobtrusive. My application code has no dependencies on the framework, it is highly decoupled, reusable and testable. One of the nicest features of Mate is the declarative configuration, essentially you wire up your application in using tags in wha... | Flex MVC Frameworks I'm currently using and enjoying using the Flex MVC framework PureMVC. I have heard some good things about Cairngorm, which is supported by Adobe and has first-to-market momentum. And there is a new player called Mate, which has a good deal of buzz. Has anyone tried two or three of these frameworks ... | TITLE:
Flex MVC Frameworks
QUESTION:
I'm currently using and enjoying using the Flex MVC framework PureMVC. I have heard some good things about Cairngorm, which is supported by Adobe and has first-to-market momentum. And there is a new player called Mate, which has a good deal of buzz. Has anyone tried two or three of... | [
"apache-flex",
"model-view-controller",
"frameworks"
] | 33 | 48 | 17,990 | 14 | 0 | 2008-08-31T19:24:55.270000 | 2008-09-01T07:27:05.347000 |
37,053 | 37,055 | How can I get the localized name of a 'special' windows folder (Recycle bin etc.)? | I'm trying to find out the 'correct' windows API for finding out the localized name of 'special' folders, specifically the Recycle Bin. I want to be able to prompt the user with a suitably localized dialog box asking them if they want to send files to the recycle bin or delete them directly. I've found lots on the inte... | Read this article for code samples and usage: http://www.codeproject.com/KB/winsdk/SpecialFolders.aspx Also there is an article on MSDN that helps you Identify the Location of Special Folders with API Calls | How can I get the localized name of a 'special' windows folder (Recycle bin etc.)? I'm trying to find out the 'correct' windows API for finding out the localized name of 'special' folders, specifically the Recycle Bin. I want to be able to prompt the user with a suitably localized dialog box asking them if they want to... | TITLE:
How can I get the localized name of a 'special' windows folder (Recycle bin etc.)?
QUESTION:
I'm trying to find out the 'correct' windows API for finding out the localized name of 'special' folders, specifically the Recycle Bin. I want to be able to prompt the user with a suitably localized dialog box asking th... | [
"winapi",
"localization",
"recycle-bin"
] | 3 | 2 | 1,963 | 2 | 0 | 2008-08-31T19:44:47.907000 | 2008-08-31T19:47:14.267000 |
37,056 | 37,083 | PostgreSQL performance monitoring tool | I'm setting up a web application with a FreeBSD PostgreSQL back-end. I'm looking for some database performance optimization tool/technique. | pgfouine works fairly well for me. And it looks like there's a FreeBSD port for it. | PostgreSQL performance monitoring tool I'm setting up a web application with a FreeBSD PostgreSQL back-end. I'm looking for some database performance optimization tool/technique. | TITLE:
PostgreSQL performance monitoring tool
QUESTION:
I'm setting up a web application with a FreeBSD PostgreSQL back-end. I'm looking for some database performance optimization tool/technique.
ANSWER:
pgfouine works fairly well for me. And it looks like there's a FreeBSD port for it. | [
"sql",
"database",
"optimization",
"postgresql",
"freebsd"
] | 11 | 5 | 9,764 | 7 | 0 | 2008-08-31T19:47:35.340000 | 2008-08-31T20:34:02.623000 |
37,059 | 37,173 | Configure Lucene.Net with SQL Server | Has anyone used Lucene.NET rather than using the full text search that comes with sql server? If so I would be interested on how you implemented it. Did you for example write a windows service that queried the database every hour then saved the results to the lucene.net index? | Yes, I've used it for exactly what you are describing. We had two services - one for read, and one for write, but only because we had multiple readers. I'm sure we could have done it with just one service (the writer) and embedded the reader in the web app and services. I've used lucene.net as a general database indexe... | Configure Lucene.Net with SQL Server Has anyone used Lucene.NET rather than using the full text search that comes with sql server? If so I would be interested on how you implemented it. Did you for example write a windows service that queried the database every hour then saved the results to the lucene.net index? | TITLE:
Configure Lucene.Net with SQL Server
QUESTION:
Has anyone used Lucene.NET rather than using the full text search that comes with sql server? If so I would be interested on how you implemented it. Did you for example write a windows service that queried the database every hour then saved the results to the lucen... | [
"sql-server",
"lucene.net"
] | 60 | 59 | 26,555 | 4 | 0 | 2008-08-31T19:53:14.797000 | 2008-08-31T22:11:33.950000 |
37,067 | 37,314 | Task oriented thread pooling | I've created a model for executing worker tasks in a server application using a thread pool associated with an IO completion port such as shown in the posts below: http://weblogs.asp.net/kennykerr/archive/2008/01/03/parallel-programming-with-c-part-4-i-o-completion-ports.aspx http://blogs.msdn.com/larryosterman/archive... | Not really, at least, not last time I looked. I mean, boost::thread_group might make things marginally tidier in places, but not so as would make much of a difference, I don't think. Boost's thread support seems marginally useful when writing something that's cross-platform, but given that what you're writing is going ... | Task oriented thread pooling I've created a model for executing worker tasks in a server application using a thread pool associated with an IO completion port such as shown in the posts below: http://weblogs.asp.net/kennykerr/archive/2008/01/03/parallel-programming-with-c-part-4-i-o-completion-ports.aspx http://blogs.m... | TITLE:
Task oriented thread pooling
QUESTION:
I've created a model for executing worker tasks in a server application using a thread pool associated with an IO completion port such as shown in the posts below: http://weblogs.asp.net/kennykerr/archive/2008/01/03/parallel-programming-with-c-part-4-i-o-completion-ports.a... | [
"c++",
"multithreading",
"boost"
] | 4 | 1 | 756 | 4 | 0 | 2008-08-31T20:13:52.673000 | 2008-09-01T00:46:10.180000 |
37,069 | 37,111 | Apache - how do I build individual and/or all modules as shared modules | On Mac OS X 10.5 I downloaded the latest version of Apache 2.2.9. After the usual configure, make, make install dance I had a build of apache without mod_rewrite. This wasn't statically linked and the module was not built in the /modules folder either. I had to do the following to build Apache and mod_rewrite:./configu... | Try the./configure option --enable-mods-shared="all", or --enable-mods-shared=" " to compile modules as shared objects. See further details in Apache 2.2 docs To just compile Apache with the ability to load shared objects (and add modules later), use --enable-so, then consult the documentation on compiling modules sepe... | Apache - how do I build individual and/or all modules as shared modules On Mac OS X 10.5 I downloaded the latest version of Apache 2.2.9. After the usual configure, make, make install dance I had a build of apache without mod_rewrite. This wasn't statically linked and the module was not built in the /modules folder eit... | TITLE:
Apache - how do I build individual and/or all modules as shared modules
QUESTION:
On Mac OS X 10.5 I downloaded the latest version of Apache 2.2.9. After the usual configure, make, make install dance I had a build of apache without mod_rewrite. This wasn't statically linked and the module was not built in the /... | [
"apache",
"unix",
"configuration",
"mod-rewrite",
"build"
] | 13 | 15 | 23,423 | 2 | 0 | 2008-08-31T20:18:13.833000 | 2008-08-31T21:14:05.197000 |
37,070 | 37,092 | What is the meaning of "non temporal" memory accesses in x86 | This is a somewhat low-level question. In x86 assembly there are two SSE instructions: MOVDQA xmmi, m128 and MOVNTDQA xmmi, m128 The IA-32 Software Developer's Manual says that the NT in MOVNTDQA stands for Non-Temporal, and that otherwise it's the same as MOVDQA. My question is, what does Non-Temporal mean? | Non-Temporal SSE instructions (MOVNTI, MOVNTQ, etc.), don't follow the normal cache-coherency rules. Therefore non-temporal stores must be followed by an SFENCE instruction in order for their results to be seen by other processors in a timely fashion. When data is produced and not (immediately) consumed again, the fact... | What is the meaning of "non temporal" memory accesses in x86 This is a somewhat low-level question. In x86 assembly there are two SSE instructions: MOVDQA xmmi, m128 and MOVNTDQA xmmi, m128 The IA-32 Software Developer's Manual says that the NT in MOVNTDQA stands for Non-Temporal, and that otherwise it's the same as MO... | TITLE:
What is the meaning of "non temporal" memory accesses in x86
QUESTION:
This is a somewhat low-level question. In x86 assembly there are two SSE instructions: MOVDQA xmmi, m128 and MOVNTDQA xmmi, m128 The IA-32 Software Developer's Manual says that the NT in MOVNTDQA stands for Non-Temporal, and that otherwise i... | [
"x86",
"sse",
"assembly"
] | 161 | 191 | 54,273 | 4 | 0 | 2008-08-31T20:18:34.113000 | 2008-08-31T20:50:00.200000 |
37,073 | 37,321 | What is currently the best way to get a favicon to display in all browsers that support Favicons? | What is currently the best way to get a favicon to display in all browsers that currently support it? Please include: Which image formats are supported by which browsers. Which lines are needed in what places for the various browsers. | I go for a belt and braces approach here. I create a 32x32 icon in both the.ico and.png formats called favicon.ico and favicon.png. The icon name doesn't really matter unless you are dealing with older browsers. Place favicon.ico at your site root to support the older browsers (optional and only relevant for older brow... | What is currently the best way to get a favicon to display in all browsers that support Favicons? What is currently the best way to get a favicon to display in all browsers that currently support it? Please include: Which image formats are supported by which browsers. Which lines are needed in what places for the vario... | TITLE:
What is currently the best way to get a favicon to display in all browsers that support Favicons?
QUESTION:
What is currently the best way to get a favicon to display in all browsers that currently support it? Please include: Which image formats are supported by which browsers. Which lines are needed in what pl... | [
"html",
"standards",
"favicon"
] | 83 | 110 | 43,826 | 9 | 0 | 2008-08-31T20:20:46.527000 | 2008-09-01T00:55:43.010000 |
37,089 | 37,090 | How can an application use multiple cores or CPUs in .NET or Java? | When launching a thread or a process in.NET or Java, is there a way to choose which processor or core it is launched on? How does the shared memory model work in such cases? | If you're using multiple threads, the operating system will automatically take care of using multiple cores. | How can an application use multiple cores or CPUs in .NET or Java? When launching a thread or a process in.NET or Java, is there a way to choose which processor or core it is launched on? How does the shared memory model work in such cases? | TITLE:
How can an application use multiple cores or CPUs in .NET or Java?
QUESTION:
When launching a thread or a process in.NET or Java, is there a way to choose which processor or core it is launched on? How does the shared memory model work in such cases?
ANSWER:
If you're using multiple threads, the operating syst... | [
"c#",
"java",
"multithreading"
] | 10 | 7 | 15,649 | 5 | 0 | 2008-08-31T20:42:43.650000 | 2008-08-31T20:45:34.873000 |
37,095 | 37,118 | How do I avoid read locks in my database? | How do I avoid read locks in my database? Answers for multiple databases welcome! | In Oracle the default mode of operation is the Read committed isolation level where a select statement is not blocked by another transaction modifying the data it's reading. From Data Concurrency and Consistency: Each query executed by a transaction sees only data that was committed before the query (not the transactio... | How do I avoid read locks in my database? How do I avoid read locks in my database? Answers for multiple databases welcome! | TITLE:
How do I avoid read locks in my database?
QUESTION:
How do I avoid read locks in my database? Answers for multiple databases welcome!
ANSWER:
In Oracle the default mode of operation is the Read committed isolation level where a select statement is not blocked by another transaction modifying the data it's read... | [
"sql",
"database",
"performance",
"locking"
] | 6 | 3 | 5,794 | 4 | 0 | 2008-08-31T20:54:19.003000 | 2008-08-31T21:21:44.507000 |
37,101 | 37,167 | How to Clear OutputCache for Website without Restarting App | Is there a way clear or reset the outputcache for an entire website without a restart? I'm just starting to use outputcache on a site and when I make a mistake in setting it up I need a page I can browse to that will reset it. | This should do the trick: Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim path As String path="/AbosoluteVirtualPath/OutputCached.aspx" HttpResponse.RemoveOutputCacheItem(path)
End Sub | How to Clear OutputCache for Website without Restarting App Is there a way clear or reset the outputcache for an entire website without a restart? I'm just starting to use outputcache on a site and when I make a mistake in setting it up I need a page I can browse to that will reset it. | TITLE:
How to Clear OutputCache for Website without Restarting App
QUESTION:
Is there a way clear or reset the outputcache for an entire website without a restart? I'm just starting to use outputcache on a site and when I make a mistake in setting it up I need a page I can browse to that will reset it.
ANSWER:
This s... | [
"asp.net",
"outputcache"
] | 11 | 9 | 9,057 | 2 | 0 | 2008-08-31T21:03:14.693000 | 2008-08-31T22:02:53.800000 |
37,103 | 37,131 | CSS - Make divs align horizontally | I have a container div with a fixed width and height, with overflow: hidden. I want a horizontal row of float: left divs within this container. Divs which are floated left will naturally push onto the 'line' below after they read the right bound of their parent. This will happen even if the height of the parent should ... | You may put an inner div in the container that is enough wide to hold all the floated divs. #container {
background-color: red;
overflow: hidden;
width: 200px;
}
#inner {
overflow: hidden;
width: 2000px;
}.child {
float: left;
background-color: blue;
width: 50px;
height: 50px;
} | CSS - Make divs align horizontally I have a container div with a fixed width and height, with overflow: hidden. I want a horizontal row of float: left divs within this container. Divs which are floated left will naturally push onto the 'line' below after they read the right bound of their parent. This will happen even ... | TITLE:
CSS - Make divs align horizontally
QUESTION:
I have a container div with a fixed width and height, with overflow: hidden. I want a horizontal row of float: left divs within this container. Divs which are floated left will naturally push onto the 'line' below after they read the right bound of their parent. This... | [
"html",
"css",
"alignment"
] | 93 | 107 | 259,039 | 7 | 0 | 2008-08-31T21:05:41.830000 | 2008-08-31T21:29:59.510000 |
37,104 | 37,132 | Best Practices for versioning web site? | What's are the best practices for versioning web sites? Which revision control systems are well suited for such a job? What special-purpose tools exist? What other questions should I be asking? | Firstly you can - and should - use a revision control system, most will handle binary files although unlike text files you can't merge two different set of changes so you may want to set the system up to lock these files whilst they are being changed (assuming that that's not the default mode of operation for you rcs i... | Best Practices for versioning web site? What's are the best practices for versioning web sites? Which revision control systems are well suited for such a job? What special-purpose tools exist? What other questions should I be asking? | TITLE:
Best Practices for versioning web site?
QUESTION:
What's are the best practices for versioning web sites? Which revision control systems are well suited for such a job? What special-purpose tools exist? What other questions should I be asking?
ANSWER:
Firstly you can - and should - use a revision control syste... | [
"version-control"
] | 12 | 5 | 10,048 | 3 | 0 | 2008-08-31T21:05:48.943000 | 2008-08-31T21:30:06.623000 |
37,122 | 156,274 | Make browser window blink in task Bar | How do I make a user's browser blink/flash/highlight in the task bar using JavaScript? For example, if I make an AJAX request every 10 seconds to see if the user has any new messages on the server, I want the user to know it right away, even if he is using another application at the time. Edit: These users do want to b... | this won't make the taskbar button flash in changing colours, but the title will blink on and off until they move the mouse. This should work cross platform, and even if they just have it in a different tab. newExcitingAlerts = (function () { var oldTitle = document.title; var msg = "New!"; var timeoutId; var blink = f... | Make browser window blink in task Bar How do I make a user's browser blink/flash/highlight in the task bar using JavaScript? For example, if I make an AJAX request every 10 seconds to see if the user has any new messages on the server, I want the user to know it right away, even if he is using another application at th... | TITLE:
Make browser window blink in task Bar
QUESTION:
How do I make a user's browser blink/flash/highlight in the task bar using JavaScript? For example, if I make an AJAX request every 10 seconds to see if the user has any new messages on the server, I want the user to know it right away, even if he is using another... | [
"javascript",
"browser"
] | 108 | 89 | 118,309 | 12 | 0 | 2008-08-31T21:22:51.930000 | 2008-10-01T04:48:18.450000 |
37,141 | 37,309 | Event handling in Dojo | Taking Jeff Atwood's advice, I decided to use a JavaScript library for the very basic to-do list application I'm writing. I picked the Dojo toolkit, version 1.1.1. At first, all was fine: the drag-and-drop code I wrote worked first time, you can drag tasks on-screen to change their order of precedence, and each drag-an... | I assume that you followed the dijit.Tree and dojo.data in Dojo 1.1 tutorial which directed you to pass the data to the tree control using a data store. That had me banging my head of a brick wall for a while. Its not really a great approach and the alternative is not really well documented. You need to create a use mo... | Event handling in Dojo Taking Jeff Atwood's advice, I decided to use a JavaScript library for the very basic to-do list application I'm writing. I picked the Dojo toolkit, version 1.1.1. At first, all was fine: the drag-and-drop code I wrote worked first time, you can drag tasks on-screen to change their order of prece... | TITLE:
Event handling in Dojo
QUESTION:
Taking Jeff Atwood's advice, I decided to use a JavaScript library for the very basic to-do list application I'm writing. I picked the Dojo toolkit, version 1.1.1. At first, all was fine: the drag-and-drop code I wrote worked first time, you can drag tasks on-screen to change th... | [
"javascript",
"dojo"
] | 1 | 3 | 3,230 | 1 | 0 | 2008-08-31T21:40:39.720000 | 2008-09-01T00:38:52.973000 |
37,157 | 37,160 | Caching MySQL queries | Is there a simple way to cache MySQL queries in PHP or failing that, is there a small class set that someone has written and made available that will do it? I can cache a whole page but that won't work as some data changes but some do not, I want to cache the part that does not. | This is a great overview of how to cache queries in MySQL: The MySQL Query Cache | Caching MySQL queries Is there a simple way to cache MySQL queries in PHP or failing that, is there a small class set that someone has written and made available that will do it? I can cache a whole page but that won't work as some data changes but some do not, I want to cache the part that does not. | TITLE:
Caching MySQL queries
QUESTION:
Is there a simple way to cache MySQL queries in PHP or failing that, is there a small class set that someone has written and made available that will do it? I can cache a whole page but that won't work as some data changes but some do not, I want to cache the part that does not.
... | [
"php",
"mysql",
"caching"
] | 6 | 10 | 10,840 | 5 | 0 | 2008-08-31T21:55:35.580000 | 2008-08-31T21:59:03.043000 |
37,162 | 37,183 | How do I make an HTML page print in landscape when the user selects 'print'? | We generate web pages that should always be printed in landscape mode. Web browser print dialogs default to portrait, so for every print job the user has to manually select landscape. It's minor, but would be nice for the user if we can remove this unnecessary step. Thanks in advance to all respondents. | A quick Google indicates that it's not really supported. There's more than a few folks out there trying to hack their way to it - but I'd strongly suggest just rendering a server side PDF instead. | How do I make an HTML page print in landscape when the user selects 'print'? We generate web pages that should always be printed in landscape mode. Web browser print dialogs default to portrait, so for every print job the user has to manually select landscape. It's minor, but would be nice for the user if we can remove... | TITLE:
How do I make an HTML page print in landscape when the user selects 'print'?
QUESTION:
We generate web pages that should always be printed in landscape mode. Web browser print dialogs default to portrait, so for every print job the user has to manually select landscape. It's minor, but would be nice for the use... | [
"html",
"printing",
"landscape",
"portrait"
] | 8 | 4 | 5,128 | 4 | 0 | 2008-08-31T22:00:25.180000 | 2008-08-31T22:21:15.113000 |
37,185 | 53,369 | What's the idiomatic way to do async socket programming in Delphi? | What is the normal way people writing network code in Delphi use Windows-style overlapped asynchronous socket I/O? Here's my prior research into this question: The Indy components seem entirely synchronous. On the other hand, while ScktComp unit does use WSAAsyncSelect, it basically only asynchronizes a BSD-style multi... | For async stuff try ICS http://www.overbyte.be/frame_index.html?redirTo=/products/ics.html | What's the idiomatic way to do async socket programming in Delphi? What is the normal way people writing network code in Delphi use Windows-style overlapped asynchronous socket I/O? Here's my prior research into this question: The Indy components seem entirely synchronous. On the other hand, while ScktComp unit does us... | TITLE:
What's the idiomatic way to do async socket programming in Delphi?
QUESTION:
What is the normal way people writing network code in Delphi use Windows-style overlapped asynchronous socket I/O? Here's my prior research into this question: The Indy components seem entirely synchronous. On the other hand, while Sck... | [
"delphi",
"winapi",
"sockets",
"asynchronous",
"networking"
] | 10 | 0 | 6,546 | 10 | 0 | 2008-08-31T22:22:58.823000 | 2008-09-10T03:27:22.943000 |
37,189 | 37,202 | C# console program can't send fax when run as a scheduled task | I have a console program written in C# that I am using to send faxes. When I step through the program in Visual Studio it works fine. When I double click on the program in Windows Explorer it works fine. When I setup a Windows scheduled task to run the program it fails with this in the event log. EventType clr20r3, P1 ... | I can't explain it - but I have a few ideas. Most of the times, when a program works fine testing it, and doesn't when scheduling it - security is the case. In the context of which user is your program scheduled? Maybe that user isn't granted enough access. Is the resource your programm is trying to access a network dr... | C# console program can't send fax when run as a scheduled task I have a console program written in C# that I am using to send faxes. When I step through the program in Visual Studio it works fine. When I double click on the program in Windows Explorer it works fine. When I setup a Windows scheduled task to run the prog... | TITLE:
C# console program can't send fax when run as a scheduled task
QUESTION:
I have a console program written in C# that I am using to send faxes. When I step through the program in Visual Studio it works fine. When I double click on the program in Windows Explorer it works fine. When I setup a Windows scheduled ta... | [
"c#",
"console",
"fax"
] | 0 | 5 | 1,884 | 6 | 0 | 2008-08-31T22:28:22.927000 | 2008-08-31T22:40:42.273000 |
37,219 | 37,267 | How do you remove a specific revision in the git history? | Suppose your git history looks like this: 1 2 3 4 5 1–5 are separate revisions. You need to remove 3 while still keeping 1, 2, 4 and 5. How can this be done? Is there an efficient method when there are hundreds of revisions after the one to be deleted? | To combine revision 3 and 4 into a single revision, you can use git rebase. If you want to remove the changes in revision 3, you need to use the edit command in the interactive rebase mode. If you want to combine the changes into a single revision, use squash. I have successfully used this squash technique, but have ne... | How do you remove a specific revision in the git history? Suppose your git history looks like this: 1 2 3 4 5 1–5 are separate revisions. You need to remove 3 while still keeping 1, 2, 4 and 5. How can this be done? Is there an efficient method when there are hundreds of revisions after the one to be deleted? | TITLE:
How do you remove a specific revision in the git history?
QUESTION:
Suppose your git history looks like this: 1 2 3 4 5 1–5 are separate revisions. You need to remove 3 while still keeping 1, 2, 4 and 5. How can this be done? Is there an efficient method when there are hundreds of revisions after the one to be ... | [
"git"
] | 251 | 81 | 139,074 | 9 | 0 | 2008-08-31T22:51:21.327000 | 2008-08-31T23:46:33.880000 |
37,248 | 37,260 | C# Preprocessor | While the C# spec does include a pre-processor and basic directives (#define, #if, etc), the language does not have the same flexible pre-processor found in languages such as C/C++. I believe the lack of such a flexible pre-processor was a design decision made by Anders Hejlsberg (although, unfortunately, I can't find ... | Consider taking a look at an aspect-oriented solution like PostSharp, which injects code after the fact based on custom attributes. It's the opposite of a precompiler but can give you the sort of functionality you're looking for (PropertyChanged notifications etc). | C# Preprocessor While the C# spec does include a pre-processor and basic directives (#define, #if, etc), the language does not have the same flexible pre-processor found in languages such as C/C++. I believe the lack of such a flexible pre-processor was a design decision made by Anders Hejlsberg (although, unfortunatel... | TITLE:
C# Preprocessor
QUESTION:
While the C# spec does include a pre-processor and basic directives (#define, #if, etc), the language does not have the same flexible pre-processor found in languages such as C/C++. I believe the lack of such a flexible pre-processor was a design decision made by Anders Hejlsberg (alth... | [
"c#",
"c-preprocessor"
] | 22 | 11 | 10,311 | 13 | 0 | 2008-08-31T23:18:41.917000 | 2008-08-31T23:37:27.910000 |
37,263 | 37,291 | Where does "Change Management" end and "Project Failure" begin? | I got into a mini-argument with my boss recently regarding "project failure." After three years, our project to migrate a codebase to a new platform (a project I was on for 1.5 years, but my team lead was on for only a few months) went live. He, along with senior management of both my company and the client (I'm one of... | I think, most of the time, we developers forget this we all do is, after all, about bussiness. From that point of view a project is not a failure while the client is willing to pay for it. It all depends on the client, some clients have more patience and understand better the risks of software development, other just w... | Where does "Change Management" end and "Project Failure" begin? I got into a mini-argument with my boss recently regarding "project failure." After three years, our project to migrate a codebase to a new platform (a project I was on for 1.5 years, but my team lead was on for only a few months) went live. He, along with... | TITLE:
Where does "Change Management" end and "Project Failure" begin?
QUESTION:
I got into a mini-argument with my boss recently regarding "project failure." After three years, our project to migrate a codebase to a new platform (a project I was on for 1.5 years, but my team lead was on for only a few months) went li... | [
"project-management",
"change-management"
] | 1 | 5 | 1,608 | 5 | 0 | 2008-08-31T23:39:48.590000 | 2008-09-01T00:07:26.760000 |
37,299 | 37,304 | Xcode equivalent of ' __asm int 3 / DebugBreak() / Halt? | What's the instruction to cause a hard-break in Xcode? For example under Visual Studio I could do '_asm int 3' or 'DebugBreak()'. Under some GCC implementations it's asm("break 0") or asm("trap"). I've tried various combos under Xcode without any luck. (inline assembler works fine so it's not a syntax issue). For refer... | http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeProjectManagement/090_Running_Programs/chapter_11_section_3.html asm {trap}; Halts a program running on PPC32 or PPC64.
__asm {int 3}; Halts a program running on IA-32. | Xcode equivalent of ' __asm int 3 / DebugBreak() / Halt? What's the instruction to cause a hard-break in Xcode? For example under Visual Studio I could do '_asm int 3' or 'DebugBreak()'. Under some GCC implementations it's asm("break 0") or asm("trap"). I've tried various combos under Xcode without any luck. (inline as... | TITLE:
Xcode equivalent of ' __asm int 3 / DebugBreak() / Halt?
QUESTION:
What's the instruction to cause a hard-break in Xcode? For example under Visual Studio I could do '_asm int 3' or 'DebugBreak()'. Under some GCC implementations it's asm("break 0") or asm("trap"). I've tried various combos under Xcode without an... | [
"xcode",
"macos",
"debugbreak"
] | 23 | 24 | 18,330 | 7 | 0 | 2008-09-01T00:18:18.263000 | 2008-09-01T00:22:27.223000 |
37,306 | 37,371 | Font-dependent control positioning | I'd like to use Segoe UI 9 pt on Vista, and Tahoma 8 pt on Windows XP/etc. (Actually, I'd settle for Segoe UI on both, but my users probably don't have it installed.) But, these being quite different, they really screw up the layout of my forms. So... is there a good way to deal with this? An example: I have a Label, w... | It's strange to need to layout one control within another. You might be solving an upstream problem wrong. Are you able to split the label into two labels with the updown between and maybe rely on a Windows Forms TableLayout panel? If it's essential to try to position based on font sizes, you could use Graphics.Measure... | Font-dependent control positioning I'd like to use Segoe UI 9 pt on Vista, and Tahoma 8 pt on Windows XP/etc. (Actually, I'd settle for Segoe UI on both, but my users probably don't have it installed.) But, these being quite different, they really screw up the layout of my forms. So... is there a good way to deal with ... | TITLE:
Font-dependent control positioning
QUESTION:
I'd like to use Segoe UI 9 pt on Vista, and Tahoma 8 pt on Windows XP/etc. (Actually, I'd settle for Segoe UI on both, but my users probably don't have it installed.) But, these being quite different, they really screw up the layout of my forms. So... is there a good... | [
".net",
"winforms",
"user-interface",
"layout",
"fonts"
] | 2 | 1 | 385 | 4 | 0 | 2008-09-01T00:32:32.397000 | 2008-09-01T02:08:47.173000 |
37,310 | 37,316 | Checking the results of a Factory in a unit test | I have developed some classes with similar behavior, they all implement the same interface. I implemented a factory that creates the appropriate object and returns the interface. I am writing a unit test for the factory. All you get back is an interface to the object. What is the best way to test that the factory has w... | Since I don't know how your factory method looks like, all I can advise right now is to Check to see the object is the correct concrete implementation you were looking for: IMyInterface fromFactory = factory.create(...); Assert.assertTrue(fromFactory instanceof MyInterfaceImpl1); You can check if the factory setup the ... | Checking the results of a Factory in a unit test I have developed some classes with similar behavior, they all implement the same interface. I implemented a factory that creates the appropriate object and returns the interface. I am writing a unit test for the factory. All you get back is an interface to the object. Wh... | TITLE:
Checking the results of a Factory in a unit test
QUESTION:
I have developed some classes with similar behavior, they all implement the same interface. I implemented a factory that creates the appropriate object and returns the interface. I am writing a unit test for the factory. All you get back is an interface... | [
"java",
"unit-testing",
"tdd"
] | 25 | 23 | 30,750 | 5 | 0 | 2008-09-01T00:40:03.830000 | 2008-09-01T00:47:22.907000 |
37,317 | 37,336 | How do you return the focus to the last used control after clicking a button in a winform app? | I'm working on a windows forms application (C#) where a user is entering data in a form. At any point while editing the data in the form the user can click one of the buttons on the form to perform certain actions. By default the focus goes to the clicked button so the user has to click back on to the control they want... | For a bit of 'simplicity' maybe try. public Form1() { InitializeComponent();
foreach (Control ctrl in Controls) { if (ctrl is TextBox) { ctrl.Enter += delegate(object sender, EventArgs e) { _lastEnteredControl = (Control)sender; }; } } } then you don't have to worry about decorating each textbox manually (or forgettin... | How do you return the focus to the last used control after clicking a button in a winform app? I'm working on a windows forms application (C#) where a user is entering data in a form. At any point while editing the data in the form the user can click one of the buttons on the form to perform certain actions. By default... | TITLE:
How do you return the focus to the last used control after clicking a button in a winform app?
QUESTION:
I'm working on a windows forms application (C#) where a user is entering data in a form. At any point while editing the data in the form the user can click one of the buttons on the form to perform certain a... | [
"c#",
".net",
"winforms"
] | 7 | 16 | 12,579 | 7 | 0 | 2008-09-01T00:48:03.637000 | 2008-09-01T01:11:00.587000 |
37,324 | 37,332 | What is the syntax for an inner join in LINQ to SQL? | I'm writing a LINQ to SQL statement, and I'm after the standard syntax for a normal inner join with an ON clause in C#. How do you represent the following in LINQ to SQL: select DealerContact.* from Dealer inner join DealerContact on Dealer.DealerID = DealerContact.DealerID | It goes something like: from t1 in db.Table1 join t2 in db.Table2 on t1.field equals t2.field select new { t1.field2, t2.field3} It would be nice to have sensible names and fields for your tables for a better example.:) Update I think for your query this might be more appropriate: var dealercontacts = from contact in D... | What is the syntax for an inner join in LINQ to SQL? I'm writing a LINQ to SQL statement, and I'm after the standard syntax for a normal inner join with an ON clause in C#. How do you represent the following in LINQ to SQL: select DealerContact.* from Dealer inner join DealerContact on Dealer.DealerID = DealerContact.D... | TITLE:
What is the syntax for an inner join in LINQ to SQL?
QUESTION:
I'm writing a LINQ to SQL statement, and I'm after the standard syntax for a normal inner join with an ON clause in C#. How do you represent the following in LINQ to SQL: select DealerContact.* from Dealer inner join DealerContact on Dealer.DealerID... | [
"c#",
".net",
"sql",
"linq-to-sql",
"join"
] | 482 | 616 | 687,894 | 18 | 0 | 2008-09-01T01:00:24.467000 | 2008-09-01T01:08:58.110000 |
37,335 | 37,349 | How to deal with "java.lang.OutOfMemoryError: Java heap space" error? | I am writing a client-side Swing application (graphical font designer) on Java 5. Recently, I am running into java.lang.OutOfMemoryError: Java heap space error because I am not being conservative on memory usage. The user can open unlimited number of files, and the program keeps the opened objects in the memory. After ... | Ultimately you always have a finite max of heap to use no matter what platform you are running on. In Windows 32 bit this is around 2GB (not specifically heap but total amount of memory per process). It just happens that Java chooses to make the default smaller (presumably so that the programmer can't create programs t... | How to deal with "java.lang.OutOfMemoryError: Java heap space" error? I am writing a client-side Swing application (graphical font designer) on Java 5. Recently, I am running into java.lang.OutOfMemoryError: Java heap space error because I am not being conservative on memory usage. The user can open unlimited number of... | TITLE:
How to deal with "java.lang.OutOfMemoryError: Java heap space" error?
QUESTION:
I am writing a client-side Swing application (graphical font designer) on Java 5. Recently, I am running into java.lang.OutOfMemoryError: Java heap space error because I am not being conservative on memory usage. The user can open u... | [
"java",
"jvm",
"out-of-memory",
"heap-memory"
] | 574 | 310 | 2,250,811 | 32 | 0 | 2008-09-01T01:10:03.727000 | 2008-09-01T01:29:54.457000 |
37,343 | 2,189,015 | Wordpress MediaWiki Cookie Integration | I have my Wordpress install and MediaWiki sharing the same login information. Unfortunately, users need to log into both separately, but at least they use the same credentials. What I would like to do is cause a successful login on the Wordpress blog to also cause a login for MediaWiki (ideally both directions). There ... | They both support OpenId now. MediaWiki's extension WordPress's plugin There are probably other options for using OpenId, but I think that is the best solution available. | Wordpress MediaWiki Cookie Integration I have my Wordpress install and MediaWiki sharing the same login information. Unfortunately, users need to log into both separately, but at least they use the same credentials. What I would like to do is cause a successful login on the Wordpress blog to also cause a login for Medi... | TITLE:
Wordpress MediaWiki Cookie Integration
QUESTION:
I have my Wordpress install and MediaWiki sharing the same login information. Unfortunately, users need to log into both separately, but at least they use the same credentials. What I would like to do is cause a successful login on the Wordpress blog to also caus... | [
"php",
"wordpress",
"lamp",
"mediawiki"
] | 3 | 1 | 1,837 | 4 | 0 | 2008-09-01T01:23:51.400000 | 2010-02-03T01:07:39.590000 |
37,346 | 37,348 | Why can't a forward declaration be used for a std::vector? | If I create a class like so: // B.h #ifndef _B_H_ #define _B_H_
class B { private: int x; int y; };
#endif // _B_H_ and use it like this: // main.cpp #include #include class B; // Forward declaration.
class A { public: A() { std::cout << v.size() << std::endl; }
private: std::vector v; };
int main() { A a; } The c... | The compiler needs to know how big "B" is before it can generate the appropriate layout information. If instead, you said std::vector, then the compiler wouldn't need to know how big B is because it knows how big a pointer is. | Why can't a forward declaration be used for a std::vector? If I create a class like so: // B.h #ifndef _B_H_ #define _B_H_
class B { private: int x; int y; };
#endif // _B_H_ and use it like this: // main.cpp #include #include class B; // Forward declaration.
class A { public: A() { std::cout << v.size() << std::end... | TITLE:
Why can't a forward declaration be used for a std::vector?
QUESTION:
If I create a class like so: // B.h #ifndef _B_H_ #define _B_H_
class B { private: int x; int y; };
#endif // _B_H_ and use it like this: // main.cpp #include #include class B; // Forward declaration.
class A { public: A() { std::cout << v.... | [
"c++",
"stl"
] | 34 | 31 | 23,429 | 8 | 0 | 2008-09-01T01:27:25.400000 | 2008-09-01T01:29:43.617000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.