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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9,702 | 9,857 | Default database IDs; system and user values | As part of our current database work, we are looking at a dealing with the process of updating databases. A point which has been brought up recurrently, is that of dealing with system vs. user values; in our project user and system vals are stored together. For example... We have a list of templates. 1, 2, 3, These are... | I have never had problems (performance or development - TDD & unit testing included) using GUIDs as the ID for my databases, and I've worked on some pretty big ones. Have a look here, here and here if you want to find out more about using GUIDs (and the potential GOTCHAS involved) as your primary keys - but I can't rec... | Default database IDs; system and user values As part of our current database work, we are looking at a dealing with the process of updating databases. A point which has been brought up recurrently, is that of dealing with system vs. user values; in our project user and system vals are stored together. For example... We... | TITLE:
Default database IDs; system and user values
QUESTION:
As part of our current database work, we are looking at a dealing with the process of updating databases. A point which has been brought up recurrently, is that of dealing with system vs. user values; in our project user and system vals are stored together.... | [
"database"
] | 1 | 1 | 994 | 6 | 0 | 2008-08-13T12:23:37.863000 | 2008-08-13T14:06:58.013000 |
9,704 | 9,708 | How to prevent the mouse cursor from being hidden after calling CComboBox::ShowDropDown? | In my MFC application, when I call CComboBox::ShowDropDown(), the mouse cursor is hidden until interaction with the combo box completes (when the combo box loses focus.) It doesn't reappear when the mouse is moved, like it does with edit boxes. How can I keep the mouse cursor from being hidden? | Call SetCursor(LoadCursor(NULL, IDC_ARROW)); immediately after the ShowDropDown() call. | How to prevent the mouse cursor from being hidden after calling CComboBox::ShowDropDown? In my MFC application, when I call CComboBox::ShowDropDown(), the mouse cursor is hidden until interaction with the combo box completes (when the combo box loses focus.) It doesn't reappear when the mouse is moved, like it does wit... | TITLE:
How to prevent the mouse cursor from being hidden after calling CComboBox::ShowDropDown?
QUESTION:
In my MFC application, when I call CComboBox::ShowDropDown(), the mouse cursor is hidden until interaction with the combo box completes (when the combo box loses focus.) It doesn't reappear when the mouse is moved... | [
"mfc",
"mouse",
"visibility",
"ccombobox"
] | 2 | 3 | 2,328 | 1 | 0 | 2008-08-13T12:28:57.057000 | 2008-08-13T12:31:26.023000 |
9,729 | 22,058 | How to extend project properties page? | Is it possible to add a custom tab to a project properties page in the Visual Studio 2008? What I want to do is to be able to add a custom tab to properties page for the projects created from default project templates (WPF Application, WPF custom controls library, etc). | Keith, I'm working on VS add-in for WPF applications localization. I want to be able to manage project specific settings via "project properties" page. I did some research and it seems that it is not possible to extend existing projects in this way. | How to extend project properties page? Is it possible to add a custom tab to a project properties page in the Visual Studio 2008? What I want to do is to be able to add a custom tab to properties page for the projects created from default project templates (WPF Application, WPF custom controls library, etc). | TITLE:
How to extend project properties page?
QUESTION:
Is it possible to add a custom tab to a project properties page in the Visual Studio 2008? What I want to do is to be able to add a custom tab to properties page for the projects created from default project templates (WPF Application, WPF custom controls library... | [
"visual-studio",
"visual-studio-2008",
"vsx",
"extensibility"
] | 4 | 3 | 2,481 | 2 | 0 | 2008-08-13T12:50:10.557000 | 2008-08-22T10:50:17.123000 |
9,734 | 9,747 | C#.Net case-insensitive string | Why does C#.Net allow the declaration of the string object to be case-insensitive? String sHello = "Hello"; string sHello = "Hello"; Both the lower-case and upper-case S of the word String are acceptable and this seems to be the only object that allows this. Can anyone explain why? | string is a language keyword while System.String is the type it aliases. Both compile to exactly the same thing, similarly: int is System.Int32 long is System.Int64 float is System.Single double is System.Double char is System.Char byte is System.Byte short is System.Int16 ushort is System.UInt16 uint is System.UInt32 ... | C#.Net case-insensitive string Why does C#.Net allow the declaration of the string object to be case-insensitive? String sHello = "Hello"; string sHello = "Hello"; Both the lower-case and upper-case S of the word String are acceptable and this seems to be the only object that allows this. Can anyone explain why? | TITLE:
C#.Net case-insensitive string
QUESTION:
Why does C#.Net allow the declaration of the string object to be case-insensitive? String sHello = "Hello"; string sHello = "Hello"; Both the lower-case and upper-case S of the word String are acceptable and this seems to be the only object that allows this. Can anyone e... | [
"c#",
".net"
] | 7 | 21 | 2,778 | 7 | 0 | 2008-08-13T12:53:20.550000 | 2008-08-13T12:57:34.520000 |
9,751 | 15,415 | Sending emails without looking like spam | I want so send every week an update by email. But Im afraid that if there are too many emails sent, they will be marked as spam. Any of you has experience sending many emails (thousands) weekly? What techniques do you use? | A good answer for this question would be a real gold mine for a motivated spammer:) Not really -- as you'll see in that other thread, answers center on showing that you are the authorative sender of the email, and various aspects that are useless to spammers and useful to non-spammers who send a lot of email. | Sending emails without looking like spam I want so send every week an update by email. But Im afraid that if there are too many emails sent, they will be marked as spam. Any of you has experience sending many emails (thousands) weekly? What techniques do you use? | TITLE:
Sending emails without looking like spam
QUESTION:
I want so send every week an update by email. But Im afraid that if there are too many emails sent, they will be marked as spam. Any of you has experience sending many emails (thousands) weekly? What techniques do you use?
ANSWER:
A good answer for this questi... | [
"asp.net",
"email"
] | 5 | 2 | 2,527 | 1 | 0 | 2008-08-13T13:01:08.023000 | 2008-08-19T00:12:23.860000 |
9,783 | 9,798 | Oracle XE or SQL Server Express | I'm starting a new project here (Windows Forms). What's the best option today for a small (free as in beer) DBMS? I've used SQL Server Express on the past projects, but time and time again I hear people saying that the product from Oracle is faster and more powerful. It will be used in a small company (around 20 users)... | Sorry, no link, but one advice. Because we support Oracle and SQL Server, I know that getting fixes for the 'normal' Oracle database, is not something what I call fun. You have to pay for it, and if you have no tool which updates your Oracle system for you, it's a pain in the a.., if you ask me. Check out how the Oracl... | Oracle XE or SQL Server Express I'm starting a new project here (Windows Forms). What's the best option today for a small (free as in beer) DBMS? I've used SQL Server Express on the past projects, but time and time again I hear people saying that the product from Oracle is faster and more powerful. It will be used in a... | TITLE:
Oracle XE or SQL Server Express
QUESTION:
I'm starting a new project here (Windows Forms). What's the best option today for a small (free as in beer) DBMS? I've used SQL Server Express on the past projects, but time and time again I hear people saying that the product from Oracle is faster and more powerful. It... | [
"sql-server",
"database",
"oracle-xe"
] | 8 | 3 | 9,632 | 9 | 0 | 2008-08-13T13:18:30.950000 | 2008-08-13T13:32:06.430000 |
9,805 | 9,851 | Calculate DateTime Weeks into Rows | I am currently writing a small calendar in ASP.Net C#. Currently to produce the rows of the weeks I do the following for loop: var iWeeks = 6; for (int w = 0; w < iWeeks; w++) { This works fine, however, some month will only have 5 weeks and in some rare cases, 4. How can I calculate the number of rows that will be req... | Here is the method that does it: public int GetWeekRows(int year, int month) { DateTime firstDayOfMonth = new DateTime(year, month, 1); DateTime lastDayOfMonth = new DateTime(year, month, 1).AddMonths(1).AddDays(-1); System.Globalization.Calendar calendar = System.Threading.Thread.CurrentThread.CurrentCulture.Calendar;... | Calculate DateTime Weeks into Rows I am currently writing a small calendar in ASP.Net C#. Currently to produce the rows of the weeks I do the following for loop: var iWeeks = 6; for (int w = 0; w < iWeeks; w++) { This works fine, however, some month will only have 5 weeks and in some rare cases, 4. How can I calculate ... | TITLE:
Calculate DateTime Weeks into Rows
QUESTION:
I am currently writing a small calendar in ASP.Net C#. Currently to produce the rows of the weeks I do the following for loop: var iWeeks = 6; for (int w = 0; w < iWeeks; w++) { This works fine, however, some month will only have 5 weeks and in some rare cases, 4. Ho... | [
"c#",
"asp.net"
] | 8 | 6 | 5,890 | 9 | 0 | 2008-08-13T13:38:56.043000 | 2008-08-13T14:03:39.223000 |
9,831 | 12,910 | Mootools: Drag & Drop problems | I've asked this question to the forums on the Mootools website and one person said that my class selection was corrupted before an admin came along and changed my post status to invalid. Needless to say this did not help much. I then posted to a google group for Mootools with no response. My question is why doesn't the... | Ok, it looks like there are a couple of issues here. As far as I can tell, there is no such thing as a "droppable" in mootools. This means your events like 'enter', 'leave' and 'drop' won't work. (These are events on the drag object) If you change those names to events that elements in mootools have (as in, DOM events)... | Mootools: Drag & Drop problems I've asked this question to the forums on the Mootools website and one person said that my class selection was corrupted before an admin came along and changed my post status to invalid. Needless to say this did not help much. I then posted to a google group for Mootools with no response.... | TITLE:
Mootools: Drag & Drop problems
QUESTION:
I've asked this question to the forums on the Mootools website and one person said that my class selection was corrupted before an admin came along and changed my post status to invalid. Needless to say this did not help much. I then posted to a google group for Mootools... | [
"javascript",
"drag-and-drop",
"mootools"
] | 6 | 3 | 3,000 | 2 | 0 | 2008-08-13T13:49:51.963000 | 2008-08-16T00:13:57.603000 |
9,836 | 9,848 | Developer Friendly ERP | My company is currently using Sage MAS as their ERP system. While integrating our shopping cart is not going to be impossible, it uses COM and has it's own challenges. I was wondering if there was a more developer friendly ERP out there. I have looked into Microsoft Dynamics but getting information on ERP systems that ... | MS Dyanamics is very cool app. V3 was fully Web Serviced V4 i assume even more- all actions are exposed as webservices, there is a big license hit on MS CRM due to "internet" licensing. We use CRMv3 in a totally.NET SOA here and its great. You should have no problems doing the integration - security aside => | Developer Friendly ERP My company is currently using Sage MAS as their ERP system. While integrating our shopping cart is not going to be impossible, it uses COM and has it's own challenges. I was wondering if there was a more developer friendly ERP out there. I have looked into Microsoft Dynamics but getting informati... | TITLE:
Developer Friendly ERP
QUESTION:
My company is currently using Sage MAS as their ERP system. While integrating our shopping cart is not going to be impossible, it uses COM and has it's own challenges. I was wondering if there was a more developer friendly ERP out there. I have looked into Microsoft Dynamics but... | [
"c#",
"erp"
] | 5 | 2 | 3,248 | 3 | 0 | 2008-08-13T13:51:48.450000 | 2008-08-13T14:01:50.647000 |
9,846 | 10,301 | Performance critical GUI application (windows,linux) | I've been tasked with updating a series of applications which are performance critical VB.NET apps that essentially just monitor and return networking statistics. I've only got three requirements: convert it to C#, make it fast, and make it stable One caveat is that we "may" migrate from a.NET platform to linux "soon" ... | First off, I would put some time into trying out a few VB.NET to C# converters. You're basically porting syntax, and there's no reason to do that by hand if you don't have to. Sure, you might have to clean up what comes out of the converter, but that's way better than a by-hand conversion. Now, as for your questions: 1... | Performance critical GUI application (windows,linux) I've been tasked with updating a series of applications which are performance critical VB.NET apps that essentially just monitor and return networking statistics. I've only got three requirements: convert it to C#, make it fast, and make it stable One caveat is that ... | TITLE:
Performance critical GUI application (windows,linux)
QUESTION:
I've been tasked with updating a series of applications which are performance critical VB.NET apps that essentially just monitor and return networking statistics. I've only got three requirements: convert it to C#, make it fast, and make it stable O... | [
".net",
"windows",
"linux",
"user-interface"
] | 5 | 5 | 3,503 | 12 | 0 | 2008-08-13T14:00:55.280000 | 2008-08-13T19:47:04.350000 |
9,877 | 9,903 | Personal Website Construction | I'm currently trying to build a personal website to create a presence on the web for myself. My plan is to include content such as my resume, any projects that I have done on my own and links to open source projects that I have contributed to, and so on. However, I'm not sure which approach would be better from a persp... | I've toyed with this idea in the past but I don't think it's really a good idea for a number of reasons. Firstly, there are a number of places that can take care of most of this without you needing to do the work or maintenance. Just signing up for a linkedIn account for example will allow you to get most of your needs... | Personal Website Construction I'm currently trying to build a personal website to create a presence on the web for myself. My plan is to include content such as my resume, any projects that I have done on my own and links to open source projects that I have contributed to, and so on. However, I'm not sure which approac... | TITLE:
Personal Website Construction
QUESTION:
I'm currently trying to build a personal website to create a presence on the web for myself. My plan is to include content such as my resume, any projects that I have done on my own and links to open source projects that I have contributed to, and so on. However, I'm not ... | [
"content-management-system"
] | 33 | 27 | 4,230 | 11 | 0 | 2008-08-13T14:22:20.947000 | 2008-08-13T14:42:06.430000 |
9,882 | 12,466 | Looking for algorithm that reverses the sprintf() function output | I am working on a project that requires the parsing of log files. I am looking for a fast algorithm that would take groups messages like this: The temperature at P1 is 35F. The temperature at P1 is 40F. The temperature at P3 is 35F. Logger stopped. Logger started. The temperature at P1 is 40F. and puts out something in... | Overview: A naïve!! algorithm keeps track of the frequency of words in a per-column manner, where one can assume that each line can be separated into columns with a delimiter. Example input: The dog jumped over the moon The cat jumped over the moon The moon jumped over the moon The car jumped over the moon Frequencies:... | Looking for algorithm that reverses the sprintf() function output I am working on a project that requires the parsing of log files. I am looking for a fast algorithm that would take groups messages like this: The temperature at P1 is 35F. The temperature at P1 is 40F. The temperature at P3 is 35F. Logger stopped. Logge... | TITLE:
Looking for algorithm that reverses the sprintf() function output
QUESTION:
I am working on a project that requires the parsing of log files. I am looking for a fast algorithm that would take groups messages like this: The temperature at P1 is 35F. The temperature at P1 is 40F. The temperature at P3 is 35F. Log... | [
"algorithm",
"parsing",
"logging",
"printf",
"normalizing"
] | 5 | 6 | 1,828 | 10 | 0 | 2008-08-13T14:25:58.133000 | 2008-08-15T16:45:12.813000 |
9,905 | 20,225 | Check for hung Office process when using Office Automation | Is there a way to check to see if an Microsoft Office process (i.e. Word, Excel) has hung when using Office Automation? Additionally, if the process is hung, is there a way to terminate it? | Let me start off saying that I don't recommend doing this in a service on a server, but I'll do my best to answer the questions. Running as a service makes it difficult to clean up. For example with what you have running as a service survive killing a hung word or excel. You may be in a position to have to kill the ser... | Check for hung Office process when using Office Automation Is there a way to check to see if an Microsoft Office process (i.e. Word, Excel) has hung when using Office Automation? Additionally, if the process is hung, is there a way to terminate it? | TITLE:
Check for hung Office process when using Office Automation
QUESTION:
Is there a way to check to see if an Microsoft Office process (i.e. Word, Excel) has hung when using Office Automation? Additionally, if the process is hung, is there a way to terminate it?
ANSWER:
Let me start off saying that I don't recomme... | [
"language-agnostic",
"ms-office",
"office-automation"
] | 3 | 2 | 1,252 | 3 | 0 | 2008-08-13T14:42:52.887000 | 2008-08-21T15:24:36.957000 |
9,926 | 20,736 | Analyzing Multithreaded Programs | We have a codebase that is several years old, and all the original developers are long gone. It uses many, many threads, but with no apparent design or common architectural principles. Every developer had his own style of multithreaded programming, so some threads communicate with one another using queues, some lock da... | Invest in a copy of Intel's VTune and its thread profiling tools. It will give you both a system and a source level view of the thread behaviour. It's certainly not going to autodocument the thing for you, but should be a real help in at least visualising what is happening in different circumstances. I think there is a... | Analyzing Multithreaded Programs We have a codebase that is several years old, and all the original developers are long gone. It uses many, many threads, but with no apparent design or common architectural principles. Every developer had his own style of multithreaded programming, so some threads communicate with one a... | TITLE:
Analyzing Multithreaded Programs
QUESTION:
We have a codebase that is several years old, and all the original developers are long gone. It uses many, many threads, but with no apparent design or common architectural principles. Every developer had his own style of multithreaded programming, so some threads comm... | [
"multithreading",
"concurrency"
] | 7 | 6 | 2,989 | 7 | 0 | 2008-08-13T15:09:51.757000 | 2008-08-21T18:38:14.323000 |
9,932 | 9,957 | What is a good way to open large files across a WAN? | I have an application deployed into multiple zones and there are some issues with opening larger documents (20-50MB) across the WAN. Currently the documents are stored in Zone 1 (Americas) and a link stored in the database to the docs. I have heard some things about blobs in oracle and store binary in MS SQL Server 200... | Your best option here may be caching the document in the requested zone the first time it is requested, and pinging the source document's last modified each time the cached document is requested in order to determine if it needs refreshed. In this case you're only requesting a small piece of information (a date) across... | What is a good way to open large files across a WAN? I have an application deployed into multiple zones and there are some issues with opening larger documents (20-50MB) across the WAN. Currently the documents are stored in Zone 1 (Americas) and a link stored in the database to the docs. I have heard some things about ... | TITLE:
What is a good way to open large files across a WAN?
QUESTION:
I have an application deployed into multiple zones and there are some issues with opening larger documents (20-50MB) across the WAN. Currently the documents are stored in Zone 1 (Americas) and a link stored in the database to the docs. I have heard ... | [
"sql-server",
"database",
"oracle"
] | 1 | 2 | 415 | 2 | 0 | 2008-08-13T15:16:50.713000 | 2008-08-13T15:37:44.697000 |
9,938 | 9,972 | Generic iterator | I am trying to find a generic way of accessing a set of containers. I have a standard vector and list in addition to another custom list. The custom list defines an iterator; class Iterator: public std::iterator { //... }
Iterator begin() { return (Iterator(root)); }
Iterator end() { return (Iterator(NULL)); } with t... | Here are some articles you might find of interest Giving STL Iterators a Base Class Type Erasure for C++ Iterators any_iterator Class Reference | Generic iterator I am trying to find a generic way of accessing a set of containers. I have a standard vector and list in addition to another custom list. The custom list defines an iterator; class Iterator: public std::iterator { //... }
Iterator begin() { return (Iterator(root)); }
Iterator end() { return (Iterator... | TITLE:
Generic iterator
QUESTION:
I am trying to find a generic way of accessing a set of containers. I have a standard vector and list in addition to another custom list. The custom list defines an iterator; class Iterator: public std::iterator { //... }
Iterator begin() { return (Iterator(root)); }
Iterator end() ... | [
"c++",
"generics",
"iteration",
"containers"
] | 34 | 22 | 19,966 | 3 | 0 | 2008-08-13T15:22:47.847000 | 2008-08-13T15:47:35.707000 |
9,974 | 9,996 | Query times out from web app but runs fine from management studio | This is a question I asked on another forum which received some decent answers, but I wanted to see if anyone here has more insight. The problem is that you have one of your pages in a web application timing out when it gets to a stored procedure call, so you use Sql Profiler, or your application trace logs, to find th... | This is what I've learned so far from my research..NET sends in connection settings that are not the same as what you get when you log in to management studio. Here is what you see if you sniff the connection with Sql Profiler: -- network protocol: TCP/IP set quoted_identifier off set arithabort off set numeric_roundab... | Query times out from web app but runs fine from management studio This is a question I asked on another forum which received some decent answers, but I wanted to see if anyone here has more insight. The problem is that you have one of your pages in a web application timing out when it gets to a stored procedure call, s... | TITLE:
Query times out from web app but runs fine from management studio
QUESTION:
This is a question I asked on another forum which received some decent answers, but I wanted to see if anyone here has more insight. The problem is that you have one of your pages in a web application timing out when it gets to a stored... | [
"sql",
"sql-server",
"sql-server-2005"
] | 33 | 31 | 19,392 | 8 | 0 | 2008-08-13T15:49:41.317000 | 2008-08-13T16:01:51.730000 |
9,977 | 10,045 | What do you look for from a User Group? | I'm in the process of starting a User Group in my area related to.NET development. The format of the community will be the average free food, presentation, and then maybe free swag giveaway. What would you, as a member of a user community, look for in order to keep you coming back month to month? | It's true that some of the talks out there are very rudimentary, unfortunately some times the bulk of your crowd may need that. I consider myself a novice in a lot of fields, but I've attend talks that I thought were beneath me and still people were asking very basic questions. Perhaps it would be worth having a bi-mon... | What do you look for from a User Group? I'm in the process of starting a User Group in my area related to.NET development. The format of the community will be the average free food, presentation, and then maybe free swag giveaway. What would you, as a member of a user community, look for in order to keep you coming bac... | TITLE:
What do you look for from a User Group?
QUESTION:
I'm in the process of starting a User Group in my area related to.NET development. The format of the community will be the average free food, presentation, and then maybe free swag giveaway. What would you, as a member of a user community, look for in order to k... | [
".net"
] | 1 | 4 | 409 | 3 | 0 | 2008-08-13T15:50:56.510000 | 2008-08-13T16:30:28.303000 |
10,006 | 10,162 | What is the easiest way to add compression to WCF in Silverlight? | I have a silverlight 2 beta 2 application that accesses a WCF web service. Because of this, it currently can only use basicHttp binding. The webservice will return fairly large amounts of XML data. This seems fairly wasteful from a bandwidth usage standpoint as the response, if zipped, would be smaller by a factor of 5... | If you are using IIS7, take a look at the Compression Module. This allows you to configure compression for HTTP requests to your server. | What is the easiest way to add compression to WCF in Silverlight? I have a silverlight 2 beta 2 application that accesses a WCF web service. Because of this, it currently can only use basicHttp binding. The webservice will return fairly large amounts of XML data. This seems fairly wasteful from a bandwidth usage standp... | TITLE:
What is the easiest way to add compression to WCF in Silverlight?
QUESTION:
I have a silverlight 2 beta 2 application that accesses a WCF web service. Because of this, it currently can only use basicHttp binding. The webservice will return fairly large amounts of XML data. This seems fairly wasteful from a band... | [
"wcf",
"silverlight",
"compression",
"gzip"
] | 24 | 10 | 19,691 | 4 | 0 | 2008-08-13T16:08:43.680000 | 2008-08-13T18:22:03.273000 |
10,038 | 10,054 | Animation in javascript, a starting point | I understand how JS is run and I think I understand most of the DOM but I've no idea about animation. Does anybody here know of a good guide that can explain to me how it's done in Javascript? In addition, should I even consider Javascript for animation? Should I instead be looking to learn flash? | Avoid flash, its a horrible requirement, uncrawlable by Google, unsopported by a bunch of browsers and systems (eg iPhone) and most importantly: it forces you to reinvent web standards (e.g. scroll bars and whatnot), Javascript on the other hand is easier to maintain and code for in the noscript case. try scriptaculous... | Animation in javascript, a starting point I understand how JS is run and I think I understand most of the DOM but I've no idea about animation. Does anybody here know of a good guide that can explain to me how it's done in Javascript? In addition, should I even consider Javascript for animation? Should I instead be loo... | TITLE:
Animation in javascript, a starting point
QUESTION:
I understand how JS is run and I think I understand most of the DOM but I've no idea about animation. Does anybody here know of a good guide that can explain to me how it's done in Javascript? In addition, should I even consider Javascript for animation? Shoul... | [
"javascript",
"animation"
] | 9 | 4 | 1,378 | 4 | 0 | 2008-08-13T16:26:10.463000 | 2008-08-13T16:36:44.780000 |
10,042 | 25,311 | How do I create a Linked List Data Structure in Java? | What's the best way to make a linked list in Java? | The obvious solution to developers familiar to Java is to use the LinkedList class already provided in java.util. Say, however, you wanted to make your own implementation for some reason. Here is a quick example of a linked list that inserts a new link at the beginning of the list, deletes from the beginning of the lis... | How do I create a Linked List Data Structure in Java? What's the best way to make a linked list in Java? | TITLE:
How do I create a Linked List Data Structure in Java?
QUESTION:
What's the best way to make a linked list in Java?
ANSWER:
The obvious solution to developers familiar to Java is to use the LinkedList class already provided in java.util. Say, however, you wanted to make your own implementation for some reason. ... | [
"java",
"data-structures",
"linked-list"
] | 136 | 220 | 427,911 | 6 | 0 | 2008-08-13T16:29:22.063000 | 2008-08-24T20:03:56.310000 |
10,059 | 10,555 | Removing icon from Windows title bars without ditching close button or system menu? | I'm developing an MFC application and I've recently been searching for a good method to remove the icon from a Windows title bar, but retain the close button. The two obvious candidate solutions are turning off the system menu style or using the tool window style, but I would prefer not to disable the system menu or us... | You can use WM_NCRBUTTONDOWN to detect if the user has right-clicked on your caption and then bring up the system menu. | Removing icon from Windows title bars without ditching close button or system menu? I'm developing an MFC application and I've recently been searching for a good method to remove the icon from a Windows title bar, but retain the close button. The two obvious candidate solutions are turning off the system menu style or ... | TITLE:
Removing icon from Windows title bars without ditching close button or system menu?
QUESTION:
I'm developing an MFC application and I've recently been searching for a good method to remove the icon from a Windows title bar, but retain the close button. The two obvious candidate solutions are turning off the sys... | [
"c++",
"windows",
"user-interface",
"mfc"
] | 7 | 2 | 4,184 | 6 | 0 | 2008-08-13T16:42:40.570000 | 2008-08-14T01:28:13.567000 |
10,071 | 10,157 | Compact Framework/Threading - MessageBox displays over other controls after option is chosen | I'm working on an app that grabs and installs a bunch of updates off an an external server, and need some help with threading. The user follows this process: Clicks button Method checks for updates, count is returned. If greater than 0, then ask the user if they want to install using MessageBox.Show(). If yes, it runs ... | Your UI isn't updating because all the work is happening in the user interface thread. Your call to: this.BeginInvoke((MethodInvoker)delegate() {update.Action.Run(); }) is saying invoke update.Action.Run() on the thread that created "this" (your form), which is the user interface thread. Application.DoEvents() will ind... | Compact Framework/Threading - MessageBox displays over other controls after option is chosen I'm working on an app that grabs and installs a bunch of updates off an an external server, and need some help with threading. The user follows this process: Clicks button Method checks for updates, count is returned. If greate... | TITLE:
Compact Framework/Threading - MessageBox displays over other controls after option is chosen
QUESTION:
I'm working on an app that grabs and installs a bunch of updates off an an external server, and need some help with threading. The user follows this process: Clicks button Method checks for updates, count is r... | [
"c#",
"winforms",
"multithreading",
"compact-framework"
] | 4 | 6 | 4,563 | 3 | 0 | 2008-08-13T16:55:51.387000 | 2008-08-13T18:17:23.483000 |
10,083 | 10,107 | better command for Windows? | While I grew up using MSWindows, I transitioned to my much-loved Mac years ago. I don't want to start a flame war here on operating systems. I do, however, want a terminal a litle closer to what I'm used to. I'm not asking for full POSIX support - I don't have the patience to install Cygwin - but I miss tabbed terminal... | Some more options: MSYS: a Minimal SYStem providing a POSIX compatible Bourne shell environment, with a small collection of UNIX command line tools. Primarily developed as a means to execute the configure scripts and Makefiles used to build Open Source software, but also useful as a general purpose command line interfa... | better command for Windows? While I grew up using MSWindows, I transitioned to my much-loved Mac years ago. I don't want to start a flame war here on operating systems. I do, however, want a terminal a litle closer to what I'm used to. I'm not asking for full POSIX support - I don't have the patience to install Cygwin ... | TITLE:
better command for Windows?
QUESTION:
While I grew up using MSWindows, I transitioned to my much-loved Mac years ago. I don't want to start a flame war here on operating systems. I do, however, want a terminal a litle closer to what I'm used to. I'm not asking for full POSIX support - I don't have the patience ... | [
"windows",
"macos",
"command-line",
"terminal"
] | 13 | 6 | 6,553 | 10 | 0 | 2008-08-13T17:06:04.127000 | 2008-08-13T17:27:16.440000 |
10,088 | 10,180 | Where is TFS work item help text displayed? | I'm creating some custom work items in TFS and the helptext field seems handy but I don't see where it is being displayed in Team Explorer or Team System Web Access. Where is this information displayed? | When you hover over the type of the field. For instance create a new bug and hover over the "rank" and you should see "Stack rank used to prioritize work" | Where is TFS work item help text displayed? I'm creating some custom work items in TFS and the helptext field seems handy but I don't see where it is being displayed in Team Explorer or Team System Web Access. Where is this information displayed? | TITLE:
Where is TFS work item help text displayed?
QUESTION:
I'm creating some custom work items in TFS and the helptext field seems handy but I don't see where it is being displayed in Team Explorer or Team System Web Access. Where is this information displayed?
ANSWER:
When you hover over the type of the field. For... | [
"visual-studio",
"tfs"
] | 3 | 2 | 591 | 1 | 0 | 2008-08-13T17:09:26.210000 | 2008-08-13T18:30:52.723000 |
10,098 | 10,192 | Best mock framework that can do both WebForms and MVC? | I'm getting into more of a TDD workflow, and have a mix of MVC and asp.net Web Forms apps. MOQ is recommended for MVC. I've used Rhino for Web Forms. Does anyone have a best practice for having 1 framework mock for both? | Rhino's latest release includes much of the sweet sweet 3.5 love that MoQ has. I'm a fan of MoQ, so that's what I'm using. But I also have Rhino, in case it does something that MoQ doesn't do. TL;DR: MoQ it baby. | Best mock framework that can do both WebForms and MVC? I'm getting into more of a TDD workflow, and have a mix of MVC and asp.net Web Forms apps. MOQ is recommended for MVC. I've used Rhino for Web Forms. Does anyone have a best practice for having 1 framework mock for both? | TITLE:
Best mock framework that can do both WebForms and MVC?
QUESTION:
I'm getting into more of a TDD workflow, and have a mix of MVC and asp.net Web Forms apps. MOQ is recommended for MVC. I've used Rhino for Web Forms. Does anyone have a best practice for having 1 framework mock for both?
ANSWER:
Rhino's latest re... | [
"c#",
"asp.net",
"asp.net-mvc",
"testing"
] | 2 | 1 | 3,601 | 5 | 0 | 2008-08-13T17:16:33.857000 | 2008-08-13T18:38:46.733000 |
10,123 | 10,129 | How do I treat an integer as an array of bytes in Python? | I'm trying to decode the result of the Python os.wait() function. This returns, according to the Python docs: a tuple containing its pid and exit status indication: a 16-bit number, whose low byte is the signal number that killed the process, and whose high byte is the exit status (if the signal number is zero); the hi... | This will do what you want: signum = status & 0xff exitstatus = (status & 0xff00) >> 8 | How do I treat an integer as an array of bytes in Python? I'm trying to decode the result of the Python os.wait() function. This returns, according to the Python docs: a tuple containing its pid and exit status indication: a 16-bit number, whose low byte is the signal number that killed the process, and whose high byte... | TITLE:
How do I treat an integer as an array of bytes in Python?
QUESTION:
I'm trying to decode the result of the Python os.wait() function. This returns, according to the Python docs: a tuple containing its pid and exit status indication: a 16-bit number, whose low byte is the signal number that killed the process, a... | [
"python"
] | 15 | 14 | 5,096 | 7 | 0 | 2008-08-13T17:46:41.940000 | 2008-08-13T17:56:34.167000 |
10,149 | 10,161 | How do I bind a regular expression to a key combination in emacs? | For context, I am something of an emacs newbie. I haven't used it for very long, but have been using it more and more (I like it a lot). Also I'm comfortable with lisp, but not super familiar with elisp. What I need to do is bind a regular expression to a keyboard combination because I use this particular regex so ofte... | You can use macros, just do C-x ( then do everything for the macro, then C-x ) to end the macro, then C-x e will execute the last defined macro. Then, you can name it using M-x name-last-kbd-macro which lets you assign a name to it, which you can then invoke with M-x TESTIT, then store the definition using M-x insert-k... | How do I bind a regular expression to a key combination in emacs? For context, I am something of an emacs newbie. I haven't used it for very long, but have been using it more and more (I like it a lot). Also I'm comfortable with lisp, but not super familiar with elisp. What I need to do is bind a regular expression to ... | TITLE:
How do I bind a regular expression to a key combination in emacs?
QUESTION:
For context, I am something of an emacs newbie. I haven't used it for very long, but have been using it more and more (I like it a lot). Also I'm comfortable with lisp, but not super familiar with elisp. What I need to do is bind a regu... | [
"regex",
"emacs",
"lisp"
] | 6 | 6 | 1,882 | 4 | 0 | 2008-08-13T18:15:09.340000 | 2008-08-13T18:21:06.830000 |
10,190 | 10,194 | How to return a page of results from SQL? | Many applications have grids that display data from a database table one page at a time. Many of them also let the user pick the number of records per page, sort by any column, and navigate back and forth through the results. What's a good algorithm to implement this pattern without bringing the entire table to the cli... | On MS SQL Server 2005 and above, ROW_NUMBER() seems to work: T-SQL: Paging with ROW_NUMBER() DECLARE @PageNum AS INT; DECLARE @PageSize AS INT; SET @PageNum = 2; SET @PageSize = 10;
WITH OrdersRN AS ( SELECT ROW_NUMBER() OVER(ORDER BY OrderDate, OrderID) AS RowNum,OrderID,OrderDate,CustomerID,EmployeeID FROM dbo.Order... | How to return a page of results from SQL? Many applications have grids that display data from a database table one page at a time. Many of them also let the user pick the number of records per page, sort by any column, and navigate back and forth through the results. What's a good algorithm to implement this pattern wi... | TITLE:
How to return a page of results from SQL?
QUESTION:
Many applications have grids that display data from a database table one page at a time. Many of them also let the user pick the number of records per page, sort by any column, and navigate back and forth through the results. What's a good algorithm to impleme... | [
".net",
"sql",
"linq",
"pagination"
] | 11 | 11 | 20,141 | 8 | 0 | 2008-08-13T18:38:02.740000 | 2008-08-13T18:40:32.220000 |
10,205 | 10,262 | Delimited string parsing? | I'm looking at parsing a delimited string, something on the order of a,b,c But this is a very simple example, and parsing delimited data can get complex; for instance 1,"Your simple algorithm, it fails",True would blow your naiive string.Split implementation to bits. Is there anything I can freely use/steal/copy and pa... | I use this to read from a file string filename = @textBox1.Text; string[] fields; string[] delimiter = new string[] {"|"}; using (Microsoft.VisualBasic.FileIO.TextFieldParser parser = new Microsoft.VisualBasic.FileIO.TextFieldParser(filename)) { parser.Delimiters = delimiter; parser.HasFieldsEnclosedInQuotes = false;
... | Delimited string parsing? I'm looking at parsing a delimited string, something on the order of a,b,c But this is a very simple example, and parsing delimited data can get complex; for instance 1,"Your simple algorithm, it fails",True would blow your naiive string.Split implementation to bits. Is there anything I can fr... | TITLE:
Delimited string parsing?
QUESTION:
I'm looking at parsing a delimited string, something on the order of a,b,c But this is a very simple example, and parsing delimited data can get complex; for instance 1,"Your simple algorithm, it fails",True would blow your naiive string.Split implementation to bits. Is there... | [
"c#",
"text-parsing",
"csv"
] | 2 | 4 | 4,366 | 9 | 0 | 2008-08-13T18:46:44.517000 | 2008-08-13T19:18:26.730000 |
10,228 | 10,321 | Run PHPUnit Tests in Certain Order | Is there a way to get the tests inside of a TestCase to run in a certain order? For example, I want to separate the life cycle of an object from creation to use to destruction but I need to make sure that the object is set up first before I run the other tests. | Maybe there is a design problem in your tests. Usually each test must not depend on any other tests, so they can run in any order. Each test needs to instantiate and destroy everything it needs to run, that would be the perfect approach, you should never share objects and states between tests. Can you be more specific ... | Run PHPUnit Tests in Certain Order Is there a way to get the tests inside of a TestCase to run in a certain order? For example, I want to separate the life cycle of an object from creation to use to destruction but I need to make sure that the object is set up first before I run the other tests. | TITLE:
Run PHPUnit Tests in Certain Order
QUESTION:
Is there a way to get the tests inside of a TestCase to run in a certain order? For example, I want to separate the life cycle of an object from creation to use to destruction but I need to make sure that the object is set up first before I run the other tests.
ANSW... | [
"php",
"unit-testing",
"phpunit"
] | 82 | 62 | 45,304 | 9 | 0 | 2008-08-13T19:02:23.660000 | 2008-08-13T20:13:42.830000 |
10,229 | 10,484 | Multithreading Design Best Practice | Consider this problem: I have a program which should fetch (let's say) 100 records from a database, and then for each one it should get updated information from a web service. There are two ways to introduce parallelism in this scenario: I start each request to the web service on a new Thread. The number of simultaneou... | Option 3 is the best: Use Async IO. Unless your request processing is complex and heavy, your program is going to spend 99% of it's time waiting for the HTTP requests. This is exactly what Async IO is designed for - Let the windows networking stack (or.net framework or whatever) worry about all the waiting, and just us... | Multithreading Design Best Practice Consider this problem: I have a program which should fetch (let's say) 100 records from a database, and then for each one it should get updated information from a web service. There are two ways to introduce parallelism in this scenario: I start each request to the web service on a n... | TITLE:
Multithreading Design Best Practice
QUESTION:
Consider this problem: I have a program which should fetch (let's say) 100 records from a database, and then for each one it should get updated information from a web service. There are two ways to introduce parallelism in this scenario: I start each request to the ... | [
".net",
"multithreading"
] | 3 | 6 | 732 | 4 | 0 | 2008-08-13T19:03:21.427000 | 2008-08-13T23:35:50.270000 |
10,230 | 10,233 | Checking for string contents? string Length Vs Empty String | Which is more efficient for the compiler and the best practice for checking whether a string is blank? Checking whether the length of the string == 0 Checking whether the string is empty (strVar == "") Also, does the answer depend on language? | Yes, it depends on language, since string storage differs between languages. Pascal-type strings: Length = 0. C-style strings: [0] == 0..NET:.IsNullOrEmpty. Etc. | Checking for string contents? string Length Vs Empty String Which is more efficient for the compiler and the best practice for checking whether a string is blank? Checking whether the length of the string == 0 Checking whether the string is empty (strVar == "") Also, does the answer depend on language? | TITLE:
Checking for string contents? string Length Vs Empty String
QUESTION:
Which is more efficient for the compiler and the best practice for checking whether a string is blank? Checking whether the length of the string == 0 Checking whether the string is empty (strVar == "") Also, does the answer depend on language... | [
"string",
"optimization",
"language-agnostic",
"compiler-construction"
] | 20 | 19 | 20,287 | 14 | 0 | 2008-08-13T19:03:27.683000 | 2008-08-13T19:05:42.357000 |
10,260 | 10,811 | What are the useful new ASP.NET features in the .NET Framework 3.5? | I've kept up to date with new features in the C# language as it's moved from version 1 through version 3. I haven't done such a good job keeping up to date with ASP.NET. I feel like some of the post version 1 features are not so good (e.g. the AJAX framework) or are just not that useful to me (e.g. the membership frame... | For ASP.NET, you have a lot of improvements: split view (code and design) faster switching between code and design view embedded master pages (one master page in another) javascript debugging Anyway most of the useful stuff are really in the meat of the language, and for.NET 3.5 the new language features for C# 3.0 wil... | What are the useful new ASP.NET features in the .NET Framework 3.5? I've kept up to date with new features in the C# language as it's moved from version 1 through version 3. I haven't done such a good job keeping up to date with ASP.NET. I feel like some of the post version 1 features are not so good (e.g. the AJAX fra... | TITLE:
What are the useful new ASP.NET features in the .NET Framework 3.5?
QUESTION:
I've kept up to date with new features in the C# language as it's moved from version 1 through version 3. I haven't done such a good job keeping up to date with ASP.NET. I feel like some of the post version 1 features are not so good ... | [
"asp.net"
] | 7 | 8 | 637 | 13 | 0 | 2008-08-13T19:18:07.667000 | 2008-08-14T08:39:11.060000 |
10,274 | 10,287 | When should I not use the ThreadPool in .Net? | When should I not use the ThreadPool in.Net? It looks like the best option is to use a ThreadPool, in which case, why is it not the only option? What are your experiences around this? | The only reason why I wouldn't use the ThreadPool for cheap multithreading is if I need to… interract with the method running (e.g., to kill it) run code on a STA thread (this happened to me) keep the thread alive after my application has died ( ThreadPool threads are background threads) in case I need to change the pr... | When should I not use the ThreadPool in .Net? When should I not use the ThreadPool in.Net? It looks like the best option is to use a ThreadPool, in which case, why is it not the only option? What are your experiences around this? | TITLE:
When should I not use the ThreadPool in .Net?
QUESTION:
When should I not use the ThreadPool in.Net? It looks like the best option is to use a ThreadPool, in which case, why is it not the only option? What are your experiences around this?
ANSWER:
The only reason why I wouldn't use the ThreadPool for cheap mul... | [
"c#",
".net",
"multithreading",
"design-decisions"
] | 40 | 18 | 17,943 | 9 | 0 | 2008-08-13T19:24:22.337000 | 2008-08-13T19:32:25.253000 |
10,300 | 45,655 | Validating posted form data in the ASP.NET MVC framework | I've been playing around with the ASP.NET MVC Framework and the one thing that's really confusing me is how I'm meant to do server side validation of posted form data. I presume I don't post back to the same URL, but if I don't, how do I redisplay the form with the entered data and error messages? Also, where should th... | You might want to take a look at ScottGu's latest post for ASP.Net prev 5. It walks through a validation sample that is very interesting: http://weblogs.asp.net/scottgu/archive/2008/09/02/asp-net-mvc-preview-5-and-form-posting-scenarios.aspx | Validating posted form data in the ASP.NET MVC framework I've been playing around with the ASP.NET MVC Framework and the one thing that's really confusing me is how I'm meant to do server side validation of posted form data. I presume I don't post back to the same URL, but if I don't, how do I redisplay the form with t... | TITLE:
Validating posted form data in the ASP.NET MVC framework
QUESTION:
I've been playing around with the ASP.NET MVC Framework and the one thing that's really confusing me is how I'm meant to do server side validation of posted form data. I presume I don't post back to the same URL, but if I don't, how do I redispl... | [
"asp.net-mvc",
"validation"
] | 10 | 4 | 6,236 | 6 | 0 | 2008-08-13T19:45:33.917000 | 2008-09-05T12:29:11.297000 |
10,308 | 10,461 | Graphical representation of SVN branch/merge activity | Are you aware of any tool that creates diagrams showing the branch/merge activity in a SVN repository? We've all seen these diagrams in various tutorials. Some good, some not so good. Can they be created automatically (or maybe with a little prodding -- you might have to tell it what if your branching philosophy is dev... | prior to SVN 1.5 (which has been out all of a month or so), it didn't track merges at all, so the bits where branches 'reconnect' to the trunk are impossible for it to do anyway | Graphical representation of SVN branch/merge activity Are you aware of any tool that creates diagrams showing the branch/merge activity in a SVN repository? We've all seen these diagrams in various tutorials. Some good, some not so good. Can they be created automatically (or maybe with a little prodding -- you might ha... | TITLE:
Graphical representation of SVN branch/merge activity
QUESTION:
Are you aware of any tool that creates diagrams showing the branch/merge activity in a SVN repository? We've all seen these diagrams in various tutorials. Some good, some not so good. Can they be created automatically (or maybe with a little proddi... | [
"svn"
] | 32 | 2 | 26,768 | 4 | 0 | 2008-08-13T19:55:06.393000 | 2008-08-13T23:08:59.777000 |
10,309 | 10,338 | Whats the best way of finding ALL your memory when developing on the Compact Framework? | I've used the CF Remote Performance Monitor, however this seems to only track memory initialised in the managed world as opposed to the unmanaged world. Well, I can only presume this as the numbers listed in the profiler are way short of the maximum allowed (32mb on CE 5). Profiling a particular app with the RPM showed... | Try enabling Interop logging. Also, if you have access to the code of the native dll you are using, check this out: http://msdn.microsoft.com/en-us/netframework/bb630228.aspx | Whats the best way of finding ALL your memory when developing on the Compact Framework? I've used the CF Remote Performance Monitor, however this seems to only track memory initialised in the managed world as opposed to the unmanaged world. Well, I can only presume this as the numbers listed in the profiler are way sho... | TITLE:
Whats the best way of finding ALL your memory when developing on the Compact Framework?
QUESTION:
I've used the CF Remote Performance Monitor, however this seems to only track memory initialised in the managed world as opposed to the unmanaged world. Well, I can only presume this as the numbers listed in the pr... | [
"compact-framework",
"windows-ce"
] | 6 | 3 | 1,016 | 3 | 0 | 2008-08-13T19:56:52.707000 | 2008-08-13T20:33:46.253000 |
10,313 | 30,296 | Can I copy files to a Network Place from a script or the command line? | Is it possible, in Windows XP, to copy files to a Network Place from the command line, a batch file or, even better, a PowerShell script? What sent me down this road of research was trying to publish files to a WSS 3.0 document library from a user's machine. I can't map a drive to the library in question because the WS... | From what I'm seeing, it seems that it's not possible to directly access/ manipulate a Network Place from the command line, be it in PowerShell or the plain ol' command prompt. @slipsec (#13899): Thanks for the suggestion, but PowerShell doesn't support the port number in the destination path any more than the net use ... | Can I copy files to a Network Place from a script or the command line? Is it possible, in Windows XP, to copy files to a Network Place from the command line, a batch file or, even better, a PowerShell script? What sent me down this road of research was trying to publish files to a WSS 3.0 document library from a user's... | TITLE:
Can I copy files to a Network Place from a script or the command line?
QUESTION:
Is it possible, in Windows XP, to copy files to a Network Place from the command line, a batch file or, even better, a PowerShell script? What sent me down this road of research was trying to publish files to a WSS 3.0 document lib... | [
"powershell",
"scripting",
"command-line",
"moss",
"wss"
] | 12 | 1 | 58,615 | 9 | 0 | 2008-08-13T20:02:06.533000 | 2008-08-27T14:35:37.993000 |
10,314 | 11,994 | How do you name your instance/param values? | Being new to Objective-C (but a long term C/++) programmer I'm looking for advice/recommendations on naming conventions for variables. My personal preference would be to utilize a prefix for instance variables both for clarity within functions and to prevent shadowing of function parameters. However I'm a fan of proper... | Most Cocoa projects use underbar as a non- IBOutlet instance variable prefix, and use no prefix for IBOutlet instance variables. The reason I don't use underbars for IBOutlet instance variables is that when a nib file is loaded, if you have a setter method for a connected outlet, that setter will be called. However thi... | How do you name your instance/param values? Being new to Objective-C (but a long term C/++) programmer I'm looking for advice/recommendations on naming conventions for variables. My personal preference would be to utilize a prefix for instance variables both for clarity within functions and to prevent shadowing of func... | TITLE:
How do you name your instance/param values?
QUESTION:
Being new to Objective-C (but a long term C/++) programmer I'm looking for advice/recommendations on naming conventions for variables. My personal preference would be to utilize a prefix for instance variables both for clarity within functions and to prevent... | [
"objective-c",
"cocoa"
] | 4 | 15 | 3,113 | 10 | 0 | 2008-08-13T20:03:53.503000 | 2008-08-15T05:32:40.293000 |
10,323 | 10,350 | Why doesn't Ruby have a real StringBuffer or StringIO? | I recently read a nice post on using StringIO in Ruby. What the author doesn't mention, though, is that StringIO is just an "I." There's no "O." You can't do this, for example: s = StringIO.new s << 'foo' s << 'bar' s.to_s # => should be "foo\nbar" # => really is ''` Ruby really needs a StringBuffer just like the one J... | I looked at the ruby documentation for StringIO, and it looks like what you want is StringIO#string, not StringIO#to_s Thus, change your code to: s = StringIO.new s << 'foo' s << 'bar' s.string | Why doesn't Ruby have a real StringBuffer or StringIO? I recently read a nice post on using StringIO in Ruby. What the author doesn't mention, though, is that StringIO is just an "I." There's no "O." You can't do this, for example: s = StringIO.new s << 'foo' s << 'bar' s.to_s # => should be "foo\nbar" # => really is '... | TITLE:
Why doesn't Ruby have a real StringBuffer or StringIO?
QUESTION:
I recently read a nice post on using StringIO in Ruby. What the author doesn't mention, though, is that StringIO is just an "I." There's no "O." You can't do this, for example: s = StringIO.new s << 'foo' s << 'bar' s.to_s # => should be "foo\nbar... | [
"ruby",
"string",
"io",
"buffer"
] | 57 | 128 | 31,690 | 5 | 0 | 2008-08-13T20:19:09.807000 | 2008-08-13T20:41:29.153000 |
10,349 | 10,359 | In WinForms, why can't you update UI controls from other threads? | I'm sure there is a good (or at least decent) reason for this. What is it? | Because you can easily end up with a deadlock (among other issues). For exmaple, your secondary thread could be trying to update the UI control, but the UI control will be waiting for a resource locked by the secondary thread to be released, so both threads end up waiting for each other to finish. As others have commen... | In WinForms, why can't you update UI controls from other threads? I'm sure there is a good (or at least decent) reason for this. What is it? | TITLE:
In WinForms, why can't you update UI controls from other threads?
QUESTION:
I'm sure there is a good (or at least decent) reason for this. What is it?
ANSWER:
Because you can easily end up with a deadlock (among other issues). For exmaple, your secondary thread could be trying to update the UI control, but the... | [
"winforms",
"multithreading"
] | 18 | 8 | 8,290 | 7 | 0 | 2008-08-13T20:41:24.927000 | 2008-08-13T20:47:12.760000 |
10,366 | 11,197 | Style display not working in Firefox, Opera, Safari - (IE7 is OK) | I have an absolutely positioned div that I want to show when the user clicks a link. The onclick of the link calls a js function that sets the display of the div to block (also tried: "", inline, table-cell, inline-table, etc). This works great in IE7, not at all in every other browser I've tried (FF2, FF3, Opera 9.5, ... | Since setting the properties with javascript never seemed to work, but setting using Firebug's inspect did, I started to suspect that the javascript ID selector was broken - maybe there were multiple items in the DOM with the same ID? The source didn't show that there were, but looping through all divs using javascript... | Style display not working in Firefox, Opera, Safari - (IE7 is OK) I have an absolutely positioned div that I want to show when the user clicks a link. The onclick of the link calls a js function that sets the display of the div to block (also tried: "", inline, table-cell, inline-table, etc). This works great in IE7, n... | TITLE:
Style display not working in Firefox, Opera, Safari - (IE7 is OK)
QUESTION:
I have an absolutely positioned div that I want to show when the user clicks a link. The onclick of the link calls a js function that sets the display of the div to block (also tried: "", inline, table-cell, inline-table, etc). This wor... | [
"javascript",
"html",
"css"
] | 15 | 7 | 44,719 | 9 | 0 | 2008-08-13T20:59:54.360000 | 2008-08-14T15:23:10.273000 |
10,412 | 10,423 | How can a Word document be created in C#? | I have a project where I would like to generate a report export in MS Word format. The report will include images/graphs, tables, and text. What is the best way to do this? Third party tools? What are your experiences? | The answer is going to depend slightly upon if the application is running on a server or if it is running on the client machine. If you are running on a server then you are going to want to use one of the XML based office generation formats as there are know issues when using Office Automation on a server. However, if ... | How can a Word document be created in C#? I have a project where I would like to generate a report export in MS Word format. The report will include images/graphs, tables, and text. What is the best way to do this? Third party tools? What are your experiences? | TITLE:
How can a Word document be created in C#?
QUESTION:
I have a project where I would like to generate a report export in MS Word format. The report will include images/graphs, tables, and text. What is the best way to do this? Third party tools? What are your experiences?
ANSWER:
The answer is going to depend sl... | [
"c#",
".net",
"ms-word",
"openxml"
] | 74 | 49 | 82,427 | 17 | 0 | 2008-08-13T22:07:45.173000 | 2008-08-13T22:19:48.597000 |
10,435 | 267,243 | Impersonation in IIS 7.0 | I have a website that works correctly under IIS 6.0: It authenticates users with windows credentials, and then when talking to the service that hits the DB, it passes the credentials. In IIS 7.0, the same config settings do not pass the credentials, and the DB gets hit with NT AUTHORITY\ANONYMOUS. Is there something I'... | There has been changes between IIS7 and IIS6.0. I found for you one blog post that might actually help you ( click here to see it ). Are you running your application in Integrated Mode or in Classic Mode? From what I saw, putting the Impersonate attribute at true should display you a 500 error with the following error ... | Impersonation in IIS 7.0 I have a website that works correctly under IIS 6.0: It authenticates users with windows credentials, and then when talking to the service that hits the DB, it passes the credentials. In IIS 7.0, the same config settings do not pass the credentials, and the DB gets hit with NT AUTHORITY\ANONYMO... | TITLE:
Impersonation in IIS 7.0
QUESTION:
I have a website that works correctly under IIS 6.0: It authenticates users with windows credentials, and then when talking to the service that hits the DB, it passes the credentials. In IIS 7.0, the same config settings do not pass the credentials, and the DB gets hit with NT... | [
"configuration",
"iis-7",
"impersonation"
] | 7 | 8 | 14,440 | 4 | 0 | 2008-08-13T22:31:17.153000 | 2008-11-06T00:13:52.377000 |
10,456 | 10,463 | HowTo Disable WebBrowser 'Click Sound' in your app only | The 'click sound' in question is actually a system wide preference, so I only want it to be disabled when my application has focus and then re-enable when the application closes/loses focus. Originally, I wanted to ask this question here on stackoverflow, but I was not yet in the beta. So, after googling for the answer... | I've noticed that if you use WebBrowser.Document.Write rather than WebBrowser.DocumentText then the click sound doesn't happen. So instead of this: webBrowser1.DocumentText = " Hello, world! "; try this: webBrowser1.Document.OpenNew(true); webBrowser1.Document.Write(" Hello, world! "); | HowTo Disable WebBrowser 'Click Sound' in your app only The 'click sound' in question is actually a system wide preference, so I only want it to be disabled when my application has focus and then re-enable when the application closes/loses focus. Originally, I wanted to ask this question here on stackoverflow, but I wa... | TITLE:
HowTo Disable WebBrowser 'Click Sound' in your app only
QUESTION:
The 'click sound' in question is actually a system wide preference, so I only want it to be disabled when my application has focus and then re-enable when the application closes/loses focus. Originally, I wanted to ask this question here on stack... | [
"c#",
".net",
"winforms"
] | 28 | 12 | 14,862 | 5 | 0 | 2008-08-13T23:01:01.477000 | 2008-08-13T23:10:16.810000 |
10,475 | 10,479 | Touch Typing Software recommendations | Since the keyboard is the interface we use to the computer, I've always thought touch typing should be something I should learn, but I've always been, well, lazy is the word. So, anyone recommend any good touch typing software? It's easy enough to google, but I'ld like to hear recommendations. | Typing of the Dead! It's a good few years old so you may have to hunt around, but it's a lot of fun and as well as the main game there are numerous minigames to practice specific areas you may be weak on. | Touch Typing Software recommendations Since the keyboard is the interface we use to the computer, I've always thought touch typing should be something I should learn, but I've always been, well, lazy is the word. So, anyone recommend any good touch typing software? It's easy enough to google, but I'ld like to hear reco... | TITLE:
Touch Typing Software recommendations
QUESTION:
Since the keyboard is the interface we use to the computer, I've always thought touch typing should be something I should learn, but I've always been, well, lazy is the word. So, anyone recommend any good touch typing software? It's easy enough to google, but I'ld... | [
"editor",
"touch-typing"
] | 26 | 28 | 8,117 | 14 | 0 | 2008-08-13T23:29:38.707000 | 2008-08-13T23:32:27.560000 |
10,477 | 10,538 | Equidistant points across Bezier curves | Currently, I'm attempting to make multiple beziers have equidistant points. I'm currently using cubic interpolation to find the points, but because the way beziers work some areas are more dense than others and proving gross for texture mapping because of the variable distance. Is there a way to find points on a bezier... | distance between P_0 and P_3 (in cubic form), yes, but I think you knew that, is straight forward. Distance on a curve is just arc length: fig 1 http://www.codecogs.com/eq.latex?%5Cint_%7Bt_0%7D%5E%7Bt_1%7D%20%7B%20|P'(t)|%20dt where: fig 2 http://www.codecogs.com/eq.latex?P%27(t)%20=%20[%7Bx%27,y%27,z%27%7D]%20=%20[%7... | Equidistant points across Bezier curves Currently, I'm attempting to make multiple beziers have equidistant points. I'm currently using cubic interpolation to find the points, but because the way beziers work some areas are more dense than others and proving gross for texture mapping because of the variable distance. I... | TITLE:
Equidistant points across Bezier curves
QUESTION:
Currently, I'm attempting to make multiple beziers have equidistant points. I'm currently using cubic interpolation to find the points, but because the way beziers work some areas are more dense than others and proving gross for texture mapping because of the va... | [
"graphics",
"interpolation",
"bezier",
"curve"
] | 9 | 3 | 5,139 | 3 | 0 | 2008-08-13T23:31:32.697000 | 2008-08-14T00:47:05.103000 |
10,478 | 10,502 | Getting selected text in a browser, cross-platform | One of the things I'd like to do in my browser-based application is allow the user to select some text (not in a, just plain ol' text!), and have my application pop up a small toolbar that then can interact with the next (in my case, add annotations). I've found a lot of stuff on google that seems to be focused on writ... | Have a look at jQuery and the wrapSelection plugin. It may be what you are looking for. | Getting selected text in a browser, cross-platform One of the things I'd like to do in my browser-based application is allow the user to select some text (not in a, just plain ol' text!), and have my application pop up a small toolbar that then can interact with the next (in my case, add annotations). I've found a lot ... | TITLE:
Getting selected text in a browser, cross-platform
QUESTION:
One of the things I'd like to do in my browser-based application is allow the user to select some text (not in a, just plain ol' text!), and have my application pop up a small toolbar that then can interact with the next (in my case, add annotations).... | [
"javascript",
"browser"
] | 14 | 8 | 9,918 | 6 | 0 | 2008-08-13T23:32:09.370000 | 2008-08-13T23:52:35.400000 |
10,486 | 10,513 | Unit test execution speed (how many tests per second?) | What kind of execution rate do you aim for with your unit tests (# test per second)? How long is too long for an individual unit test? I'd be interested in knowing if people have any specific thresholds for determining whether their tests are too slow, or is it just when the friction of a long running test suite gets t... | All unit tests should run in under a second (that is all unit tests combined should run in 1 second). Now I'm sure this has practical limits, but I've had a project with a 1000 tests that run this fast on a laptop. You'll really want this speed so your developers don't dread refactoring some core part of the model (i.e... | Unit test execution speed (how many tests per second?) What kind of execution rate do you aim for with your unit tests (# test per second)? How long is too long for an individual unit test? I'd be interested in knowing if people have any specific thresholds for determining whether their tests are too slow, or is it jus... | TITLE:
Unit test execution speed (how many tests per second?)
QUESTION:
What kind of execution rate do you aim for with your unit tests (# test per second)? How long is too long for an individual unit test? I'd be interested in knowing if people have any specific thresholds for determining whether their tests are too ... | [
"unit-testing",
"performance"
] | 27 | 30 | 19,020 | 10 | 0 | 2008-08-13T23:36:28.130000 | 2008-08-14T00:08:30.467000 |
10,499 | 29,807 | Oracle - What TNS Names file am I using? | Sometimes I get Oracle connection problems because I can't figure out which tnsnames.ora file my database client is using. What's the best way to figure this out? ++happy for various platform solutions. | Oracle provides a utility called tnsping: R:\>tnsping someconnection
TNS Ping Utility for 32-bit Windows: Version 9.0.1.3.1 - Production on 27-AUG-20 08 10:38:07
Copyright (c) 1997 Oracle Corporation. All rights reserved.
Used parameter files: C:\Oracle92\network\ADMIN\sqlnet.ora C:\Oracle92\network\ADMIN\tnsnames.o... | Oracle - What TNS Names file am I using? Sometimes I get Oracle connection problems because I can't figure out which tnsnames.ora file my database client is using. What's the best way to figure this out? ++happy for various platform solutions. | TITLE:
Oracle - What TNS Names file am I using?
QUESTION:
Sometimes I get Oracle connection problems because I can't figure out which tnsnames.ora file my database client is using. What's the best way to figure this out? ++happy for various platform solutions.
ANSWER:
Oracle provides a utility called tnsping: R:\>tns... | [
"oracle",
"connection",
"tnsnames",
"tns"
] | 60 | 88 | 238,802 | 11 | 0 | 2008-08-13T23:49:15.623000 | 2008-08-27T09:41:36.483000 |
10,506 | 10,549 | Weird DB2 issue with DBUnit | I am having a strange DB2 issue when I run DBUnit tests. My DBUnit tests are highly customized, but I don't think it is the issue. When I run the tests, I get a failure: SQLCODE: -1084, SQLSTATE: 57019 which translates to SQL1084C Shared memory segments cannot be allocated. It sounds like a weird memory issue, though h... | Well, I think I fixed it by doing the following: db2stop force db2start At least, things seem to be working now..... | Weird DB2 issue with DBUnit I am having a strange DB2 issue when I run DBUnit tests. My DBUnit tests are highly customized, but I don't think it is the issue. When I run the tests, I get a failure: SQLCODE: -1084, SQLSTATE: 57019 which translates to SQL1084C Shared memory segments cannot be allocated. It sounds like a ... | TITLE:
Weird DB2 issue with DBUnit
QUESTION:
I am having a strange DB2 issue when I run DBUnit tests. My DBUnit tests are highly customized, but I don't think it is the issue. When I run the tests, I get a failure: SQLCODE: -1084, SQLSTATE: 57019 which translates to SQL1084C Shared memory segments cannot be allocated.... | [
"java",
"db2",
"dbunit",
"db2-luw"
] | 3 | 2 | 1,858 | 2 | 0 | 2008-08-13T23:57:01.567000 | 2008-08-14T01:05:31.087000 |
10,515 | 10,519 | What do I need to run PHP applications on IIS? | Having been a PHP developer on LAMP servers for quite a while, is there anything that I will need to take into consideration while preparing an application for IIS on windows. | Make sure you get the FastCGI extension for IIS 6.0 or IIS 7.0. It is the single most important thing you can have when running PHP under IIS. Also this article should get you setup: http://learn.iis.net/page.aspx/247/using-fastcgi-to-host-php-applications-on-iis-60/ Everything beyond this is simple, MySQL and what not... | What do I need to run PHP applications on IIS? Having been a PHP developer on LAMP servers for quite a while, is there anything that I will need to take into consideration while preparing an application for IIS on windows. | TITLE:
What do I need to run PHP applications on IIS?
QUESTION:
Having been a PHP developer on LAMP servers for quite a while, is there anything that I will need to take into consideration while preparing an application for IIS on windows.
ANSWER:
Make sure you get the FastCGI extension for IIS 6.0 or IIS 7.0. It is ... | [
"php",
"windows",
"iis",
"portability",
"lamp"
] | 9 | 9 | 2,031 | 7 | 0 | 2008-08-14T00:12:18.980000 | 2008-08-14T00:17:03.463000 |
10,524 | 718,366 | Expression.Invoke in Entity Framework? | The Entity Framework does not support the Expression.Invoke operator. You receive the following exception when trying to use it: "The LINQ expression node type 'Invoke' is not supported in LINQ to Entities. Has anyone got a workaround for this missing functionality? I would like to use the PredicateBuilder detailed her... | PredicateBuilder and LINQKit now support Entity Framework. Sorry, guys, for not doing this earlier! | Expression.Invoke in Entity Framework? The Entity Framework does not support the Expression.Invoke operator. You receive the following exception when trying to use it: "The LINQ expression node type 'Invoke' is not supported in LINQ to Entities. Has anyone got a workaround for this missing functionality? I would like t... | TITLE:
Expression.Invoke in Entity Framework?
QUESTION:
The Entity Framework does not support the Expression.Invoke operator. You receive the following exception when trying to use it: "The LINQ expression node type 'Invoke' is not supported in LINQ to Entities. Has anyone got a workaround for this missing functionali... | [
".net",
"linq",
"entity-framework",
"linq-to-entities"
] | 29 | 31 | 15,365 | 2 | 0 | 2008-08-14T00:24:43.320000 | 2009-04-05T04:56:19.300000 |
10,532 | 10,542 | What's the preferred way to connect to a postgresql database from PHP? | I've been using PHP & MySQL for ages and am about to start using PostgreSQL instead. What's the preferred method? Is it via the PDO objects or is there something better? | PDO objects are the new hotness. I'd recommend that as long as you can ensure that your target platform will always be running PHP 5.2+. There are many other database abstraction layers that support PostgreSQL that are compatible with older versions of PHP; I'd recommend ADODB. You should really be using PDO or a diffe... | What's the preferred way to connect to a postgresql database from PHP? I've been using PHP & MySQL for ages and am about to start using PostgreSQL instead. What's the preferred method? Is it via the PDO objects or is there something better? | TITLE:
What's the preferred way to connect to a postgresql database from PHP?
QUESTION:
I've been using PHP & MySQL for ages and am about to start using PostgreSQL instead. What's the preferred method? Is it via the PDO objects or is there something better?
ANSWER:
PDO objects are the new hotness. I'd recommend that ... | [
"php",
"postgresql"
] | 8 | 5 | 882 | 6 | 0 | 2008-08-14T00:36:20.287000 | 2008-08-14T00:54:51.030000 |
10,533 | 10,573 | Parsing attributes with regex in Perl | Here's a problem I ran into recently. I have attributes strings of the form "x=1 and y=abc and z=c4g and..." Some attributes have numeric values, some have alpha values, some have mixed, some have dates, etc. Every string is supposed to have " x=someval and y=anotherval " at the beginning, but some don't. I have three ... | I'm not the best at regular expressions, but this seems pretty close to what you're looking for: /x=(.+) and y=([^ ]+)( and (.*))?/ Except you use $1, $2, and $4. In use: my @strs = ("x=1 and y=abc and z=c4g and w=v4l", "x=yes and y=no", "z=nox and w=noy");
foreach (@strs) { if ($_ =~ /x=(.+) and y=([^ ]+)( and (.*))?... | Parsing attributes with regex in Perl Here's a problem I ran into recently. I have attributes strings of the form "x=1 and y=abc and z=c4g and..." Some attributes have numeric values, some have alpha values, some have mixed, some have dates, etc. Every string is supposed to have " x=someval and y=anotherval " at the be... | TITLE:
Parsing attributes with regex in Perl
QUESTION:
Here's a problem I ran into recently. I have attributes strings of the form "x=1 and y=abc and z=c4g and..." Some attributes have numeric values, some have alpha values, some have mixed, some have dates, etc. Every string is supposed to have " x=someval and y=anot... | [
"regex",
"perl"
] | 2 | 1 | 4,316 | 5 | 0 | 2008-08-14T00:40:26.753000 | 2008-08-14T01:56:53.480000 |
10,564 | 773,973 | How can I set up an editor to work with Git on Windows? | I'm trying out Git on Windows. I got to the point of trying "git commit" and I got this error: Terminal is dumb but no VISUAL nor EDITOR defined. Please supply the message using either -m or -F option. So I figured out I need to have an environment variable called EDITOR. No problem. I set it to point to Notepad. That ... | Update September 2015 (6 years later) The last release of git-for-Windows (2.5.3) now includes: By configuring git config core.editor notepad, users can now use notepad.exe as their default editor. Configuring git config format.commitMessageColumns 72 will be picked up by the notepad wrapper and line-wrap the commit me... | How can I set up an editor to work with Git on Windows? I'm trying out Git on Windows. I got to the point of trying "git commit" and I got this error: Terminal is dumb but no VISUAL nor EDITOR defined. Please supply the message using either -m or -F option. So I figured out I need to have an environment variable called... | TITLE:
How can I set up an editor to work with Git on Windows?
QUESTION:
I'm trying out Git on Windows. I got to the point of trying "git commit" and I got this error: Terminal is dumb but no VISUAL nor EDITOR defined. Please supply the message using either -m or -F option. So I figured out I need to have an environme... | [
"windows",
"git",
"cygwin",
"editor"
] | 655 | 639 | 428,890 | 37 | 0 | 2008-08-14T01:43:04.270000 | 2009-04-21T18:34:54.007000 |
10,580 | 10,587 | What is the difference between Early and Late Binding? | What is the difference between early and late binding? | The short answer is that early (or static) binding refers to compile time binding and late (or dynamic) binding refers to runtime binding (for example when you use reflection). | What is the difference between Early and Late Binding? What is the difference between early and late binding? | TITLE:
What is the difference between Early and Late Binding?
QUESTION:
What is the difference between early and late binding?
ANSWER:
The short answer is that early (or static) binding refers to compile time binding and late (or dynamic) binding refers to runtime binding (for example when you use reflection). | [
"binding",
"dynamic-binding",
"static-binding"
] | 107 | 69 | 121,655 | 8 | 0 | 2008-08-14T02:10:53.873000 | 2008-08-14T02:24:04.047000 |
10,586 | 10,713 | Small modification to an XML document using StAX | I'm currently trying to read in an XML file, make some minor changes (alter the value of some attributes), and write it back out again. I have intended to use a StAX parser ( javax.xml.stream.XMLStreamReader ) to read in each event, see if it was one I wanted to change, and then pass it straight on to the StAX writer (... | StAX works pretty well and is very fast. I used it in a project to parse XML files which are up to 20MB. I don't have a thorough analysis, but it was definitely faster than SAX. As for your question: The difference between streaming and event-handling, AFAIK is control. With the streaming API you can walk through your ... | Small modification to an XML document using StAX I'm currently trying to read in an XML file, make some minor changes (alter the value of some attributes), and write it back out again. I have intended to use a StAX parser ( javax.xml.stream.XMLStreamReader ) to read in each event, see if it was one I wanted to change, ... | TITLE:
Small modification to an XML document using StAX
QUESTION:
I'm currently trying to read in an XML file, make some minor changes (alter the value of some attributes), and write it back out again. I have intended to use a StAX parser ( javax.xml.stream.XMLStreamReader ) to read in each event, see if it was one I ... | [
"java",
"xml",
"stax"
] | 6 | 3 | 4,545 | 3 | 0 | 2008-08-14T02:22:37.920000 | 2008-08-14T05:52:27.730000 |
10,595 | 11,958 | How do I write those cool command line code generators (rails, sproutcore, webgen) | I've grokked the code for all the aforementioned apps and I still can't find a straightforward way to create a static directory structure from a single command. | Check out rubigen. You can also view a presentation by dr nic. | How do I write those cool command line code generators (rails, sproutcore, webgen) I've grokked the code for all the aforementioned apps and I still can't find a straightforward way to create a static directory structure from a single command. | TITLE:
How do I write those cool command line code generators (rails, sproutcore, webgen)
QUESTION:
I've grokked the code for all the aforementioned apps and I still can't find a straightforward way to create a static directory structure from a single command.
ANSWER:
Check out rubigen. You can also view a presentati... | [
"ruby"
] | 0 | 5 | 655 | 2 | 0 | 2008-08-14T02:39:38.917000 | 2008-08-15T04:24:56.700000 |
10,599 | 11,467 | Web page field validation | I need to validate a date/time field on a webpage but want it to do it without reloading the page and would like 'instant' feedback for the users. What's the best/easiest solution. BTW: easiest scores 65% of total points Edit: What if best was 65% of total points? | Looks like there's a great video about the ASP.NET AJAX Control Toolkit provides the MaskedEdit control and the MaskedEditValidator control that works great. Not easy for beginners but VERY good and instant feedback. Thanks for all the answers though! asp.net Unfortunately I can't accept this answer. | Web page field validation I need to validate a date/time field on a webpage but want it to do it without reloading the page and would like 'instant' feedback for the users. What's the best/easiest solution. BTW: easiest scores 65% of total points Edit: What if best was 65% of total points? | TITLE:
Web page field validation
QUESTION:
I need to validate a date/time field on a webpage but want it to do it without reloading the page and would like 'instant' feedback for the users. What's the best/easiest solution. BTW: easiest scores 65% of total points Edit: What if best was 65% of total points?
ANSWER:
Lo... | [
"html"
] | 2 | 0 | 703 | 10 | 0 | 2008-08-14T02:50:26.210000 | 2008-08-14T18:33:33.213000 |
10,604 | 10,617 | Automatically measure all SQL queries | In Maybe Normalizing Isn't Normal Jeff Atwood says, "You're automatically measuring all the queries that flow through your software, right?" I'm not but I'd like to. Some features of the application in question: ASP.NET a data access layer which depends on the MS Enterprise Library Data Access Application Block MS SQL ... | In addition to Brad's mention of SQL Profiler, if you want to do this in code, then all your database calls need to funnelled through a common library. You insert the timing code there, and voila, you know how long every query in your system takes. A single point of entry to the database is a fairly standard feature of... | Automatically measure all SQL queries In Maybe Normalizing Isn't Normal Jeff Atwood says, "You're automatically measuring all the queries that flow through your software, right?" I'm not but I'd like to. Some features of the application in question: ASP.NET a data access layer which depends on the MS Enterprise Library... | TITLE:
Automatically measure all SQL queries
QUESTION:
In Maybe Normalizing Isn't Normal Jeff Atwood says, "You're automatically measuring all the queries that flow through your software, right?" I'm not but I'd like to. Some features of the application in question: ASP.NET a data access layer which depends on the MS ... | [
"sql-server",
"optimization"
] | 5 | 6 | 766 | 6 | 0 | 2008-08-14T02:57:18.507000 | 2008-08-14T03:13:56.770000 |
10,616 | 10,623 | Differences between MySQL and SQL Server | I'm an ASP.NET developer who has used Microsoft SQL Server for all my database needs (both at work and for personal projects). I am considering trying out the LAMP stack for some of my personal projects. What are some of the main differences between MySQL and SQL Server? Is using stored procedures a common practice in ... | One thing you have to watch out for is the fairly severe differences in the way SQL Server and MySQL implement the SQL syntax. Here's a nice Comparison of Different SQL Implementations. For example, take a look at the top-n section. In MySQL: SELECT age FROM person ORDER BY age ASC LIMIT 1 OFFSET 2 In SQL Server (T-SQL... | Differences between MySQL and SQL Server I'm an ASP.NET developer who has used Microsoft SQL Server for all my database needs (both at work and for personal projects). I am considering trying out the LAMP stack for some of my personal projects. What are some of the main differences between MySQL and SQL Server? Is usin... | TITLE:
Differences between MySQL and SQL Server
QUESTION:
I'm an ASP.NET developer who has used Microsoft SQL Server for all my database needs (both at work and for personal projects). I am considering trying out the LAMP stack for some of my personal projects. What are some of the main differences between MySQL and S... | [
"mysql",
"sql-server",
"t-sql"
] | 150 | 143 | 334,059 | 12 | 0 | 2008-08-14T03:13:26.633000 | 2008-08-14T03:17:18.153000 |
10,634 | 10,737 | Should I switch from nant to msbuild? | I currently use nant, ccnet (cruise control), svn, mbunit. I use msbuild to do my sln build just because it was simpler to shell out. Are there any merits to switching my whole build script to MSBuild? I need to be able to run tests, watir style tests, xcopy deploy. Is this easier? Update: Any compelling features that ... | I like MSBuild. One reason is that.csproj files are msbuild files, and building in VS is just like building at the command line. Another reason is the good support from TeamCity which is the CI server I've been using. If you start using MSBuild, and you want to do more custom things in your build process, get the MSBui... | Should I switch from nant to msbuild? I currently use nant, ccnet (cruise control), svn, mbunit. I use msbuild to do my sln build just because it was simpler to shell out. Are there any merits to switching my whole build script to MSBuild? I need to be able to run tests, watir style tests, xcopy deploy. Is this easier?... | TITLE:
Should I switch from nant to msbuild?
QUESTION:
I currently use nant, ccnet (cruise control), svn, mbunit. I use msbuild to do my sln build just because it was simpler to shell out. Are there any merits to switching my whole build script to MSBuild? I need to be able to run tests, watir style tests, xcopy deplo... | [
"msbuild",
"build-process",
"build-automation",
"nant"
] | 28 | 31 | 6,168 | 18 | 0 | 2008-08-14T03:36:54.790000 | 2008-08-14T06:14:26.970000 |
10,635 | 10,638 | Why are my PowerShell scripts not running? | I wrote a simple batch file as a PowerShell script, and I am getting errors when they run. It's in a scripts directory in my path. This is the error I get: Cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about-signing". I looked in the help, but it's less than helpful. | It could be PowerShell's default security level, which (IIRC) will only run signed scripts. Try typing this: set-executionpolicy remotesigned That will tell PowerShell to allow local (that is, on a local drive) unsigned scripts to run. Then try executing your script again. | Why are my PowerShell scripts not running? I wrote a simple batch file as a PowerShell script, and I am getting errors when they run. It's in a scripts directory in my path. This is the error I get: Cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about-signing". I look... | TITLE:
Why are my PowerShell scripts not running?
QUESTION:
I wrote a simple batch file as a PowerShell script, and I am getting errors when they run. It's in a scripts directory in my path. This is the error I get: Cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help abou... | [
"powershell"
] | 116 | 114 | 252,297 | 11 | 0 | 2008-08-14T03:39:17.610000 | 2008-08-14T03:41:33.003000 |
10,644 | 10,655 | Any decent C# profilers out there? | I need a C# profiler. Although I'm not averse to paying for one, something which is free or at least with a trial version would be ideal since it takes time to raise a purchase order. Any recommendations? | You can try the following: nprof (free but kinda old) ProfileSharp (open source).Net Memory Profiler (really good for memory leaks, there's a trial version) Edit: Nprof has been replaced with SlimTune and works with.Net 4.0 applications | Any decent C# profilers out there? I need a C# profiler. Although I'm not averse to paying for one, something which is free or at least with a trial version would be ideal since it takes time to raise a purchase order. Any recommendations? | TITLE:
Any decent C# profilers out there?
QUESTION:
I need a C# profiler. Although I'm not averse to paying for one, something which is free or at least with a trial version would be ideal since it takes time to raise a purchase order. Any recommendations?
ANSWER:
You can try the following: nprof (free but kinda old)... | [
"c#",
".net",
"profiling",
"profiler"
] | 83 | 35 | 42,000 | 19 | 0 | 2008-08-14T03:52:55.553000 | 2008-08-14T04:01:56.410000 |
10,661 | 11,290 | Does the OutputCacheFilter in the Microsoft MVC Preview 4 actually save on action invocations? | We deployed a live, fresh, swanky site using preview 3 including rigorous stress testing. Page Output caching was our saviour and afforded us the ability to meet our performance contractual requirements. My question is, is there a difference between action OutputCacheFilter and page output caching? Is the action output... | Internally, the OutputCacheAttribute (aka output cache filter) uses the same internal mechanism as page output caching (aka the @OutputCache directive). Therefore, it's not any faster than page output caching. However, with MVC, you really can't use page output caching via the @OutputCache directive in MVC because we r... | Does the OutputCacheFilter in the Microsoft MVC Preview 4 actually save on action invocations? We deployed a live, fresh, swanky site using preview 3 including rigorous stress testing. Page Output caching was our saviour and afforded us the ability to meet our performance contractual requirements. My question is, is th... | TITLE:
Does the OutputCacheFilter in the Microsoft MVC Preview 4 actually save on action invocations?
QUESTION:
We deployed a live, fresh, swanky site using preview 3 including rigorous stress testing. Page Output caching was our saviour and afforded us the ability to meet our performance contractual requirements. My ... | [
"c#",
"asp.net",
"asp.net-mvc",
"outputcache"
] | 6 | 3 | 350 | 2 | 0 | 2008-08-14T04:16:18.610000 | 2008-08-14T16:32:22.693000 |
10,670 | 10,714 | Asynchronous Remoting calls | We have a remoting singleton server running in a separate windows service (let's call her RemotingService). The clients of the RemotingService are ASP.NET instances (many many). Currently, the clients remoting call RemotingService and blocks while the RemotingService call is serviced. However, the remoting service is g... | The idea behind using the ThreadPool is that through it you can control the amount of synchronous threads, and if those get too many, then the thread pool automatically manages the waiting of newer threads. The Asp.Net worked thread (AFAIK) doesn't come from the Thread Pool and shouldn't get affected by your call to th... | Asynchronous Remoting calls We have a remoting singleton server running in a separate windows service (let's call her RemotingService). The clients of the RemotingService are ASP.NET instances (many many). Currently, the clients remoting call RemotingService and blocks while the RemotingService call is serviced. Howeve... | TITLE:
Asynchronous Remoting calls
QUESTION:
We have a remoting singleton server running in a separate windows service (let's call her RemotingService). The clients of the RemotingService are ASP.NET instances (many many). Currently, the clients remoting call RemotingService and blocks while the RemotingService call i... | [
"c#",
".net-3.5",
".net-2.0",
"remoting",
"rpc"
] | 9 | 0 | 2,506 | 1 | 0 | 2008-08-14T04:35:16.810000 | 2008-08-14T05:53:40.397000 |
10,680 | 10,686 | Is there a difference between the on_exit() and atexit() functions? | Is there any difference between int on_exit(void (*function)(int, void *), void *arg); and int atexit(void (*function)(void)); other than the fact that the function used by on_exit gets the exit status? That is, if I don't care about the exit status, is there any reason to use one or the other? Edit: Many of the answer... | According to this link I found, it seems there are a few differences. on_exit will let you pass in an argument that is passed in to the on_exit function when it is called... which might let you set up some pointers to do some cleanup work on when it is time to exit. Furthermore, it appears that on_exit was a SunOS spec... | Is there a difference between the on_exit() and atexit() functions? Is there any difference between int on_exit(void (*function)(int, void *), void *arg); and int atexit(void (*function)(void)); other than the fact that the function used by on_exit gets the exit status? That is, if I don't care about the exit status, i... | TITLE:
Is there a difference between the on_exit() and atexit() functions?
QUESTION:
Is there any difference between int on_exit(void (*function)(int, void *), void *arg); and int atexit(void (*function)(void)); other than the fact that the function used by on_exit gets the exit status? That is, if I don't care about ... | [
"c",
"linux"
] | 24 | 15 | 13,749 | 5 | 0 | 2008-08-14T04:53:45.620000 | 2008-08-14T05:03:17.707000 |
10,727 | 10,818 | What is a "reasonable" length of time to keep a SQL cursor open? | In your applications, what's a "long time" to keep a transaction open before committing or rolling back? Minutes? Seconds? Hours? and on which database? | @lomaxx, @ChanChan: to the best of my knowledge cursors are only a problem on SQL Server and Sybase (T-SQL variants). If your database of choice is Oracle, then cursors are your friend. I've seen a number of cases where the use of cursors has actually improved performance. Cursors are an incredibly useful mechanism and... | What is a "reasonable" length of time to keep a SQL cursor open? In your applications, what's a "long time" to keep a transaction open before committing or rolling back? Minutes? Seconds? Hours? and on which database? | TITLE:
What is a "reasonable" length of time to keep a SQL cursor open?
QUESTION:
In your applications, what's a "long time" to keep a transaction open before committing or rolling back? Minutes? Seconds? Hours? and on which database?
ANSWER:
@lomaxx, @ChanChan: to the best of my knowledge cursors are only a problem ... | [
"sql",
"cursors"
] | 3 | 3 | 1,057 | 5 | 0 | 2008-08-14T06:07:53.347000 | 2008-08-14T08:59:38.023000 |
10,731 | 10,820 | Best way to store a database password in a startup script / config file? | So our web server apps need to connect to the database, and some other apps have startup scripts that execute at boot time. What's the best way to store the name/password for these applications, in terms of security, e.g. perhaps we don't want sysadmins to know the database password maintainability, e.g. making the con... | The best way to secure your password is to stop using one. Use a trusted connection: How To: Connect to SQL Server Using Windows Authentication in ASP.NET 2.0. Then you have nothing to hide - publish your web.config and source to the world, they still can't hit your database. If that won't work for you, use the built i... | Best way to store a database password in a startup script / config file? So our web server apps need to connect to the database, and some other apps have startup scripts that execute at boot time. What's the best way to store the name/password for these applications, in terms of security, e.g. perhaps we don't want sys... | TITLE:
Best way to store a database password in a startup script / config file?
QUESTION:
So our web server apps need to connect to the database, and some other apps have startup scripts that execute at boot time. What's the best way to store the name/password for these applications, in terms of security, e.g. perhaps... | [
"sql-server",
"security",
"passwords"
] | 8 | 10 | 6,280 | 7 | 0 | 2008-08-14T06:10:25.013000 | 2008-08-14T09:03:47.627000 |
10,793 | 12,055 | Catching unhandled exceptions in ASP.NET UserControls | I'm dynamically loading user controls adding them to the Controls collection of the web form. I'd like to hide user controls if they cause a unhandled exception while rendering. So, I tried hooking to the Error event of each UserControl but it seems that this event never fires for the UserControls as it does for Page c... | mmilic, following on from your response to my previous idea.. No additional logic required! That's the point, your doing nothing to the classes in question, just wrapping them in some instantiation bubble-wrap!:) OK, I was going to just bullet point but I wanted to see this work for myself, so I cobbled together some v... | Catching unhandled exceptions in ASP.NET UserControls I'm dynamically loading user controls adding them to the Controls collection of the web form. I'd like to hide user controls if they cause a unhandled exception while rendering. So, I tried hooking to the Error event of each UserControl but it seems that this event ... | TITLE:
Catching unhandled exceptions in ASP.NET UserControls
QUESTION:
I'm dynamically loading user controls adding them to the Controls collection of the web form. I'd like to hide user controls if they cause a unhandled exception while rendering. So, I tried hooking to the Error event of each UserControl but it seem... | [
"asp.net",
"exception",
"user-controls"
] | 5 | 12 | 4,933 | 7 | 0 | 2008-08-14T08:06:59.457000 | 2008-08-15T07:49:57.927000 |
10,808 | 3,867,490 | Ruby mixins and calling super methods | Ok, so I've been refactoring my code in my little Rails app in an effort to remove duplication, and in general make my life easier (as I like an easy life). Part of this refactoring, has been to move code that's common to two of my models to a module that I can include where I need it. So far, so good. Looks like it's ... | You can use this: super if defined?(super) Here is an example: class A end
class B < A def t super if defined?(super) puts "Hi from B" end end
B.new.t | Ruby mixins and calling super methods Ok, so I've been refactoring my code in my little Rails app in an effort to remove duplication, and in general make my life easier (as I like an easy life). Part of this refactoring, has been to move code that's common to two of my models to a module that I can include where I need... | TITLE:
Ruby mixins and calling super methods
QUESTION:
Ok, so I've been refactoring my code in my little Rails app in an effort to remove duplication, and in general make my life easier (as I like an easy life). Part of this refactoring, has been to move code that's common to two of my models to a module that I can in... | [
"ruby-on-rails",
"ruby"
] | 35 | 42 | 30,778 | 5 | 0 | 2008-08-14T08:30:27.570000 | 2010-10-05T20:34:17.547000 |
10,810 | 12,106 | Why do I get the error "Unable to update the password" when calling AzMan? | I'm doing a authorization check from a WinForms application with the help of the AzMan authorization provider from Enterprise Library and am receiving the the following error: Unable to update the password. The value provided as the current password is incorrect. (Exception from HRESULT: 0x8007052B) (Microsoft.Practice... | I found out from the event log that there was a security issue with the user making the call to AzMan from a remote computer. The user did not belong the local Users group on the computer running ADAM/AzMan. When I corrected that everything worked again. | Why do I get the error "Unable to update the password" when calling AzMan? I'm doing a authorization check from a WinForms application with the help of the AzMan authorization provider from Enterprise Library and am receiving the the following error: Unable to update the password. The value provided as the current pass... | TITLE:
Why do I get the error "Unable to update the password" when calling AzMan?
QUESTION:
I'm doing a authorization check from a WinForms application with the help of the AzMan authorization provider from Enterprise Library and am receiving the the following error: Unable to update the password. The value provided a... | [
"c#",
"winforms",
"authorization",
"adam",
"azman"
] | 4 | 2 | 3,023 | 2 | 0 | 2008-08-14T08:38:24.760000 | 2008-08-15T09:44:36.773000 |
10,819 | 2,663,232 | SQL, Auxiliary table of numbers | For certain types of sql queries, an auxiliary table of numbers can be very useful. It may be created as a table with as many rows as you need for a particular task or as a user defined function that returns the number of rows required in each query. What is the optimal way to create such a function? | Heh... sorry I'm so late responding to an old post. And, yeah, I had to respond because the most popular answer (at the time, the Recursive CTE answer with the link to 14 different methods) on this thread is, ummm... performance challenged at best. First, the article with the 14 different solutions is fine for seeing t... | SQL, Auxiliary table of numbers For certain types of sql queries, an auxiliary table of numbers can be very useful. It may be created as a table with as many rows as you need for a particular task or as a user defined function that returns the number of rows required in each query. What is the optimal way to create suc... | TITLE:
SQL, Auxiliary table of numbers
QUESTION:
For certain types of sql queries, an auxiliary table of numbers can be very useful. It may be created as a table with as many rows as you need for a particular task or as a user defined function that returns the number of rows required in each query. What is the optimal... | [
"sql",
"sql-server"
] | 67 | 117 | 26,118 | 8 | 0 | 2008-08-14T09:01:37.663000 | 2010-04-18T17:44:31.607000 |
10,822 | 10,824 | Fast database access test from .NET | What would be a very fast way to determine if your connectionstring lets you connect to a database? Normally a connection attempt keeps the user waiting a long time before notifying the attempt was futile anyway. | You haven't mentioned what database you are connecting to, however. In SQL Server 2005, from.NET, you can specify a connection timeout in your connection string like so: server=;database=;uid=;password=;Connect Timeout=3 This will try to connect to the server and if it doesn't do so in three seconds, it will throw a ti... | Fast database access test from .NET What would be a very fast way to determine if your connectionstring lets you connect to a database? Normally a connection attempt keeps the user waiting a long time before notifying the attempt was futile anyway. | TITLE:
Fast database access test from .NET
QUESTION:
What would be a very fast way to determine if your connectionstring lets you connect to a database? Normally a connection attempt keeps the user waiting a long time before notifying the attempt was futile anyway.
ANSWER:
You haven't mentioned what database you are ... | [
".net",
"database",
"connection",
"connection-string"
] | 5 | 11 | 1,173 | 2 | 0 | 2008-08-14T09:09:52.607000 | 2008-08-14T09:13:45.797000 |
10,825 | 10,826 | Compare a date string to datetime in SQL Server? | In SQL Server I have a DATETIME column which includes a time element. Example: '14 AUG 2008 14:23:019' What is the best method to only select the records for a particular day, ignoring the time part? Example: (Not safe, as it does not match the time part and returns no rows) DECLARE @p_date DATETIME SET @p_date = CONVE... | Technique 1: DECLARE @p_date DATETIME SET @p_date = CONVERT( DATETIME, '14 AUG 2008', 106 )
SELECT * FROM table1 WHERE column_datetime >= @p_date AND column_datetime < DATEADD(d, 1, @p_date) The advantage of this is that it will use any index on 'column_datetime' if it exists. | Compare a date string to datetime in SQL Server? In SQL Server I have a DATETIME column which includes a time element. Example: '14 AUG 2008 14:23:019' What is the best method to only select the records for a particular day, ignoring the time part? Example: (Not safe, as it does not match the time part and returns no r... | TITLE:
Compare a date string to datetime in SQL Server?
QUESTION:
In SQL Server I have a DATETIME column which includes a time element. Example: '14 AUG 2008 14:23:019' What is the best method to only select the records for a particular day, ignoring the time part? Example: (Not safe, as it does not match the time par... | [
"sql-server",
"database",
"t-sql",
"datetime"
] | 53 | 40 | 270,044 | 18 | 0 | 2008-08-14T09:14:07.683000 | 2008-08-14T09:16:03.530000 |
10,855 | 11,593 | LINQ query on a DataTable | I'm trying to perform a LINQ query on a DataTable object and bizarrely I am finding that performing such queries on DataTables is not straightforward. For example: var results = from myRow in myDataTable where results.Field("RowNo") == 1 select results; This is not allowed. How do I get something like this working? I'm... | You can't query against the DataTable 's Rows collection, since DataRowCollection doesn't implement IEnumerable. You need to use the AsEnumerable() extension for DataTable. Like so: var results = from myRow in myDataTable.AsEnumerable() where myRow.Field ("RowNo") == 1 select myRow; And as @Keith says, you'll need to a... | LINQ query on a DataTable I'm trying to perform a LINQ query on a DataTable object and bizarrely I am finding that performing such queries on DataTables is not straightforward. For example: var results = from myRow in myDataTable where results.Field("RowNo") == 1 select results; This is not allowed. How do I get someth... | TITLE:
LINQ query on a DataTable
QUESTION:
I'm trying to perform a LINQ query on a DataTable object and bizarrely I am finding that performing such queries on DataTables is not straightforward. For example: var results = from myRow in myDataTable where results.Field("RowNo") == 1 select results; This is not allowed. H... | [
"c#",
".net",
"linq",
"datatable",
".net-3.5"
] | 1,148 | 1,413 | 1,138,519 | 22 | 0 | 2008-08-14T10:08:27.123000 | 2008-08-14T19:45:01.383000 |
10,860 | 10,875 | Data Layer Best Practices | I am in the middle of a "discussion" with a colleague about the best way to implement the data layer in a new application. One viewpoint is that the data layer should be aware of business objects (our own classes that represent an entity), and be able to work with that object natively. The opposing viewpoint is that th... | It really depends on your view of the world - I used to be in the uncoupled camp. The DAL was only there to supply data to the BAL - end of story. With emerging technologies such as Linq to SQL and Entity Framework becoming a bit more popular, then the line between DAL and BAL have been blurred a bit. In L2S especially... | Data Layer Best Practices I am in the middle of a "discussion" with a colleague about the best way to implement the data layer in a new application. One viewpoint is that the data layer should be aware of business objects (our own classes that represent an entity), and be able to work with that object natively. The opp... | TITLE:
Data Layer Best Practices
QUESTION:
I am in the middle of a "discussion" with a colleague about the best way to implement the data layer in a new application. One viewpoint is that the data layer should be aware of business objects (our own classes that represent an entity), and be able to work with that object... | [
".net",
"n-tier-architecture"
] | 9 | 5 | 3,543 | 6 | 0 | 2008-08-14T10:23:05.657000 | 2008-08-14T10:38:04.677000 |
10,872 | 10,882 | How to encourage someone to learn programming? | I have a friend that has a little bit of a holiday coming up and they want ideas on what they should do during the holiday, I plan to suggest programming to them, what are the pros and cons that I need to mention? I'll add to the list below as people reply, I apologise if I duplicate any entries. Pros I have so far Min... | I do it for the ladies:D Seriously though, for me Pro's Great challenge, every day really is a fresh challenge in some way, shape or form. Not many jobs can truly offer that. I like the way it makes me think.. I look at EVERYTHING more logically as my skills improve.. This helps with general living as well as programmi... | How to encourage someone to learn programming? I have a friend that has a little bit of a holiday coming up and they want ideas on what they should do during the holiday, I plan to suggest programming to them, what are the pros and cons that I need to mention? I'll add to the list below as people reply, I apologise if ... | TITLE:
How to encourage someone to learn programming?
QUESTION:
I have a friend that has a little bit of a holiday coming up and they want ideas on what they should do during the holiday, I plan to suggest programming to them, what are the pros and cons that I need to mention? I'll add to the list below as people repl... | [
"language-agnostic"
] | 3 | 8 | 1,159 | 8 | 0 | 2008-08-14T10:34:05.073000 | 2008-08-14T10:50:21.420000 |
10,877 | 486,662 | How can you customize the numbers in an ordered list? | How can I left-align the numbers in an ordered list? 1. an item // skip some items for brevity 9. another item 10. notice the 1 is under the 9, and the item contents also line up Change the character after the number in an ordered list? 1) an item Also is there a CSS solution to change from numbers to alphabetic/roman ... | This is the solution I have working in Firefox 3, Opera and Google Chrome. The list still displays in IE7 (but without the close bracket and left align numbers): ol {
counter-reset: item;
margin-left: 0;
padding-left: 0;
}
li {
display: block;
margin-bottom:.5em;
margin-left: 2em;
}
li::before {
display: inl... | How can you customize the numbers in an ordered list? How can I left-align the numbers in an ordered list? 1. an item // skip some items for brevity 9. another item 10. notice the 1 is under the 9, and the item contents also line up Change the character after the number in an ordered list? 1) an item Also is there a CS... | TITLE:
How can you customize the numbers in an ordered list?
QUESTION:
How can I left-align the numbers in an ordered list? 1. an item // skip some items for brevity 9. another item 10. notice the 1 is under the 9, and the item contents also line up Change the character after the number in an ordered list? 1) an item ... | [
"html",
"css",
"html-lists",
"roman-numerals"
] | 137 | 121 | 148,615 | 17 | 0 | 2008-08-14T10:42:32.013000 | 2009-01-28T06:31:49.953000 |
10,880 | 10,890 | Any good advice on using emacs for C++ project? | I'm looking for a good article on using emacs as C/C++ IDE. Something like Steve Yegge's "Effective emacs". | No specific article, really, but I've found EmacsWiki to be full of useful information. Consider checking out these entries: CPlusPlus as a starting point for many C++-related articles, and CppTemplate to define a template that can give you a good skeleton when you start new files | Any good advice on using emacs for C++ project? I'm looking for a good article on using emacs as C/C++ IDE. Something like Steve Yegge's "Effective emacs". | TITLE:
Any good advice on using emacs for C++ project?
QUESTION:
I'm looking for a good article on using emacs as C/C++ IDE. Something like Steve Yegge's "Effective emacs".
ANSWER:
No specific article, really, but I've found EmacsWiki to be full of useful information. Consider checking out these entries: CPlusPlus as... | [
"c++",
"emacs"
] | 39 | 16 | 23,094 | 5 | 0 | 2008-08-14T10:42:59.627000 | 2008-08-14T11:04:13.680000 |
10,891 | 10,914 | Best way to connect To Sql Server with MFC | Soooo, I am starting this new job soon where most of the code is legacy MFC. The end goal is to convert/rewrite to C#. I'm a little rusty with MFC so writing some code so I can try and spark my memory. Anyway, was wondering the best way to connect to a SS2005 database with MFC. Back in the day CDatabase via ODBC was th... | The ATL consumer templates for OleDb are an option - start here. The ClassWizard is still there to assist you so the verbosity isn't too much of a hurdle at first. Very soon you will need to hand-code though. There is a lot of careful twiddling, for example ensuring that your command string has exactly the right number... | Best way to connect To Sql Server with MFC Soooo, I am starting this new job soon where most of the code is legacy MFC. The end goal is to convert/rewrite to C#. I'm a little rusty with MFC so writing some code so I can try and spark my memory. Anyway, was wondering the best way to connect to a SS2005 database with MFC... | TITLE:
Best way to connect To Sql Server with MFC
QUESTION:
Soooo, I am starting this new job soon where most of the code is legacy MFC. The end goal is to convert/rewrite to C#. I'm a little rusty with MFC so writing some code so I can try and spark my memory. Anyway, was wondering the best way to connect to a SS2005... | [
"sql-server",
"mfc"
] | 4 | 2 | 3,836 | 1 | 0 | 2008-08-14T11:05:21.743000 | 2008-08-14T11:49:25.883000 |
10,898 | 21,550 | How to set up a DB2 linked server on a 64-bit SQL Server 2005? | I need to create a linked server to a DB2 database on a mainframe. Has anyone done this successfully on a 64-bit version of SQL Server 2005? If so, which provider and settings were used? It's important that the linked server work whether we are using a Windows authenticated account to login to SQL Server or a SQL Serve... | We had this same issue with a production system late last year (sept 2007) and the official word from our Microsoft contact was that they had a 64 bit oledb driver to connect to ASI/DB2 but it was in BETA at the time. Not sure when it will be out of beta but that was the news as of last year. We decided to move the pro... | How to set up a DB2 linked server on a 64-bit SQL Server 2005? I need to create a linked server to a DB2 database on a mainframe. Has anyone done this successfully on a 64-bit version of SQL Server 2005? If so, which provider and settings were used? It's important that the linked server work whether we are using a Wind... | TITLE:
How to set up a DB2 linked server on a 64-bit SQL Server 2005?
QUESTION:
I need to create a linked server to a DB2 database on a mainframe. Has anyone done this successfully on a 64-bit version of SQL Server 2005? If so, which provider and settings were used? It's important that the linked server work whether w... | [
"sql-server",
"db2"
] | 5 | 1 | 2,158 | 3 | 0 | 2008-08-14T11:18:39.113000 | 2008-08-22T01:01:54.557000 |
10,901 | 11,004 | Future proofing a large UI Application - MFC with 2008 Feature pack, or C# and Winforms? | My company has developed a long standing product using MFC in Visual C++ as the defacto standard for UI development. Our codebase contains ALOT of legacy/archaic code which must be kept operational. Some of this code is older than me (originally written in the late 70s) and some members of our team are still on Visual ... | I'm a developer on an app that has a ton of legacy MFC code, and we have all of your same concerns. A big driver for our strategy was to eliminate as much risk and uncertainty as we could, which meant avoiding The Big Rewrite. As we all know, TBR fails most of the time. So we chose an incremental approach that allows u... | Future proofing a large UI Application - MFC with 2008 Feature pack, or C# and Winforms? My company has developed a long standing product using MFC in Visual C++ as the defacto standard for UI development. Our codebase contains ALOT of legacy/archaic code which must be kept operational. Some of this code is older than ... | TITLE:
Future proofing a large UI Application - MFC with 2008 Feature pack, or C# and Winforms?
QUESTION:
My company has developed a long standing product using MFC in Visual C++ as the defacto standard for UI development. Our codebase contains ALOT of legacy/archaic code which must be kept operational. Some of this c... | [
"c#",
"c++",
"winforms",
"mfc",
"user-interface"
] | 12 | 9 | 4,251 | 6 | 0 | 2008-08-14T11:26:02.733000 | 2008-08-14T13:32:29.810000 |
10,905 | 10,907 | Can you use generic forms in C#? | You should be able to create a generic form: public partial class MyGenericForm: Form where T: class { /* form code */ public List TypedList { get; set; } } Is valid C#, and compiles. However the designer won't work and the form will throw a runtime exception if you have any images stating that it cannot find the resou... | Yes you can! Here's a blog post I made a while ago with the trick: Designing Generic Forms Edit: Looks like you're already doing it this way. This method works fine so I wouldn't consider it too hacky. | Can you use generic forms in C#? You should be able to create a generic form: public partial class MyGenericForm: Form where T: class { /* form code */ public List TypedList { get; set; } } Is valid C#, and compiles. However the designer won't work and the form will throw a runtime exception if you have any images stat... | TITLE:
Can you use generic forms in C#?
QUESTION:
You should be able to create a generic form: public partial class MyGenericForm: Form where T: class { /* form code */ public List TypedList { get; set; } } Is valid C#, and compiles. However the designer won't work and the form will throw a runtime exception if you ha... | [
"c#",
".net",
"winforms"
] | 33 | 22 | 14,418 | 4 | 0 | 2008-08-14T11:30:54.970000 | 2008-08-14T11:33:21.377000 |
10,915 | 11,164 | Best way to model Many-To-One Relationships in NHibernate When Dealing With a Legacy DB? | Warning - I am very new to NHibernate. I know this question seems simple - and I'm sure there's a simple answer, but I've been spinning my wheels for some time on this one. I am dealing with a legacy db which really can't be altered structurally. I have a details table which lists payment plans that have been accepted ... | I'd steer away from having child object containing their logical parent, it can get very messy and very recursive pretty quickly when you do that. I'd take a look at how you're intending to use the domain model before you do that sort of thing. You can easily still have the ID references in the tables and just leave th... | Best way to model Many-To-One Relationships in NHibernate When Dealing With a Legacy DB? Warning - I am very new to NHibernate. I know this question seems simple - and I'm sure there's a simple answer, but I've been spinning my wheels for some time on this one. I am dealing with a legacy db which really can't be altere... | TITLE:
Best way to model Many-To-One Relationships in NHibernate When Dealing With a Legacy DB?
QUESTION:
Warning - I am very new to NHibernate. I know this question seems simple - and I'm sure there's a simple answer, but I've been spinning my wheels for some time on this one. I am dealing with a legacy db which real... | [
"c#",
"nhibernate"
] | 3 | 3 | 14,538 | 6 | 0 | 2008-08-14T11:56:29.550000 | 2008-08-14T15:04:15.240000 |
10,919 | 10,922 | How do you measure SQL Fill Factor value | Usually when I'm creating indexes on tables, I generally guess what the Fill Factor should be based on an educated guess of how the table will be used (many reads or many writes). Is there a more scientific way to determine a more accurate Fill Factor value? | You could try running a big list of realistic operations and looking at IO queues for the different actions. There are a lot of variables that govern it, such as the size of each row and the number of writes vs reads. Basically: high fill factor = quicker read, low = quicker write. However it's not quite that simple, a... | How do you measure SQL Fill Factor value Usually when I'm creating indexes on tables, I generally guess what the Fill Factor should be based on an educated guess of how the table will be used (many reads or many writes). Is there a more scientific way to determine a more accurate Fill Factor value? | TITLE:
How do you measure SQL Fill Factor value
QUESTION:
Usually when I'm creating indexes on tables, I generally guess what the Fill Factor should be based on an educated guess of how the table will be used (many reads or many writes). Is there a more scientific way to determine a more accurate Fill Factor value?
A... | [
"sql-server",
"fillfactor"
] | 8 | 12 | 2,499 | 2 | 0 | 2008-08-14T12:07:27.750000 | 2008-08-14T12:16:03.770000 |
10,933 | 10,988 | Can you recommend a good .NET web-based repository browser for SVN? | We have an SVN repository running on a Windows server, and I want to link internal documentation, feature changes, bugs and so on to code changes. We've found WebSVN to be amazingly slow - the repository is too large for it (I think). The team using it is primarily coding in C#, and while some have experience with othe... | Have a look at http://warehouseapp.com It's Mongrel/Ruby/MySQL stack (should work on Windows though) but I'm looking to avoid installing MySQL and Ruby on the server. I know (also using C# stack myself), but self-hosted web-based SVN client market is such a small niche that even offering in different language could be ... | Can you recommend a good .NET web-based repository browser for SVN? We have an SVN repository running on a Windows server, and I want to link internal documentation, feature changes, bugs and so on to code changes. We've found WebSVN to be amazingly slow - the repository is too large for it (I think). The team using it... | TITLE:
Can you recommend a good .NET web-based repository browser for SVN?
QUESTION:
We have an SVN repository running on a Windows server, and I want to link internal documentation, feature changes, bugs and so on to code changes. We've found WebSVN to be amazingly slow - the repository is too large for it (I think).... | [
".net",
"asp.net",
"svn"
] | 10 | 3 | 4,679 | 6 | 0 | 2008-08-14T12:37:21.013000 | 2008-08-14T13:20:05.280000 |
10,935 | 10,969 | How to trace COM objects exceptions? | I have a DLL with some COM objects. Sometimes, this objects crashes and register an error event in the Windows Event Log with lots of hexadecimal informations. I have no clue why this crashes happens. So, How can I trace those COM objects exceptions? | The first step is to lookup the Fail code's hex value (E.G. E_FAIL 0x80004005). I've had really good luck with posting that value in Google to get a sense of what the error code means. Then, I just use trial and error to try to isolate the location in code that's failing, and the root cause of the failure. | How to trace COM objects exceptions? I have a DLL with some COM objects. Sometimes, this objects crashes and register an error event in the Windows Event Log with lots of hexadecimal informations. I have no clue why this crashes happens. So, How can I trace those COM objects exceptions? | TITLE:
How to trace COM objects exceptions?
QUESTION:
I have a DLL with some COM objects. Sometimes, this objects crashes and register an error event in the Windows Event Log with lots of hexadecimal informations. I have no clue why this crashes happens. So, How can I trace those COM objects exceptions?
ANSWER:
The f... | [
"exception",
"com",
"dll",
"trace"
] | 0 | 2 | 666 | 4 | 0 | 2008-08-14T12:41:43.190000 | 2008-08-14T13:03:10.447000 |
10,980 | 16,662 | IKVM and Licensing | I have been looking into IKVMing Apache's FOP project to use with our.NET app. It's a commercial product, and looking into licensing, IKVM runs into some sticky areas because of its use of GNU Classpath. From what I've seen, no one can say for sure if this stuff can be used in a commercial product. Has anyone used IKVM... | There are multiple issues here as ikvm is currently being transitioned away from the GNU classpath system to Sun's OpenJDK. Both are licensed as GPL+Exceptions to state explicitly that applications which merely use the OpenJDK libraries will not be considered derived works. Generally speaking, applications which rely u... | IKVM and Licensing I have been looking into IKVMing Apache's FOP project to use with our.NET app. It's a commercial product, and looking into licensing, IKVM runs into some sticky areas because of its use of GNU Classpath. From what I've seen, no one can say for sure if this stuff can be used in a commercial product. H... | TITLE:
IKVM and Licensing
QUESTION:
I have been looking into IKVMing Apache's FOP project to use with our.NET app. It's a commercial product, and looking into licensing, IKVM runs into some sticky areas because of its use of GNU Classpath. From what I've seen, no one can say for sure if this stuff can be used in a com... | [
"java",
".net",
"ikvm",
"gnu-classpath"
] | 10 | 6 | 2,201 | 3 | 0 | 2008-08-14T13:16:37.580000 | 2008-08-19T18:15:58.570000 |
10,985 | 11,299 | How to prevent an object being created on the heap? | Does anyone know how I can, in platform-independent C++ code prevent an object from being created on the heap? That is, for a class "Foo", I want to prevent users from doing this: Foo *ptr = new Foo; and only allow them to do this: Foo myfooObject; Does anyone have any ideas? Cheers, | Nick's answer is a good starting point, but incomplete, as you actually need to overload: private: void* operator new(size_t); // standard new void* operator new(size_t, void*); // placement new void* operator new[](size_t); // array new void* operator new[](size_t, void*); // placement array new (Good coding practice ... | How to prevent an object being created on the heap? Does anyone know how I can, in platform-independent C++ code prevent an object from being created on the heap? That is, for a class "Foo", I want to prevent users from doing this: Foo *ptr = new Foo; and only allow them to do this: Foo myfooObject; Does anyone have an... | TITLE:
How to prevent an object being created on the heap?
QUESTION:
Does anyone know how I can, in platform-independent C++ code prevent an object from being created on the heap? That is, for a class "Foo", I want to prevent users from doing this: Foo *ptr = new Foo; and only allow them to do this: Foo myfooObject; D... | [
"c++",
"stack",
"heap-memory"
] | 32 | 29 | 10,580 | 9 | 0 | 2008-08-14T13:19:08.073000 | 2008-08-14T16:36:41.233000 |
10,990 | 11,005 | What are the proper permissions for an upload folder with PHP/Apache? | Sorry for the basic question - I'm a.NET developer and don't have much experience with LAMP setups. I have a PHP site that will allow uploads to a specific folder. I have been told that this folder needs to be owned by the webserver user for the upload process to work, so I created the folder and then set permissions a... | You can create a new group with both the apache user and FTP user as members and then make the permission on the upload folder 775. This should give both the apache and FTP users the ability to write to the files in the folder but keep everyone else from modifying them. | What are the proper permissions for an upload folder with PHP/Apache? Sorry for the basic question - I'm a.NET developer and don't have much experience with LAMP setups. I have a PHP site that will allow uploads to a specific folder. I have been told that this folder needs to be owned by the webserver user for the uplo... | TITLE:
What are the proper permissions for an upload folder with PHP/Apache?
QUESTION:
Sorry for the basic question - I'm a.NET developer and don't have much experience with LAMP setups. I have a PHP site that will allow uploads to a specific folder. I have been told that this folder needs to be owned by the webserver... | [
"php",
"apache",
"upload"
] | 60 | 48 | 123,060 | 8 | 0 | 2008-08-14T13:22:25.743000 | 2008-08-14T13:32:55.473000 |
10,999 | 11,034 | MS Team Foundation Server in distributed environments - hints tips tricks needed | Is anyone out there using Team Foundation Server within a team that is geographically distributed? We're in the UK, trying work with a team in Australia and we're finding it quite tough. Our main two issues are: Things are being checked out to us without us asking on a get latest. Even when using a proxy, most thing ta... | Definitely upgrade to TFS 2008 and Visual Studio 2008, as it is the "v2" version of Team System in every way. Fixes lots of small and medium sized problems. As for "things being randomly checked out" this is almost always due to Visual Studio deciding to edit files on your behalf. Try getting latest from the Team Explo... | MS Team Foundation Server in distributed environments - hints tips tricks needed Is anyone out there using Team Foundation Server within a team that is geographically distributed? We're in the UK, trying work with a team in Australia and we're finding it quite tough. Our main two issues are: Things are being checked ou... | TITLE:
MS Team Foundation Server in distributed environments - hints tips tricks needed
QUESTION:
Is anyone out there using Team Foundation Server within a team that is geographically distributed? We're in the UK, trying work with a team in Australia and we're finding it quite tough. Our main two issues are: Things ar... | [
"visual-studio",
"tfs"
] | 5 | 2 | 1,998 | 3 | 0 | 2008-08-14T13:27:40.523000 | 2008-08-14T13:48:02.523000 |
11,028 | 11,044 | What are the advantages of explicit Join Transitive Closure in SQL? | When I'm joining three or more tables together by a common column, I'd write my query like this: SELECT * FROM a, b, c WHERE a.id = b.id AND b.id = c.id a colleague recently asked my why I didn't do explicit Join Transitive Closure in my queries like this: SELECT * FROM a, b, c WHERE a.id = b.id AND b.id = c.id AND c.i... | You don't need to do this in todays database engines, but there was a time when things like that would give the query optimizer more hints as to possible index paths and thus to speedier results. These days that entire syntax is going out anyway. | What are the advantages of explicit Join Transitive Closure in SQL? When I'm joining three or more tables together by a common column, I'd write my query like this: SELECT * FROM a, b, c WHERE a.id = b.id AND b.id = c.id a colleague recently asked my why I didn't do explicit Join Transitive Closure in my queries like t... | TITLE:
What are the advantages of explicit Join Transitive Closure in SQL?
QUESTION:
When I'm joining three or more tables together by a common column, I'd write my query like this: SELECT * FROM a, b, c WHERE a.id = b.id AND b.id = c.id a colleague recently asked my why I didn't do explicit Join Transitive Closure in... | [
"sql"
] | 4 | 4 | 3,086 | 8 | 0 | 2008-08-14T13:44:43.357000 | 2008-08-14T13:53:33.963000 |
11,043 | 11,053 | SQL Table Aliases - Good or Bad? | What are the pros and cons of using table aliases in SQL? I personally try to avoid them, as I think they make the code less readable (especially when reading through large where/and statements), but I'd be interested in hearing any counter-points to this. When is it generally a good idea to use table aliases, and do y... | Table aliases are a necessary evil when dealing with highly normalized schemas. For example, and I'm not the architect on this DB so bear with me, it can take 7 joins in order to get a clean and complete record back which includes a person's name, address, phone number and company affiliation. Rather than the somewhat ... | SQL Table Aliases - Good or Bad? What are the pros and cons of using table aliases in SQL? I personally try to avoid them, as I think they make the code less readable (especially when reading through large where/and statements), but I'd be interested in hearing any counter-points to this. When is it generally a good id... | TITLE:
SQL Table Aliases - Good or Bad?
QUESTION:
What are the pros and cons of using table aliases in SQL? I personally try to avoid them, as I think they make the code less readable (especially when reading through large where/and statements), but I'd be interested in hearing any counter-points to this. When is it g... | [
"sql",
"alias"
] | 46 | 31 | 40,931 | 17 | 0 | 2008-08-14T13:53:33.467000 | 2008-08-14T13:56:45.207000 |
11,045 | 12,018 | Refresh Excel VBA Function Results | How can I get a user-defined function to re-evaluate itself based on changed data in the spreadsheet? I tried F9 and Shift + F9. The only thing that seems to work is editing the cell with the function call and then pressing Enter. | You should use Application.Volatile in the top of your function: Function doubleMe(d) Application.Volatile doubleMe = d * 2 End Function It will then reevaluate whenever the workbook changes (if your calculation is set to automatic). | Refresh Excel VBA Function Results How can I get a user-defined function to re-evaluate itself based on changed data in the spreadsheet? I tried F9 and Shift + F9. The only thing that seems to work is editing the cell with the function call and then pressing Enter. | TITLE:
Refresh Excel VBA Function Results
QUESTION:
How can I get a user-defined function to re-evaluate itself based on changed data in the spreadsheet? I tried F9 and Shift + F9. The only thing that seems to work is editing the cell with the function call and then pressing Enter.
ANSWER:
You should use Application.... | [
"excel",
"vba",
"user-defined-functions"
] | 80 | 138 | 166,890 | 9 | 0 | 2008-08-14T13:54:43.947000 | 2008-08-15T06:18:51.387000 |
11,055 | 11,080 | How big would such a database be? | I'm trying to figure out how big a certain database would be (it hasn't been created yet). I know how many rows and what the tables will be. Is there a feature in Oracle that will tell me the size of such a theoretical database? Is there a known math formula I can use? I know there is a feature to determine the size of... | you can from the size of the data types for the columns in a table. You can then get a rough estimate of the size of a row in that table. then for 1 to n tables, then for 1 row in 1 table for x rows in x tables = estimate of the database for a given rowsize. Long handed I know but this is how i normally do this. | How big would such a database be? I'm trying to figure out how big a certain database would be (it hasn't been created yet). I know how many rows and what the tables will be. Is there a feature in Oracle that will tell me the size of such a theoretical database? Is there a known math formula I can use? I know there is ... | TITLE:
How big would such a database be?
QUESTION:
I'm trying to figure out how big a certain database would be (it hasn't been created yet). I know how many rows and what the tables will be. Is there a feature in Oracle that will tell me the size of such a theoretical database? Is there a known math formula I can use... | [
"database",
"oracle"
] | 4 | 5 | 453 | 5 | 0 | 2008-08-14T13:57:20.227000 | 2008-08-14T14:07:27.307000 |
11,060 | 11,074 | How should I unit test a code-generator? | This is a difficult and open-ended question I know, but I thought I'd throw it to the floor and see if anyone had any interesting suggestions. I have developed a code-generator that takes our python interface to our C++ code (generated via SWIG) and generates code needed to expose this as WebServices. When I developed ... | I started writing up a summary of my experience with my own code generator, then went back and re-read your question and found you had already touched upon the same issues yourself, focus on the execution results instead of the code layout/look. Problem is, this is hard to test, the generated code might not be suited t... | How should I unit test a code-generator? This is a difficult and open-ended question I know, but I thought I'd throw it to the floor and see if anyone had any interesting suggestions. I have developed a code-generator that takes our python interface to our C++ code (generated via SWIG) and generates code needed to expo... | TITLE:
How should I unit test a code-generator?
QUESTION:
This is a difficult and open-ended question I know, but I thought I'd throw it to the floor and see if anyone had any interesting suggestions. I have developed a code-generator that takes our python interface to our C++ code (generated via SWIG) and generates c... | [
"c++",
"python",
"unit-testing",
"code-generation",
"swig"
] | 29 | 14 | 8,403 | 8 | 0 | 2008-08-14T13:59:21.533000 | 2008-08-14T14:04:25.800000 |
11,085 | 64,160 | How can I determine the type of a blessed reference in Perl? | In Perl, an object is just a reference to any of the basic Perl data types that has been blessed into a particular class. When you use the ref() function on an unblessed reference, you are told what data type the reference points to. However, when you call ref() on a blessed reference, you are returned the name of the ... | Scalar::Util::reftype() is the cleanest solution. The Scalar::Util module was added to the Perl core in version 5.7 but is available for older versions (5.004 or later) from CPAN. You can also probe with UNIVERSAL::isa(): $x->isa('HASH') # if $x is known to be an object UNIVERSAL::isa($x, 'HASH') # if $x might not be a... | How can I determine the type of a blessed reference in Perl? In Perl, an object is just a reference to any of the basic Perl data types that has been blessed into a particular class. When you use the ref() function on an unblessed reference, you are told what data type the reference points to. However, when you call re... | TITLE:
How can I determine the type of a blessed reference in Perl?
QUESTION:
In Perl, an object is just a reference to any of the basic Perl data types that has been blessed into a particular class. When you use the ref() function on an unblessed reference, you are told what data type the reference points to. However... | [
"perl",
"reference",
"types"
] | 20 | 22 | 12,669 | 3 | 0 | 2008-08-14T14:11:42.913000 | 2008-09-15T15:54:08.240000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.