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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
46,585 | 46,614 | When do you use POST and when do you use GET? | From what I can gather, there are three categories: Never use GET and use POST Never use POST and use GET It doesn't matter which one you use. Am I correct in assuming those three cases? If so, what are some examples from each case? | Use POST for destructive actions such as creation (I'm aware of the irony), editing, and deletion, because you can't hit a POST action in the address bar of your browser. Use GET when it's safe to allow a person to call an action. So a URL like: http://myblog.org/admin/posts/delete/357 Should bring you to a confirmatio... | When do you use POST and when do you use GET? From what I can gather, there are three categories: Never use GET and use POST Never use POST and use GET It doesn't matter which one you use. Am I correct in assuming those three cases? If so, what are some examples from each case? | TITLE:
When do you use POST and when do you use GET?
QUESTION:
From what I can gather, there are three categories: Never use GET and use POST Never use POST and use GET It doesn't matter which one you use. Am I correct in assuming those three cases? If so, what are some examples from each case?
ANSWER:
Use POST for d... | [
"http-post",
"http-get"
] | 410 | 450 | 252,918 | 27 | 0 | 2008-09-05T19:05:12.060000 | 2008-09-05T19:12:17.473000 |
46,586 | 52,307 | GOTO still considered harmful? | Everyone is aware of Dijkstra's Letters to the editor: go to statement considered harmful (also here.html transcript and here.pdf) and there has been a formidable push since that time to eschew the goto statement whenever possible. While it's possible to use goto to produce unmaintainable, sprawling code, it neverthele... | The following statements are generalizations; while it is always possible to plead exception, it usually (in my experience and humble opinion) isn't worth the risks. Unconstrained use of memory addresses (either GOTO or raw pointers) provides too many opportunities to make easily avoidable mistakes. The more ways there... | GOTO still considered harmful? Everyone is aware of Dijkstra's Letters to the editor: go to statement considered harmful (also here.html transcript and here.pdf) and there has been a formidable push since that time to eschew the goto statement whenever possible. While it's possible to use goto to produce unmaintainable... | TITLE:
GOTO still considered harmful?
QUESTION:
Everyone is aware of Dijkstra's Letters to the editor: go to statement considered harmful (also here.html transcript and here.pdf) and there has been a formidable push since that time to eschew the goto statement whenever possible. While it's possible to use goto to prod... | [
"language-agnostic",
"goto"
] | 316 | 202 | 102,703 | 49 | 0 | 2008-09-05T19:05:18.877000 | 2008-09-09T16:34:07.100000 |
46,621 | 46,627 | DotNetNuke using PNG images with Transparency | I have a DotNetNuke site where my main logo is a PNG file using transparency. I tried GIF but the quality wasn't good enough. Anyways it worked great on IE7 but I just saw my site in IE6 and noticed that the transparency isn't working with my logo. Does anyone know of a quick way to fix this in a DotNetNuke portal? | I don't know that it's a DotNetNuke issue as much as it is IE6. Anyways, here's a site that shows you how to work around IE6's png issues. Hope it helps. http://24ways.org/2007/supersleight-transparent-png-in-ie6 | DotNetNuke using PNG images with Transparency I have a DotNetNuke site where my main logo is a PNG file using transparency. I tried GIF but the quality wasn't good enough. Anyways it worked great on IE7 but I just saw my site in IE6 and noticed that the transparency isn't working with my logo. Does anyone know of a qui... | TITLE:
DotNetNuke using PNG images with Transparency
QUESTION:
I have a DotNetNuke site where my main logo is a PNG file using transparency. I tried GIF but the quality wasn't good enough. Anyways it worked great on IE7 but I just saw my site in IE6 and noticed that the transparency isn't working with my logo. Does an... | [
"internet-explorer-6",
"png",
"transparency",
"dotnetnuke"
] | 2 | 6 | 1,443 | 7 | 0 | 2008-09-05T19:13:22.370000 | 2008-09-05T19:14:54.127000 |
46,636 | 46,640 | Copying from network share using BAT | What's the best way to copy a file from a network share to the local file system using a Windows batch file? Normally, I would use "net use *" but using this approach how can I get the drive letter? | Can you just use the full UNC path to the file? copy \\myserver\myshare\myfolder\myfile.txt c:\myfiles | Copying from network share using BAT What's the best way to copy a file from a network share to the local file system using a Windows batch file? Normally, I would use "net use *" but using this approach how can I get the drive letter? | TITLE:
Copying from network share using BAT
QUESTION:
What's the best way to copy a file from a network share to the local file system using a Windows batch file? Normally, I would use "net use *" but using this approach how can I get the drive letter?
ANSWER:
Can you just use the full UNC path to the file? copy \\my... | [
"windows",
"batch-file"
] | 9 | 15 | 20,904 | 3 | 0 | 2008-09-05T19:17:15.153000 | 2008-09-05T19:18:23.637000 |
46,642 | 46,659 | Does anyone here have a favorite memory profiling/memory leak tool they like to use for their java webapps? | I'm looking for a good tool to profile a java webapp. I'd like to get performance information and memory usage if possible. Any suggestions? | JProfiler is a really good one. It integrates with all the major IDEs and application servers. | Does anyone here have a favorite memory profiling/memory leak tool they like to use for their java webapps? I'm looking for a good tool to profile a java webapp. I'd like to get performance information and memory usage if possible. Any suggestions? | TITLE:
Does anyone here have a favorite memory profiling/memory leak tool they like to use for their java webapps?
QUESTION:
I'm looking for a good tool to profile a java webapp. I'd like to get performance information and memory usage if possible. Any suggestions?
ANSWER:
JProfiler is a really good one. It integrate... | [
"java",
"profiling",
"web-applications"
] | 6 | 7 | 826 | 7 | 0 | 2008-09-05T19:18:30.297000 | 2008-09-05T19:20:48.513000 |
46,644 | 47,382 | Any way to handle Put and Delete verbs in ASP.Net MVC? | just wondering if anyone knows of a truly restful Put/delete implementation asp.net mvc preview 5 preferably. | Check out the mvccontrib project at http://www.mvccontrib.org. In the source code a restful implementation has been added and it is current up to Preview 5. Check out the source code here - http://mvccontrib.googlecode.com/svn/trunk/src/MVCContrib/SimplyRestful | Any way to handle Put and Delete verbs in ASP.Net MVC? just wondering if anyone knows of a truly restful Put/delete implementation asp.net mvc preview 5 preferably. | TITLE:
Any way to handle Put and Delete verbs in ASP.Net MVC?
QUESTION:
just wondering if anyone knows of a truly restful Put/delete implementation asp.net mvc preview 5 preferably.
ANSWER:
Check out the mvccontrib project at http://www.mvccontrib.org. In the source code a restful implementation has been added and it... | [
"asp.net-mvc",
"rest",
"https"
] | 3 | 2 | 2,361 | 6 | 0 | 2008-09-05T19:18:34.087000 | 2008-09-06T10:58:37.323000 |
46,663 | 47,452 | How can I send an email by Java application using GMail, Yahoo, or Hotmail? | Is it possible to send an email from my Java application using a GMail account? I have configured my company mail server with Java app to send email, but that's not going to cut it when I distribute the application. Answers with any of using Hotmail, Yahoo or GMail are acceptable. | First download the JavaMail API and make sure the relevant jar files are in your classpath. Here's a full working example using GMail. import java.util.*; import javax.mail.*; import javax.mail.internet.*;
public class Main {
private static String USER_NAME = "*****"; // GMail user name (just the part before "@gmail.... | How can I send an email by Java application using GMail, Yahoo, or Hotmail? Is it possible to send an email from my Java application using a GMail account? I have configured my company mail server with Java app to send email, but that's not going to cut it when I distribute the application. Answers with any of using Ho... | TITLE:
How can I send an email by Java application using GMail, Yahoo, or Hotmail?
QUESTION:
Is it possible to send an email from my Java application using a GMail account? I have configured my company mail server with Java app to send email, but that's not going to cut it when I distribute the application. Answers wi... | [
"java",
"email",
"gmail",
"jakarta-mail",
"mail-server"
] | 219 | 200 | 267,601 | 14 | 0 | 2008-09-05T19:23:00.303000 | 2008-09-06T13:19:58.280000 |
46,677 | 46,976 | Employee Web Usage From Proxy Logs | I need to find/create an application that will create employee web usage reports from HTTP proxy logs. Does anyone know of a good product that will do this? @Joe Liversedge - Good point. I don't have to worry about this, however, as I am the only person in my company with the know-how to pull off an SSH tunnel. | Here's a scenario: What's to stop two employees, let's call them 'Eric' and 'Tim', from running their own little SSH tunnel back home to prevent 'the Man', in this case you, from narc'ing out their use of the Internet. Now you have a useless report. If you're serious about getting real data, you'll want something close... | Employee Web Usage From Proxy Logs I need to find/create an application that will create employee web usage reports from HTTP proxy logs. Does anyone know of a good product that will do this? @Joe Liversedge - Good point. I don't have to worry about this, however, as I am the only person in my company with the know-how... | TITLE:
Employee Web Usage From Proxy Logs
QUESTION:
I need to find/create an application that will create employee web usage reports from HTTP proxy logs. Does anyone know of a good product that will do this? @Joe Liversedge - Good point. I don't have to worry about this, however, as I am the only person in my company... | [
"reporting"
] | 0 | 4 | 295 | 3 | 0 | 2008-09-05T19:26:18.483000 | 2008-09-05T22:00:18.037000 |
46,692 | 46,797 | Information Management Policy in SharePoint | An obscure puzzle, but it's driving me absolutely nuts: I'm creating a custom Information Management Policy in MOSS. I've implemented IPolicyFeature, and my policy feature happily registers itself by configuring a new SPItemEventReceiver. All new items in my library fire the events as they should, and it all works fine... | There's only a couple of things I can think of to try. First, are you developing on the box where you might be able to use Visual Studio to debug? So just stepping through it. Assuming that's not the case - what I'd do is fire up WinDBG and attach it to the process just before I registered the policy. Turn on first cha... | Information Management Policy in SharePoint An obscure puzzle, but it's driving me absolutely nuts: I'm creating a custom Information Management Policy in MOSS. I've implemented IPolicyFeature, and my policy feature happily registers itself by configuring a new SPItemEventReceiver. All new items in my library fire the ... | TITLE:
Information Management Policy in SharePoint
QUESTION:
An obscure puzzle, but it's driving me absolutely nuts: I'm creating a custom Information Management Policy in MOSS. I've implemented IPolicyFeature, and my policy feature happily registers itself by configuring a new SPItemEventReceiver. All new items in my... | [
"sharepoint",
"moss",
"information-management"
] | 1 | 1 | 841 | 2 | 0 | 2008-09-05T19:30:37.367000 | 2008-09-05T20:11:12.057000 |
46,693 | 47,320 | .Net 3.5, most secure way to pass string between processes | I'd like to be able to pass a SecureString (a cached passphrase) to a child process in C# (.Net 3.5), but I don't know what the most secure way is to do it. If I were to convert the SecureString back to a regular string and pass it as a command-line argument, for example, then I think the value may be prone to disk pag... | In general you should define your threat model before worrying about more exotic attacks. In this case: are you worried that somebody shuts down the computer and does a forensic analysis of the harddrive? Application memory can also be swapped out, so the simple fact that one process has it in memory, makes it potentia... | .Net 3.5, most secure way to pass string between processes I'd like to be able to pass a SecureString (a cached passphrase) to a child process in C# (.Net 3.5), but I don't know what the most secure way is to do it. If I were to convert the SecureString back to a regular string and pass it as a command-line argument, f... | TITLE:
.Net 3.5, most secure way to pass string between processes
QUESTION:
I'd like to be able to pass a SecureString (a cached passphrase) to a child process in C# (.Net 3.5), but I don't know what the most secure way is to do it. If I were to convert the SecureString back to a regular string and pass it as a comman... | [
".net",
"security",
".net-3.5",
"ipc"
] | 4 | 3 | 1,648 | 2 | 0 | 2008-09-05T19:30:43.137000 | 2008-09-06T08:17:42.093000 |
46,697 | 46,751 | Monitoring GDI calls | Is there a tool that allows one to monitor GDI calls? | Tools like AutomatedQA AQTime can help you diagnose GDI usage. A much simpler, but free tool one can be found here. | Monitoring GDI calls Is there a tool that allows one to monitor GDI calls? | TITLE:
Monitoring GDI calls
QUESTION:
Is there a tool that allows one to monitor GDI calls?
ANSWER:
Tools like AutomatedQA AQTime can help you diagnose GDI usage. A much simpler, but free tool one can be found here. | [
"windows",
"monitoring",
"gdi"
] | 5 | 3 | 1,269 | 2 | 0 | 2008-09-05T19:31:59.983000 | 2008-09-05T19:52:54.223000 |
46,704 | 46,800 | Using jQuery, what is the best way to set onClick event listeners for radio buttons? | For the following HTML: One Two Three Four Changing from the following JavaScript code: $(function() { var myForm = document.myForm; var radios = myForm.area;
// Loop through radio buttons for (var i=0; i Thanks EDIT: The response I selected answers the question I asked, however I like the answer that uses bind() beca... | $( function() { $("input:radio").click(radioClicks).filter("[value='S']").attr("checked", "checked"); }); | Using jQuery, what is the best way to set onClick event listeners for radio buttons? For the following HTML: One Two Three Four Changing from the following JavaScript code: $(function() { var myForm = document.myForm; var radios = myForm.area;
// Loop through radio buttons for (var i=0; i Thanks EDIT: The response I s... | TITLE:
Using jQuery, what is the best way to set onClick event listeners for radio buttons?
QUESTION:
For the following HTML: One Two Three Four Changing from the following JavaScript code: $(function() { var myForm = document.myForm; var radios = myForm.area;
// Loop through radio buttons for (var i=0; i Thanks EDIT... | [
"javascript",
"jquery"
] | 11 | 17 | 34,288 | 6 | 0 | 2008-09-05T19:35:44.157000 | 2008-09-05T20:12:02.197000 |
46,709 | 46,784 | Which ORM framework can best handle an MVCC database design? | When designing a database to use MVCC (Multi-Version Concurrency Control), you create tables with either a boolean field like "IsLatest" or an integer "VersionId", and you never do any updates, you only insert new records when things change. MVCC gives you automatic auditing for applications that require a detailed his... | I might consider implementing the MVCC tier purely in the DB, using stored procs and views to handle my data operations. Then you could present a reasonable API to any ORM that was capable of mapping to and from stored procs, and you could let the DB deal with the data integrity issues (since it's pretty much build for... | Which ORM framework can best handle an MVCC database design? When designing a database to use MVCC (Multi-Version Concurrency Control), you create tables with either a boolean field like "IsLatest" or an integer "VersionId", and you never do any updates, you only insert new records when things change. MVCC gives you au... | TITLE:
Which ORM framework can best handle an MVCC database design?
QUESTION:
When designing a database to use MVCC (Multi-Version Concurrency Control), you create tables with either a boolean field like "IsLatest" or an integer "VersionId", and you never do any updates, you only insert new records when things change.... | [
"database",
"entity-framework",
"orm"
] | 9 | 3 | 2,057 | 6 | 0 | 2008-09-05T19:37:55.553000 | 2008-09-05T20:04:33.120000 |
46,714 | 46,822 | Why is ARG_MAX not defined via limits.h? | On Fedora Core 7, I'm writing some code that relies on ARG_MAX. However, even if I #include, the constant is still not defined. My investigations show that it's present in, but this is supposed to be portable across Win32/Mac/Linux, so directly including it isn't an option. What's going on here? | The reason it's not in limits.h is that it's not a quantity giving the limits of the value range of an integral type based on bit width on the current architecture. That's the role assigned to limits.h by the ISO standard. The value in which you're interested is not hardware-bound in practice and can vary from platform... | Why is ARG_MAX not defined via limits.h? On Fedora Core 7, I'm writing some code that relies on ARG_MAX. However, even if I #include, the constant is still not defined. My investigations show that it's present in, but this is supposed to be portable across Win32/Mac/Linux, so directly including it isn't an option. What... | TITLE:
Why is ARG_MAX not defined via limits.h?
QUESTION:
On Fedora Core 7, I'm writing some code that relies on ARG_MAX. However, even if I #include, the constant is still not defined. My investigations show that it's present in, but this is supposed to be portable across Win32/Mac/Linux, so directly including it isn... | [
"linux",
"limits"
] | 12 | 8 | 7,216 | 3 | 0 | 2008-09-05T19:39:37.157000 | 2008-09-05T20:23:59.627000 |
46,718 | 46,724 | Best way to make a printer-friendly ASP.NET page? | I'm just curious how most people make their ASP.NET pages printer-friendly? Do you create a separate printer-friendly version of the ASPX page, use CSS or something else? How do you handle situations like page breaks and wide tables? Is there one elegant solution that works for the majority of the cases? | You basically make another CSS file that hide things or gives simpler "printer-friendly" style to things then add that with a media="print" so that it only applies to print media (when it is printed) | Best way to make a printer-friendly ASP.NET page? I'm just curious how most people make their ASP.NET pages printer-friendly? Do you create a separate printer-friendly version of the ASPX page, use CSS or something else? How do you handle situations like page breaks and wide tables? Is there one elegant solution that w... | TITLE:
Best way to make a printer-friendly ASP.NET page?
QUESTION:
I'm just curious how most people make their ASP.NET pages printer-friendly? Do you create a separate printer-friendly version of the ASPX page, use CSS or something else? How do you handle situations like page breaks and wide tables? Is there one elega... | [
"asp.net"
] | 8 | 14 | 7,525 | 3 | 0 | 2008-09-05T19:41:01.040000 | 2008-09-05T19:43:33.840000 |
46,719 | 46,785 | Want to Encode text during Regex.Replace call | I have a regex call that I need help with. I haven't posted my regex, because it is not relevant here. What I want to be able to do is, during the Replace, I also want to modify the ${test} portion by doing a Html.Encode on the entire text that is effecting the regex. Basically, wrap the entire text that is within the ... | Heres an implementation of this I've used to pick out special replace strings from content and localize them. protected string FindAndTranslateIn(string content) { return Regex.Replace(content, @"\{\^(.+?);(.+?)?}", new MatchEvaluator(TranslateHandler), RegexOptions.IgnoreCase); }
public string TranslateHandler(Match ... | Want to Encode text during Regex.Replace call I have a regex call that I need help with. I haven't posted my regex, because it is not relevant here. What I want to be able to do is, during the Replace, I also want to modify the ${test} portion by doing a Html.Encode on the entire text that is effecting the regex. Basic... | TITLE:
Want to Encode text during Regex.Replace call
QUESTION:
I have a regex call that I need help with. I haven't posted my regex, because it is not relevant here. What I want to be able to do is, during the Replace, I also want to modify the ${test} portion by doing a Html.Encode on the entire text that is effectin... | [
"regex"
] | 4 | 2 | 1,875 | 5 | 0 | 2008-09-05T19:41:30.820000 | 2008-09-05T20:04:33.430000 |
46,777 | 46,794 | How to control a web application through email? Or how to run php script by sending an email? | I want to run a web application on php and mysql, using the CakePHP framework. And to keep the threshold of using the site at a very low place, I want to not use the standard login with username/password. (And I don't want to hassle my users with something like OpenID either. Goes to user type.) So I'm thinking that th... | I have used the pop3 php class with great success (there is also a Pear POP3 module ). Using the pop3 class looks something like this: require ('pop3.php');
$pop3 = new pop3_class(); $pop3->hostname = MAILHOST; $pop3->Open(); $pop3->Login('myemailaddress@mydomain.com', 'mypassword');
foreach($pop3->ListMessages("",""... | How to control a web application through email? Or how to run php script by sending an email? I want to run a web application on php and mysql, using the CakePHP framework. And to keep the threshold of using the site at a very low place, I want to not use the standard login with username/password. (And I don't want to ... | TITLE:
How to control a web application through email? Or how to run php script by sending an email?
QUESTION:
I want to run a web application on php and mysql, using the CakePHP framework. And to keep the threshold of using the site at a very low place, I want to not use the standard login with username/password. (An... | [
"cakephp",
"email"
] | 3 | 7 | 1,401 | 10 | 0 | 2008-09-05T20:02:27.773000 | 2008-09-05T20:08:59.613000 |
46,788 | 46,894 | How to bind a MemoryStream to asp:image control? | Is there a way to bind a MemoryStream to asp:image control? | A handler can accept a url parameter like any other request. So instead of linking your to image.ashx you'd set it to image.ashx?ImageID=[Your image ID here]. | How to bind a MemoryStream to asp:image control? Is there a way to bind a MemoryStream to asp:image control? | TITLE:
How to bind a MemoryStream to asp:image control?
QUESTION:
Is there a way to bind a MemoryStream to asp:image control?
ANSWER:
A handler can accept a url parameter like any other request. So instead of linking your to image.ashx you'd set it to image.ashx?ImageID=[Your image ID here]. | [
"asp.net",
"image",
"memorystream"
] | 14 | 7 | 64,463 | 8 | 0 | 2008-09-05T20:05:53.180000 | 2008-09-05T21:10:42.633000 |
46,805 | 265,989 | Custom cursor in WPF? | I want to use an image or icon as a custom cursor in WPF app. How can I do that? | You have two basic options: When the mouse cursor is over your control, hide the system cursor by setting this.Cursor = Cursors.None; and draw your own cursor using whatever technique you like. Then, update the position and appearance of your cursor by responding to mouse events. Here are two examples: http://www.xamlo... | Custom cursor in WPF? I want to use an image or icon as a custom cursor in WPF app. How can I do that? | TITLE:
Custom cursor in WPF?
QUESTION:
I want to use an image or icon as a custom cursor in WPF app. How can I do that?
ANSWER:
You have two basic options: When the mouse cursor is over your control, hide the system cursor by setting this.Cursor = Cursors.None; and draw your own cursor using whatever technique you li... | [
".net",
"wpf"
] | 57 | 39 | 69,822 | 15 | 0 | 2008-09-05T20:13:48.730000 | 2008-11-05T17:38:10.477000 |
46,827 | 46,832 | How do you create a foreign key relationship in a SQL Server CE (Compact Edition) Database? | Visual Studio 2005 doesn't provide an interface for creating relationships between tables in a SQL Server CE database (I'm using version 3.0) and you can't open a Compact Edition DB using Management Studio as far as I know. Any ideas? | Unfortunately there is currently no designer support (unlike for SQL Server 2005) for building relationships between tables in SQL Server CE. To build relationships you need to use SQL commands such as: ALTER TABLE Orders ADD CONSTRAINT FK_Customer_Order FOREIGN KEY (CustomerId) REFERENCES Customers(CustomerId) If you ... | How do you create a foreign key relationship in a SQL Server CE (Compact Edition) Database? Visual Studio 2005 doesn't provide an interface for creating relationships between tables in a SQL Server CE database (I'm using version 3.0) and you can't open a Compact Edition DB using Management Studio as far as I know. Any ... | TITLE:
How do you create a foreign key relationship in a SQL Server CE (Compact Edition) Database?
QUESTION:
Visual Studio 2005 doesn't provide an interface for creating relationships between tables in a SQL Server CE database (I'm using version 3.0) and you can't open a Compact Edition DB using Management Studio as f... | [
"database",
"visual-studio",
"sql-server-ce",
"visual-studio-2005"
] | 48 | 71 | 111,404 | 7 | 0 | 2008-09-05T20:26:12.350000 | 2008-09-05T20:29:19.893000 |
46,841 | 47,237 | Why do I get this error "[DBNETLIB][ConnectionRead (recv()).]General network error" with ASP pages | Occasionally, on a ASP (classic) site users will get this error: [DBNETLIB][ConnectionRead (recv()).]General network error. Seems to be random and not connected to any particular page. The SQL server is separated from the web server and my guess is that every once and a while the "link" goes down between the two. Route... | Using the same setup as yours (ie separate web and database server), I've seen it from time to time and it has always been a connection problem between the servers - typically when the database server is being rebooted but sometimes when there's a comms problem somewhere in the system. I've not seen it triggered by any... | Why do I get this error "[DBNETLIB][ConnectionRead (recv()).]General network error" with ASP pages Occasionally, on a ASP (classic) site users will get this error: [DBNETLIB][ConnectionRead (recv()).]General network error. Seems to be random and not connected to any particular page. The SQL server is separated from the... | TITLE:
Why do I get this error "[DBNETLIB][ConnectionRead (recv()).]General network error" with ASP pages
QUESTION:
Occasionally, on a ASP (classic) site users will get this error: [DBNETLIB][ConnectionRead (recv()).]General network error. Seems to be random and not connected to any particular page. The SQL server is ... | [
"sql-server",
"networking",
"asp-classic"
] | 4 | 1 | 31,528 | 6 | 0 | 2008-09-05T20:35:57.833000 | 2008-09-06T03:49:51.427000 |
46,855 | 46,884 | C# Game Network Library | I am developing an online strategy game using.Net v2. Although the game is primarily strategic, it does have some tactical elements that require reasonable network performance. I plan to use TCP packets for strategic data and UDP packets for tactical data. {EDIT} I forgot to mention that I am leaning away from WCF and.... | Why limit yourself to.NET 2.0..NET 3.0 (or 3.5) contains WCF and is a solid, performant communications subsystem with good security..NET 3.0 is just.NET 2.0 with additional libraries (WCF, WF, WPF). | C# Game Network Library I am developing an online strategy game using.Net v2. Although the game is primarily strategic, it does have some tactical elements that require reasonable network performance. I plan to use TCP packets for strategic data and UDP packets for tactical data. {EDIT} I forgot to mention that I am le... | TITLE:
C# Game Network Library
QUESTION:
I am developing an online strategy game using.Net v2. Although the game is primarily strategic, it does have some tactical elements that require reasonable network performance. I plan to use TCP packets for strategic data and UDP packets for tactical data. {EDIT} I forgot to me... | [
"c#",
"network-programming"
] | 6 | 1 | 13,892 | 8 | 0 | 2008-09-05T20:45:11.930000 | 2008-09-05T21:03:49.937000 |
46,859 | 50,869 | Where do attached properties fit in a class diagram? | What is the most appropriate way to represent attached properties in a UML diagram or an almost-uml diagram like the VS2008 class diagram? | In UML it'll be quoted tag before the member. Something conventional, like this: "attached" Align: ElementAlign | Where do attached properties fit in a class diagram? What is the most appropriate way to represent attached properties in a UML diagram or an almost-uml diagram like the VS2008 class diagram? | TITLE:
Where do attached properties fit in a class diagram?
QUESTION:
What is the most appropriate way to represent attached properties in a UML diagram or an almost-uml diagram like the VS2008 class diagram?
ANSWER:
In UML it'll be quoted tag before the member. Something conventional, like this: "attached" Align: El... | [
".net",
"wpf",
"uml",
"dependency-properties",
"class-diagram"
] | 1 | 1 | 266 | 1 | 0 | 2008-09-05T20:47:44.733000 | 2008-09-08T22:40:06.077000 |
46,860 | 46,866 | Showing a hint for a C# winforms edit control | I'm working on a C# winforms application (VS.NET 2008,.NET 3.5 sp 1). I have a search field on a form, and rather than have a label next to the search field I'd like to show some grey text in the background of the search field itself ('Search terms', for example). When the user starts entering text in the search field ... | You will need to use some P/Inovke interop code to do this. Look for the Win32 API SendMessage function and the EM_SETCUEBANNER message. | Showing a hint for a C# winforms edit control I'm working on a C# winforms application (VS.NET 2008,.NET 3.5 sp 1). I have a search field on a form, and rather than have a label next to the search field I'd like to show some grey text in the background of the search field itself ('Search terms', for example). When the ... | TITLE:
Showing a hint for a C# winforms edit control
QUESTION:
I'm working on a C# winforms application (VS.NET 2008,.NET 3.5 sp 1). I have a search field on a form, and rather than have a label next to the search field I'd like to show some grey text in the background of the search field itself ('Search terms', for e... | [
"c#",
"winforms",
"user-interface"
] | 9 | 9 | 14,400 | 4 | 0 | 2008-09-05T20:47:55.807000 | 2008-09-05T20:53:36.683000 |
46,863 | 47,119 | concatenating unknown-length strings in COBOL | How do I concatenate together two strings, of unknown length, in COBOL? So for example: WORKING-STORAGE. FIRST-NAME PIC X(15) VALUE SPACES. LAST-NAME PIC X(15) VALUE SPACES. FULL-NAME PIC X(31) VALUE SPACES. If FIRST-NAME = 'JOHN ' and LAST-NAME = 'DOE ', how can I get: FULL-NAME = 'JOHN DOE ' as opposed to: FULL-NAME ... | I believe the following will give you what you desire. STRING FIRST-NAME DELIMITED BY " ", " ", LAST-NAME DELIMITED BY SIZE INTO FULL-NAME. | concatenating unknown-length strings in COBOL How do I concatenate together two strings, of unknown length, in COBOL? So for example: WORKING-STORAGE. FIRST-NAME PIC X(15) VALUE SPACES. LAST-NAME PIC X(15) VALUE SPACES. FULL-NAME PIC X(31) VALUE SPACES. If FIRST-NAME = 'JOHN ' and LAST-NAME = 'DOE ', how can I get: FUL... | TITLE:
concatenating unknown-length strings in COBOL
QUESTION:
How do I concatenate together two strings, of unknown length, in COBOL? So for example: WORKING-STORAGE. FIRST-NAME PIC X(15) VALUE SPACES. LAST-NAME PIC X(15) VALUE SPACES. FULL-NAME PIC X(31) VALUE SPACES. If FIRST-NAME = 'JOHN ' and LAST-NAME = 'DOE ', ... | [
"string",
"cobol"
] | 4 | 5 | 24,887 | 3 | 0 | 2008-09-05T20:49:53.743000 | 2008-09-06T00:11:00.563000 |
46,869 | 46,897 | What's a good method for extracting text from a PDF using C# or classic ASP (VBScript)? | Is there a good library for extracting text from a PDF? I'm willing to pay for it if I have to. Something that works with C# or classic ASP (VBScript) would be ideal and I also need to be able to separate the pages from the PDF. This question had some interesting stuff, especially pdftotext but I'd like to avoid callin... | You can use the IFilter interface built into Windows to extract text and properties (author, title, etc.) from any supported file type. It's a COM interface so you would have use the.NET interop facilities. You'd also have to download the free PDF IFilter driver from Adobe. | What's a good method for extracting text from a PDF using C# or classic ASP (VBScript)? Is there a good library for extracting text from a PDF? I'm willing to pay for it if I have to. Something that works with C# or classic ASP (VBScript) would be ideal and I also need to be able to separate the pages from the PDF. Thi... | TITLE:
What's a good method for extracting text from a PDF using C# or classic ASP (VBScript)?
QUESTION:
Is there a good library for extracting text from a PDF? I'm willing to pay for it if I have to. Something that works with C# or classic ASP (VBScript) would be ideal and I also need to be able to separate the pages... | [
"pdf",
"text-extraction",
"pdf-scraping"
] | 4 | 4 | 9,726 | 5 | 0 | 2008-09-05T20:55:39.767000 | 2008-09-05T21:12:38.977000 |
46,898 | 46,908 | How do I efficiently iterate over each entry in a Java Map? | If I have an object implementing the Map interface in Java and I wish to iterate over every pair contained within it, what is the most efficient way of going through the map? Will the ordering of elements depend on the specific map implementation that I have for the interface? | Map map =... for (Map.Entry entry: map.entrySet()) { System.out.println(entry.getKey() + "/" + entry.getValue()); } On Java 10+: for (var entry: map.entrySet()) { System.out.println(entry.getKey() + "/" + entry.getValue()); } | How do I efficiently iterate over each entry in a Java Map? If I have an object implementing the Map interface in Java and I wish to iterate over every pair contained within it, what is the most efficient way of going through the map? Will the ordering of elements depend on the specific map implementation that I have f... | TITLE:
How do I efficiently iterate over each entry in a Java Map?
QUESTION:
If I have an object implementing the Map interface in Java and I wish to iterate over every pair contained within it, what is the most efficient way of going through the map? Will the ordering of elements depend on the specific map implementa... | [
"java",
"dictionary",
"collections",
"iteration"
] | 3,982 | 5,893 | 3,364,999 | 46 | 0 | 2008-09-05T21:12:48.370000 | 2008-09-05T21:15:52.713000 |
46,907 | 46,931 | Is there anything wrong with this query? | INSERT INTO tblExcel (ename, position, phone, email) VALUES ('Burton, Andrew', 'Web Developer / Network Assistant', '876-9259', 'aburton@wccs.edu') I've got an Access table that has five fields: id, ename, position, phone, and email...each one is plain text field with 50 characters, save for position which is 255 and i... | I beleive "position" is a reserved word. Try... INSERT into tblExcel (ename, [position], phone, email) VALUES (... Reserved Words | Is there anything wrong with this query? INSERT INTO tblExcel (ename, position, phone, email) VALUES ('Burton, Andrew', 'Web Developer / Network Assistant', '876-9259', 'aburton@wccs.edu') I've got an Access table that has five fields: id, ename, position, phone, and email...each one is plain text field with 50 charact... | TITLE:
Is there anything wrong with this query?
QUESTION:
INSERT INTO tblExcel (ename, position, phone, email) VALUES ('Burton, Andrew', 'Web Developer / Network Assistant', '876-9259', 'aburton@wccs.edu') I've got an Access table that has five fields: id, ename, position, phone, and email...each one is plain text fie... | [
"sql",
"vb.net",
"excel",
"ms-access",
"oledb"
] | 0 | 5 | 512 | 2 | 0 | 2008-09-05T21:15:50.547000 | 2008-09-05T21:30:19.200000 |
46,909 | 46,952 | Is this the proper use of a mutex? | I have a situation where I might have multiple instances of a program running at once, and it's important that just one specific function not be executing in more than one of these instances at once. Is this the proper way to use a mutex to prevent this from happening? lock (this.GetType()) { _log.Info("Doing Sync"); D... | You said multiple instances of one application, so we're talking about two program.exe's running, right? The lock statement won't lock across multiple programs, just within the program. If you want a true Mutex, look at the System.Threading.Mutex object. Here is a usage example: bool createdNew; using (Mutex mtx = new ... | Is this the proper use of a mutex? I have a situation where I might have multiple instances of a program running at once, and it's important that just one specific function not be executing in more than one of these instances at once. Is this the proper way to use a mutex to prevent this from happening? lock (this.GetT... | TITLE:
Is this the proper use of a mutex?
QUESTION:
I have a situation where I might have multiple instances of a program running at once, and it's important that just one specific function not be executing in more than one of these instances at once. Is this the proper way to use a mutex to prevent this from happenin... | [
"c#",
"mutex"
] | 9 | 18 | 3,542 | 2 | 0 | 2008-09-05T21:17:16.783000 | 2008-09-05T21:38:56.950000 |
46,915 | 47,161 | How can I detect if a Flex app loses focus | As a follow up to this question: Developing a online exam application, how do I prevent cheaters? Can I detect when Flex application looses its focus? that is if a user has clicked onto another application or opened a browser tab? I read this: Detecting when a Flex application loses focus but was not very clear... | The key part of the code at that link is the systemManager.stage.addEventListener(Event.DEACTIVATE,deactivate); The Flash player send outs activate and deactivate events when the focus enters and leaves the player. All you need to do is create a listenr for them and react appropriately. A more clear example of how to u... | How can I detect if a Flex app loses focus As a follow up to this question: Developing a online exam application, how do I prevent cheaters? Can I detect when Flex application looses its focus? that is if a user has clicked onto another application or opened a browser tab? I read this: Detecting when a Flex application... | TITLE:
How can I detect if a Flex app loses focus
QUESTION:
As a follow up to this question: Developing a online exam application, how do I prevent cheaters? Can I detect when Flex application looses its focus? that is if a user has clicked onto another application or opened a browser tab? I read this: Detecting when ... | [
"apache-flex",
"actionscript"
] | 3 | 5 | 5,162 | 4 | 0 | 2008-09-05T21:19:41.003000 | 2008-09-06T01:18:36.953000 |
46,918 | 47,743 | What's the proper way to minimize to tray a C# WinForms app? | What is the proper way to minimize a WinForms app to the system tray? Note: minimize to system tray; on the right side of the taskbar by the clock. I'm not asking about minimizing to taskbar, which is what happens when you hit the "minus" button on the window. I've seen hackish solutions like, "minimize, set ShowInTask... | There is actually no managed way to do that form of animation to the tray in native winforms, however you can P/Invoke shell32.dll to do it: Some good info here (In the comments not the post): http://blogs.msdn.com/jfoscoding/archive/2005/10/20/483300.aspx And here it is in C++: http://www.codeproject.com/KB/shell/mini... | What's the proper way to minimize to tray a C# WinForms app? What is the proper way to minimize a WinForms app to the system tray? Note: minimize to system tray; on the right side of the taskbar by the clock. I'm not asking about minimizing to taskbar, which is what happens when you hit the "minus" button on the window... | TITLE:
What's the proper way to minimize to tray a C# WinForms app?
QUESTION:
What is the proper way to minimize a WinForms app to the system tray? Note: minimize to system tray; on the right side of the taskbar by the clock. I'm not asking about minimizing to taskbar, which is what happens when you hit the "minus" bu... | [
"c#",
"winforms",
"trayicon"
] | 63 | 20 | 65,358 | 9 | 0 | 2008-09-05T21:20:47.040000 | 2008-09-06T19:07:50.017000 |
46,924 | 47,002 | How can a simple tree algorithm be coded in a functional language? | Suppose I want to implement a reasonably efficient 'keyword recognition algorithm', that is first given a list of keyword, and must then answer if another given word was in the list. In an imperative language, I would store the keywords in a tree (one node per character). Then, when receiving a word to test, I would sc... | I think what you mean is a character per node... sort of like a simple hash tree scheme for keyword lookup. Assuming this or even another kind of tree... imagine doing something like this (in pseudo-LISP): (defun buildtree (wordlist)...code to build tree recursively returns the tree...) (define lookup (tree word)...cod... | How can a simple tree algorithm be coded in a functional language? Suppose I want to implement a reasonably efficient 'keyword recognition algorithm', that is first given a list of keyword, and must then answer if another given word was in the list. In an imperative language, I would store the keywords in a tree (one n... | TITLE:
How can a simple tree algorithm be coded in a functional language?
QUESTION:
Suppose I want to implement a reasonably efficient 'keyword recognition algorithm', that is first given a list of keyword, and must then answer if another given word was in the list. In an imperative language, I would store the keyword... | [
"algorithm",
"functional-programming"
] | 4 | 3 | 829 | 2 | 0 | 2008-09-05T21:26:51.970000 | 2008-09-05T22:26:38.613000 |
46,930 | 64,674 | Reference material for LabVIEW | I'm supposed to learn how to use LabVIEW for my new job, and I'm wondering if anybody can recommend some good books or reference/tutorial web sites. I'm a senior developer with lots of Java/C#/C++ experience. I realize that this question is perhaps more vague than is intended on stack overflow, so how about this? Pleas... | It will take some training and some time to learn the style needed to develop maintainable code. Coming from Java/C#/C++, you probably have a good idea of good software architecture. Now you just need to learn the peculiarities of LabView and the common pitfalls. For the basics, National Instruments offers training cou... | Reference material for LabVIEW I'm supposed to learn how to use LabVIEW for my new job, and I'm wondering if anybody can recommend some good books or reference/tutorial web sites. I'm a senior developer with lots of Java/C#/C++ experience. I realize that this question is perhaps more vague than is intended on stack ove... | TITLE:
Reference material for LabVIEW
QUESTION:
I'm supposed to learn how to use LabVIEW for my new job, and I'm wondering if anybody can recommend some good books or reference/tutorial web sites. I'm a senior developer with lots of Java/C#/C++ experience. I realize that this question is perhaps more vague than is int... | [
"reference",
"labview"
] | 8 | 5 | 2,636 | 10 | 0 | 2008-09-05T21:29:34.727000 | 2008-09-15T16:56:03.783000 |
46,933 | 46,946 | Why doesn't inheritance work the way I think it should work? | I'm having some inheritance issues as I've got a group of inter-related abstract classes that need to all be overridden together to create a client implementation. Ideally I would like to do something like the following: abstract class Animal { public Leg GetLeg() {...} }
abstract class Leg { }
class Dog: Animal { pu... | The short answer is that GetLeg is invariant in its return type. The long answer can be found here: Covariance and contravariance I'd like to add that while inheritance is usually the first abstraction tool that most developers pull out of their toolbox, it is almost always possible to use composition instead. Composit... | Why doesn't inheritance work the way I think it should work? I'm having some inheritance issues as I've got a group of inter-related abstract classes that need to all be overridden together to create a client implementation. Ideally I would like to do something like the following: abstract class Animal { public Leg Get... | TITLE:
Why doesn't inheritance work the way I think it should work?
QUESTION:
I'm having some inheritance issues as I've got a group of inter-related abstract classes that need to all be overridden together to create a client implementation. Ideally I would like to do something like the following: abstract class Anima... | [
"c#",
"oop",
"inheritance",
"covariance",
"contravariance"
] | 8 | 16 | 1,246 | 17 | 0 | 2008-09-05T21:31:08.183000 | 2008-09-05T21:37:40.180000 |
46,938 | 47,124 | How do you convert an aspx or master page file to page and code behind? | I have a project where a.master page was created without a code behind page. Now I want to add a code behind page for this.master page and move the "in page" code to the code behind file. What is the best/easiest way to go about doing this? I'm using Visual Studio 2008. | Create new class file, name it yourmaster.master.cs (Visual Studio will automaticly group it with the.master) and move the code to it, reference it in your masterpage. Then rightclick on your project and click "Convert to Web Application" and Visual Studio will create the designer file. | How do you convert an aspx or master page file to page and code behind? I have a project where a.master page was created without a code behind page. Now I want to add a code behind page for this.master page and move the "in page" code to the code behind file. What is the best/easiest way to go about doing this? I'm usi... | TITLE:
How do you convert an aspx or master page file to page and code behind?
QUESTION:
I have a project where a.master page was created without a code behind page. Now I want to add a code behind page for this.master page and move the "in page" code to the code behind file. What is the best/easiest way to go about d... | [
"visual-studio-2008"
] | 2 | 3 | 2,458 | 3 | 0 | 2008-09-05T21:33:48.163000 | 2008-09-06T00:15:29.757000 |
46,982 | 47,168 | Javascript and CSS parsing performance | I am trying to improve the performance of a web application. I have metrics that I can use to optimize the time taken to return the main HTML page, but I'm concerned about the external CSS and JavaScript files that are included from these HTML pages. These are served statically, with HTTP Expires headers, but are share... | Context: While it's true that HTTP overhead is more significant than parsing JS and CSS, ignoring the impact of parsing on browser performance (even if you have less than a meg of JS) is a good way to get yourself in trouble. YSlow, Fiddler, and Firebug are not the best tools to monitor parsing speed. Unless they've be... | Javascript and CSS parsing performance I am trying to improve the performance of a web application. I have metrics that I can use to optimize the time taken to return the main HTML page, but I'm concerned about the external CSS and JavaScript files that are included from these HTML pages. These are served statically, w... | TITLE:
Javascript and CSS parsing performance
QUESTION:
I am trying to improve the performance of a web application. I have metrics that I can use to optimize the time taken to return the main HTML page, but I'm concerned about the external CSS and JavaScript files that are included from these HTML pages. These are se... | [
"javascript",
"css",
"performance"
] | 10 | 14 | 3,706 | 3 | 0 | 2008-09-05T22:04:39.680000 | 2008-09-06T01:37:14.507000 |
47,003 | 47,084 | C# .NET + PostgreSQL | I'm looking at working on a project which uses C#.NET (sitting on a windows box) as the primary language and PostgreSQL as the backend database (backend is sitting on a linux box). I've heard that ODBC.NET allows for easy integration of these two components. Has anyone had experience actually setting C# and PostgreSQL ... | I'm working with C# and Postgres using Npgsql2 component, and they work fast, I recommend you. You can download from https://github.com/npgsql/Npgsql/releases Note: If you want an application that works with any database you can use the DbProviderFactory class and make your queries using IDbConnection, IDbCommand, IDat... | C# .NET + PostgreSQL I'm looking at working on a project which uses C#.NET (sitting on a windows box) as the primary language and PostgreSQL as the backend database (backend is sitting on a linux box). I've heard that ODBC.NET allows for easy integration of these two components. Has anyone had experience actually setti... | TITLE:
C# .NET + PostgreSQL
QUESTION:
I'm looking at working on a project which uses C#.NET (sitting on a windows box) as the primary language and PostgreSQL as the backend database (backend is sitting on a linux box). I've heard that ODBC.NET allows for easy integration of these two components. Has anyone had experie... | [
"c#",
".net",
"postgresql"
] | 54 | 59 | 67,268 | 9 | 0 | 2008-09-05T22:27:21.717000 | 2008-09-05T23:33:26.020000 |
47,005 | 47,054 | MySQL UTF/Unicode migration tips | Does anyone have any tips or gotcha moments to look out for when trying to migrate MySQL tables from the the default case-insenstive swedish or ascii charsets to utf-8? Some of the projects that I'm involved in are striving for better internationalization and the database is going to be a significant part of this chang... | Some hints: Your CHAR and VARCHAR columns will use up to 3 times more disk space. (You probably won't get much disk space grow for Swedish words.) Use SET NAMES utf8 before reading or writing to the database. If you don't this then you will get partially garbled characters. | MySQL UTF/Unicode migration tips Does anyone have any tips or gotcha moments to look out for when trying to migrate MySQL tables from the the default case-insenstive swedish or ascii charsets to utf-8? Some of the projects that I'm involved in are striving for better internationalization and the database is going to be... | TITLE:
MySQL UTF/Unicode migration tips
QUESTION:
Does anyone have any tips or gotcha moments to look out for when trying to migrate MySQL tables from the the default case-insenstive swedish or ascii charsets to utf-8? Some of the projects that I'm involved in are striving for better internationalization and the datab... | [
"mysql",
"unicode",
"utf-8",
"internationalization"
] | 5 | 2 | 1,081 | 5 | 0 | 2008-09-05T22:32:26.773000 | 2008-09-05T23:10:20.210000 |
47,007 | 256,455 | Determining the last changelist synced to in Perforce | A question that occasionally arises is what is the best way to determine the changelist that you last synced to in Perforce. This is often needed for things like injecting the changelist number into the revision info by the automatic build system. | I recommend the opposite for automatic build systems: you should first get the latest changelist from the server using: p4 changes -s submitted -m1 then sync to that change and record it in the revision info. The reason is as follows. Although Perforce recommends the following to determine the changelist to which the w... | Determining the last changelist synced to in Perforce A question that occasionally arises is what is the best way to determine the changelist that you last synced to in Perforce. This is often needed for things like injecting the changelist number into the revision info by the automatic build system. | TITLE:
Determining the last changelist synced to in Perforce
QUESTION:
A question that occasionally arises is what is the best way to determine the changelist that you last synced to in Perforce. This is often needed for things like injecting the changelist number into the revision info by the automatic build system.
... | [
"perforce"
] | 124 | 97 | 92,639 | 10 | 0 | 2008-09-05T22:36:02.943000 | 2008-11-02T03:05:32.907000 |
47,022 | 47,098 | "Phantom" directories in an SVN repository | I've somehow managed to get an SVN repository into a bad state. I've moved a directory and now I can't commit it in its new location. As far as svn status is concerned, the directory is unknown (the name of the directory is type ). $ svn status? type When I try to add the directory, the server says it already exists. $... | It looks to me like type was created by some Subversion-aware copy command, then moved into the current directory using a Subversion-unaware copy. In my experience, this sort of thing typically occurs when package refactoring operations have been chained together in Eclipse without commits in between. Typically, Subver... | "Phantom" directories in an SVN repository I've somehow managed to get an SVN repository into a bad state. I've moved a directory and now I can't commit it in its new location. As far as svn status is concerned, the directory is unknown (the name of the directory is type ). $ svn status? type When I try to add the dire... | TITLE:
"Phantom" directories in an SVN repository
QUESTION:
I've somehow managed to get an SVN repository into a bad state. I've moved a directory and now I can't commit it in its new location. As far as svn status is concerned, the directory is unknown (the name of the directory is type ). $ svn status? type When I t... | [
"svn"
] | 21 | 14 | 11,980 | 7 | 0 | 2008-09-05T22:47:46.707000 | 2008-09-05T23:45:49.763000 |
47,045 | 47,049 | Sprintf equivalent in Java | Printf got added to Java with the 1.5 release but I can't seem to find how to send the output to a string rather than a file (which is what sprintf does in C). Does anyone know how to do this? | // Store the formatted string in 'result' String result = String.format("%4d", i * j);
// Write the result to standard output System.out.println( result ); See format and its syntax | Sprintf equivalent in Java Printf got added to Java with the 1.5 release but I can't seem to find how to send the output to a string rather than a file (which is what sprintf does in C). Does anyone know how to do this? | TITLE:
Sprintf equivalent in Java
QUESTION:
Printf got added to Java with the 1.5 release but I can't seem to find how to send the output to a string rather than a file (which is what sprintf does in C). Does anyone know how to do this?
ANSWER:
// Store the formatted string in 'result' String result = String.format("... | [
"java",
"string",
"formatting"
] | 309 | 522 | 226,443 | 5 | 0 | 2008-09-05T23:05:35.320000 | 2008-09-05T23:06:53.820000 |
47,066 | 47,071 | "Getting" the path in Linux | I am writing a C program in Linux. Commands like execv() require a path in the form of a C string. Is there a command that will return the current path in the form of a C-style string? | getcwd(): SYNOPSIS #include char *getcwd(char *buf, size_t size); DESCRIPTION The getcwd() function shall place an absolute pathname of the current working directory in the array pointed to by buf, and return buf. The pathname copied to the array shall contain no components that are symbolic links. The size argument is... | "Getting" the path in Linux I am writing a C program in Linux. Commands like execv() require a path in the form of a C string. Is there a command that will return the current path in the form of a C-style string? | TITLE:
"Getting" the path in Linux
QUESTION:
I am writing a C program in Linux. Commands like execv() require a path in the form of a C string. Is there a command that will return the current path in the form of a C-style string?
ANSWER:
getcwd(): SYNOPSIS #include char *getcwd(char *buf, size_t size); DESCRIPTION Th... | [
"c",
"linux",
"operating-system"
] | 4 | 11 | 5,515 | 5 | 0 | 2008-09-05T23:21:18.340000 | 2008-09-05T23:25:49.330000 |
47,078 | 3,988,952 | Javascript tree views that support multiple item drag/drop | We are currently using the ExtJS tree view in an application - a requirement has arisen requiring a user to select multiple nodes (which the tree view supports currently through a pluggable selection model) - but you can not then drag the multiple selections to another part of the tree. Does anyone know of an ajax cont... | Got the same issue. I just found the solution:..new Ext.tree.TreePanel({... selModel: new Ext.tree.MultiSelectionModel()... }) | Javascript tree views that support multiple item drag/drop We are currently using the ExtJS tree view in an application - a requirement has arisen requiring a user to select multiple nodes (which the tree view supports currently through a pluggable selection model) - but you can not then drag the multiple selections to... | TITLE:
Javascript tree views that support multiple item drag/drop
QUESTION:
We are currently using the ExtJS tree view in an application - a requirement has arisen requiring a user to select multiple nodes (which the tree view supports currently through a pluggable selection model) - but you can not then drag the mult... | [
"javascript",
"ajax",
"treeview",
"drag-and-drop",
"extjs"
] | 8 | 1 | 4,035 | 3 | 0 | 2008-09-05T23:28:54.813000 | 2010-10-21T15:09:27.023000 |
47,087 | 47,111 | How do you prevent SQL injection in LAMP applications? | Here are a few possibilities to get the conversation started: Escape all input upon initialization. Escape each value, preferably when generating the SQL. The first solution is suboptimal, because you then need to unescape each value if you want to use it in anything other than SQL, like outputting it on a web page. Th... | as @Rob Walker states, parameterized queries are your best bet. If you're using the latest and greatest PHP, I'd highly recommend taking a look at PDO (PHP Data Objects). This is a native database abstraction library that has support for a wide range of databases (including MySQL of course) as well as prepared statemen... | How do you prevent SQL injection in LAMP applications? Here are a few possibilities to get the conversation started: Escape all input upon initialization. Escape each value, preferably when generating the SQL. The first solution is suboptimal, because you then need to unescape each value if you want to use it in anythi... | TITLE:
How do you prevent SQL injection in LAMP applications?
QUESTION:
Here are a few possibilities to get the conversation started: Escape all input upon initialization. Escape each value, preferably when generating the SQL. The first solution is suboptimal, because you then need to unescape each value if you want t... | [
"php",
"sql",
"mysql",
"lamp"
] | 8 | 7 | 1,172 | 5 | 0 | 2008-09-05T23:34:31.897000 | 2008-09-06T00:04:10.500000 |
47,089 | 47,095 | Best way in asp.net to force https for an entire site? | About 6 months ago I rolled out a site where every request needed to be over https. The only way at the time I could find to ensure that every request to a page was over https was to check it in the page load event. If the request was not over http I would response.redirect(" https://example.com ") Is there a better wa... | Please use HSTS (HTTP Strict Transport Security) from http://www.hanselman.com/blog/HowToEnableHTTPStrictTransportSecurityHSTSInIIS7.aspx Original Answer (replaced with the above on 4 December 2015) basically protected void Application_BeginRequest(Object sender, EventArgs e) { if (HttpContext.Current.Request.IsSecureC... | Best way in asp.net to force https for an entire site? About 6 months ago I rolled out a site where every request needed to be over https. The only way at the time I could find to ensure that every request to a page was over https was to check it in the page load event. If the request was not over http I would response... | TITLE:
Best way in asp.net to force https for an entire site?
QUESTION:
About 6 months ago I rolled out a site where every request needed to be over https. The only way at the time I could find to ensure that every request to a page was over https was to check it in the page load event. If the request was not over htt... | [
"c#",
"asp.net",
"vb.net",
"webforms",
"https"
] | 212 | 275 | 207,360 | 16 | 0 | 2008-09-05T23:34:53.583000 | 2008-09-05T23:42:16.480000 |
47,144 | 47,147 | Is there a way to ensure entire code block execution in a .NET thread? | In my C# program, I have a thread that represents a running test, which can be aborted by a click on a button labeled "Interrupt execution". In order for the thread (and therefore the test) to terminate in an elegant manner (and do some vital work beforehand), this button is enabled only in some well-defined moments, i... | The situations under which a ThreadAbortException will be generated can be complex. A better option might be to ask why you are using ThreadAbortExceptions at all. A better pattern would be to simply use a flag to indicate to the running thread that it should abort, and then test the flag regularly while it is working.... | Is there a way to ensure entire code block execution in a .NET thread? In my C# program, I have a thread that represents a running test, which can be aborted by a click on a button labeled "Interrupt execution". In order for the thread (and therefore the test) to terminate in an elegant manner (and do some vital work b... | TITLE:
Is there a way to ensure entire code block execution in a .NET thread?
QUESTION:
In my C# program, I have a thread that represents a running test, which can be aborted by a click on a button labeled "Interrupt execution". In order for the thread (and therefore the test) to terminate in an elegant manner (and do... | [
".net",
"multithreading"
] | 3 | 5 | 605 | 2 | 0 | 2008-09-06T00:59:14.160000 | 2008-09-06T01:06:30.787000 |
47,163 | 47,209 | How to set the order in subnodes of a tree structure | I have a tree representation of pages in a CMS application. I understand how to persist the tree in the database. However, I don't have a good way to: A) Reorder subpages under a particular parent page. B) Provide a UI implementation that allows the user to change the order. Any suggestions? | Changing the order itself will require you store some sort of ordering along with each page in the database. Just the current highest / lowest value +/- 1 would probably be a fine starting point. Once you've got that ordering in there, reordering becomes a case of swapping two values or changing the value for one page ... | How to set the order in subnodes of a tree structure I have a tree representation of pages in a CMS application. I understand how to persist the tree in the database. However, I don't have a good way to: A) Reorder subpages under a particular parent page. B) Provide a UI implementation that allows the user to change th... | TITLE:
How to set the order in subnodes of a tree structure
QUESTION:
I have a tree representation of pages in a CMS application. I understand how to persist the tree in the database. However, I don't have a good way to: A) Reorder subpages under a particular parent page. B) Provide a UI implementation that allows the... | [
"treeview",
"tree"
] | 2 | 0 | 382 | 2 | 0 | 2008-09-06T01:24:19.543000 | 2008-09-06T02:45:33.407000 |
47,167 | 47,170 | Do you know of any "best practice" or "what works" vi tutorial for programmers? | There are thousands of vi tutorials on the web, most of them generically listing all the commands. There are even videos on youtube which show basic functionality. But does anyone know of a vi tutorial which focuses on the needs of programmers? For example when I program in Perl with vi, moving to the "next paragraph" ... | A nice collection of vimtips. And the best Vim cheatsheet around. | Do you know of any "best practice" or "what works" vi tutorial for programmers? There are thousands of vi tutorials on the web, most of them generically listing all the commands. There are even videos on youtube which show basic functionality. But does anyone know of a vi tutorial which focuses on the needs of programm... | TITLE:
Do you know of any "best practice" or "what works" vi tutorial for programmers?
QUESTION:
There are thousands of vi tutorials on the web, most of them generically listing all the commands. There are even videos on youtube which show basic functionality. But does anyone know of a vi tutorial which focuses on the... | [
"unix",
"vim",
"editor",
"keyboard-shortcuts",
"text-editor"
] | 3 | 10 | 3,158 | 3 | 0 | 2008-09-06T01:31:37.390000 | 2008-09-06T01:37:59.933000 |
47,169 | 47,200 | Is there an event that triggers if the number of ListViewItems in a ListView changes? (Windows Forms) | I'd like to enable/disable some other controls based on how many items are in my ListView control. I can't find any event that would do this, either on the ListView itself or on the ListViewItemCollection. Maybe there's a way to generically watch any collection in C# for changes? I'd be happy with other events too, eve... | @Domenic Not too sure, Never quite got that far in the thought process. Another solution might be to extend ListView, and when adding and removing stuff, instead of calling.items.add, and items.remove, you call your other functions. It would still be possible to add and remove without events being raised, but with a li... | Is there an event that triggers if the number of ListViewItems in a ListView changes? (Windows Forms) I'd like to enable/disable some other controls based on how many items are in my ListView control. I can't find any event that would do this, either on the ListView itself or on the ListViewItemCollection. Maybe there'... | TITLE:
Is there an event that triggers if the number of ListViewItems in a ListView changes? (Windows Forms)
QUESTION:
I'd like to enable/disable some other controls based on how many items are in my ListView control. I can't find any event that would do this, either on the ListView itself or on the ListViewItemCollec... | [
"winforms",
"events",
"listview"
] | 3 | 2 | 6,843 | 3 | 0 | 2008-09-06T01:37:52.553000 | 2008-09-06T02:26:58.253000 |
47,177 | 47,290 | How do I monitor the computer's CPU, memory, and disk usage in Java? | I would like to monitor the following system information in Java: Current CPU usage** (percent) Available memory* (free/total) Available disk space (free/total) *Note that I mean overall memory available to the whole system, not just the JVM. I'm looking for a cross-platform solution (Linux, Mac, and Windows) that does... | Along the lines of what I mentioned in this post. I recommend you use the SIGAR API. I use the SIGAR API in one of my own applications and it is great. You'll find it is stable, well supported, and full of useful examples. It is open-source with a GPL 2 Apache 2.0 license. Check it out. I have a feeling it will meet yo... | How do I monitor the computer's CPU, memory, and disk usage in Java? I would like to monitor the following system information in Java: Current CPU usage** (percent) Available memory* (free/total) Available disk space (free/total) *Note that I mean overall memory available to the whole system, not just the JVM. I'm look... | TITLE:
How do I monitor the computer's CPU, memory, and disk usage in Java?
QUESTION:
I would like to monitor the following system information in Java: Current CPU usage** (percent) Available memory* (free/total) Available disk space (free/total) *Note that I mean overall memory available to the whole system, not just... | [
"java",
"memory",
"cross-platform",
"cpu",
"diskspace"
] | 206 | 68 | 327,104 | 12 | 0 | 2008-09-06T01:44:06.563000 | 2008-09-06T06:31:29.400000 |
47,198 | 47,208 | Which Version of Python to Use for Maximum Compatibility | If I was going to start an open source project using Python what version should I use to ensure that the vast majority of users can use it on their system? I'm the kind of person who quickly jumps to the next version (which I'll do when Python 3 comes out) but many people may be more conservative if their current versi... | As python is in kind of an transition phase towards python 3 with breaking backward compatibility I don't think it is a good idea to go python 3 only. Based on the time line there will be at least one or two following releases of the 2.x series after 2.6/3.0 in october. Beside not having python 3 available on your targ... | Which Version of Python to Use for Maximum Compatibility If I was going to start an open source project using Python what version should I use to ensure that the vast majority of users can use it on their system? I'm the kind of person who quickly jumps to the next version (which I'll do when Python 3 comes out) but ma... | TITLE:
Which Version of Python to Use for Maximum Compatibility
QUESTION:
If I was going to start an open source project using Python what version should I use to ensure that the vast majority of users can use it on their system? I'm the kind of person who quickly jumps to the next version (which I'll do when Python 3... | [
"python",
"compatibility"
] | 15 | 6 | 3,841 | 6 | 0 | 2008-09-06T02:22:50.683000 | 2008-09-06T02:44:31.067000 |
47,203 | 47,214 | SQL Server, nvarchar(MAX) or ntext, image or varbinary? | When should I choose one or the other? What are the implications regarding space and (full-text) indexing? BTW: I'm currently using SQL Server 2005 planing to upgrade to 2008 in the following months. Thanks | The new (max) fields make it a lot easier to deal with the data from.NET code. With varbinary(max), you simply set the value of a SqlParameter to a byte array and you are done. WIth the image field, you need to write a few hundred lines of code to stream the data into and out of the field. Also, the image/text fields a... | SQL Server, nvarchar(MAX) or ntext, image or varbinary? When should I choose one or the other? What are the implications regarding space and (full-text) indexing? BTW: I'm currently using SQL Server 2005 planing to upgrade to 2008 in the following months. Thanks | TITLE:
SQL Server, nvarchar(MAX) or ntext, image or varbinary?
QUESTION:
When should I choose one or the other? What are the implications regarding space and (full-text) indexing? BTW: I'm currently using SQL Server 2005 planing to upgrade to 2008 in the following months. Thanks
ANSWER:
The new (max) fields make it a... | [
"sql-server",
"t-sql",
"sql-server-2005",
"sql-types"
] | 9 | 13 | 6,512 | 2 | 0 | 2008-09-06T02:31:47.010000 | 2008-09-06T02:50:26.140000 |
47,207 | 47,304 | Django: Print url of view without hardcoding the url | Can i print out a url /admin/manage/products/add of a certain view in a template? Here is the rule i want to create a link for (r'^manage/products/add/$', create_object, {'model': Product, 'post_save_redirect': ''}), I would like to have /manage/products/add in a template without hardcoding it. How can i do this? Edit:... | You can use get_absolute_url, but that will only work for a particular object. Since your object hasn't been created yet, it won't work in this case. You want to use named URL patterns. Here's a quick intro: Change the line in your urls.py to: (r'^manage/products/add/$', create_object, {'model': Product, 'post_save_red... | Django: Print url of view without hardcoding the url Can i print out a url /admin/manage/products/add of a certain view in a template? Here is the rule i want to create a link for (r'^manage/products/add/$', create_object, {'model': Product, 'post_save_redirect': ''}), I would like to have /manage/products/add in a tem... | TITLE:
Django: Print url of view without hardcoding the url
QUESTION:
Can i print out a url /admin/manage/products/add of a certain view in a template? Here is the rule i want to create a link for (r'^manage/products/add/$', create_object, {'model': Product, 'post_save_redirect': ''}), I would like to have /manage/pro... | [
"python",
"django"
] | 10 | 17 | 8,182 | 3 | 0 | 2008-09-06T02:42:49.357000 | 2008-09-06T07:22:52.583000 |
47,210 | 54,788 | Is there a good Fogbugz client for Mac OS X? | And/or: do I need one? I've recently started using FogBugz for my hobby projects, and I'm very happy with things so far. Having read more about it, especially the evidence-based scheduling, I'd like to start using it for my PhD as well. (Heh; something tells me my supervisors won't be opening tickets for me, though.) L... | The official answer is no, there is not a dedicated Mac client, other than Safari:) There's a command line version that runs on Linux, Windows, and Mac. There are also plans for an iPhone version although I'm not technically supposed to announce features before they are done or even spec'd so pretend I didn't say that. | Is there a good Fogbugz client for Mac OS X? And/or: do I need one? I've recently started using FogBugz for my hobby projects, and I'm very happy with things so far. Having read more about it, especially the evidence-based scheduling, I'd like to start using it for my PhD as well. (Heh; something tells me my supervisor... | TITLE:
Is there a good Fogbugz client for Mac OS X?
QUESTION:
And/or: do I need one? I've recently started using FogBugz for my hobby projects, and I'm very happy with things so far. Having read more about it, especially the evidence-based scheduling, I'd like to start using it for my PhD as well. (Heh; something tell... | [
"macos",
"fogbugz"
] | 7 | 9 | 2,519 | 12 | 0 | 2008-09-06T02:47:19.110000 | 2008-09-10T17:35:29.800000 |
47,217 | 1,905,709 | "Cannot change DataType of a column once it has data" error in Visual Studio 2005 DataSet Designer | I've got a DataSet in VisualStudio 2005. I need to change the datatype of a column in one of the datatables from System.Int32 to System.Decimal. When I try to change the datatype in the DataSet Designer I receive the following error: Property value is not valid. Cannot change DataType of a column once it has data. From... | I get the same error but only for columns with its DefaultValue set to any value (except the default ). So the way I got around this issue was: Column DefaultValue: Type in Save and reopen the dataset | "Cannot change DataType of a column once it has data" error in Visual Studio 2005 DataSet Designer I've got a DataSet in VisualStudio 2005. I need to change the datatype of a column in one of the datatables from System.Int32 to System.Decimal. When I try to change the datatype in the DataSet Designer I receive the foll... | TITLE:
"Cannot change DataType of a column once it has data" error in Visual Studio 2005 DataSet Designer
QUESTION:
I've got a DataSet in VisualStudio 2005. I need to change the datatype of a column in one of the datatables from System.Int32 to System.Decimal. When I try to change the datatype in the DataSet Designer ... | [
"visual-studio",
"dataset",
".net-2.0",
"dataset-designer"
] | 24 | 46 | 25,836 | 6 | 0 | 2008-09-06T02:55:19.513000 | 2009-12-15T07:17:51.557000 |
47,225 | 67,198 | How would you migrate hundreds of MS Access databases to a central service? | We have literally 100's of Access databases floating around the network. Some with light usage and some with quite heavy usage, and some no usage whatsoever. What we would like to do is centralise these databases onto a managed database and retain as much as possible of the reports and forms within them. The benefits o... | Upsizing an Access application is no magic bullet. It may be that some things will be faster, but some types of operations will be real dogs. That means that an upsized app has to be tested thoroughly and performance bottlenecks addressed, usually by moving the data retrieval logic server-side (views, stored procedures... | How would you migrate hundreds of MS Access databases to a central service? We have literally 100's of Access databases floating around the network. Some with light usage and some with quite heavy usage, and some no usage whatsoever. What we would like to do is centralise these databases onto a managed database and ret... | TITLE:
How would you migrate hundreds of MS Access databases to a central service?
QUESTION:
We have literally 100's of Access databases floating around the network. Some with light usage and some with quite heavy usage, and some no usage whatsoever. What we would like to do is centralise these databases onto a manage... | [
"sql-server",
"oracle",
"ms-access"
] | 5 | 3 | 522 | 5 | 0 | 2008-09-06T03:25:44.697000 | 2008-09-15T21:31:07.430000 |
47,235 | 47,245 | What is the .MSPX file extension? | I've noticed a lot of Microsoft sites have the *.MSPX extension. While I'm very familiar with ASP.NET, I've not seen this extension before. Does anyone know what this identifies? | A few internet searches led me to http://www.microsoft.com/backstage/bkst_column_46.mspx, but it was a dead link. Fortunately, it was archived on the Wayback Machine and you can read it here: http://web.archive.org/web/20040803120105/http://www.microsoft.com/backstage/bkst_column_46.mspx The.MSPX extension is part of t... | What is the .MSPX file extension? I've noticed a lot of Microsoft sites have the *.MSPX extension. While I'm very familiar with ASP.NET, I've not seen this extension before. Does anyone know what this identifies? | TITLE:
What is the .MSPX file extension?
QUESTION:
I've noticed a lot of Microsoft sites have the *.MSPX extension. While I'm very familiar with ASP.NET, I've not seen this extension before. Does anyone know what this identifies?
ANSWER:
A few internet searches led me to http://www.microsoft.com/backstage/bkst_column... | [
"asp.net",
".net",
"file-extension"
] | 8 | 9 | 5,267 | 4 | 0 | 2008-09-06T03:44:23.297000 | 2008-09-06T04:06:24.037000 |
47,239 | 47,273 | How can I generate database tables from C# classes? | Does anyone know a way to auto-generate database tables for a given class? I'm not looking for an entire persistence layer - I already have a data access solution I'm using, but I suddenly have to store a lot of information from a large number of classes and I really don't want to have to create all these tables by han... | It's really late, and I only spent about 10 minutes on this, so its extremely sloppy, however it does work and will give you a good jumping off point: using System; using System.Collections.Generic; using System.Text; using System.Reflection;
namespace TableGenerator { class Program { static void Main(string[] args) {... | How can I generate database tables from C# classes? Does anyone know a way to auto-generate database tables for a given class? I'm not looking for an entire persistence layer - I already have a data access solution I'm using, but I suddenly have to store a lot of information from a large number of classes and I really ... | TITLE:
How can I generate database tables from C# classes?
QUESTION:
Does anyone know a way to auto-generate database tables for a given class? I'm not looking for an entire persistence layer - I already have a data access solution I'm using, but I suddenly have to store a lot of information from a large number of cla... | [
"c#",
"code-generation",
"data-access"
] | 66 | 112 | 85,307 | 12 | 0 | 2008-09-06T03:52:15.180000 | 2008-09-06T05:50:12.650000 |
47,253 | 47,266 | How do you set up a Python WSGI server under IIS? | I work in a Windows environment and would prefer to deploy code to IIS. At the same time I would like to code in Python. Having read that IIS can run fastCGI application, I went to the IIS site where it describes in detail how to get PHP up and running but not much about anything else. Does anyone have experience getti... | There shouldn't be any need to use FastCGI. There exists a ISAPI extension for WSGI. | How do you set up a Python WSGI server under IIS? I work in a Windows environment and would prefer to deploy code to IIS. At the same time I would like to code in Python. Having read that IIS can run fastCGI application, I went to the IIS site where it describes in detail how to get PHP up and running but not much abou... | TITLE:
How do you set up a Python WSGI server under IIS?
QUESTION:
I work in a Windows environment and would prefer to deploy code to IIS. At the same time I would like to code in Python. Having read that IIS can run fastCGI application, I went to the IIS site where it describes in detail how to get PHP up and running... | [
"python",
"iis",
"deployment",
"windows-server",
"iis-modules"
] | 31 | 24 | 16,575 | 3 | 0 | 2008-09-06T04:26:49.807000 | 2008-09-06T05:32:39.557000 |
47,262 | 47,263 | Storing Windows passwords | I'm writing (in C# with.NET 3.5) an administrative application which will poll multiple Windows systems for various bits of data. In many cases it will use WMI, but in some cases it may need to read remote registry or remotely execute some command or script on the polled system. This polling will happen at repeating in... | The answer is here: How to store passwords in Winforms application? | Storing Windows passwords I'm writing (in C# with.NET 3.5) an administrative application which will poll multiple Windows systems for various bits of data. In many cases it will use WMI, but in some cases it may need to read remote registry or remotely execute some command or script on the polled system. This polling w... | TITLE:
Storing Windows passwords
QUESTION:
I'm writing (in C# with.NET 3.5) an administrative application which will poll multiple Windows systems for various bits of data. In many cases it will use WMI, but in some cases it may need to read remote registry or remotely execute some command or script on the polled syst... | [
"c#",
".net",
"windows",
"security",
"passwords"
] | 10 | 6 | 1,510 | 2 | 0 | 2008-09-06T05:02:37.430000 | 2008-09-06T05:15:23.403000 |
47,279 | 845,174 | Are there any good oracle podcasts? | Are there any good oracle podcasts around? The only ones I've found is produced by oracle corp, and as such are little more than advertising pieces pushing their technology of the moment. I'm specifically interested in Database technologies. | Oracle Podcast Center Green Enterprise Podcasts Host: Paul Salinger, VP Marketing Listen to discussions with customers, partners, and Oracle green experts, exploring topics that can help Oracle customers better understand how Oracle products can support their sustainability initiatives and enable a green enterprise. Or... | Are there any good oracle podcasts? Are there any good oracle podcasts around? The only ones I've found is produced by oracle corp, and as such are little more than advertising pieces pushing their technology of the moment. I'm specifically interested in Database technologies. | TITLE:
Are there any good oracle podcasts?
QUESTION:
Are there any good oracle podcasts around? The only ones I've found is produced by oracle corp, and as such are little more than advertising pieces pushing their technology of the moment. I'm specifically interested in Database technologies.
ANSWER:
Oracle Podcast ... | [
"oracle",
"podcast"
] | 5 | 3 | 2,613 | 3 | 0 | 2008-09-06T06:19:13.110000 | 2009-05-10T11:44:58.167000 |
47,309 | 47,678 | GODI installation issue | I'm trying to install GODI on linux (Ubuntu). It's a library management tool for the ocaml language. I've actually installed this before --twice, but awhile ago-- with no issues --that I can remember-- but this time I just can't figure out what I'm missing. $./bootstrap --prefix /home/nlucaroni/godi $./bootstrap_stage2... | Hey Chris, I just figured it out. Silly mistake. It was just a permission issue, running everything from /tmp/ worked fine --well after enabling GODI_BASEPKG_PCRE in godi.conf. I had been running it from my home directory, you forget simple things like that at 3:00am. -- Actually I'm having another problem. Installing ... | GODI installation issue I'm trying to install GODI on linux (Ubuntu). It's a library management tool for the ocaml language. I've actually installed this before --twice, but awhile ago-- with no issues --that I can remember-- but this time I just can't figure out what I'm missing. $./bootstrap --prefix /home/nlucaroni/... | TITLE:
GODI installation issue
QUESTION:
I'm trying to install GODI on linux (Ubuntu). It's a library management tool for the ocaml language. I've actually installed this before --twice, but awhile ago-- with no issues --that I can remember-- but this time I just can't figure out what I'm missing. $./bootstrap --prefi... | [
"linux",
"ocaml",
"godi"
] | 7 | 1 | 891 | 2 | 0 | 2008-09-06T07:36:31.817000 | 2008-09-06T17:15:42.517000 |
47,323 | 47,325 | Top tips for secure web applications | I am looking for easy steps that are simple and effective in making a web application more secure. What are your top tips for secure web applications, and what kind of attack will they stop? | Microsoft Technet has en excellent article: Ten Tips for Designing, Building, and Deploying More Secure Web Applications Here are the topics for the tips answered in that article: Never Directly Trust User Input Services Should Have Neither System nor Administrator Access Follow SQL Server Best Practices Protect the As... | Top tips for secure web applications I am looking for easy steps that are simple and effective in making a web application more secure. What are your top tips for secure web applications, and what kind of attack will they stop? | TITLE:
Top tips for secure web applications
QUESTION:
I am looking for easy steps that are simple and effective in making a web application more secure. What are your top tips for secure web applications, and what kind of attack will they stop?
ANSWER:
Microsoft Technet has en excellent article: Ten Tips for Designin... | [
"security",
"web-applications"
] | 12 | 10 | 2,092 | 6 | 0 | 2008-09-06T08:21:35.283000 | 2008-09-06T08:23:56.867000 |
47,329 | 47,344 | UserControl rendering: write link to current page? | I'm implementing a custom control and in this control I need to write a bunch of links to the current page, each one with a different query parameter. I need to keep existing query string intact, and add (or modify the value of ) an extra query item (eg. "page"): "Default.aspx?page=1" "Default.aspx?page=2" "Default.asp... | I'm afraid I don't know of any built-in method for this, we use this method that takes the querystring and sets parameters /// /// Set a parameter value in a query string. If the parameter is not found in the passed in query string, /// it is added to the end of the query string /// /// The query string that is to be m... | UserControl rendering: write link to current page? I'm implementing a custom control and in this control I need to write a bunch of links to the current page, each one with a different query parameter. I need to keep existing query string intact, and add (or modify the value of ) an extra query item (eg. "page"): "Defa... | TITLE:
UserControl rendering: write link to current page?
QUESTION:
I'm implementing a custom control and in this control I need to write a bunch of links to the current page, each one with a different query parameter. I need to keep existing query string intact, and add (or modify the value of ) an extra query item (... | [
"asp.net",
"web-applications",
"custom-server-controls"
] | 3 | 1 | 1,018 | 2 | 0 | 2008-09-06T08:30:22.233000 | 2008-09-06T09:01:16.280000 |
47,338 | 47,418 | ASP.NET MVC Preview 5 routing ambiguity | I have a problem with a sample routing with the preview 5 of asp.net mvc. In the AccountController I have 2 actions: public ActionResult Delete() public ActionResult Delete(string username) While trying to look for Account/Delete or Account/Delete?username=davide the ControllerActionInvoker throws a exception saying th... | Solution found! With the introduction of the ActionNameAttribute, it's now necessary to filter manually which method to call depending on the request. This is done by the ActionSelectionAttribute. Full explanation here: http://haacked.com/archive/2008/08/29/how-a-method-becomes-an-action.aspx | ASP.NET MVC Preview 5 routing ambiguity I have a problem with a sample routing with the preview 5 of asp.net mvc. In the AccountController I have 2 actions: public ActionResult Delete() public ActionResult Delete(string username) While trying to look for Account/Delete or Account/Delete?username=davide the ControllerAc... | TITLE:
ASP.NET MVC Preview 5 routing ambiguity
QUESTION:
I have a problem with a sample routing with the preview 5 of asp.net mvc. In the AccountController I have 2 actions: public ActionResult Delete() public ActionResult Delete(string username) While trying to look for Account/Delete or Account/Delete?username=david... | [
"asp.net-mvc",
"routes"
] | 1 | 3 | 815 | 4 | 0 | 2008-09-06T08:49:26.103000 | 2008-09-06T12:44:07.523000 |
47,340 | 47,368 | Versioning library like SQLite database library? | I like how SQLite library can be included into an application and the application has a full-fledged database to use. Similarly, is there an open source versioning library that I can include into my application so that I can save versions of files as well as do diffs and merges? | SVN doesn't require any prerequisites on end user machine. You can embed SVN right into you app. To learn more on subversion integration, visit " Application Integration/Embedding " thread on SVN forum. | Versioning library like SQLite database library? I like how SQLite library can be included into an application and the application has a full-fledged database to use. Similarly, is there an open source versioning library that I can include into my application so that I can save versions of files as well as do diffs and... | TITLE:
Versioning library like SQLite database library?
QUESTION:
I like how SQLite library can be included into an application and the application has a full-fledged database to use. Similarly, is there an open source versioning library that I can include into my application so that I can save versions of files as we... | [
"version-control",
"open-source"
] | 4 | 3 | 1,002 | 5 | 0 | 2008-09-06T08:52:34.817000 | 2008-09-06T10:18:36.123000 |
47,363 | 47,364 | Show all triggers in a MySQL database | What is the command to list all triggers in a MySQL database? | The command for listing all triggers is: show triggers; or you can access the INFORMATION_SCHEMA table directly by: select trigger_schema, trigger_name, action_statement from information_schema.triggers You can do this from version 5.0.10 onwards. More information about the TRIGGERS table is here. | Show all triggers in a MySQL database What is the command to list all triggers in a MySQL database? | TITLE:
Show all triggers in a MySQL database
QUESTION:
What is the command to list all triggers in a MySQL database?
ANSWER:
The command for listing all triggers is: show triggers; or you can access the INFORMATION_SCHEMA table directly by: select trigger_schema, trigger_name, action_statement from information_schema... | [
"sql",
"mysql",
"database",
"triggers",
"sqlcommand"
] | 128 | 200 | 164,873 | 8 | 0 | 2008-09-06T10:02:26.770000 | 2008-09-06T10:02:40.827000 |
47,366 | 1,521,408 | SQL Compare-Like tool for Oracle? | We're a.NET team which uses the Oracle DB for a lot of reasons that I won't get into. But deployment has been a bitch. We are manually keeping track of all the changes to the schema in each version, by keeping a record of all the scripts that we run during development. Now, if a developer forgets to check-in his script... | Red Gate Schema Compare for Oracle has now been released! http://www.red-gate.com/products/schema_compare_for_oracle/index.htm There is a 28-day fully functional free trial. Please give it a go and let us know your feedback! | SQL Compare-Like tool for Oracle? We're a.NET team which uses the Oracle DB for a lot of reasons that I won't get into. But deployment has been a bitch. We are manually keeping track of all the changes to the schema in each version, by keeping a record of all the scripts that we run during development. Now, if a develo... | TITLE:
SQL Compare-Like tool for Oracle?
QUESTION:
We're a.NET team which uses the Oracle DB for a lot of reasons that I won't get into. But deployment has been a bitch. We are manually keeping track of all the changes to the schema in each version, by keeping a record of all the scripts that we run during development... | [
"oracle",
"sqlcompare"
] | 9 | 11 | 4,244 | 7 | 0 | 2008-09-06T10:06:32.970000 | 2009-10-05T17:41:03.967000 |
47,374 | 130,400 | Best practices re: LINQ To SQL for data access | Part of the web application I'm working on is an area displaying messages from management to 1...n users. I have a DataAccess project that contains the LINQ to SQL classes, and a website project that is the UI. My database looks like this: User -> MessageDetail <- Message <- MessageCategory MessageDetail is a join tabl... | All your LINQ querys should be in a business logic class, no change from older methodologies like ADO. If you are a purist you should always return List(of T) from your methods in the business class, in fact, the datacontext should only be visible to the business classes. Then you can manipulate the list in the user in... | Best practices re: LINQ To SQL for data access Part of the web application I'm working on is an area displaying messages from management to 1...n users. I have a DataAccess project that contains the LINQ to SQL classes, and a website project that is the UI. My database looks like this: User -> MessageDetail <- Message ... | TITLE:
Best practices re: LINQ To SQL for data access
QUESTION:
Part of the web application I'm working on is an area displaying messages from management to 1...n users. I have a DataAccess project that contains the LINQ to SQL classes, and a website project that is the UI. My database looks like this: User -> Message... | [
"asp.net",
"linq",
"linq-to-sql"
] | 6 | 5 | 1,729 | 2 | 0 | 2008-09-06T10:43:39.497000 | 2008-09-24T22:46:45.073000 |
47,376 | 47,380 | How can I monitor the executed sql statements on a SQL Server 2005 | In a project of mine the SQL statements that are executed against a SQL Server are failing for some unknown reason. Some of the code is already used in production so debugging it is not an easy task. Therefore I need a way to see in the database itself what SQL statements are used, as the statements are generated at ru... | Seeing how you use the Management Studio Express, I will assume you don't have access to the MSSQL 2005 client tools. If you do, install those, because it includes the SQL profiler which does exactly what you want (and more!). For more info about that one, see msdn. I found this a while ago, because I was thinking abou... | How can I monitor the executed sql statements on a SQL Server 2005 In a project of mine the SQL statements that are executed against a SQL Server are failing for some unknown reason. Some of the code is already used in production so debugging it is not an easy task. Therefore I need a way to see in the database itself ... | TITLE:
How can I monitor the executed sql statements on a SQL Server 2005
QUESTION:
In a project of mine the SQL statements that are executed against a SQL Server are failing for some unknown reason. Some of the code is already used in production so debugging it is not an easy task. Therefore I need a way to see in th... | [
"sql",
"sql-server",
"sql-server-2005",
"monitoring"
] | 18 | 22 | 28,545 | 2 | 0 | 2008-09-06T10:48:06.990000 | 2008-09-06T10:53:04.637000 |
47,387 | 47,393 | Setting Up MySQL Triggers | I've been hearing about triggers, and I have a few questions. What are triggers? How do I set them up? Are there any precautions, aside from typical SQL stuff, that should be taken? | Triggers allow you to perform a function in the database as certain events happen (eg, an insert into a table). I can't comment on mysql specifically. Precaution: Triggers can be very alluring, when you first start using them they seem like a magic bullet to all kinds of problems. But, they make "magic" stuff happen, i... | Setting Up MySQL Triggers I've been hearing about triggers, and I have a few questions. What are triggers? How do I set them up? Are there any precautions, aside from typical SQL stuff, that should be taken? | TITLE:
Setting Up MySQL Triggers
QUESTION:
I've been hearing about triggers, and I have a few questions. What are triggers? How do I set them up? Are there any precautions, aside from typical SQL stuff, that should be taken?
ANSWER:
Triggers allow you to perform a function in the database as certain events happen (eg... | [
"mysql",
"triggers"
] | 10 | 15 | 2,111 | 4 | 0 | 2008-09-06T11:24:53 | 2008-09-06T11:35:21.883000 |
47,402 | 47,426 | Efficiently reverse the order of the words (not characters) in an array of characters | Given an array of characters which forms a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it. Example input and output: >>> reverse_words("this is a string") 'string a is this' It should be O(N) time and O(1) space ( split() and pushing on / popping off the stack ar... | A solution in C/C++: void swap(char* str, int i, int j){ char t = str[i]; str[i] = str[j]; str[j] = t; }
void reverse_string(char* str, int length){ for(int i=0; i This should be O(n) in time and O(1) in space. Edit: Cleaned it up a bit. The first pass over the string is obviously O(n/2) = O(n). The second pass is O(n... | Efficiently reverse the order of the words (not characters) in an array of characters Given an array of characters which forms a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it. Example input and output: >>> reverse_words("this is a string") 'string a is this' It ... | TITLE:
Efficiently reverse the order of the words (not characters) in an array of characters
QUESTION:
Given an array of characters which forms a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it. Example input and output: >>> reverse_words("this is a string") 'str... | [
"algorithm",
"language-agnostic",
"reverse",
"puzzle"
] | 15 | 34 | 31,647 | 21 | 0 | 2008-09-06T12:09:57.057000 | 2008-09-06T12:53:35.377000 |
47,413 | 47,431 | MS-Access design pattern for last value for a grouping | It's common to have a table where for example the the fields are account, value, and time. What's the best design pattern for retrieving the last value for each account? Unfortunately the last keyword in a grouping gives you the last physical record in the database, not the last record by any sorting. Which means IMHO ... | The subquery option sounds best to me, something like the following psuedo-sql. It may be possible/necessary to optimize it via a join, that will depend on the capabilities of the SQL engine. select * from table where account+time in (select account+max(time) from table group by account order by time) | MS-Access design pattern for last value for a grouping It's common to have a table where for example the the fields are account, value, and time. What's the best design pattern for retrieving the last value for each account? Unfortunately the last keyword in a grouping gives you the last physical record in the database... | TITLE:
MS-Access design pattern for last value for a grouping
QUESTION:
It's common to have a table where for example the the fields are account, value, and time. What's the best design pattern for retrieving the last value for each account? Unfortunately the last keyword in a grouping gives you the last physical reco... | [
"ms-access"
] | 3 | 1 | 3,596 | 8 | 0 | 2008-09-06T12:37:41.110000 | 2008-09-06T13:03:12.687000 |
47,414 | 53,790 | Standard way to merge Entities in LlblGenPro | I start with an entity A with primary key A1, it has child collections B and C, but they are empty, because I haven't prefetched them. I now get a new occurrence of A (A prime) with primary key A1 with the child collections B and C filled. What is a good way to get the A and A prime to be the same object and to get A c... | Once you, have 2 separate objects in memory and you have references to both of them the only way to merge them is to change all references to point to one of the objects, which might be impossible. However there's something you can do not to arrive in this situation you can use a SD.LLBLGen.Pro.ORMSupportClasses.Contex... | Standard way to merge Entities in LlblGenPro I start with an entity A with primary key A1, it has child collections B and C, but they are empty, because I haven't prefetched them. I now get a new occurrence of A (A prime) with primary key A1 with the child collections B and C filled. What is a good way to get the A and... | TITLE:
Standard way to merge Entities in LlblGenPro
QUESTION:
I start with an entity A with primary key A1, it has child collections B and C, but they are empty, because I haven't prefetched them. I now get a new occurrence of A (A prime) with primary key A1 with the child collections B and C filled. What is a good wa... | [
"c#",
"orm",
"llblgenpro"
] | 4 | 3 | 548 | 1 | 0 | 2008-09-06T12:37:55.133000 | 2008-09-10T11:19:53.387000 |
47,427 | 47,428 | Why do some websites add "Slugs" to the end of URLs? | Many websites, including this one, add what are apparently called slugs - descriptive but as far as I can tell useless bits of text - to the end of URLs. For example, the URL the site gives for this question is: https://stackoverflow.com/questions/47427/why-do-some-websites-add-slugs-to-the-end-of-urls But the followin... | The slugs make the URL more user-friendly and you know what to expect when you click a link. Search engines such as Google, rank the pages higher if the searchword is in the URL. | Why do some websites add "Slugs" to the end of URLs? Many websites, including this one, add what are apparently called slugs - descriptive but as far as I can tell useless bits of text - to the end of URLs. For example, the URL the site gives for this question is: https://stackoverflow.com/questions/47427/why-do-some-w... | TITLE:
Why do some websites add "Slugs" to the end of URLs?
QUESTION:
Many websites, including this one, add what are apparently called slugs - descriptive but as far as I can tell useless bits of text - to the end of URLs. For example, the URL the site gives for this question is: https://stackoverflow.com/questions/4... | [
"url",
"seo",
"friendly-url",
"slug"
] | 115 | 170 | 45,562 | 14 | 0 | 2008-09-06T13:00:32.333000 | 2008-09-06T13:01:53.237000 |
47,432 | 48,229 | Would you recommend using "The C5 Generic Collection Library for C# and CLI" based on your experience with it? | This free collection library comes from IT University of Copenhagen. http://www.itu.dk/research/c5/ There is a video with one of the authors on Channel 9. I am trying to learn how to use these collections and I was wondering whether anyone has more experiences or what are your thoughts on this specific collection libra... | I've used it in the past and there are a couple of notes I must make: The library is very good, very fast and very useful. It has lots of very nice data structures, some of which I did not know before starting to use this library. It's Open-Source! This is a huge benefit. Sometimes you don't have exactly what you want.... | Would you recommend using "The C5 Generic Collection Library for C# and CLI" based on your experience with it? This free collection library comes from IT University of Copenhagen. http://www.itu.dk/research/c5/ There is a video with one of the authors on Channel 9. I am trying to learn how to use these collections and ... | TITLE:
Would you recommend using "The C5 Generic Collection Library for C# and CLI" based on your experience with it?
QUESTION:
This free collection library comes from IT University of Copenhagen. http://www.itu.dk/research/c5/ There is a video with one of the authors on Channel 9. I am trying to learn how to use thes... | [
".net",
"collections"
] | 21 | 18 | 5,533 | 3 | 0 | 2008-09-06T13:05:24.007000 | 2008-09-07T07:51:41.273000 |
47,433 | 47,449 | subselect vs outer join | Consider the following 2 queries: select tblA.a,tblA.b,tblA.c,tblA.d from tblA where tblA.a not in (select tblB.a from tblB)
select tblA.a,tblA.b,tblA.c,tblA.d from tblA left outer join tblB on tblA.a = tblB.a where tblB.a is null Which will perform better? My assumption is that in general the join will be better exce... | RDBMSs "rewrite" queries to optimize them, so it depends on system you're using, and I would guess they end up giving the same performance on most "good" databases. I suggest picking the one that is clearer and easier to maintain, for my money, that's the first one. It's much easier to debug the subquery as it can be r... | subselect vs outer join Consider the following 2 queries: select tblA.a,tblA.b,tblA.c,tblA.d from tblA where tblA.a not in (select tblB.a from tblB)
select tblA.a,tblA.b,tblA.c,tblA.d from tblA left outer join tblB on tblA.a = tblB.a where tblB.a is null Which will perform better? My assumption is that in general the ... | TITLE:
subselect vs outer join
QUESTION:
Consider the following 2 queries: select tblA.a,tblA.b,tblA.c,tblA.d from tblA where tblA.a not in (select tblB.a from tblB)
select tblA.a,tblA.b,tblA.c,tblA.d from tblA left outer join tblB on tblA.a = tblB.a where tblB.a is null Which will perform better? My assumption is th... | [
"sql",
"sql-server",
"database",
"performance"
] | 8 | 16 | 6,206 | 8 | 0 | 2008-09-06T13:05:42.587000 | 2008-09-06T13:17:00.783000 |
47,447 | 47,466 | Child spans of the same width | I am trying to create a horizontal menu with the elements represented by 's. The menu itself (parent ) has a fixed width, but the elements number is always different. I would like to have child 's of the same width, independently of how many of them are there. What I've done so far: added a float: left; style for every... | You might try a table with a fixed table layout. It should calculate the column widths without concerning itself with the cell contents. table.ClassName { table-layout: fixed } | Child spans of the same width I am trying to create a horizontal menu with the elements represented by 's. The menu itself (parent ) has a fixed width, but the elements number is always different. I would like to have child 's of the same width, independently of how many of them are there. What I've done so far: added ... | TITLE:
Child spans of the same width
QUESTION:
I am trying to create a horizontal menu with the elements represented by 's. The menu itself (parent ) has a fixed width, but the elements number is always different. I would like to have child 's of the same width, independently of how many of them are there. What I've d... | [
"html",
"css"
] | 2 | 2 | 528 | 4 | 0 | 2008-09-06T13:15:49.270000 | 2008-09-06T13:42:53.230000 |
47,475 | 47,478 | Are unit-test names important? | If unit-test names can become outdated over time and if you consider that the test itself is the most important thing, then is it important to choose wise test names? ie [Test] public void ShouldValidateUserNameIsLessThan100Characters() {} verse [Test] public void UserNameTestValidation1() {} | The name of any method should make it clear what it does. IMO, your first suggestion is a bit long and the second one isn't informative enough. Also it's probably a bad idea to put "100" in the name, as that's very likely to change. What about: public void validateUserNameLength() If the test changes, the name should b... | Are unit-test names important? If unit-test names can become outdated over time and if you consider that the test itself is the most important thing, then is it important to choose wise test names? ie [Test] public void ShouldValidateUserNameIsLessThan100Characters() {} verse [Test] public void UserNameTestValidation1(... | TITLE:
Are unit-test names important?
QUESTION:
If unit-test names can become outdated over time and if you consider that the test itself is the most important thing, then is it important to choose wise test names? ie [Test] public void ShouldValidateUserNameIsLessThan100Characters() {} verse [Test] public void UserNa... | [
"unit-testing"
] | 18 | 18 | 1,746 | 13 | 0 | 2008-09-06T13:59:55.657000 | 2008-09-06T14:05:19.900000 |
47,483 | 47,689 | Passing switches to Xcode 3.1 user scripts | I have a user script that would be much more useful if it could dynamically change some of its execution dependent on what the user wanted. Passing simple switches would easily solve this problem but I don't see any way to do it. I also tried embedding a keyword in the script name, but Xcode copies the script to a guid... | You can't pass parameters to user scripts — instead, user scripts operate on the context you're working in (e.g. the selected file, the selected text, etc.). You should use the context to determine what the user really wants. | Passing switches to Xcode 3.1 user scripts I have a user script that would be much more useful if it could dynamically change some of its execution dependent on what the user wanted. Passing simple switches would easily solve this problem but I don't see any way to do it. I also tried embedding a keyword in the script ... | TITLE:
Passing switches to Xcode 3.1 user scripts
QUESTION:
I have a user script that would be much more useful if it could dynamically change some of its execution dependent on what the user wanted. Passing simple switches would easily solve this problem but I don't see any way to do it. I also tried embedding a keyw... | [
"xcode",
"scripting",
"arguments",
"xcode3.1"
] | 1 | 1 | 862 | 4 | 0 | 2008-09-06T14:11:38.467000 | 2008-09-06T17:45:21.543000 |
47,486 | 47,501 | Tips for database design in a web application | Does someone have any tips/advice on database design for a web application? The kind of stuff that can save me a lot of time/effort in the future when/if the application I'm working on takes off and starts having a lot of usage. To be a bit more specific, the application is a strategy game (browser based, just text) th... | You have probably touched on a much larger issue of designing for high scalability and performance in general. Essentially, for your database design I would follow good practices such as adding foreign keys and indexes to data you expect to be used frequently, normalise your data by splitting it into smaller tables and... | Tips for database design in a web application Does someone have any tips/advice on database design for a web application? The kind of stuff that can save me a lot of time/effort in the future when/if the application I'm working on takes off and starts having a lot of usage. To be a bit more specific, the application is... | TITLE:
Tips for database design in a web application
QUESTION:
Does someone have any tips/advice on database design for a web application? The kind of stuff that can save me a lot of time/effort in the future when/if the application I'm working on takes off and starts having a lot of usage. To be a bit more specific, ... | [
"database-design",
"web-applications"
] | 5 | 10 | 8,898 | 4 | 0 | 2008-09-06T14:16:50.607000 | 2008-09-06T14:35:39.157000 |
47,487 | 47,508 | Create a variable in .CSS file for use within that .CSS file | Possible Duplicate: Avoiding repeated constants in CSS We have some "theme colors" that are reused in our CSS sheet. Is there a way to set a variable and then reuse it? E.g..css OurColor: Blue
H1 { color:OurColor; } | There's no requirement that all styles for a selector reside in a single rule, and a single rule can apply to multiple selectors... so flip it around: /* Theme color: text */ H1, P, TABLE, UL { color: blue; }
/* Theme color: emphasis */ B, I, STRONG, EM { color: #00006F; }
/*... */
/* Theme font: header */ H1, H2, H... | Create a variable in .CSS file for use within that .CSS file Possible Duplicate: Avoiding repeated constants in CSS We have some "theme colors" that are reused in our CSS sheet. Is there a way to set a variable and then reuse it? E.g..css OurColor: Blue
H1 { color:OurColor; } | TITLE:
Create a variable in .CSS file for use within that .CSS file
QUESTION:
Possible Duplicate: Avoiding repeated constants in CSS We have some "theme colors" that are reused in our CSS sheet. Is there a way to set a variable and then reuse it? E.g..css OurColor: Blue
H1 { color:OurColor; }
ANSWER:
There's no requ... | [
"css",
"variables"
] | 52 | 90 | 39,144 | 13 | 0 | 2008-09-06T14:21:25.293000 | 2008-09-06T14:43:01.247000 |
47,519 | 47,584 | How to make your website look the same on Linux | I have a fairly standards compliant XHTML+CSS site that looks great on all browsers on PC and Mac. The other day I saw it on FF3 on Linux and the letter spacing was slightly larger, throwing everything out of whack and causing unwanted wrapping and clipping of text. The CSS in question has font-size: 11px; font-family:... | Sizing/spacing differences are usually difficult to catch. What you can do is create a Linux-specific CSS file that will contain these values adjusted for Linux, then do a simple JS-based detect to inject that CSS if the User agent is a Linux one. This is probably not the cleanest approach, but it will work, and with t... | How to make your website look the same on Linux I have a fairly standards compliant XHTML+CSS site that looks great on all browsers on PC and Mac. The other day I saw it on FF3 on Linux and the letter spacing was slightly larger, throwing everything out of whack and causing unwanted wrapping and clipping of text. The C... | TITLE:
How to make your website look the same on Linux
QUESTION:
I have a fairly standards compliant XHTML+CSS site that looks great on all browsers on PC and Mac. The other day I saw it on FF3 on Linux and the letter spacing was slightly larger, throwing everything out of whack and causing unwanted wrapping and clipp... | [
"css",
"linux"
] | 4 | 0 | 1,387 | 5 | 0 | 2008-09-06T14:52:07.340000 | 2008-09-06T15:46:46.787000 |
47,521 | 47,799 | Using yield to iterate over a datareader might not close the connection? | Here is a sample code to retrieve data from a database using the yield keyword that I found in a few place while googling around: public IEnumerable ExecuteSelect(string commandText) { using (IDbConnection connection = CreateConnection()) { using (IDbCommand cmd = CreateCommand(commandText, connection)) { connection.Op... | The Iterator that the compiler synthesises implements IDisposable, which foreach calls when the foreach loop is exited. The Iterator's Dispose() method will clean up the using statements on early exit. As long as you use the iterator in a foreach loop, using() block, or call the Dispose() method in some other way, the ... | Using yield to iterate over a datareader might not close the connection? Here is a sample code to retrieve data from a database using the yield keyword that I found in a few place while googling around: public IEnumerable ExecuteSelect(string commandText) { using (IDbConnection connection = CreateConnection()) { using ... | TITLE:
Using yield to iterate over a datareader might not close the connection?
QUESTION:
Here is a sample code to retrieve data from a database using the yield keyword that I found in a few place while googling around: public IEnumerable ExecuteSelect(string commandText) { using (IDbConnection connection = CreateConn... | [
".net-2.0",
"yield"
] | 15 | 12 | 6,531 | 4 | 0 | 2008-09-06T14:53:45.447000 | 2008-09-06T20:15:18.453000 |
47,524 | 47,540 | JUnit for database code | I've been trying to implement unit testing and currently have some code that does the following: query external database, loading into a feed table query a view, which is a delta of my feed and data tables, updating data table to match feed table my unit testing strategy is this: I have a testing database that I am fre... | Is it your intent to test the view which generates the deltas, or to test that your code correctly adds, deletes and updates in response to the view? If you want to test the view, you could use a tool like DBUnit to populate your feed and data tables with various data whose delta you've manually calculated. Then, for e... | JUnit for database code I've been trying to implement unit testing and currently have some code that does the following: query external database, loading into a feed table query a view, which is a delta of my feed and data tables, updating data table to match feed table my unit testing strategy is this: I have a testin... | TITLE:
JUnit for database code
QUESTION:
I've been trying to implement unit testing and currently have some code that does the following: query external database, loading into a feed table query a view, which is a delta of my feed and data tables, updating data table to match feed table my unit testing strategy is thi... | [
"java",
"database",
"unit-testing",
"junit"
] | 8 | 8 | 13,397 | 5 | 0 | 2008-09-06T14:57:31.290000 | 2008-09-06T15:11:11.647000 |
47,533 | 47,583 | Reading from a socket in C# | I am trying to read ASCII text response from a tcp open streaming socket This is what I have come up with so far. I want to know what is the best way to do this that includes error handling. Should I also be checking the SocketError after the Receive call in the do loop? IPEndPoint ep = new IPEndPoint(IPAddress.Parse("... | Your best bet is probably TcpClient. There's a great sample that does exactly what you're doing right in the.NET Documentation here: http://msdn.microsoft.com/en-us/library/system.net.sockets.tcpclient.aspx Good luck to you! | Reading from a socket in C# I am trying to read ASCII text response from a tcp open streaming socket This is what I have come up with so far. I want to know what is the best way to do this that includes error handling. Should I also be checking the SocketError after the Receive call in the do loop? IPEndPoint ep = new ... | TITLE:
Reading from a socket in C#
QUESTION:
I am trying to read ASCII text response from a tcp open streaming socket This is what I have come up with so far. I want to know what is the best way to do this that includes error handling. Should I also be checking the SocketError after the Receive call in the do loop? IP... | [
"c#",
"sockets"
] | 2 | 5 | 48,178 | 1 | 0 | 2008-09-06T15:07:36.243000 | 2008-09-06T15:46:40.517000 |
47,535 | 47,552 | SQL to add column with default value - Access 2003 | Updating an old ASP/Access site for a client - I need SQL to add a column to an existing table and set a default value. Doesn't work - any ideas? This works fine ALTER TABLE documents ADD COLUMN membersOnly NUMBER I want this to work: ALTER TABLE documents ADD COLUMN membersOnly NUMBER DEFAULT 0 Have googled and seen i... | Tools -> Options -> Tables/Queries -> (At the bottom right:) Sql Server Compatible Syntax - turn option on for this database. then you can execute your query: ALTER TABLE documents ADD COLUMN membersOnly NUMBER DEFAULT 0 | SQL to add column with default value - Access 2003 Updating an old ASP/Access site for a client - I need SQL to add a column to an existing table and set a default value. Doesn't work - any ideas? This works fine ALTER TABLE documents ADD COLUMN membersOnly NUMBER I want this to work: ALTER TABLE documents ADD COLUMN m... | TITLE:
SQL to add column with default value - Access 2003
QUESTION:
Updating an old ASP/Access site for a client - I need SQL to add a column to an existing table and set a default value. Doesn't work - any ideas? This works fine ALTER TABLE documents ADD COLUMN membersOnly NUMBER I want this to work: ALTER TABLE docu... | [
"sql",
"ms-access"
] | 6 | 8 | 54,243 | 5 | 0 | 2008-09-06T15:08:35.677000 | 2008-09-06T15:22:06.940000 |
47,537 | 47,548 | C# Console? | Does anyone know if there is a c# Console app, similar to the Python or Ruby console? I know the whole "Compiled versus Interpreted" difference, but with C#'s reflection power I think it could be done. UPDATE Well, it only took about 200 lines, but I wrote a simple one...It works a lot like osql. You enter commands and... | Given your mention of "C#'s reflection power", I am unsure whether you're looking for an interactive C# console for small code snippets of your own (à la Ruby's irb ), or a means of interacting with an existing, compiled application currently running as a process. In the former case: Windows PowerShell might be your fr... | C# Console? Does anyone know if there is a c# Console app, similar to the Python or Ruby console? I know the whole "Compiled versus Interpreted" difference, but with C#'s reflection power I think it could be done. UPDATE Well, it only took about 200 lines, but I wrote a simple one...It works a lot like osql. You enter ... | TITLE:
C# Console?
QUESTION:
Does anyone know if there is a c# Console app, similar to the Python or Ruby console? I know the whole "Compiled versus Interpreted" difference, but with C#'s reflection power I think it could be done. UPDATE Well, it only took about 200 lines, but I wrote a simple one...It works a lot lik... | [
"c#",
".net",
"console",
"interactive"
] | 28 | 19 | 11,018 | 7 | 0 | 2008-09-06T15:08:57.097000 | 2008-09-06T15:19:39.317000 |
47,538 | 47,554 | Where's the Win32 resource for the mouse cursor for dragging splitters? | I am building a custom win32 control/widget and would like to change the cursor to a horizontal "splitter" symbol when hovering over a particular vertical line in the control. IE: I want to drag this vertical line (splitter bar) left and right (WEST and EAST). Of the the system cursors (OCR_*), the only cursor that mak... | There are all sorts of icons, cursors, and images in use throughout the Windows UI which are not publicly available to 3rd-party software. Of course, you could still load up the module in which they reside and use them, but there's really no guarantee your program will keep working after a system update / upgrade. Incl... | Where's the Win32 resource for the mouse cursor for dragging splitters? I am building a custom win32 control/widget and would like to change the cursor to a horizontal "splitter" symbol when hovering over a particular vertical line in the control. IE: I want to drag this vertical line (splitter bar) left and right (WES... | TITLE:
Where's the Win32 resource for the mouse cursor for dragging splitters?
QUESTION:
I am building a custom win32 control/widget and would like to change the cursor to a horizontal "splitter" symbol when hovering over a particular vertical line in the control. IE: I want to drag this vertical line (splitter bar) l... | [
"c++",
"winapi",
"native"
] | 2 | 5 | 1,998 | 2 | 0 | 2008-09-06T15:09:10.217000 | 2008-09-06T15:22:46.127000 |
47,555 | 5,212,707 | Practical Experience using Stripes? | I am coming from an Enterprise Java background which involves a fairly heavyweight software stack, and have recently discovered the Stripes framework; my initial impression is that this seems to do a good job of minimising the unpleasant parts of building a web application in Java. Has anyone used Stripes for a project... | We've been using Stripes for about 4 years now. Our stack is Stripes/EJB3/JPA. Many use Stripes plus Stripernate as a single, full stack solution. We don't because we want our business logic within the EJB tier, so we simply rely on JPA Entities as combined Model and DTO. Stripes does the binding to our Entities/DTO an... | Practical Experience using Stripes? I am coming from an Enterprise Java background which involves a fairly heavyweight software stack, and have recently discovered the Stripes framework; my initial impression is that this seems to do a good job of minimising the unpleasant parts of building a web application in Java. H... | TITLE:
Practical Experience using Stripes?
QUESTION:
I am coming from an Enterprise Java background which involves a fairly heavyweight software stack, and have recently discovered the Stripes framework; my initial impression is that this seems to do a good job of minimising the unpleasant parts of building a web appl... | [
"java",
"stripes"
] | 19 | 9 | 3,586 | 6 | 0 | 2008-09-06T15:24:24.360000 | 2011-03-06T19:03:41.173000 |
47,589 | 47,662 | Can I detect and handle MySQL Warnings with PHP? | I'm dealing with a MySQL table that defines the JobName column as UNIQUE. If somebody tries to save a new Job to the database using a JobName that is already in the database, MySQL throws a warning. I would like to be able to detect this warning, just like an error, in my PHP script and deal with it appropriately. Idea... | For warnings to be "flagged" to PHP natively would require changes to the mysql/mysqli driver, which is obviously beyond the scope of this question. Instead you're going to have to basically check every query you make on the database for warnings: $warningCountResult = mysql_query("SELECT @@warning_count"); if ($warnin... | Can I detect and handle MySQL Warnings with PHP? I'm dealing with a MySQL table that defines the JobName column as UNIQUE. If somebody tries to save a new Job to the database using a JobName that is already in the database, MySQL throws a warning. I would like to be able to detect this warning, just like an error, in m... | TITLE:
Can I detect and handle MySQL Warnings with PHP?
QUESTION:
I'm dealing with a MySQL table that defines the JobName column as UNIQUE. If somebody tries to save a new Job to the database using a JobName that is already in the database, MySQL throws a warning. I would like to be able to detect this warning, just l... | [
"php",
"mysql",
"error-handling",
"warnings"
] | 15 | 13 | 17,298 | 8 | 0 | 2008-09-06T15:51:51.643000 | 2008-09-06T17:00:05.270000 |
47,605 | 47,628 | String concatenation: concat() vs "+" operator | Assuming String a and b: a += b a = a.concat(b) Under the hood, are they the same thing? Here is concat decompiled as reference. I'd like to be able to decompile the + operator as well to see what that does. public String concat(String s) {
int i = s.length(); if (i == 0) { return this; } else { char ac[] = new char[c... | No, not quite. Firstly, there's a slight difference in semantics. If a is null, then a.concat(b) throws a NullPointerException but a+=b will treat the original value of a as if it were null. Furthermore, the concat() method only accepts String values while the + operator will silently convert the argument to a String (... | String concatenation: concat() vs "+" operator Assuming String a and b: a += b a = a.concat(b) Under the hood, are they the same thing? Here is concat decompiled as reference. I'd like to be able to decompile the + operator as well to see what that does. public String concat(String s) {
int i = s.length(); if (i == 0)... | TITLE:
String concatenation: concat() vs "+" operator
QUESTION:
Assuming String a and b: a += b a = a.concat(b) Under the hood, are they the same thing? Here is concat decompiled as reference. I'd like to be able to decompile the + operator as well to see what that does. public String concat(String s) {
int i = s.len... | [
"java",
"string",
"concatenation"
] | 592 | 649 | 1,089,762 | 12 | 0 | 2008-09-06T16:08:54.940000 | 2008-09-06T16:25:37.163000 |
47,612 | 47,618 | How to do C++ style destructors in C#? | I've got a C# class with a Dispose function via IDisposable. It's intended to be used inside a using block so the expensive resource it handles can be released right away. The problem is that a bug occurred when an exception was thrown before Dispose was called, and the programmer neglected to use using or finally. In ... | Unfortunately there isn't any way to do this directly in the code. If this is an issue in house, there are various code analysis solutions that could catch these sort of problems. Have you looked into FxCop? I think that this will catch these situations and in all cases where IDisposable objects might be left hanging. ... | How to do C++ style destructors in C#? I've got a C# class with a Dispose function via IDisposable. It's intended to be used inside a using block so the expensive resource it handles can be released right away. The problem is that a bug occurred when an exception was thrown before Dispose was called, and the programmer... | TITLE:
How to do C++ style destructors in C#?
QUESTION:
I've got a C# class with a Dispose function via IDisposable. It's intended to be used inside a using block so the expensive resource it handles can be released right away. The problem is that a bug occurred when an exception was thrown before Dispose was called, ... | [
"c#",
"dispose",
"idisposable",
"using"
] | 2 | 3 | 2,124 | 7 | 0 | 2008-09-06T16:12:48.020000 | 2008-09-06T16:17:36.433000 |
47,639 | 47,649 | What are the advantages of installing programs in AppData like Google Chrome? | I just noticed that Chromium was installed in AppData in both Vista and XP. If Google does that and if other applications does this, than is that becuase there is some form of protection? Should we write installers that does the same thing as Google? | Windows still lacks a convention for per-user installation. When an installer asks whether to install for the current user or all users, it really only refers to shortcut placement (Start Menu; Desktop). The actual application files still go in the system-wide %PROGRAMFILES%. Microsoft's own ClickOnce works around this... | What are the advantages of installing programs in AppData like Google Chrome? I just noticed that Chromium was installed in AppData in both Vista and XP. If Google does that and if other applications does this, than is that becuase there is some form of protection? Should we write installers that does the same thing as... | TITLE:
What are the advantages of installing programs in AppData like Google Chrome?
QUESTION:
I just noticed that Chromium was installed in AppData in both Vista and XP. If Google does that and if other applications does this, than is that becuase there is some form of protection? Should we write installers that does... | [
"windows",
"google-chrome",
"windows-installer"
] | 18 | 21 | 8,126 | 8 | 0 | 2008-09-06T16:37:23.513000 | 2008-09-06T16:47:16.487000 |
47,656 | 47,680 | How do I do full-text searching in Ruby on Rails? | I would like to do full-text searching of data in my Ruby on Rails application. What options exist? | There are several options available and each have different strengths and weaknesses. If you would like to add full-text searching, it would be prudent to investigate each a little bit and try them out to see how well it works for you in your environment. MySQL has built-in support for full-text searching. It has onlin... | How do I do full-text searching in Ruby on Rails? I would like to do full-text searching of data in my Ruby on Rails application. What options exist? | TITLE:
How do I do full-text searching in Ruby on Rails?
QUESTION:
I would like to do full-text searching of data in my Ruby on Rails application. What options exist?
ANSWER:
There are several options available and each have different strengths and weaknesses. If you would like to add full-text searching, it would be... | [
"ruby-on-rails",
"full-text-search"
] | 12 | 20 | 10,461 | 8 | 0 | 2008-09-06T16:51:21.280000 | 2008-09-06T17:18:19.703000 |
47,658 | 48,107 | Standards Document | I am writing a coding standards document for a team of about 15 developers with a project load of between 10 and 15 projects a year. Amongst other sections (which I may post here as I get to them) I am writing a section on code formatting. So to start with, I think it is wise that, for whatever reason, we establish som... | First find a automated code-formatter that works with your language. Reason: Whatever the document says, people will inevitably break the rules. It's much easier to run code through a formatter than to nit-pick in a code review. If you're using a language with an existing standard (e.g. Java, C#), it's easiest to use i... | Standards Document I am writing a coding standards document for a team of about 15 developers with a project load of between 10 and 15 projects a year. Amongst other sections (which I may post here as I get to them) I am writing a section on code formatting. So to start with, I think it is wise that, for whatever reaso... | TITLE:
Standards Document
QUESTION:
I am writing a coding standards document for a team of about 15 developers with a project load of between 10 and 15 projects a year. Amongst other sections (which I may post here as I get to them) I am writing a section on code formatting. So to start with, I think it is wise that, ... | [
"coding-style"
] | 5 | 3 | 424 | 4 | 0 | 2008-09-06T16:52:32.807000 | 2008-09-07T03:34:30.563000 |
47,676 | 444,367 | Tomcat vs Weblogic JNDI Lookup | The Weblogic servers we are using have been configured to allow JNDI datasource names like "appds". For development (localhost), we might be running Tomcat and when declared in the section of server.xml, Tomcat will hang JNDI datasources on "java:comp/env/jdbc/*" in the JNDI tree. Problem: in Weblogic, the JNDI lookup ... | JndiLocatorSupport has a property resourceRef. When setting this true, "java:comp/env/" prefix will be prepended automatically. So I believe it would be correct to differentiate this parameter when moving from Tomcat to Weblogic. | Tomcat vs Weblogic JNDI Lookup The Weblogic servers we are using have been configured to allow JNDI datasource names like "appds". For development (localhost), we might be running Tomcat and when declared in the section of server.xml, Tomcat will hang JNDI datasources on "java:comp/env/jdbc/*" in the JNDI tree. Problem... | TITLE:
Tomcat vs Weblogic JNDI Lookup
QUESTION:
The Weblogic servers we are using have been configured to allow JNDI datasource names like "appds". For development (localhost), we might be running Tomcat and when declared in the section of server.xml, Tomcat will hang JNDI datasources on "java:comp/env/jdbc/*" in the ... | [
"java",
"tomcat",
"jakarta-ee",
"weblogic",
"jndi"
] | 25 | 12 | 48,913 | 8 | 0 | 2008-09-06T17:13:14.053000 | 2009-01-14T19:37:29.273000 |
47,683 | 47,963 | Reconnecting JMS listener to JBossMQ | We have a Java listener that reads text messages off of a queue in JBossMQ. If we have to reboot JBoss, the listener will not reconnect and start reading messages again. We just get messages in the listener's log file every 2 minutes saying it can't connect. Is there something we're not setting in our code or in JBossM... | You should implement in your client code javax.jms.ExceptionListener. You will need a method called onException. When the client's connection is lost, you should get a JMSException, and this method will be called automatically. The only thing you have to look out for is if you are intentionally disconnecting from JBoss... | Reconnecting JMS listener to JBossMQ We have a Java listener that reads text messages off of a queue in JBossMQ. If we have to reboot JBoss, the listener will not reconnect and start reading messages again. We just get messages in the listener's log file every 2 minutes saying it can't connect. Is there something we're... | TITLE:
Reconnecting JMS listener to JBossMQ
QUESTION:
We have a Java listener that reads text messages off of a queue in JBossMQ. If we have to reboot JBoss, the listener will not reconnect and start reading messages again. We just get messages in the listener's log file every 2 minutes saying it can't connect. Is the... | [
"java",
"jboss",
"jms",
"jbossmq"
] | 13 | 10 | 10,172 | 4 | 0 | 2008-09-06T17:33:00.247000 | 2008-09-07T00:05:10.490000 |
47,685 | 68,212 | How can I reformat XAML nicely in VS 2008? | Visual Studio 2008's XAML editor (SP1) cannot reformat the XML into a consistent style. Which tools can I use to get a nicely formatted XAML file? Studio integration preferred. | Here's a link that is specific to VS2008 XAML formatting but the good news is you can do it directly inside VS. Link | How can I reformat XAML nicely in VS 2008? Visual Studio 2008's XAML editor (SP1) cannot reformat the XML into a consistent style. Which tools can I use to get a nicely formatted XAML file? Studio integration preferred. | TITLE:
How can I reformat XAML nicely in VS 2008?
QUESTION:
Visual Studio 2008's XAML editor (SP1) cannot reformat the XML into a consistent style. Which tools can I use to get a nicely formatted XAML file? Studio integration preferred.
ANSWER:
Here's a link that is specific to VS2008 XAML formatting but the good new... | [
".net",
"wpf",
"xaml",
"formatting"
] | 4 | 4 | 4,116 | 8 | 0 | 2008-09-06T17:33:38.310000 | 2008-09-16T00:23:03.727000 |
47,692 | 47,729 | How do I become "test infected" with TDD? | I keep reading about people who are "test infected", meaning that they don't just "get" TDD but also can't live without it. They've "had the makeover" as it were. The question is, how do I get like that? | Part of the point of being "test infected" is that you've used TDD enough and seen the successes enough that you don't want to code without it. Once you've gone through a cycle of writing tests first, then coding and refactoring and seeing your bug counts go down and your code get better as a result, not only does it b... | How do I become "test infected" with TDD? I keep reading about people who are "test infected", meaning that they don't just "get" TDD but also can't live without it. They've "had the makeover" as it were. The question is, how do I get like that? | TITLE:
How do I become "test infected" with TDD?
QUESTION:
I keep reading about people who are "test infected", meaning that they don't just "get" TDD but also can't live without it. They've "had the makeover" as it were. The question is, how do I get like that?
ANSWER:
Part of the point of being "test infected" is t... | [
"unit-testing",
"testing",
"tdd"
] | 10 | 16 | 2,264 | 4 | 0 | 2008-09-06T17:57:51.620000 | 2008-09-06T18:47:46.323000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.