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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7,284 | 7,320 | What is Turing Complete? | What does the expression "Turing Complete" mean? Can you give a simple explanation, without going into too many theoretical details? | Here's the briefest explanation: A Turing Complete system means a system in which a program can be written that will find an answer (although with no guarantees regarding runtime or memory). So, if somebody says "my new thing is Turing Complete" that means in principle (although often not in practice) it could be used ... | What is Turing Complete? What does the expression "Turing Complete" mean? Can you give a simple explanation, without going into too many theoretical details? | TITLE:
What is Turing Complete?
QUESTION:
What does the expression "Turing Complete" mean? Can you give a simple explanation, without going into too many theoretical details?
ANSWER:
Here's the briefest explanation: A Turing Complete system means a system in which a program can be written that will find an answer (al... | [
"language-agnostic",
"theory",
"turing-machines",
"turing-complete"
] | 703 | 524 | 307,423 | 14 | 0 | 2008-08-10T18:41:02.300000 | 2008-08-10T20:10:48.687000 |
7,287 | 7,296 | How do you test/change untested and untestable code? | Lately I had to change some code on older systems where not all of the code has unit tests. Before making the changes I want to write tests, but each class created a lot of dependencies and other anti-patterns which made testing quite hard. Obviously, I wanted to refactor the code to make it easier to test, write the t... | First of all, here's a great article with tips on unit testing. Secondly, I found a great way to avoid making tons of changes in old code is to just refactor it a little until you can test it. One easy way to do this is to make private members protected, and then override the protected field. For example, let's say you... | How do you test/change untested and untestable code? Lately I had to change some code on older systems where not all of the code has unit tests. Before making the changes I want to write tests, but each class created a lot of dependencies and other anti-patterns which made testing quite hard. Obviously, I wanted to ref... | TITLE:
How do you test/change untested and untestable code?
QUESTION:
Lately I had to change some code on older systems where not all of the code has unit tests. Before making the changes I want to write tests, but each class created a lot of dependencies and other anti-patterns which made testing quite hard. Obviousl... | [
"unit-testing",
"refactoring",
"legacy"
] | 9 | 6 | 2,052 | 5 | 0 | 2008-08-10T18:49:53.920000 | 2008-08-10T19:22:36.943000 |
7,348 | 7,351 | Zip library options for the Compact Framework? | My requirements: Support.NET Compact Framework 2.0 and Windows Mobile 6.0 devices. Only need to unzip the contents to a directory on a storage card. Creation of zip files is not required. Must be able to use in corporate/commercial software. Can be open source, but not have GPL or other viral license. I've seen the Xce... | Have a look at #ziplib (www.icsharpcode.com). It's GPL, but you can use it in closed-source, commercial applications. They don't say anything specifically on their page about using it with the Compact Framework, so you'd have to give it a test yourself (that said, it's pure C# without any external dependencies, so the ... | Zip library options for the Compact Framework? My requirements: Support.NET Compact Framework 2.0 and Windows Mobile 6.0 devices. Only need to unzip the contents to a directory on a storage card. Creation of zip files is not required. Must be able to use in corporate/commercial software. Can be open source, but not hav... | TITLE:
Zip library options for the Compact Framework?
QUESTION:
My requirements: Support.NET Compact Framework 2.0 and Windows Mobile 6.0 devices. Only need to unzip the contents to a directory on a storage card. Creation of zip files is not required. Must be able to use in corporate/commercial software. Can be open s... | [
"windows-mobile",
"compact-framework",
"zip",
"components"
] | 9 | 3 | 7,849 | 5 | 0 | 2008-08-10T21:00:14.173000 | 2008-08-10T21:04:56.690000 |
7,364 | 7,455 | Edit PDF in PHP? | Does anyone know of a good method for editing PDFs in PHP? Preferably open-source/zero-license cost methods.:) I am thinking along the lines of opening a PDF file, replacing text in the PDF and then writing out the modified version of the PDF? On the front-end | If you are taking a 'fill in the blank' approach, you can precisely position text anywhere you want on the page. So it's relatively easy (if not a bit tedious) to add the missing text to the document. For example with Zend Framework: pages[0]; $font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA); $page->s... | Edit PDF in PHP? Does anyone know of a good method for editing PDFs in PHP? Preferably open-source/zero-license cost methods.:) I am thinking along the lines of opening a PDF file, replacing text in the PDF and then writing out the modified version of the PDF? On the front-end | TITLE:
Edit PDF in PHP?
QUESTION:
Does anyone know of a good method for editing PDFs in PHP? Preferably open-source/zero-license cost methods.:) I am thinking along the lines of opening a PDF file, replacing text in the PDF and then writing out the modified version of the PDF? On the front-end
ANSWER:
If you are taki... | [
"php",
"pdf"
] | 93 | 73 | 151,987 | 9 | 0 | 2008-08-10T21:58:24.913000 | 2008-08-11T00:49:58.077000 |
7,367 | 7,399 | Visual Studio - new "default" property values for inherited controls | I'm looking for help setting a new default property value for an inherited control in Visual Studio: class NewCombo: System.Windows.Forms.ComboBox { public NewCombo() { DropDownItems = 50; } } The problem is that the base class property DropDownItems has a 'default' attribute set on it that is a different value (not 50... | In your derived class you need to either override (or shadow using new ) the property in question and then re-apply the default value attribute. | Visual Studio - new "default" property values for inherited controls I'm looking for help setting a new default property value for an inherited control in Visual Studio: class NewCombo: System.Windows.Forms.ComboBox { public NewCombo() { DropDownItems = 50; } } The problem is that the base class property DropDownItems ... | TITLE:
Visual Studio - new "default" property values for inherited controls
QUESTION:
I'm looking for help setting a new default property value for an inherited control in Visual Studio: class NewCombo: System.Windows.Forms.ComboBox { public NewCombo() { DropDownItems = 50; } } The problem is that the base class prope... | [
"c#",
".net",
"vb.net",
"visual-studio"
] | 11 | 5 | 4,116 | 1 | 0 | 2008-08-10T22:06:49.670000 | 2008-08-10T23:11:39.133000 |
7,398 | 26,994 | How to avoid redefining VERSION, PACKAGE, etc | I haven't seen any questions relating to GNU autoconf/automake builds, but I'm hoping at least some of you out there are familiar with it. Here goes: I have a project (I'll call it myproject) that includes another project (vendor). The vendor project is a standalone project maintained by someone else. Including a proje... | Some notes: you didn't mention how config.h was included - with quotes or angle brackets. See this other question for more information on the difference. In short, config.h is typically included with quotes, not angle brackets, and this should make the preprocessor prefer the config.h from the project's own directory (... | How to avoid redefining VERSION, PACKAGE, etc I haven't seen any questions relating to GNU autoconf/automake builds, but I'm hoping at least some of you out there are familiar with it. Here goes: I have a project (I'll call it myproject) that includes another project (vendor). The vendor project is a standalone project... | TITLE:
How to avoid redefining VERSION, PACKAGE, etc
QUESTION:
I haven't seen any questions relating to GNU autoconf/automake builds, but I'm hoping at least some of you out there are familiar with it. Here goes: I have a project (I'll call it myproject) that includes another project (vendor). The vendor project is a ... | [
"c",
"linux",
"unix",
"autoconf",
"automake"
] | 9 | 5 | 1,782 | 3 | 0 | 2008-08-10T23:10:53.190000 | 2008-08-25T21:52:23.997000 |
7,440 | 20,754 | What do you use to Unit-Test your Web UI? | The company I'm currently working for is using Selenium for Uniting-Testing our User Interface. What do you use to Unit-Test your Web UI and how effective do you find it? | We use Watin at my place of employment, we are a.net shop so this solution made a lot of sense. We actually started with Watir (the original ruby implementation) and switched after. It's been a pretty good solution for us so far | What do you use to Unit-Test your Web UI? The company I'm currently working for is using Selenium for Uniting-Testing our User Interface. What do you use to Unit-Test your Web UI and how effective do you find it? | TITLE:
What do you use to Unit-Test your Web UI?
QUESTION:
The company I'm currently working for is using Selenium for Uniting-Testing our User Interface. What do you use to Unit-Test your Web UI and how effective do you find it?
ANSWER:
We use Watin at my place of employment, we are a.net shop so this solution made ... | [
"unit-testing",
"user-interface",
"selenium"
] | 35 | 10 | 11,955 | 15 | 0 | 2008-08-11T00:05:36.590000 | 2008-08-21T18:46:18.563000 |
7,472 | 7,479 | WPF Databinding | Can anyone point me to a good resource (or throw me a clue) to show me how to do DataBinding to controls (ComboBox, ListBox, etc.) in WPF? I'm at a bit of a loss when all my WinForms niceities are taken away from me, and I'm not all that bright to start with... | I find the tutorial videos at Windows Client.Net equally awesome. Dot Net Rocks TV has also covered it some time ago. | WPF Databinding Can anyone point me to a good resource (or throw me a clue) to show me how to do DataBinding to controls (ComboBox, ListBox, etc.) in WPF? I'm at a bit of a loss when all my WinForms niceities are taken away from me, and I'm not all that bright to start with... | TITLE:
WPF Databinding
QUESTION:
Can anyone point me to a good resource (or throw me a clue) to show me how to do DataBinding to controls (ComboBox, ListBox, etc.) in WPF? I'm at a bit of a loss when all my WinForms niceities are taken away from me, and I'm not all that bright to start with...
ANSWER:
I find the tuto... | [
"wpf",
"data-binding"
] | 11 | 3 | 3,869 | 6 | 0 | 2008-08-11T01:34:34.773000 | 2008-08-11T01:45:45.297000 |
7,477 | 7,523 | How to autosize a textarea using Prototype? | I'm currently working on an internal sales application for the company I work for, and I've got a form that allows the user to change the delivery address. Now I think it would look much nicer, if the textarea I'm using for the main address details would just take up the area of the text in it, and automatically resize... | Facebook does it, when you write on people's walls, but only resizes vertically. Horizontal resize strikes me as being a mess, due to word-wrap, long lines, and so on, but vertical resize seems to be pretty safe and nice. None of the Facebook-using-newbies I know have ever mentioned anything about it or been confused. ... | How to autosize a textarea using Prototype? I'm currently working on an internal sales application for the company I work for, and I've got a form that allows the user to change the delivery address. Now I think it would look much nicer, if the textarea I'm using for the main address details would just take up the area... | TITLE:
How to autosize a textarea using Prototype?
QUESTION:
I'm currently working on an internal sales application for the company I work for, and I've got a form that allows the user to change the delivery address. Now I think it would look much nicer, if the textarea I'm using for the main address details would jus... | [
"javascript",
"html",
"css",
"textarea",
"prototypejs"
] | 132 | 80 | 170,377 | 18 | 0 | 2008-08-11T01:43:13.493000 | 2008-08-11T04:49:33.930000 |
7,489 | 13,384 | How do I make a GUI? | I've made many different seperate parts of a GUI system for the Nintendo DS, like buttons and textboxes and select boxes, but I need a way of containing these classes in one Gui class, so that I can draw everything to the screen all at once, and check all the buttons at once to check if any are being pressed. My questi... | This question is very similar to one I was going to post, only mine is for Sony PSP programming. I've been toying with something for a while, I've consulted some books and VTMs, and so far this is a rough idea of a simple ui systems. class uiElement() {... virtual void Update() = 0; virtual void Draw() = 0;... }
class... | How do I make a GUI? I've made many different seperate parts of a GUI system for the Nintendo DS, like buttons and textboxes and select boxes, but I need a way of containing these classes in one Gui class, so that I can draw everything to the screen all at once, and check all the buttons at once to check if any are bei... | TITLE:
How do I make a GUI?
QUESTION:
I've made many different seperate parts of a GUI system for the Nintendo DS, like buttons and textboxes and select boxes, but I need a way of containing these classes in one Gui class, so that I can draw everything to the screen all at once, and check all the buttons at once to ch... | [
"c++",
"user-interface"
] | 8 | 3 | 2,528 | 5 | 0 | 2008-08-11T02:50:09.113000 | 2008-08-16T22:05:03.323000 |
7,503 | 7,512 | Linq to objects - select first object | I know almost nothing about linq. I'm doing this: var apps = from app in Process.GetProcesses() where app.ProcessName.Contains( "MyAppName" ) && app.MainWindowHandle!= IntPtr.Zero select app; Which gets me all the running processes which match that criteria. But I don't know how to get the first one. The examples I can... | @FryHard FirstOrDefault will work but remember that it returns null if none are found. This code isn't tested but should be close to what you want: var app = Process.GetProcesses().FirstOrDefault(p => p.ProcessName.Contains("MyAppName") && p.MainWindowHandle!= IntPtr.Zero);
if (app == null) return;
SetForegroundWindo... | Linq to objects - select first object I know almost nothing about linq. I'm doing this: var apps = from app in Process.GetProcesses() where app.ProcessName.Contains( "MyAppName" ) && app.MainWindowHandle!= IntPtr.Zero select app; Which gets me all the running processes which match that criteria. But I don't know how to... | TITLE:
Linq to objects - select first object
QUESTION:
I know almost nothing about linq. I'm doing this: var apps = from app in Process.GetProcesses() where app.ProcessName.Contains( "MyAppName" ) && app.MainWindowHandle!= IntPtr.Zero select app; Which gets me all the running processes which match that criteria. But I... | [
"c#",
"linq",
"linq-to-objects"
] | 12 | 20 | 43,847 | 3 | 0 | 2008-08-11T03:54:43.947000 | 2008-08-11T04:25:07.333000 |
7,517 | 25,741 | Dropping a group of tables in SQL Server | Is there a simple way to drop a group of interrelated tables in SQL Server? Ideally I'd like to avoid having to worry about what order they're being dropped in since I know the entire group will be gone by the end of the process. | At the risk of sounding stupid, I don't believe SQL Server supports the delete / cascade syntax. I think you can configure a delete rule to do cascading deletes ( http://msdn.microsoft.com/en-us/library/ms152507.aspx ), but as far as I know the trick with SQL Server is to just to run your drop query once for each table... | Dropping a group of tables in SQL Server Is there a simple way to drop a group of interrelated tables in SQL Server? Ideally I'd like to avoid having to worry about what order they're being dropped in since I know the entire group will be gone by the end of the process. | TITLE:
Dropping a group of tables in SQL Server
QUESTION:
Is there a simple way to drop a group of interrelated tables in SQL Server? Ideally I'd like to avoid having to worry about what order they're being dropped in since I know the entire group will be gone by the end of the process.
ANSWER:
At the risk of soundin... | [
"sql",
"sql-server",
"database"
] | 8 | 4 | 3,650 | 7 | 0 | 2008-08-11T04:32:01 | 2008-08-25T07:40:42.033000 |
7,525 | 7,695 | Of Memory Management, Heap Corruption, and C++ | So, I need some help. I am working on a project in C++. However, I think I have somehow managed to corrupt my heap. This is based on the fact that I added an std::string to a class and assigning it a value from another std::string: std::string hello = "Hello, world.\n"; /* exampleString = "Hello, world.\n" would work f... | These are relatively cheap mechanisms for possibly solving the problem: Keep an eye on my heap corruption question - I'm updating with the answers as they shake out. The first was balancing new[] and delete[], but you're already doing that. Give valgrind more of a go; it's an excellent tool, and I only wish it was avai... | Of Memory Management, Heap Corruption, and C++ So, I need some help. I am working on a project in C++. However, I think I have somehow managed to corrupt my heap. This is based on the fact that I added an std::string to a class and assigning it a value from another std::string: std::string hello = "Hello, world.\n"; /*... | TITLE:
Of Memory Management, Heap Corruption, and C++
QUESTION:
So, I need some help. I am working on a project in C++. However, I think I have somehow managed to corrupt my heap. This is based on the fact that I added an std::string to a class and assigning it a value from another std::string: std::string hello = "He... | [
"c++",
"memory",
"stack",
"heap-memory"
] | 20 | 24 | 16,404 | 12 | 0 | 2008-08-11T04:52:50.800000 | 2008-08-11T11:59:25.777000 |
7,535 | 7,547 | SQL Server 2008 compatibility with SQL Server 2005 | What is the best way to use SQL Server 2008 as a development database, but ensure that the database is compatible with SQL Server 2005? | This can be done via SQL Enterprise Manager or like this: ALTER DATABASE SET COMPATIBILITY_LEVEL = { 80 | 90 | 100 } Use 90 for 2005 compatibility. This replaces the functionality used for previous releases, the stored procedure sp_dbcmptlevel. | SQL Server 2008 compatibility with SQL Server 2005 What is the best way to use SQL Server 2008 as a development database, but ensure that the database is compatible with SQL Server 2005? | TITLE:
SQL Server 2008 compatibility with SQL Server 2005
QUESTION:
What is the best way to use SQL Server 2008 as a development database, but ensure that the database is compatible with SQL Server 2005?
ANSWER:
This can be done via SQL Enterprise Manager or like this: ALTER DATABASE SET COMPATIBILITY_LEVEL = { 80 | ... | [
"sql-server",
"sql-server-2008",
"sql-server-2005"
] | 15 | 19 | 11,273 | 3 | 0 | 2008-08-11T05:16:13.047000 | 2008-08-11T05:35:06.177000 |
7,539 | 7,561 | Use of java.math.MathContext | Recently I tried understanding the use of java.math.MathContext but failed to understand properly. Is it used for rounding in java.math.BigDecimal. If yes why does not it round the decimal digits but even mantissa part. From API docs, I came to know that it follows the standard specified in ANSI X3.274-1996 and ANSI X3... | @jatan Thanks for you answer. It makes sense. Can you please explain me MathContext in the context of BigDecimal#round method. There's nothing special about BigDecimal.round() vs. any other BigDecimal method. In all cases, the MathContext specifies the number of significant digits and the rounding technique. Basically,... | Use of java.math.MathContext Recently I tried understanding the use of java.math.MathContext but failed to understand properly. Is it used for rounding in java.math.BigDecimal. If yes why does not it round the decimal digits but even mantissa part. From API docs, I came to know that it follows the standard specified in... | TITLE:
Use of java.math.MathContext
QUESTION:
Recently I tried understanding the use of java.math.MathContext but failed to understand properly. Is it used for rounding in java.math.BigDecimal. If yes why does not it round the decimal digits but even mantissa part. From API docs, I came to know that it follows the sta... | [
"java",
"math",
"bigdecimal",
"mathcontext"
] | 64 | 56 | 93,899 | 5 | 0 | 2008-08-11T05:23:02.427000 | 2008-08-11T06:06:48.483000 |
7,540 | 7,570 | Some kind of task manager for JavaScript in Firefox 3? | Recently I have been having issues with Firefox 3 on Ubuntu Hardy Heron. I will click on a link and it will hang for a while. I don't know if its a bug in Firefox 3 or a page running too much client side JavaScript, but I would like to try and debug it a bit. So, my question is "is there a way to have some kind of proc... | It's probably the awesome firefox3 fsync "bug", which is a giant pile of fail. In summary Firefox3 saves its bookmarks and history in an SQLite database Every time you load a page it writes to this database several times SQLite cares deeply that you don't lose your bookmarks, so each time it writes, instructs the kerne... | Some kind of task manager for JavaScript in Firefox 3? Recently I have been having issues with Firefox 3 on Ubuntu Hardy Heron. I will click on a link and it will hang for a while. I don't know if its a bug in Firefox 3 or a page running too much client side JavaScript, but I would like to try and debug it a bit. So, m... | TITLE:
Some kind of task manager for JavaScript in Firefox 3?
QUESTION:
Recently I have been having issues with Firefox 3 on Ubuntu Hardy Heron. I will click on a link and it will hang for a while. I don't know if its a bug in Firefox 3 or a page running too much client side JavaScript, but I would like to try and deb... | [
"javascript",
"firefox",
"memory",
"cpu"
] | 11 | 9 | 2,626 | 5 | 0 | 2008-08-11T05:24:33.593000 | 2008-08-11T06:35:58.160000 |
7,551 | 7,618 | Best Practices for securing a REST API / web service | When designing a REST API or service are there any established best practices for dealing with security (Authentication, Authorization, Identity Management)? When building a SOAP API you have WS-Security as a guide and much literature exists on the topic. I have found less information about securing REST endpoints. Whi... | As tweakt said, Amazon S3 is a good model to work with. Their request signatures do have some features (such as incorporating a timestamp) that help guard against both accidental and malicious request replaying. The nice thing about HTTP Basic is that virtually all HTTP libraries support it. You will, of course, need t... | Best Practices for securing a REST API / web service When designing a REST API or service are there any established best practices for dealing with security (Authentication, Authorization, Identity Management)? When building a SOAP API you have WS-Security as a guide and much literature exists on the topic. I have foun... | TITLE:
Best Practices for securing a REST API / web service
QUESTION:
When designing a REST API or service are there any established best practices for dealing with security (Authentication, Authorization, Identity Management)? When building a SOAP API you have WS-Security as a guide and much literature exists on the ... | [
"wcf",
"security",
"rest",
"authorization",
"rest-security"
] | 840 | 303 | 317,485 | 18 | 0 | 2008-08-11T05:44:42.803000 | 2008-08-11T08:45:13.343000 |
7,586 | 7,590 | How do I generate WPF controls through code | I was trying to get my head around XAML and thought that I would try writing some code. Trying to add a grid with 6 by 6 column definitions then add a text block into one of the grid cells. I don't seem to be able to reference the cell that I want. There is no method on the grid that I can add the text block too. There... | WPF makes use of a funky thing called attached properties. So in your XAML you might write this: And this will effectively move the TextBlock into cell (0,0) of your grid. In code this looks a little strange. I believe it'd be something like: g.Children.Add(tb); Grid.SetRow(tb, 0); Grid.SetColumn(tb, 0); Have a look at... | How do I generate WPF controls through code I was trying to get my head around XAML and thought that I would try writing some code. Trying to add a grid with 6 by 6 column definitions then add a text block into one of the grid cells. I don't seem to be able to reference the cell that I want. There is no method on the g... | TITLE:
How do I generate WPF controls through code
QUESTION:
I was trying to get my head around XAML and thought that I would try writing some code. Trying to add a grid with 6 by 6 column definitions then add a text block into one of the grid cells. I don't seem to be able to reference the cell that I want. There is ... | [
"c#",
".net",
"wpf",
"xaml"
] | 8 | 7 | 4,144 | 4 | 0 | 2008-08-11T07:26:46.903000 | 2008-08-11T07:37:24.713000 |
7,592 | 7,643 | Can I use JavaScript to create a client side email? | I want to create a client side mail creator web page. I know the problems of using the mailto action in an html form (not standard, no default mail appication set on the client). But the web page isn't very important, and they don't care very much. The mail created by the mailto action has the syntax: subject: undefine... | What we used in a projet is a popup window that opens a mailto: link, it is the only way we found to compose a mail within the default mail client that works with all mail clients (at least all our clients used). var addresses = "";//between the speech mark goes the receptient. Seperate addresses with a; var body = ""/... | Can I use JavaScript to create a client side email? I want to create a client side mail creator web page. I know the problems of using the mailto action in an html form (not standard, no default mail appication set on the client). But the web page isn't very important, and they don't care very much. The mail created by... | TITLE:
Can I use JavaScript to create a client side email?
QUESTION:
I want to create a client side mail creator web page. I know the problems of using the mailto action in an html form (not standard, no default mail appication set on the client). But the web page isn't very important, and they don't care very much. T... | [
"javascript",
"email"
] | 19 | 18 | 36,072 | 5 | 0 | 2008-08-11T07:39:51.433000 | 2008-08-11T09:45:17.873000 |
7,596 | 13,283 | How should I structure a Java application, where do I put my classes? | First of all, I know how to build a Java application. But I have always been puzzled about where to put my classes. There are proponents for organizing the packages in a strictly domain oriented fashion, others separate by tier. I myself have always had problems with naming, placing So, Where do you put your domain spe... | I've really come to like Maven's Standard Directory Layout. One of the key ideas for me is to have two source roots - one for production code and one for test code like so: MyProject/src/main/java/com/acme/Widget.java MyProject/src/test/java/com/acme/WidgetTest.java (here, both src/main/java and src/test/java are sourc... | How should I structure a Java application, where do I put my classes? First of all, I know how to build a Java application. But I have always been puzzled about where to put my classes. There are proponents for organizing the packages in a strictly domain oriented fashion, others separate by tier. I myself have always ... | TITLE:
How should I structure a Java application, where do I put my classes?
QUESTION:
First of all, I know how to build a Java application. But I have always been puzzled about where to put my classes. There are proponents for organizing the packages in a strictly domain oriented fashion, others separate by tier. I m... | [
"java",
"architecture"
] | 43 | 29 | 26,099 | 10 | 0 | 2008-08-11T07:45:20.050000 | 2008-08-16T19:06:10.267000 |
7,622 | 7,636 | Are the shift operators (<<, >>) arithmetic or logical in C? | In C, are the shift operators ( <<, >> ) arithmetic or logical? | According to K&R 2nd edition the results are implementation-dependent for right shifts of signed values. Wikipedia says that C/C++ 'usually' implements an arithmetic shift on signed values. Basically you need to either test your compiler or not rely on it. My VS2008 help for the current MS C++ compiler says that their ... | Are the shift operators (<<, >>) arithmetic or logical in C? In C, are the shift operators ( <<, >> ) arithmetic or logical? | TITLE:
Are the shift operators (<<, >>) arithmetic or logical in C?
QUESTION:
In C, are the shift operators ( <<, >> ) arithmetic or logical?
ANSWER:
According to K&R 2nd edition the results are implementation-dependent for right shifts of signed values. Wikipedia says that C/C++ 'usually' implements an arithmetic sh... | [
"c",
"binary",
"bit-manipulation",
"bit-shift"
] | 178 | 119 | 310,131 | 11 | 0 | 2008-08-11T08:55:13.277000 | 2008-08-11T09:18:29.533000 |
7,642 | 7,644 | Naming convention for VB.NET private fields | Is there an official convention for naming private fields in VB.NET? For example, if I have a property called 'Foo', I normally call the private field '_Foo'. This seems to be frowned upon in the Offical Guidelines: "Do not use a prefix for field names. For example, do not use g_ or s_ to distinguish static versus non-... | I still use the _ prefix in VB for private fields, so I'll have _foo as the private field and Foo as the property. I do this for c# as well and pretty much any code I write. Generally I wouldn't get too caught up in "what is the right way to do it" because there isn't really a "right" way (altho there are some very bad... | Naming convention for VB.NET private fields Is there an official convention for naming private fields in VB.NET? For example, if I have a property called 'Foo', I normally call the private field '_Foo'. This seems to be frowned upon in the Offical Guidelines: "Do not use a prefix for field names. For example, do not us... | TITLE:
Naming convention for VB.NET private fields
QUESTION:
Is there an official convention for naming private fields in VB.NET? For example, if I have a property called 'Foo', I normally call the private field '_Foo'. This seems to be frowned upon in the Offical Guidelines: "Do not use a prefix for field names. For ... | [
"vb.net",
"convention"
] | 24 | 21 | 13,900 | 10 | 0 | 2008-08-11T09:41:11.373000 | 2008-08-11T09:45:27.967000 |
7,651 | 7,657 | How do I remove duplicate items from an array in Perl? | I have an array in Perl: my @my_array = ("one","two","three","two","three"); How do I remove the duplicates from the array? | You can do something like this as demonstrated in perlfaq4: sub uniq { my %seen; grep!$seen{$_}++, @_; }
my @array = qw(one two three two three); my @filtered = uniq(@array);
print "@filtered\n"; Outputs: one two three If you are aiming for universality, you should take a look at the uniq function. It is included in ... | How do I remove duplicate items from an array in Perl? I have an array in Perl: my @my_array = ("one","two","three","two","three"); How do I remove the duplicates from the array? | TITLE:
How do I remove duplicate items from an array in Perl?
QUESTION:
I have an array in Perl: my @my_array = ("one","two","three","two","three"); How do I remove the duplicates from the array?
ANSWER:
You can do something like this as demonstrated in perlfaq4: sub uniq { my %seen; grep!$seen{$_}++, @_; }
my @arra... | [
"perl",
"arrays",
"unique",
"duplicates"
] | 175 | 181 | 242,614 | 11 | 0 | 2008-08-11T10:04:32.093000 | 2008-08-11T10:16:22.770000 |
7,652 | 7,710 | Querying like Linq when you don't have Linq | I have a project that I'm currently working on but it currently only supports the.net framework 2.0. I love linq, but because of the framework version I can't use it. What I want isn't so much the ORM side of things, but the "queryability" (is that even a word?) of Linq. So far the closest is llblgen but if there was s... | Have a look at this: http://www.albahari.com/nutshell/linqbridge.html Linq is several different things, and I'm not 100% sure which bits you want, but the above might be useful in some way. If you don't already have a book on Linq (I guess you don't), then I found "Linq In Action" to be be good. | Querying like Linq when you don't have Linq I have a project that I'm currently working on but it currently only supports the.net framework 2.0. I love linq, but because of the framework version I can't use it. What I want isn't so much the ORM side of things, but the "queryability" (is that even a word?) of Linq. So f... | TITLE:
Querying like Linq when you don't have Linq
QUESTION:
I have a project that I'm currently working on but it currently only supports the.net framework 2.0. I love linq, but because of the framework version I can't use it. What I want isn't so much the ORM side of things, but the "queryability" (is that even a wo... | [
"database",
"linq",
"orm"
] | 3 | 5 | 1,657 | 7 | 0 | 2008-08-11T10:04:50.483000 | 2008-08-11T12:20:36.327000 |
7,661 | 32,551 | Java code for WGS84 to Google map position and back | Searching for some sample code for converting a point in WGS84 coordinate system to a map position in Google Maps (pixel position), also supporting zoom levels. If the codes is well commented, then it can also be in some other language. You can also point me to a open source Java project:) Some resources found: OpenLay... | Tile utility code in Java on mapki.com (great resource for google map developers) | Java code for WGS84 to Google map position and back Searching for some sample code for converting a point in WGS84 coordinate system to a map position in Google Maps (pixel position), also supporting zoom levels. If the codes is well commented, then it can also be in some other language. You can also point me to a open... | TITLE:
Java code for WGS84 to Google map position and back
QUESTION:
Searching for some sample code for converting a point in WGS84 coordinate system to a map position in Google Maps (pixel position), also supporting zoom levels. If the codes is well commented, then it can also be in some other language. You can also ... | [
"java",
"google-maps",
"mapping",
"wgs84"
] | 10 | 5 | 23,567 | 6 | 0 | 2008-08-11T10:23:48.763000 | 2008-08-28T15:17:00.740000 |
7,662 | 7,724 | Database, Table and Column Naming Conventions? | Whenever I design a database, I always wonder if there is a best way of naming an item in my database. Quite often I ask myself the following questions: Should table names be plural? Should column names be singular? Should I prefix tables or columns? Should I use any case in naming items? Are there any recommended guid... | I recommend checking out Microsoft's SQL Server sample databases: https://github.com/Microsoft/sql-server-samples/releases/tag/adventureworks The AdventureWorks sample uses a very clear and consistent naming convention that uses schema names for the organization of database objects. Singular names for tables Singular n... | Database, Table and Column Naming Conventions? Whenever I design a database, I always wonder if there is a best way of naming an item in my database. Quite often I ask myself the following questions: Should table names be plural? Should column names be singular? Should I prefix tables or columns? Should I use any case ... | TITLE:
Database, Table and Column Naming Conventions?
QUESTION:
Whenever I design a database, I always wonder if there is a best way of naming an item in my database. Quite often I ask myself the following questions: Should table names be plural? Should column names be singular? Should I prefix tables or columns? Shou... | [
"database",
"database-design",
"language-agnostic",
"naming-conventions"
] | 918 | 382 | 717,584 | 23 | 0 | 2008-08-11T10:27:22.780000 | 2008-08-11T12:39:37.817000 |
7,664 | 7,669 | Windows C++: How can I redirect stderr for calls to fprintf? | I am wrapping existing C++ code from a BSD project in our own custom wrapper and I want to integrate it to our code with as few changes as possible. This code uses fprintf to print to stderr in order to log / report errors. I want to redirect this to an alternative place within the same process. On Unix I have done thi... | You can use a similar technique on Windows, you just need to use different words for the same concepts.:) This article: http://msdn.microsoft.com/en-us/library/ms682499.aspx uses a win32 pipe to handle I/O from another process, you just have to do the same thing with threads within the same process. Of course, in your ... | Windows C++: How can I redirect stderr for calls to fprintf? I am wrapping existing C++ code from a BSD project in our own custom wrapper and I want to integrate it to our code with as few changes as possible. This code uses fprintf to print to stderr in order to log / report errors. I want to redirect this to an alter... | TITLE:
Windows C++: How can I redirect stderr for calls to fprintf?
QUESTION:
I am wrapping existing C++ code from a BSD project in our own custom wrapper and I want to integrate it to our code with as few changes as possible. This code uses fprintf to print to stderr in order to log / report errors. I want to redirec... | [
"c++",
"windows",
"redirect"
] | 6 | 6 | 11,922 | 3 | 0 | 2008-08-11T10:38:51.570000 | 2008-08-11T11:05:37.820000 |
7,665 | 7,666 | How to resolve symbolic links in a shell script | Given an absolute or relative path (in a Unix-like system), I would like to determine the full path of the target after resolving any intermediate symlinks. Bonus points for also resolving ~username notation at the same time. If the target is a directory, it might be possible to chdir() into the directory and then call... | According to the standards, pwd -P should return the path with symlinks resolved. C function char *getcwd(char *buf, size_t size) from unistd.h should have the same behaviour. getcwd pwd | How to resolve symbolic links in a shell script Given an absolute or relative path (in a Unix-like system), I would like to determine the full path of the target after resolving any intermediate symlinks. Bonus points for also resolving ~username notation at the same time. If the target is a directory, it might be poss... | TITLE:
How to resolve symbolic links in a shell script
QUESTION:
Given an absolute or relative path (in a Unix-like system), I would like to determine the full path of the target after resolving any intermediate symlinks. Bonus points for also resolving ~username notation at the same time. If the target is a directory... | [
"bash",
"shell",
"scripting",
"symlink"
] | 267 | 102 | 222,917 | 21 | 0 | 2008-08-11T10:40:41.363000 | 2008-08-11T10:48:19.260000 |
7,674 | 8,982 | Best practices for building Flash video player | We have a custom-built Flash-based video player that I maintain, and it needs to support preroll ads and ideally both progressive video playback and streaming depending on a server switch. I've been working with the flvPlayback component but am finding myself a little out of my depth. Are there any good tutorials or re... | I would definitely have a look at the JW Flash Media Player: http://www.jeroenwijering.com/?item=JW_FLV_Player It's Open Source, and I found the Source quite clean and easy to understand, it also supports playlists. I don't know the DART In-Stream stuff, but maybe you could "creatively use" the playlist feature to achi... | Best practices for building Flash video player We have a custom-built Flash-based video player that I maintain, and it needs to support preroll ads and ideally both progressive video playback and streaming depending on a server switch. I've been working with the flvPlayback component but am finding myself a little out ... | TITLE:
Best practices for building Flash video player
QUESTION:
We have a custom-built Flash-based video player that I maintain, and it needs to support preroll ads and ideally both progressive video playback and streaming depending on a server switch. I've been working with the flvPlayback component but am finding my... | [
"flash",
"video"
] | 5 | 4 | 2,218 | 4 | 0 | 2008-08-11T11:17:36.547000 | 2008-08-12T15:44:27.193000 |
7,681 | 7,688 | Test serialization encoding | What is the best way to verify/test that a text string is serialized to a byte array with a certain encoding? In my case, I want to verify that an XML structure is serialized to a byte array with the UTF-8 encoding which is of variable character length. As an example, my current ugly procedure is to inject a character ... | Perhaps you could deserialise the byte array using a known encoding and ensure that (a) it doesn't throw any exceptions, and (b) deserialises to the original string. It seems that from your description of the scenario, you may not have the original string readily available. Might there be a way to create it? | Test serialization encoding What is the best way to verify/test that a text string is serialized to a byte array with a certain encoding? In my case, I want to verify that an XML structure is serialized to a byte array with the UTF-8 encoding which is of variable character length. As an example, my current ugly procedu... | TITLE:
Test serialization encoding
QUESTION:
What is the best way to verify/test that a text string is serialized to a byte array with a certain encoding? In my case, I want to verify that an XML structure is serialized to a byte array with the UTF-8 encoding which is of variable character length. As an example, my cu... | [
"java",
"xml",
"string",
"serialization",
"encoding"
] | 10 | 2 | 2,452 | 2 | 0 | 2008-08-11T11:33:01.930000 | 2008-08-11T11:46:40.030000 |
7,707 | 881,597 | IE8 overflow:auto with max-height | I have an element which may contain very big amounts of data, but I don't want it to ruin the page layout, so I set max-height: 100px and overflow:auto, hoping for scrollbars to appear when the content does not fit. It all works fine in Firefox and IE7, but IE8 behaves as if overflow:hidden was present instead of overf... | This is a really nasty bug as it affects us heavily on Stack Overflow with code blocks, which have max-height:600 and width:auto. It is logged as a bug in the final version of IE8 with no fix. http://connect.microsoft.com/IE/feedback/ViewFeedback.aspx?FeedbackID=408759 There is a really, really hacky CSS workaround: ht... | IE8 overflow:auto with max-height I have an element which may contain very big amounts of data, but I don't want it to ruin the page layout, so I set max-height: 100px and overflow:auto, hoping for scrollbars to appear when the content does not fit. It all works fine in Firefox and IE7, but IE8 behaves as if overflow:h... | TITLE:
IE8 overflow:auto with max-height
QUESTION:
I have an element which may contain very big amounts of data, but I don't want it to ruin the page layout, so I set max-height: 100px and overflow:auto, hoping for scrollbars to appear when the content does not fit. It all works fine in Firefox and IE7, but IE8 behave... | [
"internet-explorer-8",
"overflow",
"css"
] | 56 | 72 | 68,906 | 8 | 0 | 2008-08-11T12:18:02.150000 | 2009-05-19T08:34:12.627000 |
7,719 | 7,840 | Capture MouseDown event for .NET TextBox | Is there any way to capture the MouseDown even from the.NET 2.0 TextBox control? I know the inherited Control class has the event, but it's not exposed in TextBox. Is there a way to override the event handler? I also tried the OpenNETCF TextBox2 control which does have the MouseDown event exposed, but no matter what I ... | Looks like you're right. Bummer. No MouseOver event. One of the fallbacks that always works with.NET, though, is P/Invoke. Someone already took the time to do this for the.NET CF TextBox. I found this on CodeProject: http://www.codeproject.com/KB/cs/TextBox_subclassing.aspx Hope this helps | Capture MouseDown event for .NET TextBox Is there any way to capture the MouseDown even from the.NET 2.0 TextBox control? I know the inherited Control class has the event, but it's not exposed in TextBox. Is there a way to override the event handler? I also tried the OpenNETCF TextBox2 control which does have the Mouse... | TITLE:
Capture MouseDown event for .NET TextBox
QUESTION:
Is there any way to capture the MouseDown even from the.NET 2.0 TextBox control? I know the inherited Control class has the event, but it's not exposed in TextBox. Is there a way to override the event handler? I also tried the OpenNETCF TextBox2 control which d... | [
"c#",
".net",
"events",
"windows-mobile"
] | 2 | 0 | 12,745 | 5 | 0 | 2008-08-11T12:36:20.350000 | 2008-08-11T14:45:05.957000 |
7,720 | 149,971 | Packaging Java apps for the Windows/Linux desktop | I am writing an application in Java for the desktop using the Eclipse SWT library for GUI rendering. I think SWT helps Java get over the biggest hurdle for acceptance on the desktop: namely providing a Java application with a consistent, responsive interface that looks like that belonging to any other app on your deskt... | To follow up on pauxu's answer, I'm using launch4j and NSIS on a project of mine and thought it would be helpful to show just how I'm using them. Here's what I'm doing for Windows. BTW, I'm creating.app and.dmg for Mac, but haven't figured out what to do for Linux yet. Project Copies of launch4j and NSIS In my project ... | Packaging Java apps for the Windows/Linux desktop I am writing an application in Java for the desktop using the Eclipse SWT library for GUI rendering. I think SWT helps Java get over the biggest hurdle for acceptance on the desktop: namely providing a Java application with a consistent, responsive interface that looks ... | TITLE:
Packaging Java apps for the Windows/Linux desktop
QUESTION:
I am writing an application in Java for the desktop using the Eclipse SWT library for GUI rendering. I think SWT helps Java get over the biggest hurdle for acceptance on the desktop: namely providing a Java application with a consistent, responsive int... | [
"java",
"windows",
"swt",
"executable",
"software-distribution"
] | 40 | 32 | 15,642 | 18 | 0 | 2008-08-11T12:37:50.503000 | 2008-09-29T18:16:22.020000 |
7,737 | 7,950 | How to display unicode text in OpenGL? | Is there a good way for displaying unicode text in opengl under Windows? For example, when you have to deal with different languages. The most common approach like #define FONTLISTRANGE 128 GLuint list; list = glGenLists(FONTLISTRANGE); wglUseFontBitmapsW(hDC, 0, FONTLISTRANGE, list); just won't do because you can't cr... | You could also group the characters by language. Load each language table as needed, and when you need to switch languages, unload the previous language table and load the new one. | How to display unicode text in OpenGL? Is there a good way for displaying unicode text in opengl under Windows? For example, when you have to deal with different languages. The most common approach like #define FONTLISTRANGE 128 GLuint list; list = glGenLists(FONTLISTRANGE); wglUseFontBitmapsW(hDC, 0, FONTLISTRANGE, li... | TITLE:
How to display unicode text in OpenGL?
QUESTION:
Is there a good way for displaying unicode text in opengl under Windows? For example, when you have to deal with different languages. The most common approach like #define FONTLISTRANGE 128 GLuint list; list = glGenLists(FONTLISTRANGE); wglUseFontBitmapsW(hDC, 0,... | [
"windows",
"opengl",
"unicode"
] | 7 | 0 | 18,947 | 8 | 0 | 2008-08-11T12:50:43.787000 | 2008-08-11T16:54:04.997000 |
7,758 | 8,461 | What is the value-binding syntax in xaml? | I'm getting all learned up about binding in WPF. I'm having a lot of trouble debugging the parse errors in my xaml, though. Can somebody pretty please tell me what's wrong with this little piece?: It's the databinding that breaks. I get an InvalidAttributeValue exception for ThumbKnob.Height when I try to run this. I k... | The ElementName property on a Binding is not supported in Silverlight. You will notice, if you go into the code behind or inspect the Binding object in class explorer, it doesn't have a property named ElementName. | What is the value-binding syntax in xaml? I'm getting all learned up about binding in WPF. I'm having a lot of trouble debugging the parse errors in my xaml, though. Can somebody pretty please tell me what's wrong with this little piece?: It's the databinding that breaks. I get an InvalidAttributeValue exception for Th... | TITLE:
What is the value-binding syntax in xaml?
QUESTION:
I'm getting all learned up about binding in WPF. I'm having a lot of trouble debugging the parse errors in my xaml, though. Can somebody pretty please tell me what's wrong with this little piece?: It's the databinding that breaks. I get an InvalidAttributeValu... | [
".net",
"wpf",
"silverlight",
"xaml",
"binding"
] | 2 | 2 | 4,490 | 7 | 0 | 2008-08-11T13:09:08.693000 | 2008-08-12T04:33:00.357000 |
7,773 | 7,777 | Change visibility of ASP.NET label with JavaScript | I have a ASP.NET page with an asp:button that is not visible. I can't turn it visible with JavaScript because it is not rendered to the page. What can I do to resolve this? | If you need to manipulate it on the client side, you can't use the Visible property on the server side. Instead, set its CSS display style to "none". For example: Then, you could make it visible on the client side with: document.getElementById('Label1').style.display = 'inherit'; You could make it hidden again with: do... | Change visibility of ASP.NET label with JavaScript I have a ASP.NET page with an asp:button that is not visible. I can't turn it visible with JavaScript because it is not rendered to the page. What can I do to resolve this? | TITLE:
Change visibility of ASP.NET label with JavaScript
QUESTION:
I have a ASP.NET page with an asp:button that is not visible. I can't turn it visible with JavaScript because it is not rendered to the page. What can I do to resolve this?
ANSWER:
If you need to manipulate it on the client side, you can't use the Vi... | [
"asp.net",
"javascript"
] | 34 | 43 | 128,913 | 7 | 0 | 2008-08-11T13:24:19.037000 | 2008-08-11T13:28:55.470000 |
7,779 | 28,154 | I would like a recommendation for a book on Eclipse's Rich Client Platform (RCP) | I have read through several reviews on Amazon and some books seem outdated. I am currently using MyEclipse 6.5 which is using Eclipse 3.3. I'm interested in hearing from people that have experience learning RCP and what reference material they used to get started. | I've been doing Eclipse RCP development for almost 2 years now. When I first started, I wanted a book for help and many people told me, with Eclipse you're better off using the Eclipsepedia and Google. However, I started with " The Java Developer's Guide to Eclipse " by D'Anjou et al, and I still reference it when I ne... | I would like a recommendation for a book on Eclipse's Rich Client Platform (RCP) I have read through several reviews on Amazon and some books seem outdated. I am currently using MyEclipse 6.5 which is using Eclipse 3.3. I'm interested in hearing from people that have experience learning RCP and what reference material ... | TITLE:
I would like a recommendation for a book on Eclipse's Rich Client Platform (RCP)
QUESTION:
I have read through several reviews on Amazon and some books seem outdated. I am currently using MyEclipse 6.5 which is using Eclipse 3.3. I'm interested in hearing from people that have experience learning RCP and what r... | [
"java",
"eclipse",
"rcp",
"myeclipse"
] | 11 | 3 | 3,752 | 6 | 0 | 2008-08-11T13:30:21.850000 | 2008-08-26T14:17:10.447000 |
7,846 | 7,853 | How can I split an XML document into thirds (or, even better, n pieces)? | I would like to use a language that I am familiar with - Java, C#, Ruby, PHP, C/C++, although examples in any language or pseudocode are more than welcome. What is the best way of splitting a large XML document into smaller sections that are still valid XML? For my purposes, I need to split them into roughly thirds or ... | Well of course you can always extract the top-level elements (whether this is the granularity you want is up to you). In C#, you'd use the XmlDocument class. For example, if your XML file looked something like this: Some text Some other text then you'd use code like this to extract all of the Pieces: XmlDocument doc = ... | How can I split an XML document into thirds (or, even better, n pieces)? I would like to use a language that I am familiar with - Java, C#, Ruby, PHP, C/C++, although examples in any language or pseudocode are more than welcome. What is the best way of splitting a large XML document into smaller sections that are still... | TITLE:
How can I split an XML document into thirds (or, even better, n pieces)?
QUESTION:
I would like to use a language that I am familiar with - Java, C#, Ruby, PHP, C/C++, although examples in any language or pseudocode are more than welcome. What is the best way of splitting a large XML document into smaller secti... | [
"xml"
] | 8 | 3 | 12,727 | 10 | 0 | 2008-08-11T15:04:21.363000 | 2008-08-11T15:13:14.107000 |
7,864 | 8,215 | Why all the Active Record hate? | As I learn more and more about OOP, and start to implement various design patterns, I keep coming back to cases where people are hating on Active Record. Often, people say that it doesn't scale well (citing Twitter as their prime example) -- but nobody actually explains why it doesn't scale well; and / or how to achiev... | There's ActiveRecord the Design Pattern and ActiveRecord the Rails ORM Library, and there's also a ton of knock-offs for.NET, and other languages. These are all different things. They mostly follow that design pattern, but extend and modify it in many different ways, so before anyone says "ActiveRecord Sucks" it needs ... | Why all the Active Record hate? As I learn more and more about OOP, and start to implement various design patterns, I keep coming back to cases where people are hating on Active Record. Often, people say that it doesn't scale well (citing Twitter as their prime example) -- but nobody actually explains why it doesn't sc... | TITLE:
Why all the Active Record hate?
QUESTION:
As I learn more and more about OOP, and start to implement various design patterns, I keep coming back to cases where people are hating on Active Record. Often, people say that it doesn't scale well (citing Twitter as their prime example) -- but nobody actually explains... | [
"ruby-on-rails",
"design-patterns",
"oop",
"activerecord"
] | 102 | 91 | 20,798 | 14 | 0 | 2008-08-11T15:30:30.313000 | 2008-08-11T21:02:03.870000 |
7,880 | 7,886 | How do you open a file in C++? | I want to open a file for reading, the C++ way. I need to be able to do it for: text files, which would involve some sort of read line function. binary files, which would provide a way to read raw data into a char* buffer. | There are three ways to do this, depending on your needs. You could use the old-school C way and call fopen / fread / fclose, or you could use the C++ fstream facilities ( ifstream / ofstream ), or if you're using MFC, use the CFile class, which provides functions to accomplish actual file operations. All of these are ... | How do you open a file in C++? I want to open a file for reading, the C++ way. I need to be able to do it for: text files, which would involve some sort of read line function. binary files, which would provide a way to read raw data into a char* buffer. | TITLE:
How do you open a file in C++?
QUESTION:
I want to open a file for reading, the C++ way. I need to be able to do it for: text files, which would involve some sort of read line function. binary files, which would provide a way to read raw data into a char* buffer.
ANSWER:
There are three ways to do this, depend... | [
"c++",
"file",
"io"
] | 57 | 17 | 215,989 | 9 | 0 | 2008-08-11T15:50:51.660000 | 2008-08-11T15:58:06.980000 |
7,884 | 7,892 | Testing for inequality in T-SQL | I've just come across this in a WHERE clause: AND NOT (t.id = @id) How does this compare with: AND t.id!= @id Or with: AND t.id <> @id I'd always write the latter myself, but clearly someone else thinks differently. Is one going to perform any better than the other? I know that using <> or!= is going to bust any hopes ... | These 3 will get the same exact execution plan declare @id varchar(40) select @id = '172-32-1176'
select * from authors where au_id <> @id
select * from authors where au_id!= @id
select * from authors where not (au_id = @id) It will also depend on the selectivity of the index itself of course. I always use au_id <> ... | Testing for inequality in T-SQL I've just come across this in a WHERE clause: AND NOT (t.id = @id) How does this compare with: AND t.id!= @id Or with: AND t.id <> @id I'd always write the latter myself, but clearly someone else thinks differently. Is one going to perform any better than the other? I know that using <> ... | TITLE:
Testing for inequality in T-SQL
QUESTION:
I've just come across this in a WHERE clause: AND NOT (t.id = @id) How does this compare with: AND t.id!= @id Or with: AND t.id <> @id I'd always write the latter myself, but clearly someone else thinks differently. Is one going to perform any better than the other? I k... | [
"t-sql",
"indexing",
"inequality"
] | 48 | 44 | 23,048 | 4 | 0 | 2008-08-11T15:56:42.973000 | 2008-08-11T16:02:43.710000 |
7,885 | 8,668 | How do you create objects in Perl? | Perl has OOP features, but they are somewhat rarely used. How do you create and use Perl objects with methods and properties? | You should definitely take a look at Moose. package Point; use Moose; # automatically turns on strict and warnings
has 'x' => (is => 'rw', isa => 'Int'); has 'y' => (is => 'rw', isa => 'Int');
sub clear { my $self = shift; $self->x(0); $self->y(0); } Moose gives you (among other things) a constructor, accessor method... | How do you create objects in Perl? Perl has OOP features, but they are somewhat rarely used. How do you create and use Perl objects with methods and properties? | TITLE:
How do you create objects in Perl?
QUESTION:
Perl has OOP features, but they are somewhat rarely used. How do you create and use Perl objects with methods and properties?
ANSWER:
You should definitely take a look at Moose. package Point; use Moose; # automatically turns on strict and warnings
has 'x' => (is =... | [
"perl",
"oop",
"syntax"
] | 13 | 23 | 6,766 | 7 | 0 | 2008-08-11T15:57:35.047000 | 2008-08-12T10:54:25.360000 |
7,913 | 7,924 | How do I make Subversion (SVN) send email on checkins? | I've always found checkin (commit) mails to be very useful for keeping track of what work other people are doing in the codebase / repository. How do I set up SVN to email a distribution list on each commit? I'm running clients on Windows and the Apache Subversion server on Linux. The answers below for various platform... | You use the post-commit hooks. Here's a sample Ruby script that sends an email after each commit: commit-email.rb | How do I make Subversion (SVN) send email on checkins? I've always found checkin (commit) mails to be very useful for keeping track of what work other people are doing in the codebase / repository. How do I set up SVN to email a distribution list on each commit? I'm running clients on Windows and the Apache Subversion ... | TITLE:
How do I make Subversion (SVN) send email on checkins?
QUESTION:
I've always found checkin (commit) mails to be very useful for keeping track of what work other people are doing in the codebase / repository. How do I set up SVN to email a distribution list on each commit? I'm running clients on Windows and the ... | [
"svn",
"hook",
"post-commit",
"post-commit-hook"
] | 52 | 31 | 79,401 | 16 | 0 | 2008-08-11T16:27:55.703000 | 2008-08-11T16:35:18.887000 |
7,917 | 8,113 | Remove Quotes and Commas from a String in MySQL | I'm importing some data from a CSV file, and numbers that are larger than 1000 get turned into 1,100 etc. What's a good way to remove both the quotes and the comma from this so I can put it into an int field? Edit: The data is actually already in a MySQL table, so I need to be able to this using SQL. Sorry for the mixu... | Here is a good case for regular expressions. You can run a find and replace on the data either before you import (easier) or later on if the SQL import accepted those characters (not nearly as easy). But in either case, you have any number of methods to do a find and replace, be it editors, scripting languages, GUI pro... | Remove Quotes and Commas from a String in MySQL I'm importing some data from a CSV file, and numbers that are larger than 1000 get turned into 1,100 etc. What's a good way to remove both the quotes and the comma from this so I can put it into an int field? Edit: The data is actually already in a MySQL table, so I need ... | TITLE:
Remove Quotes and Commas from a String in MySQL
QUESTION:
I'm importing some data from a CSV file, and numbers that are larger than 1000 get turned into 1,100 etc. What's a good way to remove both the quotes and the comma from this so I can put it into an int field? Edit: The data is actually already in a MySQL... | [
"mysql",
"regex",
"string"
] | 16 | 2 | 57,017 | 8 | 0 | 2008-08-11T16:28:57.683000 | 2008-08-11T19:21:10.113000 |
7,933 | 7,936 | interrogating table lock schemes in T-SQL | Is there some means of querying the system tables to establish which tables are using what locking schemes? I took a look at the columns in sysobjects but nothing jumped out. | aargh, just being an idiot: SELECT name, lockscheme(name) FROM sysobjects WHERE type="U" ORDER BY name | interrogating table lock schemes in T-SQL Is there some means of querying the system tables to establish which tables are using what locking schemes? I took a look at the columns in sysobjects but nothing jumped out. | TITLE:
interrogating table lock schemes in T-SQL
QUESTION:
Is there some means of querying the system tables to establish which tables are using what locking schemes? I took a look at the columns in sysobjects but nothing jumped out.
ANSWER:
aargh, just being an idiot: SELECT name, lockscheme(name) FROM sysobjects WH... | [
"t-sql",
"sysobjects"
] | 3 | 1 | 1,800 | 2 | 0 | 2008-08-11T16:41:47.487000 | 2008-08-11T16:44:54.483000 |
7,937 | 13,197 | How to solve the select overlap bug in IE6? | When using IE, you cannot put an absolutely positioned div over a select input element. That's because the select element is considered an ActiveX object and is on top of every HTML element in the page. I already saw people hiding selects when opening a popup div, that leads to pretty bad user experience having control... | I don't know anything better than an Iframe But it does occur to me that this could be added in JS by looking for a couple of variables IE 6 A high Z-Index (you tend to have to set a z-index if you are floating a div over) A box element Then a script that looks for these items and just add an iframe layer would be a ne... | How to solve the select overlap bug in IE6? When using IE, you cannot put an absolutely positioned div over a select input element. That's because the select element is considered an ActiveX object and is on top of every HTML element in the page. I already saw people hiding selects when opening a popup div, that leads ... | TITLE:
How to solve the select overlap bug in IE6?
QUESTION:
When using IE, you cannot put an absolutely positioned div over a select input element. That's because the select element is considered an ActiveX object and is on top of every HTML element in the page. I already saw people hiding selects when opening a popu... | [
"html",
"css",
"internet-explorer-6",
"html-select"
] | 28 | 8 | 19,700 | 10 | 0 | 2008-08-11T16:45:10.363000 | 2008-08-16T16:06:35.840000 |
7,940 | 7,945 | How important is W3C XHTML/CSS validation when finalizing work? | Even though I always strive for complete validation these days, I often wonder if it's a waste of time. If the code runs and it looks the same in all browsers (I use browsershots.org to verify) then do I need to take it any further or am I just being overly anal? What level do you hold your code to when you create it f... | a) Must look the same b) As standards-compliant as possible, but not so anal that it blocks finishing work In a situation where you have perpetual access to the code, I don't think standards-compliance is all that important, since you can always make changes to the code if something breaks. If you don't have perpetual ... | How important is W3C XHTML/CSS validation when finalizing work? Even though I always strive for complete validation these days, I often wonder if it's a waste of time. If the code runs and it looks the same in all browsers (I use browsershots.org to verify) then do I need to take it any further or am I just being overl... | TITLE:
How important is W3C XHTML/CSS validation when finalizing work?
QUESTION:
Even though I always strive for complete validation these days, I often wonder if it's a waste of time. If the code runs and it looks the same in all browsers (I use browsershots.org to verify) then do I need to take it any further or am ... | [
"css",
"validation",
"xhtml",
"cross-browser",
"w3c"
] | 15 | 12 | 3,414 | 9 | 0 | 2008-08-11T16:46:28.567000 | 2008-08-11T16:50:32.867000 |
7,954 | 8,034 | SQL Server Recovery States | When restoring a SQL Server Database, I notice that there are 3 different Recovery States to choose from: Restore with Recovery Restore with No Recovery Restore with Standby I've always left it at it's default value, but what do they all mean? (Preferably in layman's terms) | GateKiller, In simple terms (and not a copy-paste out of the SQLBOL) so you can understand the concepts: RESTORE WITH RECOVERY uses the backup media file (eg. fulldata.bak) to restore the database to back to the time that backup file was created. This is great if you want to go back in time to restore the database to a... | SQL Server Recovery States When restoring a SQL Server Database, I notice that there are 3 different Recovery States to choose from: Restore with Recovery Restore with No Recovery Restore with Standby I've always left it at it's default value, but what do they all mean? (Preferably in layman's terms) | TITLE:
SQL Server Recovery States
QUESTION:
When restoring a SQL Server Database, I notice that there are 3 different Recovery States to choose from: Restore with Recovery Restore with No Recovery Restore with Standby I've always left it at it's default value, but what do they all mean? (Preferably in layman's terms)
... | [
"sql-server",
"backup"
] | 7 | 9 | 14,168 | 3 | 0 | 2008-08-11T16:59:35.047000 | 2008-08-11T18:10:27.133000 |
7,981 | 8,035 | Decoding printf statements in C (Printf Primer) | I'm working on bringing some old code from 1998 up to the 21st century. One of the first steps in the process is converting the printf statements to QString variables. No matter how many times I look back at printf though, I always end up forgetting one thing or the other. So, for fun, let's decode it together, for ole... | Danny is mostly right. a. unsigned decimal, minimum 4 characters, space padded b. floating point, minimum 16 digits before the decimal (0 padded), 1 digit after the decimal c. hex, minimum 4 characters, 0 padded, letters are printed in upper case d. same as above, but minimum 2 characters e. e is assumed to be an int, ... | Decoding printf statements in C (Printf Primer) I'm working on bringing some old code from 1998 up to the 21st century. One of the first steps in the process is converting the printf statements to QString variables. No matter how many times I look back at printf though, I always end up forgetting one thing or the other... | TITLE:
Decoding printf statements in C (Printf Primer)
QUESTION:
I'm working on bringing some old code from 1998 up to the 21st century. One of the first steps in the process is converting the printf statements to QString variables. No matter how many times I look back at printf though, I always end up forgetting one ... | [
"c",
"qt",
"printf",
"qstring"
] | 4 | 5 | 4,566 | 6 | 0 | 2008-08-11T17:28:56.610000 | 2008-08-11T18:11:45.697000 |
7,990 | 8,112 | Printing from a .NET Service | I am working on a project right now that involves receiving a message from another application, formatting the contents of that message, and sending it to a printer. The technology of choice is C# windows service. The output could be called a report, I suppose, but a reporting engine is not necessary. A simple templati... | Trust me, you will spend more money trying to search/develop a solution for this as compared to buying a third party component. Do not reinvent the wheel and go for the paid solution. Printing is a complex problem and I would love to see the day when better framework support is added for this. | Printing from a .NET Service I am working on a project right now that involves receiving a message from another application, formatting the contents of that message, and sending it to a printer. The technology of choice is C# windows service. The output could be called a report, I suppose, but a reporting engine is not... | TITLE:
Printing from a .NET Service
QUESTION:
I am working on a project right now that involves receiving a message from another application, formatting the contents of that message, and sending it to a printer. The technology of choice is C# windows service. The output could be called a report, I suppose, but a repor... | [
"c#",
".net",
"windows-services",
"printing"
] | 23 | 16 | 19,627 | 11 | 0 | 2008-08-11T17:37:27.310000 | 2008-08-11T19:20:29.707000 |
7,991 | 8,097 | Center text output from Graphics.DrawString() | I'm using the.NETCF (Windows Mobile) Graphics class and the DrawString() method to render a single character to the screen. The problem is that I can't seem to get it centred properly. No matter what I set for the Y coordinate of the location of the string render, it always comes out lower than that and the larger the ... | Through a combination of the suggestions I got, I came up with this: private void DrawLetter() { Graphics g = this.CreateGraphics();
float width = ((float)this.ClientRectangle.Width); float height = ((float)this.ClientRectangle.Width);
float emSize = height;
Font font = new Font(FontFamily.GenericSansSerif, emSize, ... | Center text output from Graphics.DrawString() I'm using the.NETCF (Windows Mobile) Graphics class and the DrawString() method to render a single character to the screen. The problem is that I can't seem to get it centred properly. No matter what I set for the Y coordinate of the location of the string render, it always... | TITLE:
Center text output from Graphics.DrawString()
QUESTION:
I'm using the.NETCF (Windows Mobile) Graphics class and the DrawString() method to render a single character to the screen. The problem is that I can't seem to get it centred properly. No matter what I set for the Y coordinate of the location of the string... | [
"c#",
"graphics",
"compact-framework"
] | 73 | 24 | 146,121 | 6 | 0 | 2008-08-11T17:37:57.107000 | 2008-08-11T19:03:59.803000 |
8,004 | 8,090 | Best way to wrap rsync progress in a gui? | I use rsync to synchronize files to Windows clients in a server agnostic way. What methods are available to send the progress of rsync to the parent process for display in a gui progress bar? I imagine two or three choices exist. (1) Watch STDOUT (2) Watch rsync.exe log file, similar to unix tail (3) Watch rsync consol... | For this type of tasks, I use my own AutoIt script (freeware, Windows only). The script redirects the standard output into a graphical window, displaying it with the ability to scroll back, etc (very useful in long processes like XCOPYs / PKZIPs to check if any error did happen). I use AutoIt because it's free, very ea... | Best way to wrap rsync progress in a gui? I use rsync to synchronize files to Windows clients in a server agnostic way. What methods are available to send the progress of rsync to the parent process for display in a gui progress bar? I imagine two or three choices exist. (1) Watch STDOUT (2) Watch rsync.exe log file, s... | TITLE:
Best way to wrap rsync progress in a gui?
QUESTION:
I use rsync to synchronize files to Windows clients in a server agnostic way. What methods are available to send the progress of rsync to the parent process for display in a gui progress bar? I imagine two or three choices exist. (1) Watch STDOUT (2) Watch rsy... | [
"windows",
"user-interface",
"rsync"
] | 5 | 2 | 6,125 | 5 | 0 | 2008-08-11T17:43:50.277000 | 2008-08-11T18:55:33.753000 |
8,042 | 38,494 | Extension interface patterns | The new extensions in.Net 3.5 allow functionality to be split out from interfaces. For instance in.Net 2.0 public interface IHaveChildren { string ParentType { get; } int ParentId { get; }
List GetChildren() } Can (in 3.5) become: public interface IHaveChildren { string ParentType { get; } int ParentId { get; } }
pub... | I think the judicious use of extension methods put interfaces on a more equatable position with (abstract) base classes. Versioning. One advantage base classes have over interfaces is that you can easily add new virtual members in a later version, whereas adding members to an interface will break implementers built aga... | Extension interface patterns The new extensions in.Net 3.5 allow functionality to be split out from interfaces. For instance in.Net 2.0 public interface IHaveChildren { string ParentType { get; } int ParentId { get; }
List GetChildren() } Can (in 3.5) become: public interface IHaveChildren { string ParentType { get; }... | TITLE:
Extension interface patterns
QUESTION:
The new extensions in.Net 3.5 allow functionality to be split out from interfaces. For instance in.Net 2.0 public interface IHaveChildren { string ParentType { get; } int ParentId { get; }
List GetChildren() } Can (in 3.5) become: public interface IHaveChildren { string P... | [
"c#",
".net-3.5",
"extension-methods"
] | 25 | 9 | 15,866 | 11 | 0 | 2008-08-11T18:13:44.197000 | 2008-09-01T21:52:48.700000 |
8,066 | 8,086 | .NET Interfaces | Over the past few years I've changed from having a long flowing page of controls that I hid/showed to using a lot of user controls. I've always had a bit of a discussion between co-workers on best practices. Should you have properties that you populate, or use paramterized sub's to load the information in your controls... | I'm not sure if interfaces are going to help you a lot here. My understanding is that you are breaking a page down into set of "composite" user controls that contain other controls, and you want to decide whether to use properties for setting values. I guess this really depends on how the user controls are designed and... | .NET Interfaces Over the past few years I've changed from having a long flowing page of controls that I hid/showed to using a lot of user controls. I've always had a bit of a discussion between co-workers on best practices. Should you have properties that you populate, or use paramterized sub's to load the information ... | TITLE:
.NET Interfaces
QUESTION:
Over the past few years I've changed from having a long flowing page of controls that I hid/showed to using a lot of user controls. I've always had a bit of a discussion between co-workers on best practices. Should you have properties that you populate, or use paramterized sub's to loa... | [
".net",
"user-controls",
"interface"
] | 0 | 1 | 826 | 1 | 0 | 2008-08-11T18:30:44.893000 | 2008-08-11T18:50:28.770000 |
8,107 | 8,115 | MySQL replication for fallback scenario | When I have two mysql servers that have different jobs (holding different databases) but want to be able to use one of them to slip in when the other one fails, what would you suggest how I keep the data on both of them equal "close to realtime"? Obviously it's not possible to make a full database dump every x minutes.... | Binary log is definitely the way to go. However, you should be aware that with MySQL you can't just flip back and forth between servers like that. One server will be the master and the other will be the slave. You write/read to the master, but can only read from the slave server. If you ever write to the slave, they'll... | MySQL replication for fallback scenario When I have two mysql servers that have different jobs (holding different databases) but want to be able to use one of them to slip in when the other one fails, what would you suggest how I keep the data on both of them equal "close to realtime"? Obviously it's not possible to ma... | TITLE:
MySQL replication for fallback scenario
QUESTION:
When I have two mysql servers that have different jobs (holding different databases) but want to be able to use one of them to slip in when the other one fails, what would you suggest how I keep the data on both of them equal "close to realtime"? Obviously it's ... | [
"mysql",
"replication",
"fallback",
"binary-log"
] | 10 | 2 | 3,149 | 2 | 0 | 2008-08-11T19:12:33.920000 | 2008-08-11T19:22:13.060000 |
8,127 | 8,189 | Pre-build task - deleting the working copy in CruiseControl.NET | I'm currently in the process of setting up a continuous integration environment at work. We are using VisualSVN Server and CrusieControl.NET. Occasionally a build will fail and a symptom is that there are conflicts in the CruiseControl.NET working copy. I believe this is due to the way I've setup the Visual Studio solu... | Doing a full delete before or after your build is good practice. This means that there is no chance of your build environment picking up an out of date file. Your building exactly against what is in the repository. Deleting the working copy is possible as I have done it with Nant. In Nant I would have a clean script in... | Pre-build task - deleting the working copy in CruiseControl.NET I'm currently in the process of setting up a continuous integration environment at work. We are using VisualSVN Server and CrusieControl.NET. Occasionally a build will fail and a symptom is that there are conflicts in the CruiseControl.NET working copy. I ... | TITLE:
Pre-build task - deleting the working copy in CruiseControl.NET
QUESTION:
I'm currently in the process of setting up a continuous integration environment at work. We are using VisualSVN Server and CrusieControl.NET. Occasionally a build will fail and a symptom is that there are conflicts in the CruiseControl.NE... | [
"visual-studio",
"continuous-integration",
"cruisecontrol.net",
"visualsvn-server"
] | 8 | 10 | 6,094 | 5 | 0 | 2008-08-11T19:36:47.630000 | 2008-08-11T20:27:11.603000 |
8,128 | 8,130 | How do I calculate CRC32 of a string | How do I calculate the CRC32 (Cyclic Redundancy Checksum) of a string in.NET? | This guy seems to have your answer. https://damieng.com/blog/2006/08/08/calculating_crc32_in_c_and_net And in case the blog ever goes away or breaks the url, here's the github link: https://github.com/damieng/DamienGKit/blob/master/CSharp/DamienG.Library/Security/Cryptography/Crc32.cs Usage of the Crc32 class from the ... | How do I calculate CRC32 of a string How do I calculate the CRC32 (Cyclic Redundancy Checksum) of a string in.NET? | TITLE:
How do I calculate CRC32 of a string
QUESTION:
How do I calculate the CRC32 (Cyclic Redundancy Checksum) of a string in.NET?
ANSWER:
This guy seems to have your answer. https://damieng.com/blog/2006/08/08/calculating_crc32_in_c_and_net And in case the blog ever goes away or breaks the url, here's the github li... | [
".net",
"crc32"
] | 53 | 43 | 115,804 | 4 | 0 | 2008-08-11T19:41:20.320000 | 2008-08-11T19:43:31.003000 |
8,140 | 8,157 | Suggestions for Adding Plugin Capability? | Is there a general procedure for programming extensibility capability into your code? I am wondering what the general procedure is for adding extension-type capability to a system you are writing so that functionality can be extended through some kind of plugin API rather than having to modify the core code of a system... | This is generally something that you'll have to expose yourself, so yes, it will be dependent on the language your system is written in (though often it's possible to write wrappers for other languages as well). If, for example, you had a program written in C, for Windows, plugins would be written for your program as D... | Suggestions for Adding Plugin Capability? Is there a general procedure for programming extensibility capability into your code? I am wondering what the general procedure is for adding extension-type capability to a system you are writing so that functionality can be extended through some kind of plugin API rather than ... | TITLE:
Suggestions for Adding Plugin Capability?
QUESTION:
Is there a general procedure for programming extensibility capability into your code? I am wondering what the general procedure is for adding extension-type capability to a system you are writing so that functionality can be extended through some kind of plugi... | [
"plugins",
"extensibility"
] | 16 | 3 | 3,289 | 6 | 0 | 2008-08-11T19:48:52.053000 | 2008-08-11T20:00:09.627000 |
8,142 | 8,152 | When should I use Compiled LINQ vs Normal LINQ | I just read up on a performance of LINQ, and there is a HUGE amount to be gained by using Compiled LINQ. Now, why won't I always use compiled LINQ? | Short answer: when it's only going to happen once in a long time. Long Answer. | When should I use Compiled LINQ vs Normal LINQ I just read up on a performance of LINQ, and there is a HUGE amount to be gained by using Compiled LINQ. Now, why won't I always use compiled LINQ? | TITLE:
When should I use Compiled LINQ vs Normal LINQ
QUESTION:
I just read up on a performance of LINQ, and there is a HUGE amount to be gained by using Compiled LINQ. Now, why won't I always use compiled LINQ?
ANSWER:
Short answer: when it's only going to happen once in a long time. Long Answer. | [
".net",
"linq-to-sql"
] | 5 | 4 | 1,649 | 2 | 0 | 2008-08-11T19:50:31.393000 | 2008-08-11T19:57:30.990000 |
8,145 | 8,161 | How do I find the high water mark (for sessions) on Oracle 9i | How can I find the high water mark (the historical maximum number of concurrent users) in an oracle database (9i). | This should do the trick: SELECT sessions_highwater FROM v$license; | How do I find the high water mark (for sessions) on Oracle 9i How can I find the high water mark (the historical maximum number of concurrent users) in an oracle database (9i). | TITLE:
How do I find the high water mark (for sessions) on Oracle 9i
QUESTION:
How can I find the high water mark (the historical maximum number of concurrent users) in an oracle database (9i).
ANSWER:
This should do the trick: SELECT sessions_highwater FROM v$license; | [
"sql",
"oracle",
"session",
"oracle9i"
] | 7 | 5 | 11,362 | 2 | 0 | 2008-08-11T19:53:16.443000 | 2008-08-11T20:05:44.377000 |
8,147 | 8,289 | How do you get a custom id to render using HtmlHelper in MVC | Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( "myCheckBox", "Click Here", "True", false ) %> only outputs: There is a name there for the form post back but no id for javascript or labels:-( I was hoping that changing it to: Html.CheckBox( "myCheckBox", "Click Here", "True", false, new { id="myCheckBox" }... | Try this: <%= Html.CheckBox("myCheckbox", "Click here", "True", false, new {_id ="test" })%> For any keyword you can use an underscore before the name of the attribute. Instead of class you use _class. Since class is a keyword in C#, and also the name of the attribute in HTML. Now, "id" isn't a keyword in C#, but perha... | How do you get a custom id to render using HtmlHelper in MVC Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( "myCheckBox", "Click Here", "True", false ) %> only outputs: There is a name there for the form post back but no id for javascript or labels:-( I was hoping that changing it to: Html.CheckBox( "myCh... | TITLE:
How do you get a custom id to render using HtmlHelper in MVC
QUESTION:
Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( "myCheckBox", "Click Here", "True", false ) %> only outputs: There is a name there for the form post back but no id for javascript or labels:-( I was hoping that changing it to: Ht... | [
"asp.net-mvc",
"html-helper"
] | 6 | 5 | 3,405 | 2 | 0 | 2008-08-11T19:54:20.687000 | 2008-08-11T22:26:29.177000 |
8,154 | 46,442 | Pylons error - 'MySQL server has gone away' | I'm using Pylons (a python framework) to serve a simple web application, but it seems to die from time to time, with this in the error log: (2006, 'MySQL server has gone away') I did a bit of checking, and saw that this was because the connections to MySQL were not being renewed. This shouldn't be a problem though, bec... | I think I fixed it. It's turns out I had a simple config error. My ini file read: sqlalchemy.default.url = [connection string here] sqlalchemy.pool_recycle = 1800 The problem is that my environment.py file declared that the engine would only map keys with the prefix: sqlalchemy.default so pool_recycle was ignored. The ... | Pylons error - 'MySQL server has gone away' I'm using Pylons (a python framework) to serve a simple web application, but it seems to die from time to time, with this in the error log: (2006, 'MySQL server has gone away') I did a bit of checking, and saw that this was because the connections to MySQL were not being rene... | TITLE:
Pylons error - 'MySQL server has gone away'
QUESTION:
I'm using Pylons (a python framework) to serve a simple web application, but it seems to die from time to time, with this in the error log: (2006, 'MySQL server has gone away') I did a bit of checking, and saw that this was because the connections to MySQL w... | [
"python",
"mysql",
"pylons"
] | 16 | 8 | 3,760 | 2 | 0 | 2008-08-11T19:59:32.670000 | 2008-09-05T18:07:50.310000 |
8,166 | 8,184 | MySQL replication: if I don't specify any databases, will log_bin log EVERYTHING? | I'm setting up replication for a server which runs a bunch of databases (one per client) and plan on adding more all the time, on my.cnf, Instead of having: binlog-do-db = databasename 1 binlog-do-db = databasename 2 binlog-do-db = databasename 3... binlog-do-db = databasename n can I rather just have binlog-ignore-db ... | That looks correct: http://dev.mysql.com/doc/refman/5.0/en/binary-log.html#option_mysqld_binlog-ignore-db. According to that reference: There are some --binlog-ignore-db rules. Does the default database match any of the --binlog-ignore-db rules? Yes: Do not write the statement, and exit. No: Write the query and exit. S... | MySQL replication: if I don't specify any databases, will log_bin log EVERYTHING? I'm setting up replication for a server which runs a bunch of databases (one per client) and plan on adding more all the time, on my.cnf, Instead of having: binlog-do-db = databasename 1 binlog-do-db = databasename 2 binlog-do-db = databa... | TITLE:
MySQL replication: if I don't specify any databases, will log_bin log EVERYTHING?
QUESTION:
I'm setting up replication for a server which runs a bunch of databases (one per client) and plan on adding more all the time, on my.cnf, Instead of having: binlog-do-db = databasename 1 binlog-do-db = databasename 2 bin... | [
"mysql",
"replication"
] | 21 | 12 | 17,119 | 1 | 0 | 2008-08-11T20:08:03.310000 | 2008-08-11T20:22:24.730000 |
8,213 | 8,220 | Generate insert SQL statements from a CSV file | I need to import a csv file into Firebird and I've spent a couple of hours trying out some tools and none fit my needs. The main problem is that all the tools I've been trying like EMS Data Import and Firebird Data Wizard expect that my CSV file contains all the information needed by my Table. I need to write some cust... | It's a bit crude - but for one off jobs, I sometimes use Excel. If you import the CSV file into Excel, you can create a formula which creates an INSERT statement by using string concatenation in the formula. So - if your CSV file has 3 columns that appear in columns A, B, and C in Excel, you could write a formula like.... | Generate insert SQL statements from a CSV file I need to import a csv file into Firebird and I've spent a couple of hours trying out some tools and none fit my needs. The main problem is that all the tools I've been trying like EMS Data Import and Firebird Data Wizard expect that my CSV file contains all the informatio... | TITLE:
Generate insert SQL statements from a CSV file
QUESTION:
I need to import a csv file into Firebird and I've spent a couple of hours trying out some tools and none fit my needs. The main problem is that all the tools I've been trying like EMS Data Import and Firebird Data Wizard expect that my CSV file contains ... | [
"sql",
"csv",
"insert",
"firebird"
] | 64 | 130 | 124,433 | 12 | 0 | 2008-08-11T20:59:11.973000 | 2008-08-11T21:07:51.287000 |
8,214 | 31,514 | Instrumenting a UI | How are you instrumenting your UI's? In the past I've read that people have instrumented their user interfaces, but what I haven't found is examples or tips on how to instrument a UI. By instrumenting, I mean collecting data regarding usage and performance of the system. A MSDN article on Instrumentation is http://msdn... | The following blog post gives quite a few good ideas for instrumenting a WPF application: Techniques for UI Auditing on WPF apps. | Instrumenting a UI How are you instrumenting your UI's? In the past I've read that people have instrumented their user interfaces, but what I haven't found is examples or tips on how to instrument a UI. By instrumenting, I mean collecting data regarding usage and performance of the system. A MSDN article on Instrumenta... | TITLE:
Instrumenting a UI
QUESTION:
How are you instrumenting your UI's? In the past I've read that people have instrumented their user interfaces, but what I haven't found is examples or tips on how to instrument a UI. By instrumenting, I mean collecting data regarding usage and performance of the system. A MSDN arti... | [
"wpf",
"user-interface",
"instrumentation"
] | 8 | 3 | 2,821 | 7 | 0 | 2008-08-11T21:00:40.520000 | 2008-08-28T02:08:26.253000 |
8,219 | 8,226 | Test Distribution | At my work we are running a group of tests that consist of about 3,000 separate test cases. Previously we were running this entire test suite on one machine, which took about 24-72 hours to complete the entire test run. We now have created our own system for grouping and distributing the tests among about three separat... | I've seen some people having a play with distributed JUnit. I can't particularly vouch for how effective it is, but the other teams I've seen seemed to think it was straight forward enough. Hope that helps. | Test Distribution At my work we are running a group of tests that consist of about 3,000 separate test cases. Previously we were running this entire test suite on one machine, which took about 24-72 hours to complete the entire test run. We now have created our own system for grouping and distributing the tests among a... | TITLE:
Test Distribution
QUESTION:
At my work we are running a group of tests that consist of about 3,000 separate test cases. Previously we were running this entire test suite on one machine, which took about 24-72 hours to complete the entire test run. We now have created our own system for grouping and distributing... | [
"java",
"testing",
"enterprise"
] | 10 | 3 | 879 | 3 | 0 | 2008-08-11T21:07:44.687000 | 2008-08-11T21:13:06.813000 |
8,223 | 8,232 | Connection Pooling in .NET/SQL Server? | Is it necessary or advantageous to write custom connection pooling code when developing applications in.NET with an SQL Server database? I know that ADO.NET gives you the option to enable/disable connection pooling -- does that mean that it's built into the framework and I don't need to worry about it? Why do people ta... | The connection pooling built-in to ADO.Net is robust and mature. I would recommend against attempting to write your own version. | Connection Pooling in .NET/SQL Server? Is it necessary or advantageous to write custom connection pooling code when developing applications in.NET with an SQL Server database? I know that ADO.NET gives you the option to enable/disable connection pooling -- does that mean that it's built into the framework and I don't n... | TITLE:
Connection Pooling in .NET/SQL Server?
QUESTION:
Is it necessary or advantageous to write custom connection pooling code when developing applications in.NET with an SQL Server database? I know that ADO.NET gives you the option to enable/disable connection pooling -- does that mean that it's built into the frame... | [
"c#",
".net",
"sql-server",
"connection-pooling"
] | 11 | 15 | 4,174 | 5 | 0 | 2008-08-11T21:10:32.903000 | 2008-08-11T21:14:40.303000 |
8,228 | 8,900 | Why won't Entourage work with Exchange 2007? | So this is IT more than programming but Google found nothing, and you guys are just the right kind of geniuses. My Exchange Server 2007 and Entourage clients don't play nice. Right now the big issue is that the entourage client will not connect to Exchange 2007 ( Entourage 2004 or 2008) The account settings are correct... | Try it without using the /exchange in the server properties field. Here's a link with relevant info. | Why won't Entourage work with Exchange 2007? So this is IT more than programming but Google found nothing, and you guys are just the right kind of geniuses. My Exchange Server 2007 and Entourage clients don't play nice. Right now the big issue is that the entourage client will not connect to Exchange 2007 ( Entourage 2... | TITLE:
Why won't Entourage work with Exchange 2007?
QUESTION:
So this is IT more than programming but Google found nothing, and you guys are just the right kind of geniuses. My Exchange Server 2007 and Entourage clients don't play nice. Right now the big issue is that the entourage client will not connect to Exchange ... | [
"email",
"dll",
"exchange-server",
"entourage"
] | 4 | 2 | 1,456 | 2 | 0 | 2008-08-11T21:13:59.340000 | 2008-08-12T14:40:45.060000 |
8,236 | 8,384 | How do you determine the size of a file in C? | How can I figure out the size of a file, in bytes? #include unsigned int fsize(char* file){ //what goes here? } | On Unix-like systems, you can use POSIX system calls: stat on a path, or fstat on an already-open file descriptor (POSIX man page, Linux man page ). (Get a file descriptor from open(2), or fileno(FILE*) on a stdio stream). Based on NilObject's code: #include #include off_t fsize(const char *filename) { struct stat st;
... | How do you determine the size of a file in C? How can I figure out the size of a file, in bytes? #include unsigned int fsize(char* file){ //what goes here? } | TITLE:
How do you determine the size of a file in C?
QUESTION:
How can I figure out the size of a file, in bytes? #include unsigned int fsize(char* file){ //what goes here? }
ANSWER:
On Unix-like systems, you can use POSIX system calls: stat on a path, or fstat on an already-open file descriptor (POSIX man page, Linu... | [
"c",
"file",
"io",
"filesize"
] | 170 | 177 | 156,929 | 12 | 0 | 2008-08-11T21:16:30.147000 | 2008-08-12T00:55:48.313000 |
8,263 | 8,347 | I can't get my debugger to stop breaking on first-chance exceptions | I'm using Visual C++ 2003 to debug a program remotely via TCP/IP. I had set the Win32 exception c00000005, "Access violation," to break into the debugger when thrown. Then, I set it back to "Use parent setting." The setting for the parent, Win32 Exceptions, is to continue when the exception is thrown. Now, when I debug... | I'd like to support Will Dean's answer An access violation sounds like an actual bug in your code. It's not something I'd expect the underlying C/++ Runtime to be throwing and catching internally. The 'first-chance-exceptions' feature is so you can intercept things which get 'caught' in code, using the debugger, and ha... | I can't get my debugger to stop breaking on first-chance exceptions I'm using Visual C++ 2003 to debug a program remotely via TCP/IP. I had set the Win32 exception c00000005, "Access violation," to break into the debugger when thrown. Then, I set it back to "Use parent setting." The setting for the parent, Win32 Except... | TITLE:
I can't get my debugger to stop breaking on first-chance exceptions
QUESTION:
I'm using Visual C++ 2003 to debug a program remotely via TCP/IP. I had set the Win32 exception c00000005, "Access violation," to break into the debugger when thrown. Then, I set it back to "Use parent setting." The setting for the pa... | [
"c++",
"visual-studio",
"debugging",
"visual-studio-2003",
"first-chance-exception"
] | 4 | 5 | 2,869 | 3 | 0 | 2008-08-11T21:51:06.813000 | 2008-08-11T23:48:33.927000 |
8,276 | 8,310 | Class::DBI-like library for php? | I have inherited an old crusty PHP application, and I'd like to refactor it into something a little nicer to deal with, but in a gradual manner. In perl's CPAN, there is a series of classes around Class::DBI that allow you to use database rows as the basis for objects in your code, with the library generating accessor ... | It's now defunct but phpdbi is possibly worth a look. If you're willing to let go of some of your caveats (the framework one), I've found that Doctrine is a pretty neat way of accessing DBs in PHP. Worth investigating anyway. | Class::DBI-like library for php? I have inherited an old crusty PHP application, and I'd like to refactor it into something a little nicer to deal with, but in a gradual manner. In perl's CPAN, there is a series of classes around Class::DBI that allow you to use database rows as the basis for objects in your code, with... | TITLE:
Class::DBI-like library for php?
QUESTION:
I have inherited an old crusty PHP application, and I'd like to refactor it into something a little nicer to deal with, but in a gradual manner. In perl's CPAN, there is a series of classes around Class::DBI that allow you to use database rows as the basis for objects ... | [
"php",
"perl",
"orm"
] | 13 | 4 | 2,191 | 5 | 0 | 2008-08-11T22:12:04.527000 | 2008-08-11T22:40:02.893000 |
8,284 | 8,299 | Generating Icon Files | I'm looking for an online solution for generating.ICO files. I'd like the ICO files to have the ability to have transparency as well. What software or web site do you use to create them? [Update] To clarify, I have an existing image in PNG format, 32 x 32 pixels. I want to generate the icon from this existing file, not... | I have found the application IcoFx useful, you can import pretty much any image type to use for icon creation, including PNG's. | Generating Icon Files I'm looking for an online solution for generating.ICO files. I'd like the ICO files to have the ability to have transparency as well. What software or web site do you use to create them? [Update] To clarify, I have an existing image in PNG format, 32 x 32 pixels. I want to generate the icon from t... | TITLE:
Generating Icon Files
QUESTION:
I'm looking for an online solution for generating.ICO files. I'd like the ICO files to have the ability to have transparency as well. What software or web site do you use to create them? [Update] To clarify, I have an existing image in PNG format, 32 x 32 pixels. I want to genera... | [
"icons",
"favicon"
] | 12 | 12 | 2,860 | 17 | 0 | 2008-08-11T22:20:04.697000 | 2008-08-11T22:33:41.613000 |
8,306 | 8,315 | Creating Redundancy for a Subversion Repository? | What is the best way to create redundant subversion repositories? I have a subversion repository (linked through apache2 and WebDAV) and would like to create a mirror repository on a different server in the event of outages, but I am not certain of the best way to proceed. I am thinking that post-commit scripts could b... | Sounds like what you are looking for is basically federated (synced) servers... I asked the same question recently...and while I didn't find the exact solution I was looking for it came close. See here: | Creating Redundancy for a Subversion Repository? What is the best way to create redundant subversion repositories? I have a subversion repository (linked through apache2 and WebDAV) and would like to create a mirror repository on a different server in the event of outages, but I am not certain of the best way to procee... | TITLE:
Creating Redundancy for a Subversion Repository?
QUESTION:
What is the best way to create redundant subversion repositories? I have a subversion repository (linked through apache2 and WebDAV) and would like to create a mirror repository on a different server in the event of outages, but I am not certain of the ... | [
"svn",
"repository",
"redundancy"
] | 4 | 4 | 3,408 | 3 | 0 | 2008-08-11T22:37:47.983000 | 2008-08-11T22:49:02.610000 |
8,318 | 8,322 | Resolving Session Fixation in JBoss | I need to prevent Session Fixation, a particular type of session hijacking, in a Java web application running in JBoss. However, it appears that the standard idiom doesn't work in JBoss. Can this be worked around? | This defect (found here ) points the way to the solution. The Tomcat instance that runs in JBoss is configured with emptySessionPath="true", rather than "false", which is the default. This can be modified in.../deploy/jboss-web.deployer/server.xml; both the HTTP and AJP connectors have this option. The feature itself i... | Resolving Session Fixation in JBoss I need to prevent Session Fixation, a particular type of session hijacking, in a Java web application running in JBoss. However, it appears that the standard idiom doesn't work in JBoss. Can this be worked around? | TITLE:
Resolving Session Fixation in JBoss
QUESTION:
I need to prevent Session Fixation, a particular type of session hijacking, in a Java web application running in JBoss. However, it appears that the standard idiom doesn't work in JBoss. Can this be worked around?
ANSWER:
This defect (found here ) points the way to... | [
"java",
"security",
"jboss"
] | 11 | 9 | 10,695 | 4 | 0 | 2008-08-11T22:53:50.883000 | 2008-08-11T23:00:58.467000 |
8,348 | 8,366 | Using unhandled exceptions instead of Contains()? | Imagine an object you are working with has a collection of other objects associated with it, for example, the Controls collection on a WinForm. You want to check for a certain object in the collection, but the collection doesn't have a Contains() method. There are several ways of dealing with this. Implement your own C... | I would have to say that this is pretty bad practice. Whilst some people might be happy to say that looping through the collection is less efficient to throwing an exception, there is an overhead to throwing an exception. I would also question why you are using a collection to access an item by key when you would be be... | Using unhandled exceptions instead of Contains()? Imagine an object you are working with has a collection of other objects associated with it, for example, the Controls collection on a WinForm. You want to check for a certain object in the collection, but the collection doesn't have a Contains() method. There are sever... | TITLE:
Using unhandled exceptions instead of Contains()?
QUESTION:
Imagine an object you are working with has a collection of other objects associated with it, for example, the Controls collection on a WinForm. You want to check for a certain object in the collection, but the collection doesn't have a Contains() metho... | [
"c#",
".net",
"error-handling"
] | 8 | 3 | 1,201 | 8 | 0 | 2008-08-11T23:49:32.503000 | 2008-08-12T00:26:37.577000 |
8,351 | 8,360 | Is there something like "Firebug for IE" (for debugging JavaScript)? | I'm trying to fix some JavaScript bugs. Firebug makes debugging these issues a lot easier when working in Firefox, but what do you do when the code works fine on Firefox but IE is complaining? | you can also check out the IE Developer Toolbar which isn't a debugger but will help you analyze the contents of your code. Visual Studio will help with the debugging Fiddler should help analyse the traffic travelling to and from your browser | Is there something like "Firebug for IE" (for debugging JavaScript)? I'm trying to fix some JavaScript bugs. Firebug makes debugging these issues a lot easier when working in Firefox, but what do you do when the code works fine on Firefox but IE is complaining? | TITLE:
Is there something like "Firebug for IE" (for debugging JavaScript)?
QUESTION:
I'm trying to fix some JavaScript bugs. Firebug makes debugging these issues a lot easier when working in Firefox, but what do you do when the code works fine on Firefox but IE is complaining?
ANSWER:
you can also check out the IE D... | [
"javascript",
"debugging",
"internet-explorer",
"firebug",
"javascript-debugger"
] | 44 | 23 | 44,845 | 16 | 0 | 2008-08-12T00:02:42.417000 | 2008-08-12T00:11:03.303000 |
8,355 | 12,069 | Using mod_rewrite to Mimic SSL Virtual Hosts? | What is the best way to transparently rewrite a URL over an SSL connection with Apache 2.2? Apache 2 does not natively support multiple name-based virtual hosts for an SSL connection and I have heard that mod_rewrite can help with this. I would like to do something like this: I have set up the server so that the sites ... | Configure a single VirtualHost to serve both secure.example.com and dbadmin.example.com (making it the only *:443 VirtualHost achieves this). You can then use mod_rewrite to adjust the URI for requests to dbadmin.example.com: ServerName secure.example.com ServerAlias dbadmin.example.com
RewriteEngine on RewriteCond %{... | Using mod_rewrite to Mimic SSL Virtual Hosts? What is the best way to transparently rewrite a URL over an SSL connection with Apache 2.2? Apache 2 does not natively support multiple name-based virtual hosts for an SSL connection and I have heard that mod_rewrite can help with this. I would like to do something like thi... | TITLE:
Using mod_rewrite to Mimic SSL Virtual Hosts?
QUESTION:
What is the best way to transparently rewrite a URL over an SSL connection with Apache 2.2? Apache 2 does not natively support multiple name-based virtual hosts for an SSL connection and I have heard that mod_rewrite can help with this. I would like to do ... | [
"apache",
"mod-rewrite",
"https"
] | 7 | 3 | 2,271 | 3 | 0 | 2008-08-12T00:06:36.073000 | 2008-08-15T08:21:28.300000 |
8,365 | 23,804 | MySQL Administrator Backups: "Compatibility Mode", What Exactly is this doing? | In Mysql Administrator, when doing backups, what exactly is "Compatibility Mode"? I'm trying to bridge backups generated by webmin with the upload tool available inside mysql administrator. My data already has a couple of inconsistencies (ticks, commas, etc, I think) I just wont try to kink out (they might just reappea... | Compatibility mode - the mode that helps you create exports compabible with different versions of MYSQL or other databases. You see, some versions of MySQL had different commands that were used in various versions. So what compatibility mode allows you to do is take a database and export the SQL to be compatible with a... | MySQL Administrator Backups: "Compatibility Mode", What Exactly is this doing? In Mysql Administrator, when doing backups, what exactly is "Compatibility Mode"? I'm trying to bridge backups generated by webmin with the upload tool available inside mysql administrator. My data already has a couple of inconsistencies (ti... | TITLE:
MySQL Administrator Backups: "Compatibility Mode", What Exactly is this doing?
QUESTION:
In Mysql Administrator, when doing backups, what exactly is "Compatibility Mode"? I'm trying to bridge backups generated by webmin with the upload tool available inside mysql administrator. My data already has a couple of i... | [
"mysql",
"backup"
] | 6 | 1 | 8,185 | 1 | 0 | 2008-08-12T00:21:58.790000 | 2008-08-23T00:46:30.907000 |
8,371 | 8,380 | How do you redirect HTTPS to HTTP? | How do you redirect HTTPS to HTTP?. That is, the opposite of what (seemingly) everyone teaches. I have a server on HTTPS for which I paid an SSL certification for and a mirror for which I haven't and keep around for just for emergencies so it doesn't merit getting a certification for. On my client's desktops I have SOM... | This has not been tested but I think this should work using mod_rewrite RewriteEngine On RewriteCond %{HTTPS} on RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} | How do you redirect HTTPS to HTTP? How do you redirect HTTPS to HTTP?. That is, the opposite of what (seemingly) everyone teaches. I have a server on HTTPS for which I paid an SSL certification for and a mirror for which I haven't and keep around for just for emergencies so it doesn't merit getting a certification for.... | TITLE:
How do you redirect HTTPS to HTTP?
QUESTION:
How do you redirect HTTPS to HTTP?. That is, the opposite of what (seemingly) everyone teaches. I have a server on HTTPS for which I paid an SSL certification for and a mirror for which I haven't and keep around for just for emergencies so it doesn't merit getting a ... | [
"apache",
"ssl",
"redirect",
"https"
] | 189 | 143 | 495,296 | 11 | 0 | 2008-08-12T00:36:32.223000 | 2008-08-12T00:48:49.577000 |
8,398 | 8,433 | How do I debug JavaScript in Visual Studio 2005? | I just saw this mentioned in Stack Overflow question Best WYSIWYG CSS editor and didn't know it could be done. I'm a Visual Studio newbie, so how do you do it? Is there a separate debugger for JavaScript? I know how to work the one for code-behind pages... I usually use Firebug to deal with debugging JavaScript code. I... | I prefer using Firebug for projects I can't use Visual Studio 2008 on. | How do I debug JavaScript in Visual Studio 2005? I just saw this mentioned in Stack Overflow question Best WYSIWYG CSS editor and didn't know it could be done. I'm a Visual Studio newbie, so how do you do it? Is there a separate debugger for JavaScript? I know how to work the one for code-behind pages... I usually use ... | TITLE:
How do I debug JavaScript in Visual Studio 2005?
QUESTION:
I just saw this mentioned in Stack Overflow question Best WYSIWYG CSS editor and didn't know it could be done. I'm a Visual Studio newbie, so how do you do it? Is there a separate debugger for JavaScript? I know how to work the one for code-behind pages... | [
"javascript",
"visual-studio",
"visual-studio-2005",
"debugging"
] | 17 | 8 | 10,917 | 11 | 0 | 2008-08-12T01:22:38.197000 | 2008-08-12T03:12:49.317000 |
8,422 | 402,856 | How do you handle audit logging with SSRS? | I have some reports in SQL Server Reporting Services 2005 that I need to keep audit logs for. The audit log should include who ran what report with what parameters. I can't use Windows authentication. What is the best way to log this information? | The previous comments were dead on accurate that you can mine the data from the ReportServer ExecutionLog table in SQL Server 2000/2005 or the ExecutionLogStorage table in SQL Server 2008. If you are using form-based authentication to access the reports instead of windows authentication, then you are probably passing s... | How do you handle audit logging with SSRS? I have some reports in SQL Server Reporting Services 2005 that I need to keep audit logs for. The audit log should include who ran what report with what parameters. I can't use Windows authentication. What is the best way to log this information? | TITLE:
How do you handle audit logging with SSRS?
QUESTION:
I have some reports in SQL Server Reporting Services 2005 that I need to keep audit logs for. The audit log should include who ran what report with what parameters. I can't use Windows authentication. What is the best way to log this information?
ANSWER:
The... | [
"sql-server",
"sql-server-2005",
"reporting-services",
"reportingservices-2005"
] | 6 | 5 | 8,827 | 5 | 0 | 2008-08-12T02:39:06.437000 | 2008-12-31T12:10:30.493000 |
8,435 | 8,436 | How do you get the icons out of shell32.dll? | I'd like to get the Tree icon to use for a homegrown app. Does anyone know how to extract the images out as.icon files? I'd like both the 16x16 and 32x32, or I'd just do a screen capture. | In Visual Studio, choose "File Open..." then "File...". Then pick the Shell32.dll. A folder tree should be opened, and you will find the icons in the "Icon" folder. To save an Icon, you can right-click on the icon in the folder tree and choose "Export". | How do you get the icons out of shell32.dll? I'd like to get the Tree icon to use for a homegrown app. Does anyone know how to extract the images out as.icon files? I'd like both the 16x16 and 32x32, or I'd just do a screen capture. | TITLE:
How do you get the icons out of shell32.dll?
QUESTION:
I'd like to get the Tree icon to use for a homegrown app. Does anyone know how to extract the images out as.icon files? I'd like both the 16x16 and 32x32, or I'd just do a screen capture.
ANSWER:
In Visual Studio, choose "File Open..." then "File...". Then... | [
"windows",
"powershell",
"icons"
] | 69 | 58 | 120,479 | 13 | 0 | 2008-08-12T03:26:38.557000 | 2008-08-12T03:32:20.590000 |
8,439 | 12,283 | Conditional Visibility and Page Breaks with SQL Server 2005 Reporting Services | I know there's a bug with conditional visibility and page breaks with SQL 2005, but I wonder if anyone has come up with a work around. I have a table that has a conditional visibility expression, and I need a page break at the end of the table. If I set the PageBreakAtEnd property to true. It is ignored no matter what.... | Place two rectangles, one inside the other. Place your table inside the inner rectangle and set it to always be visible. Set the inner rectangle's Page Break to Insert After Rectangle. Set the outer rectangle's visibility to use your conditional expression. The page break and the conditional visibility are now separate... | Conditional Visibility and Page Breaks with SQL Server 2005 Reporting Services I know there's a bug with conditional visibility and page breaks with SQL 2005, but I wonder if anyone has come up with a work around. I have a table that has a conditional visibility expression, and I need a page break at the end of the tab... | TITLE:
Conditional Visibility and Page Breaks with SQL Server 2005 Reporting Services
QUESTION:
I know there's a bug with conditional visibility and page breaks with SQL 2005, but I wonder if anyone has come up with a work around. I have a table that has a conditional visibility expression, and I need a page break at ... | [
"sql-server-2005",
"reporting-services"
] | 19 | 11 | 24,997 | 7 | 0 | 2008-08-12T03:46:11.043000 | 2008-08-15T14:22:26.470000 |
8,441 | 8,454 | Mod-Rewrite loading files behind the DocumentRoot | I'm using.htaccess and mod_rewrite to point to files that reside behind the DocumentRoot. My folder structure looks like this: home/ webroot/ other_files/ I have a.htaccess file in webroot with the following content: RewriteEngine on RewriteRule ^(.*)$ /home/other_files/$1 If I try to access http://example.com/file.htm... | I believe you need to add a section with (options) to your server configuration before apache will be able to serve anything from it. For an example, my DocumentRoot is /var/www but there is this section in the default available site: Alias /doc/ "/usr/share/doc/" Options Indexes MultiViews FollowSymLinks AllowOverride... | Mod-Rewrite loading files behind the DocumentRoot I'm using.htaccess and mod_rewrite to point to files that reside behind the DocumentRoot. My folder structure looks like this: home/ webroot/ other_files/ I have a.htaccess file in webroot with the following content: RewriteEngine on RewriteRule ^(.*)$ /home/other_files... | TITLE:
Mod-Rewrite loading files behind the DocumentRoot
QUESTION:
I'm using.htaccess and mod_rewrite to point to files that reside behind the DocumentRoot. My folder structure looks like this: home/ webroot/ other_files/ I have a.htaccess file in webroot with the following content: RewriteEngine on RewriteRule ^(.*)$... | [
".htaccess",
"mod-rewrite"
] | 13 | 13 | 6,589 | 3 | 0 | 2008-08-12T03:58:21.910000 | 2008-08-12T04:21:54.857000 |
8,447 | 8,480 | What does the [Flags] Enum Attribute mean in C#? | From time to time I see an enum like the following: [Flags] public enum Options { None = 0, Option1 = 1, Option2 = 2, Option3 = 4, Option4 = 8 } I don't understand what exactly the [Flags] attribute does. Anyone have a good explanation or example they could post? | The [Flags] attribute should be used whenever the enumerable represents a collection of possible values, rather than a single value. Such collections are often used with bitwise operators, for example: var allowedColors = MyColor.Red | MyColor.Green | MyColor.Blue; Note that the [Flags] attribute doesn't enable this by... | What does the [Flags] Enum Attribute mean in C#? From time to time I see an enum like the following: [Flags] public enum Options { None = 0, Option1 = 1, Option2 = 2, Option3 = 4, Option4 = 8 } I don't understand what exactly the [Flags] attribute does. Anyone have a good explanation or example they could post? | TITLE:
What does the [Flags] Enum Attribute mean in C#?
QUESTION:
From time to time I see an enum like the following: [Flags] public enum Options { None = 0, Option1 = 1, Option2 = 2, Option3 = 4, Option4 = 8 } I don't understand what exactly the [Flags] attribute does. Anyone have a good explanation or example they c... | [
"c#",
"enums",
"flags"
] | 1,753 | 2,531 | 655,063 | 14 | 0 | 2008-08-12T04:09:16.083000 | 2008-08-12T05:10:46.427000 |
8,448 | 8,468 | F# curried function | Anyone have a decent example, preferably practical/useful, they could post demonstrating the concept? | (Edit: a small Ocaml FP Koan to start things off) The Koan of Currying (A koan about food, that is not about food) A student came to Jacques Garrigue and said, "I do not understand what currying is good for." Jacques replied, "Tell me your favorite meal and your favorite dessert". The puzzled student replied that he li... | F# curried function Anyone have a decent example, preferably practical/useful, they could post demonstrating the concept? | TITLE:
F# curried function
QUESTION:
Anyone have a decent example, preferably practical/useful, they could post demonstrating the concept?
ANSWER:
(Edit: a small Ocaml FP Koan to start things off) The Koan of Currying (A koan about food, that is not about food) A student came to Jacques Garrigue and said, "I do not u... | [
"f#",
"functional-programming",
"currying"
] | 19 | 21 | 7,102 | 6 | 0 | 2008-08-12T04:11:15.800000 | 2008-08-12T04:46:33.480000 |
8,451 | 8,486 | Secure Memory Allocator in C++ | I want to create an allocator which provides memory with the following attributes: cannot be paged to disk. is incredibly hard to access through an attached debugger The idea is that this will contain sensitive information (like licence information) which should be inaccessible to the user. I have done the usual resear... | You can't really protect against memory access. You can probably prevent paging if you are running as an admin or as the system, but you cannot prevent the admin or system from reading your memory. Even if you could somehow completely block other processes from reading your memory (which you can't), another process cou... | Secure Memory Allocator in C++ I want to create an allocator which provides memory with the following attributes: cannot be paged to disk. is incredibly hard to access through an attached debugger The idea is that this will contain sensitive information (like licence information) which should be inaccessible to the use... | TITLE:
Secure Memory Allocator in C++
QUESTION:
I want to create an allocator which provides memory with the following attributes: cannot be paged to disk. is incredibly hard to access through an attached debugger The idea is that this will contain sensitive information (like licence information) which should be inacc... | [
"c++",
"security",
"memory",
"ram-scraping"
] | 15 | 19 | 9,738 | 13 | 0 | 2008-08-12T04:18:09.873000 | 2008-08-12T05:17:09.473000 |
8,452 | 8,471 | Custom WPF command pattern example | I've done some WPF programing and one thing I never got was the command pattern. Every example seems to be for built in ones, edit, cut, paste. Anyone have an example or suggestion of best practice for custom commands? | Ah ha! A question I can answer! Firstly, I should mention that I have personally found it easier to define and hook up commands in code rather than in XAML. It allows me to hook up the handlers for the commands a little more flexibly than an all XAML approach does. You should work out what commands you want to have and... | Custom WPF command pattern example I've done some WPF programing and one thing I never got was the command pattern. Every example seems to be for built in ones, edit, cut, paste. Anyone have an example or suggestion of best practice for custom commands? | TITLE:
Custom WPF command pattern example
QUESTION:
I've done some WPF programing and one thing I never got was the command pattern. Every example seems to be for built in ones, edit, cut, paste. Anyone have an example or suggestion of best practice for custom commands?
ANSWER:
Ah ha! A question I can answer! Firstly... | [
"wpf",
"design-patterns",
"command"
] | 37 | 38 | 9,471 | 4 | 0 | 2008-08-12T04:18:30.853000 | 2008-08-12T04:58:38.620000 |
8,472 | 8,637 | Practical non-image based CAPTCHA approaches? | It looks like we'll be adding CAPTCHA support to Stack Overflow. This is necessary to prevent bots, spammers, and other malicious scripted activity. We only want human beings to post or edit things here! We'll be using a JavaScript (jQuery) CAPTCHA as a first line of defense: http://docs.jquery.com/Tutorials:Safer_Cont... | A method that I have developed and which seems to work perfectly (although I probably don't get as much comment spam as you), is to have a hidden field and fill it with a bogus value e.g.: I then have a piece of JavaScript which updates the value every second with the number of seconds the page has been loaded for: var... | Practical non-image based CAPTCHA approaches? It looks like we'll be adding CAPTCHA support to Stack Overflow. This is necessary to prevent bots, spammers, and other malicious scripted activity. We only want human beings to post or edit things here! We'll be using a JavaScript (jQuery) CAPTCHA as a first line of defens... | TITLE:
Practical non-image based CAPTCHA approaches?
QUESTION:
It looks like we'll be adding CAPTCHA support to Stack Overflow. This is necessary to prevent bots, spammers, and other malicious scripted activity. We only want human beings to post or edit things here! We'll be using a JavaScript (jQuery) CAPTCHA as a fi... | [
"security",
"language-agnostic",
"captcha"
] | 317 | 205 | 83,757 | 103 | 0 | 2008-08-12T04:59:35.017000 | 2008-08-12T09:34:30.670000 |
8,485 | 49,184 | Use the routing engine for form submissions in ASP.NET MVC Preview 4 | I'm using ASP.NET MVC Preview 4 and would like to know how to use the routing engine for form submissions. For example, I have a route like this: routes.MapRoute( "TestController-TestAction", "TestController.mvc/TestAction/{paramName}", new { controller = "TestController", action = "TestAction", id = "TestTopic" } ); A... | Solution: public ActionResult TestAction(string paramName) { if (!String.IsNullOrEmpty(Request["paramName"])) { return RedirectToAction("TestAction", new { paramName = Request["paramName"]}); } /*... */ } | Use the routing engine for form submissions in ASP.NET MVC Preview 4 I'm using ASP.NET MVC Preview 4 and would like to know how to use the routing engine for form submissions. For example, I have a route like this: routes.MapRoute( "TestController-TestAction", "TestController.mvc/TestAction/{paramName}", new { controll... | TITLE:
Use the routing engine for form submissions in ASP.NET MVC Preview 4
QUESTION:
I'm using ASP.NET MVC Preview 4 and would like to know how to use the routing engine for form submissions. For example, I have a route like this: routes.MapRoute( "TestController-TestAction", "TestController.mvc/TestAction/{paramName... | [
"asp.net-mvc",
"forms",
"asp.net-mvc-routing"
] | 12 | 9 | 3,567 | 3 | 0 | 2008-08-12T05:16:01.427000 | 2008-09-08T04:58:18.700000 |
8,493 | 15,363 | What's in your .procmailrc | Are there any handy general items you put in your.procmailrc file? | Many mailers prefix a mail's subject with "Re: " when replying, if that prefix isn't already there. German Outlook instead prefixes with "AW: " (for "AntWort") if that prefix isn't already there. Unfortunately, these two behaviours clash, resulting in mail subjects like "Re: AW: Re: AW: Re: AW: Re: AW: Lunch". So I now... | What's in your .procmailrc Are there any handy general items you put in your.procmailrc file? | TITLE:
What's in your .procmailrc
QUESTION:
Are there any handy general items you put in your.procmailrc file?
ANSWER:
Many mailers prefix a mail's subject with "Re: " when replying, if that prefix isn't already there. German Outlook instead prefixes with "AW: " (for "AntWort") if that prefix isn't already there. Unf... | [
"email",
"unix",
"procmail"
] | 6 | 5 | 1,259 | 4 | 0 | 2008-08-12T05:24:36.307000 | 2008-08-18T23:15:11.400000 |
8,508 | 8,515 | How should I monitor potential threats to my site? | By looking at our DB's error log, we found that there was a constant stream of almost successful SQL injection attacks. Some quick coding avoided that, but how could I have setup a monitor for both the DB and Web server (including POST requests) to check for this? By this I mean if there are off the shelf tools for scr... | Funnily enough, Scott Hanselman had a post on UrlScan today which is one thing you could do to help monitor and minimize potential threats. It's a pretty interesting read. | How should I monitor potential threats to my site? By looking at our DB's error log, we found that there was a constant stream of almost successful SQL injection attacks. Some quick coding avoided that, but how could I have setup a monitor for both the DB and Web server (including POST requests) to check for this? By t... | TITLE:
How should I monitor potential threats to my site?
QUESTION:
By looking at our DB's error log, we found that there was a constant stream of almost successful SQL injection attacks. Some quick coding avoided that, but how could I have setup a monitor for both the DB and Web server (including POST requests) to ch... | [
"monitor",
"alert"
] | 6 | 5 | 624 | 5 | 0 | 2008-08-12T05:40:49.847000 | 2008-08-12T05:47:15.777000 |
8,517 | 36,791 | Lucene exact ordering | I've had this long term issue in not quite understanding how to implement a decent Lucene sort or ranking. Say I have a list of cities and their populations. If someone searches "new" or "london" I want the list of prefix matches ordered by population, and I have that working with a prefix search and an sort by field r... | dlamblin,let me see if I get this correctly: You want to make a prefix-based query, and then sort the results by population, and maybe combine the sort order with preference for exact matches. I suggest you separate the search from the sort and use a CustomSorter for the sorting: Here's a blog entry describing a custom... | Lucene exact ordering I've had this long term issue in not quite understanding how to implement a decent Lucene sort or ranking. Say I have a list of cities and their populations. If someone searches "new" or "london" I want the list of prefix matches ordered by population, and I have that working with a prefix search ... | TITLE:
Lucene exact ordering
QUESTION:
I've had this long term issue in not quite understanding how to implement a decent Lucene sort or ranking. Say I have a list of cities and their populations. If someone searches "new" or "london" I want the list of prefix matches ordered by population, and I have that working wit... | [
"lucene"
] | 4 | 3 | 2,887 | 3 | 0 | 2008-08-12T05:51:01.947000 | 2008-08-31T11:40:56.760000 |
8,532 | 9,085 | With Lucene: Why do I get a Too Many Clauses error if I do a prefix search? | I've had an app doing prefix searches for a while. Recently the index size was increased and it turned out that some prefixes were too darned numerous for lucene to handle. It kept throwing me a Too Many Clauses error, which was very frustrating as I kept looking at my JARs and confirming that none of the included code... | I've hit this before. It has to do with the fact that lucene, under the covers, turns many (all?) things into boolean queries when you call Query.rewrite() From: http://web.archive.org/web/20110915061619/http://lucene.apache.org:80/java/2_2_0/api/org/apache/lucene/search/Query.html public Query rewrite(IndexReader read... | With Lucene: Why do I get a Too Many Clauses error if I do a prefix search? I've had an app doing prefix searches for a while. Recently the index size was increased and it turned out that some prefixes were too darned numerous for lucene to handle. It kept throwing me a Too Many Clauses error, which was very frustratin... | TITLE:
With Lucene: Why do I get a Too Many Clauses error if I do a prefix search?
QUESTION:
I've had an app doing prefix searches for a while. Recently the index size was increased and it turned out that some prefixes were too darned numerous for lucene to handle. It kept throwing me a Too Many Clauses error, which w... | [
"exception",
"lucene"
] | 8 | 5 | 7,032 | 3 | 0 | 2008-08-12T06:04:48.940000 | 2008-08-12T17:58:08.627000 |
8,545 | 8,559 | Closet server versus Colo? | As a programmer I need a place to store my stuff. I've been running a server in my parents closet for a long time, but I recently came across a decent 2U server. I have no experience dealing with hosting companies, beyond the very cheap stuff, and I'm wondering what I should look for in a colo or if I should just keep ... | There are three major factors here. Cost. The colo will obviously be more expensive than sticking a server in your parents' closet. Quality. The colo should be a lot more reliable than the server in your parents' closet. They aren't as likely to go down when there's a power surge. They should provide some support if th... | Closet server versus Colo? As a programmer I need a place to store my stuff. I've been running a server in my parents closet for a long time, but I recently came across a decent 2U server. I have no experience dealing with hosting companies, beyond the very cheap stuff, and I'm wondering what I should look for in a col... | TITLE:
Closet server versus Colo?
QUESTION:
As a programmer I need a place to store my stuff. I've been running a server in my parents closet for a long time, but I recently came across a decent 2U server. I have no experience dealing with hosting companies, beyond the very cheap stuff, and I'm wondering what I should... | [
"hardware",
"storage"
] | 1 | 3 | 654 | 3 | 0 | 2008-08-12T06:18:08.680000 | 2008-08-12T06:48:26.340000 |
8,546 | 8,553 | Is there a "try to lock, skip if timed out" operation in C#? | I need to try to lock on an object, and if its already locked just continue (after time out, or without it). The C# lock statement is blocking. | I believe that you can use Monitor.TryEnter(). The lock statement just translates to a Monitor.Enter() call and a try catch block. | Is there a "try to lock, skip if timed out" operation in C#? I need to try to lock on an object, and if its already locked just continue (after time out, or without it). The C# lock statement is blocking. | TITLE:
Is there a "try to lock, skip if timed out" operation in C#?
QUESTION:
I need to try to lock on an object, and if its already locked just continue (after time out, or without it). The C# lock statement is blocking.
ANSWER:
I believe that you can use Monitor.TryEnter(). The lock statement just translates to a M... | [
"c#",
"multithreading",
"locking"
] | 74 | 44 | 33,959 | 6 | 0 | 2008-08-12T06:19:38.550000 | 2008-08-12T06:29:24.070000 |
8,549 | 8,580 | Visual Studio refactoring: Remove method | Is there any Visual Studio Add-In that can do the remove method refactoring? Suppose you have the following method: Result DoSomething(parameters) { return ComputeResult(parameters); } Or the variant where Result is void. The purpose of the refactoring is to replace all the calls to DoSomething with calls to ComputeRes... | If I understand the question, then Resharper calls this 'inline method' - Ctrl - R + I | Visual Studio refactoring: Remove method Is there any Visual Studio Add-In that can do the remove method refactoring? Suppose you have the following method: Result DoSomething(parameters) { return ComputeResult(parameters); } Or the variant where Result is void. The purpose of the refactoring is to replace all the call... | TITLE:
Visual Studio refactoring: Remove method
QUESTION:
Is there any Visual Studio Add-In that can do the remove method refactoring? Suppose you have the following method: Result DoSomething(parameters) { return ComputeResult(parameters); } Or the variant where Result is void. The purpose of the refactoring is to re... | [
"visual-studio",
"refactoring",
"methods"
] | 7 | 6 | 7,326 | 6 | 0 | 2008-08-12T06:22:06.377000 | 2008-08-12T07:48:33.443000 |
8,569 | 13,367 | What's your "best practice" for the first Java EE Spring project? | I'm currently trying to get into the Java EE development with the Spring framework. As I'm new to Spring, it is hard to imaging how a good running project should start off. Do you have any best practices, tipps or major DO NOTs for a starter? How did you start with Spring - big project or small tutorial-like applicatio... | Small tip - I've found it helpful to modularize and clearly label my Spring xml context files based on application concern. Here's an example for a web app I worked on: MyProject / src / main / resources / spring / datasource.xml - My single data source bean. persistence.xml - My DAOs/Repositories. Depends on datasourc... | What's your "best practice" for the first Java EE Spring project? I'm currently trying to get into the Java EE development with the Spring framework. As I'm new to Spring, it is hard to imaging how a good running project should start off. Do you have any best practices, tipps or major DO NOTs for a starter? How did you... | TITLE:
What's your "best practice" for the first Java EE Spring project?
QUESTION:
I'm currently trying to get into the Java EE development with the Spring framework. As I'm new to Spring, it is hard to imaging how a good running project should start off. Do you have any best practices, tipps or major DO NOTs for a st... | [
"java",
"spring",
"jakarta-ee",
"aop"
] | 32 | 28 | 11,733 | 11 | 0 | 2008-08-12T07:36:14.107000 | 2008-08-16T21:12:19.233000 |
8,585 | 8,593 | Watch for change in ip address status | Is there a way to watch for changes in the ip-address much the same as it is possible to watch for changes to files using the FileSystemWatcher? I'm connecting to a machine via tcp/ip but it takes a while until it gives me an ip-address. I would like to dim out the connect button until I have a valid ip-address. | Check NetworkChange class. It raises an event when a network address changes. | Watch for change in ip address status Is there a way to watch for changes in the ip-address much the same as it is possible to watch for changes to files using the FileSystemWatcher? I'm connecting to a machine via tcp/ip but it takes a while until it gives me an ip-address. I would like to dim out the connect button u... | TITLE:
Watch for change in ip address status
QUESTION:
Is there a way to watch for changes in the ip-address much the same as it is possible to watch for changes to files using the FileSystemWatcher? I'm connecting to a machine via tcp/ip but it takes a while until it gives me an ip-address. I would like to dim out th... | [
".net",
"windows"
] | 5 | 6 | 585 | 1 | 0 | 2008-08-12T07:53:40.857000 | 2008-08-12T07:59:54.573000 |
8,599 | 8,655 | Best binary XML format for JavaME | Can anyone recommend a good binary XML format? It's for a JavaME application, so it needs to be a) Easy to implement on the server, and b) Easy to write a low-footprint parser for on a low-end JavaME client device. And it goes without saying that it needs to be smaller than XML, and faster to parse. The data would be s... | You might want to take a look at wbxml (Wireless Binary XML) it is optimized for size, and often used on mobile phones, but it is not optimized for parsing speed. | Best binary XML format for JavaME Can anyone recommend a good binary XML format? It's for a JavaME application, so it needs to be a) Easy to implement on the server, and b) Easy to write a low-footprint parser for on a low-end JavaME client device. And it goes without saying that it needs to be smaller than XML, and fa... | TITLE:
Best binary XML format for JavaME
QUESTION:
Can anyone recommend a good binary XML format? It's for a JavaME application, so it needs to be a) Easy to implement on the server, and b) Easy to write a low-footprint parser for on a low-end JavaME client device. And it goes without saying that it needs to be smalle... | [
"java",
"xml",
"java-me",
"mobile"
] | 10 | 6 | 1,685 | 4 | 0 | 2008-08-12T08:08:11.327000 | 2008-08-12T10:42:35.917000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.