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
179,024
179,097
Adding a JAR to an Eclipse Java library
How do you add a JAR file to an already existing Java library in Eclipse? Note that this is not a user library. That is, if you look at the Java Build Path for a Java project and click on the Libraries tab, you will see the list of libraries used by the project. If you expand a given library, you will see a list of JAR...
In Eclipse Ganymede (3.4.0): Select the library and click "Edit" (left side of the window) Click "User Libraries" Select the library again and click "Add JARs"
Adding a JAR to an Eclipse Java library How do you add a JAR file to an already existing Java library in Eclipse? Note that this is not a user library. That is, if you look at the Java Build Path for a Java project and click on the Libraries tab, you will see the list of libraries used by the project. If you expand a g...
TITLE: Adding a JAR to an Eclipse Java library QUESTION: How do you add a JAR file to an already existing Java library in Eclipse? Note that this is not a user library. That is, if you look at the Java Build Path for a Java project and click on the Libraries tab, you will see the list of libraries used by the project....
[ "eclipse", "jar" ]
38
19
139,643
4
0
2008-10-07T15:24:55.823000
2008-10-07T15:38:43.580000
179,026
421,752
How do I perform an IMAP search in Python (using Gmail and imaplib)?
In Gmail, I have a bunch of labeled messages. I'd like to use an IMAP client to get those messages, but I'm not sure what the search incantation is. c = imaplib.IMAP4_SSL('imap.gmail.com') c.list() ('OK', [..., '(\\HasNoChildren) "/" "GM"',...]) c.search(???) I'm not finding many examples for this sort of thing.
imaplib is intentionally a thin wrapper around the IMAP protocol, I assume to allow for a greater degree of user flexibility and a greater ability to adapt to changes in the IMAP specification. As a result, it doesn't really offer any structure for your search queries and requires you to be familiar with the IMAP speci...
How do I perform an IMAP search in Python (using Gmail and imaplib)? In Gmail, I have a bunch of labeled messages. I'd like to use an IMAP client to get those messages, but I'm not sure what the search incantation is. c = imaplib.IMAP4_SSL('imap.gmail.com') c.list() ('OK', [..., '(\\HasNoChildren) "/" "GM"',...]) c.sea...
TITLE: How do I perform an IMAP search in Python (using Gmail and imaplib)? QUESTION: In Gmail, I have a bunch of labeled messages. I'd like to use an IMAP client to get those messages, but I'm not sure what the search incantation is. c = imaplib.IMAP4_SSL('imap.gmail.com') c.list() ('OK', [..., '(\\HasNoChildren) "/"...
[ "python", "gmail", "imap" ]
12
12
18,956
5
0
2008-10-07T15:24:59.037000
2009-01-07T19:37:42.950000
179,031
179,055
Creating a compressed (or zipped) folder
Is there a way to programmatically create a compressed folder in Windows? I can't see a way to do this using the FileSystemObject (although there is the 'Compressed' attribute). I've seen zip dll's but I'd prefer to avoid having to re-distribute a dll if possible. Windows XP natively supports compressed folders after a...
Have a look at the following links: http://www.rondebruin.nl/windowsxpzip.htm http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1383147&SiteID=1 Stripping the important parts from the first link example may prove to be sufficient. Sub NewZip(sPath) 'Create empty Zip File 'Changed by keepITcool Dec-12-2005 If Len(Di...
Creating a compressed (or zipped) folder Is there a way to programmatically create a compressed folder in Windows? I can't see a way to do this using the FileSystemObject (although there is the 'Compressed' attribute). I've seen zip dll's but I'd prefer to avoid having to re-distribute a dll if possible. Windows XP nat...
TITLE: Creating a compressed (or zipped) folder QUESTION: Is there a way to programmatically create a compressed folder in Windows? I can't see a way to do this using the FileSystemObject (although there is the 'Compressed' attribute). I've seen zip dll's but I'd prefer to avoid having to re-distribute a dll if possib...
[ "vba", "vb6" ]
6
6
19,259
1
0
2008-10-07T15:26:43.947000
2008-10-07T15:29:46.373000
179,054
179,117
Is there any good or reliable way to figure out where a JavaScript error is using only an Internet Explorer error message?
I'm writing an app which for various reasons involves Internet Explorer (IE7, for the record), ActiveX controls, and a heroic amount of JavaScript, which is spread across multiple.js includes. One of our remote testers is experiencing an error message and IE's error message says something to the effect of: Line: 719 Ch...
In short. Not really. Try finding the error in FF first, and if that fails, you can get an almost as good debugger with Visual Web Developer. Debugging IE just sucks for the most part.
Is there any good or reliable way to figure out where a JavaScript error is using only an Internet Explorer error message? I'm writing an app which for various reasons involves Internet Explorer (IE7, for the record), ActiveX controls, and a heroic amount of JavaScript, which is spread across multiple.js includes. One ...
TITLE: Is there any good or reliable way to figure out where a JavaScript error is using only an Internet Explorer error message? QUESTION: I'm writing an app which for various reasons involves Internet Explorer (IE7, for the record), ActiveX controls, and a heroic amount of JavaScript, which is spread across multiple...
[ "javascript", "debugging", "internet-explorer" ]
8
5
825
10
0
2008-10-07T15:29:44.673000
2008-10-07T15:44:04.677000
179,063
181,969
How to store key-value pairs in application settings at runtime?
How can dynamic Key-value pairs of objects be stored in app.config in using the application settings api, at runtime? I've been trying to get my head around, and I can't find any meaningful example or documentation. I seems that.Net dictionary classes can't be serialized in XML to store them in app.config Is the only w...
After some more searching net, I've found a very good (albeit very long) article which describes in dept the.Net configuration model: Unraveling the Mysteries of.NET 2.0 Configuration I also found something very usefull: Configuration Section Designer A visual studio adding for visually designing config sections and ge...
How to store key-value pairs in application settings at runtime? How can dynamic Key-value pairs of objects be stored in app.config in using the application settings api, at runtime? I've been trying to get my head around, and I can't find any meaningful example or documentation. I seems that.Net dictionary classes can...
TITLE: How to store key-value pairs in application settings at runtime? QUESTION: How can dynamic Key-value pairs of objects be stored in app.config in using the application settings api, at runtime? I've been trying to get my head around, and I can't find any meaningful example or documentation. I seems that.Net dict...
[ "c#", ".net", "settings", "app-config" ]
4
2
10,340
5
0
2008-10-07T15:31:39.490000
2008-10-08T09:51:00.113000
179,072
341,596
Has using the HttpRuntime.Cache changed in ASP.NET MVC?
So, I was looking over my standard cache utility when preparing to unit test a controller and thought, hey, is accessing the HttpRuntime.Cache directly considered harmful in MVC? I wrap the cache in a proxy class that implements a cache-like interface (tho much simpler) so that I can mock it during tests. But I'm wonde...
No, but the cache has changed in 3.5. 3.5 includes wrapper classes that make stubbing/mocking many of the static classes used in asp.net easy. http://www.codethinked.com/post/2008/12/04/Using-SystemWebAbstractions-in-Your-WebForms-Apps.aspx
Has using the HttpRuntime.Cache changed in ASP.NET MVC? So, I was looking over my standard cache utility when preparing to unit test a controller and thought, hey, is accessing the HttpRuntime.Cache directly considered harmful in MVC? I wrap the cache in a proxy class that implements a cache-like interface (tho much si...
TITLE: Has using the HttpRuntime.Cache changed in ASP.NET MVC? QUESTION: So, I was looking over my standard cache utility when preparing to unit test a controller and thought, hey, is accessing the HttpRuntime.Cache directly considered harmful in MVC? I wrap the cache in a proxy class that implements a cache-like inte...
[ "asp.net-mvc", "caching", "httpruntime.cache" ]
1
0
2,208
2
0
2008-10-07T15:34:36.223000
2008-12-04T18:18:27.557000
179,085
179,224
Multiple Indexes vs Multi-Column Indexes
What is the difference between creating one index across multiple columns versus creating multiple indexes, one per column? Are there reasons why one should be used over the other? For example: Create NonClustered Index IX_IndexName On TableName (Column1 Asc, Column2 Asc, Column3 Asc) Versus: Create NonClustered Index ...
I agree with Cade Roux. This article should get you on the right track: Indexes in SQL Server 2005/2008 – Best Practices, Part 1 Indexes in SQL Server 2005/2008 – Part 2 – Internals One thing to note, clustered indexes should have a unique key (an identity column I would recommend) as the first column. Basically it hel...
Multiple Indexes vs Multi-Column Indexes What is the difference between creating one index across multiple columns versus creating multiple indexes, one per column? Are there reasons why one should be used over the other? For example: Create NonClustered Index IX_IndexName On TableName (Column1 Asc, Column2 Asc, Column...
TITLE: Multiple Indexes vs Multi-Column Indexes QUESTION: What is the difference between creating one index across multiple columns versus creating multiple indexes, one per column? Are there reasons why one should be used over the other? For example: Create NonClustered Index IX_IndexName On TableName (Column1 Asc, C...
[ "sql-server", "database", "indexing" ]
863
423
434,057
5
0
2008-10-07T15:36:44.597000
2008-10-07T16:10:57.883000
179,094
179,164
Where does the Toolbar Metadata live in Visual Studio on the Filesystem
My IDE crashes any time I try add a new component to the toolbar. I've already tried Resetting the toolbar. Where does the the information about the toolbar exist on the filesystem to see what may be the offending control?
Found the location: C:\users\\AppData\Local\Microsoft\VisualStudio\9.0 The 4 files: toolbox.tbd, toolbox_reset.tbd, toolboxIndex.tbd, toolboxIndex_reset.tbd
Where does the Toolbar Metadata live in Visual Studio on the Filesystem My IDE crashes any time I try add a new component to the toolbar. I've already tried Resetting the toolbar. Where does the the information about the toolbar exist on the filesystem to see what may be the offending control?
TITLE: Where does the Toolbar Metadata live in Visual Studio on the Filesystem QUESTION: My IDE crashes any time I try add a new component to the toolbar. I've already tried Resetting the toolbar. Where does the the information about the toolbar exist on the filesystem to see what may be the offending control? ANSWER...
[ "visual-studio" ]
1
2
100
1
0
2008-10-07T15:38:24.937000
2008-10-07T15:54:52.500000
179,099
183,679
Buildprocess for ActiveX / COM / VB6 enterprise projects
We have developed a software system using ActiveX/COM (VB6) technology from microsoft. In the last year, i get more and more interested in automated build processes and SCM at a whole. I intensively searched big parts of the web for information about best practices how to do scm with COM based software systems. The "pr...
Visual Build Pro. If you are still stuck in VB6 land, and have to build professional products I highly recommend you look into this product. It has a free trial and is worth every penny (plus it does a pretty good job of continuous integration for.Net and other platforms.) It has saved us from DLL hell on every release...
Buildprocess for ActiveX / COM / VB6 enterprise projects We have developed a software system using ActiveX/COM (VB6) technology from microsoft. In the last year, i get more and more interested in automated build processes and SCM at a whole. I intensively searched big parts of the web for information about best practic...
TITLE: Buildprocess for ActiveX / COM / VB6 enterprise projects QUESTION: We have developed a software system using ActiveX/COM (VB6) technology from microsoft. In the last year, i get more and more interested in automated build processes and SCM at a whole. I intensively searched big parts of the web for information ...
[ "com", "vb6", "build-process", "build-automation", "version-control" ]
5
5
3,490
3
0
2008-10-07T15:39:04.453000
2008-10-08T16:33:01.830000
179,105
179,121
Why shouldn't you use references to smart pointers?
I recall reading somewhere that using references to smart pointers can cause memory corruption. Is this simply because of using the reference of the smart pointer after its been destroyed? Or does the reference counting get messed up? Thanks for clarifying
Assuming you are talking about shared_ptr here... Is this simply because of using the reference of the smart pointer after its been destroyed? This is a good answer. You may not know absolutely the lifetime of the pointer your reference refers too. To get around this, you'd want to look into boost::weak_ptr. It doesn't...
Why shouldn't you use references to smart pointers? I recall reading somewhere that using references to smart pointers can cause memory corruption. Is this simply because of using the reference of the smart pointer after its been destroyed? Or does the reference counting get messed up? Thanks for clarifying
TITLE: Why shouldn't you use references to smart pointers? QUESTION: I recall reading somewhere that using references to smart pointers can cause memory corruption. Is this simply because of using the reference of the smart pointer after its been destroyed? Or does the reference counting get messed up? Thanks for clar...
[ "c++", "smart-pointers" ]
26
15
16,340
6
0
2008-10-07T15:41:15.680000
2008-10-07T15:44:32.507000
179,112
383,117
Need a way to authenticate to Exchange Web Services
I'm using Exchange Web Services to Find, Create, Update, and Delete appointments from the calendars for one or more people. The application would be used by a manager to view employees' vacation time, as well as assign appointments based on availability. In order for this to all work, an authenticated user's credential...
Are there company policy restrictions preventing you from using impersonation? Are you referring to Windows impersonation or Exchange impersonation? Depending on which impersonation you cannot use, an alternative might be delegate acess. If the goal is to let a manager view multiple mailboxes, here are some options: (1...
Need a way to authenticate to Exchange Web Services I'm using Exchange Web Services to Find, Create, Update, and Delete appointments from the calendars for one or more people. The application would be used by a manager to view employees' vacation time, as well as assign appointments based on availability. In order for ...
TITLE: Need a way to authenticate to Exchange Web Services QUESTION: I'm using Exchange Web Services to Find, Create, Update, and Delete appointments from the calendars for one or more people. The application would be used by a manager to view employees' vacation time, as well as assign appointments based on availabil...
[ "web-services", "exchange-server", "exchangewebservices" ]
5
6
11,338
3
0
2008-10-07T15:42:42.777000
2008-12-20T08:51:10.060000
179,113
179,118
Graceful handling of dependent scheduled tasks?
Say I've got two scheduled processes: A and B. Given that B should not run until A has completed, how might I gracefully enforce this dependency? Approaches that have been considered: Have A schedule B upon completion. This has the downside of B never being scheduled if for some reason A failed. When B runs, have it pi...
Your option 1 directly answers your question: if B is dependent on A, and A fails, A not scheduling B means that B can't happen. Unless B merely has to run after A does, whether or not A was successful. In that case, something like the following (in bash) would work: A && B
Graceful handling of dependent scheduled tasks? Say I've got two scheduled processes: A and B. Given that B should not run until A has completed, how might I gracefully enforce this dependency? Approaches that have been considered: Have A schedule B upon completion. This has the downside of B never being scheduled if f...
TITLE: Graceful handling of dependent scheduled tasks? QUESTION: Say I've got two scheduled processes: A and B. Given that B should not run until A has completed, how might I gracefully enforce this dependency? Approaches that have been considered: Have A schedule B upon completion. This has the downside of B never be...
[ "dependencies", "scheduled-tasks" ]
0
2
1,729
2
0
2008-10-07T15:42:44.803000
2008-10-07T15:44:07.703000
179,123
179,147
How to modify existing, unpushed commit messages?
I wrote the wrong thing in a commit message. How can I change the message? The commit has not been pushed yet.
Amending the most recent commit message git commit --amend will open your editor, allowing you to change the commit message of the most recent commit. Additionally, you can set the commit message directly in the command line with: git commit --amend -m "New commit message" …however, this can make multi-line commit mess...
How to modify existing, unpushed commit messages? I wrote the wrong thing in a commit message. How can I change the message? The commit has not been pushed yet.
TITLE: How to modify existing, unpushed commit messages? QUESTION: I wrote the wrong thing in a commit message. How can I change the message? The commit has not been pushed yet. ANSWER: Amending the most recent commit message git commit --amend will open your editor, allowing you to change the commit message of the m...
[ "git", "git-commit", "git-rewrite-history", "git-amend" ]
7,648
18,566
3,729,267
27
0
2008-10-07T15:44:47.920000
2008-10-07T15:50:34.630000
179,128
179,323
Reading compound documents in c#
I'm starting a project which requires reading outlook msg files in c#. I have the specs for compound documents but am having trouble reading them in c#. Any pointers would be greatly appreciated. Thanks.
Here is my shot. This is an initial translation of this article. namespace cs_console_app { using System; using System.Runtime.InteropServices; using System.Runtime.InteropServices.ComTypes; [ComImport] [Guid("0000000d-0000-0000-C000-000000000046")] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interfac...
Reading compound documents in c# I'm starting a project which requires reading outlook msg files in c#. I have the specs for compound documents but am having trouble reading them in c#. Any pointers would be greatly appreciated. Thanks.
TITLE: Reading compound documents in c# QUESTION: I'm starting a project which requires reading outlook msg files in c#. I have the specs for compound documents but am having trouble reading them in c#. Any pointers would be greatly appreciated. Thanks. ANSWER: Here is my shot. This is an initial translation of this ...
[ "c#", ".net", "binaryfiles" ]
6
13
6,522
2
0
2008-10-07T15:46:00.663000
2008-10-07T16:33:46.370000
179,161
179,174
Is a DVCS useful for one developer?
Or would a conventional client-server VCS be more appropriate? I'm currently using TortoiseSVN, but I'm interested in a DVCS, but I'm not sure if it's even a good idea to try to use something like that solo.
Since you can still push to another machine also running Git/Mercurial/Bzr/etc you still have the multi-computer backup safety, which you'd hopefully have either way. However if you ever code while traveling, having full repository access can be a huge plus, then just resync to your server when you have a net connectio...
Is a DVCS useful for one developer? Or would a conventional client-server VCS be more appropriate? I'm currently using TortoiseSVN, but I'm interested in a DVCS, but I'm not sure if it's even a good idea to try to use something like that solo.
TITLE: Is a DVCS useful for one developer? QUESTION: Or would a conventional client-server VCS be more appropriate? I'm currently using TortoiseSVN, but I'm interested in a DVCS, but I'm not sure if it's even a good idea to try to use something like that solo. ANSWER: Since you can still push to another machine also ...
[ "version-control", "dvcs" ]
16
15
1,042
6
0
2008-10-07T15:53:48.963000
2008-10-07T15:56:30.487000
179,162
179,894
Hashtable implementation for Delphi 5
Do you know a good and free Hashtable imlementation for Delphi 5? I need to organize a huge amount of data in a hastable and I am bit worried about memory leak issues that I found in most available implementations on the web. Tks
You can also check out the open-source / formerly commercial TurboPower SysTools. Not sure how much it is being updated. At one point Julian Bucknall recommended it over his EZDSL library, although that was back when he still worked fur TurboPower and it was being maintained / updated.
Hashtable implementation for Delphi 5 Do you know a good and free Hashtable imlementation for Delphi 5? I need to organize a huge amount of data in a hastable and I am bit worried about memory leak issues that I found in most available implementations on the web. Tks
TITLE: Hashtable implementation for Delphi 5 QUESTION: Do you know a good and free Hashtable imlementation for Delphi 5? I need to organize a huge amount of data in a hastable and I am bit worried about memory leak issues that I found in most available implementations on the web. Tks ANSWER: You can also check out th...
[ "delphi", "data-structures", "memory-leaks", "hashtable" ]
10
10
6,628
8
0
2008-10-07T15:54:08.197000
2008-10-07T19:09:34.307000
179,173
179,191
Append XML string block to existing XmlDocument
I have an XmlDocument that already exists and is read from a file. I would like to add a chunk of Xml to a node in the document. Is there a good way to create and add all the nodes without cluttering my code with many.CreateNote and.AppendChild calls? I would like some way of making a string or stringBuilder of a valid...
I suggest using XmlDocument.CreateDocumentFragment if you have the data in free form strings. You'll still have to use AppendChild to add the fragment to a node, but you have the freedom of building the XML in your StringBuilder. XmlDocument xdoc = new XmlDocument(); xdoc.LoadXml(@" "); XmlDocumentFragment xfrag = xdo...
Append XML string block to existing XmlDocument I have an XmlDocument that already exists and is read from a file. I would like to add a chunk of Xml to a node in the document. Is there a good way to create and add all the nodes without cluttering my code with many.CreateNote and.AppendChild calls? I would like some wa...
TITLE: Append XML string block to existing XmlDocument QUESTION: I have an XmlDocument that already exists and is read from a file. I would like to add a chunk of Xml to a node in the document. Is there a good way to create and add all the nodes without cluttering my code with many.CreateNote and.AppendChild calls? I ...
[ "c#", "xml" ]
37
93
78,956
6
0
2008-10-07T15:56:26.913000
2008-10-07T16:00:49.807000
179,176
179,190
How to create an SQL table and and populate it with Excel spreadsheet data?
Is there an easy way to create a table in SQL Server (2005) from an Excel spreadsheet. I'm thinking maybe some tool? Thanks in advance.
If the data is not that big and if it is a simple table, easiest way is to create and open the table in SQL Server Management Studio and copy paste the excel data into it. Other solutions are using DTS or using SSIS..
How to create an SQL table and and populate it with Excel spreadsheet data? Is there an easy way to create a table in SQL Server (2005) from an Excel spreadsheet. I'm thinking maybe some tool? Thanks in advance.
TITLE: How to create an SQL table and and populate it with Excel spreadsheet data? QUESTION: Is there an easy way to create a table in SQL Server (2005) from an Excel spreadsheet. I'm thinking maybe some tool? Thanks in advance. ANSWER: If the data is not that big and if it is a simple table, easiest way is to create...
[ "sql-server", "excel", "ssis", "dts" ]
25
11
116,594
6
0
2008-10-07T15:56:54.667000
2008-10-07T16:00:42.990000
179,186
531,847
Problem with conflict between mysql and math.h
The problem is that the compiler says that there is a redefinition of a function between a library that belongs to MySQL and math.h from the std library. I have been over this for two days and I still can't figure it out. Has this ever happened to anyone? This is the output from the compiler C:\mingw\bin\mingw32-make.e...
The problem was about an included library, which linux simply ignores, but windows want out. There is no problem letting it out in linux neither... Somedays i feel SOOOOOOOOOOOOOOOOOOOOOOO STUPID:..
Problem with conflict between mysql and math.h The problem is that the compiler says that there is a redefinition of a function between a library that belongs to MySQL and math.h from the std library. I have been over this for two days and I still can't figure it out. Has this ever happened to anyone? This is the outpu...
TITLE: Problem with conflict between mysql and math.h QUESTION: The problem is that the compiler says that there is a redefinition of a function between a library that belongs to MySQL and math.h from the std library. I have been over this for two days and I still can't figure it out. Has this ever happened to anyone?...
[ "mysql", "math.h" ]
0
1
743
3
0
2008-10-07T15:59:53.630000
2009-02-10T11:01:33.243000
179,223
179,240
How do you inherit StringBuilder in vb.net?
I want to add my own member to the StringBuilder class, but when I go to create it IntelliSense doesn't bring it up. public class myStringBuilder() Inherits System.Text.[StringBuilder should be here].... end class Is it even possible? thanks
StringBuilder is NotInheritable (aka sealed in C#) so you cannot derive from it. You could try wrapping StringBuilder in your own class or consider using extension methods instead.
How do you inherit StringBuilder in vb.net? I want to add my own member to the StringBuilder class, but when I go to create it IntelliSense doesn't bring it up. public class myStringBuilder() Inherits System.Text.[StringBuilder should be here].... end class Is it even possible? thanks
TITLE: How do you inherit StringBuilder in vb.net? QUESTION: I want to add my own member to the StringBuilder class, but when I go to create it IntelliSense doesn't bring it up. public class myStringBuilder() Inherits System.Text.[StringBuilder should be here].... end class Is it even possible? thanks ANSWER: StringB...
[ "vb.net", "stringbuilder" ]
6
16
2,238
6
0
2008-10-07T16:10:48.193000
2008-10-07T16:13:33.167000
179,238
179,313
What scares you the most about the integrated IDE of most modern Smalltalks?
As I'm riding the wave of resurgence of Smalltalk (especially because many Ruby-on-Rails people are rediscovering Smalltalk and seeing Seaside as their next upgraded web framework), I get questions like "yeah, but how do I use my favorite editor to edit Smalltalk code?" or "Does Smalltalk still insist on living in a wo...
Everything's different. Want to go to the end of the line? It's not Ctrl - E. Want to jump a few words over, by word? It's not Meta-F.... Text editing is a fundamental programming activity. Messing with those inputs is messing with something deep in my mind. Edit: and here is someone asking for emacs key bindings on co...
What scares you the most about the integrated IDE of most modern Smalltalks? As I'm riding the wave of resurgence of Smalltalk (especially because many Ruby-on-Rails people are rediscovering Smalltalk and seeing Seaside as their next upgraded web framework), I get questions like "yeah, but how do I use my favorite edit...
TITLE: What scares you the most about the integrated IDE of most modern Smalltalks? QUESTION: As I'm riding the wave of resurgence of Smalltalk (especially because many Ruby-on-Rails people are rediscovering Smalltalk and seeing Seaside as their next upgraded web framework), I get questions like "yeah, but how do I us...
[ "ruby-on-rails", "ruby", "ide", "smalltalk", "seaside" ]
22
27
2,131
8
0
2008-10-07T16:13:24.960000
2008-10-07T16:30:23.460000
179,254
1,592,129
Reloading configuration without restarting application using ConfigurationManager.RefreshSection
Has anyone got this working in a web application? No matter what I do it seems that my appSettings section (redirected from web.config using appSettings file=".\Site\site.config") does not get reloaded. Am I doomed to the case of having to just restart the application? I was hoping this method would lead me to a more p...
Make sure you are passing the correct case sensitive value to RefreshSection, i.e. ConfigurationManager.RefreshSection("appSettings");
Reloading configuration without restarting application using ConfigurationManager.RefreshSection Has anyone got this working in a web application? No matter what I do it seems that my appSettings section (redirected from web.config using appSettings file=".\Site\site.config") does not get reloaded. Am I doomed to the c...
TITLE: Reloading configuration without restarting application using ConfigurationManager.RefreshSection QUESTION: Has anyone got this working in a web application? No matter what I do it seems that my appSettings section (redirected from web.config using appSettings file=".\Site\site.config") does not get reloaded. Am...
[ "c#", "asp.net", "performance", "settings" ]
45
58
51,922
10
0
2008-10-07T16:16:04.377000
2009-10-20T02:14:32.963000
179,260
179,296
IE8 loses cookies when opening a new window after a redirect
I'm using Internet Explorer 8 beta 2. Client performs POST on http://alpha/foo Server responds with redirect to http://beta/bar Client performs GET on http://beta/bar Server responds with redirect to http://beta/baz and sets cookie Client performs GET on http://beta/baz including cookie Server provides response User se...
I believe that IE8 uses a separate process for each window. If you're using session cookies, the new process will start with a fresh session and therefore won't be able to submit the session cookies received by the other process. Can you try using persistent cookies and see what happens? From http://www.microsoft.com/w...
IE8 loses cookies when opening a new window after a redirect I'm using Internet Explorer 8 beta 2. Client performs POST on http://alpha/foo Server responds with redirect to http://beta/bar Client performs GET on http://beta/bar Server responds with redirect to http://beta/baz and sets cookie Client performs GET on http...
TITLE: IE8 loses cookies when opening a new window after a redirect QUESTION: I'm using Internet Explorer 8 beta 2. Client performs POST on http://alpha/foo Server responds with redirect to http://beta/bar Client performs GET on http://beta/bar Server responds with redirect to http://beta/baz and sets cookie Client pe...
[ "cookies", "internet-explorer-8" ]
6
2
16,410
1
0
2008-10-07T16:17:03.080000
2008-10-07T16:26:59.643000
179,264
180,183
What is the optimum limit for URL length? 100, 200+
I have an ASP.Net 3.5 platform and windows 2003 server with all the updates. There is a limit with.Net that it cannot handle more than 260 characters. Moreover if you look it up on web, you will find that IE 6 fails to work if it is not patched at above 100 charcters. I want to have the rewrite path module to be suppor...
A Url is path + querystring, and the linked article only talks about limiting the path. Therefore, if you're using asp.net, don't exceed a path of 260 characters. Less than 260 will always work, and asp.net has no troubles with long querystrings. http://somewhere.com/directory/filename.aspx?id=1234 ^^^^^^^- querystring...
What is the optimum limit for URL length? 100, 200+ I have an ASP.Net 3.5 platform and windows 2003 server with all the updates. There is a limit with.Net that it cannot handle more than 260 characters. Moreover if you look it up on web, you will find that IE 6 fails to work if it is not patched at above 100 charcters....
TITLE: What is the optimum limit for URL length? 100, 200+ QUESTION: I have an ASP.Net 3.5 platform and windows 2003 server with all the updates. There is a limit with.Net that it cannot handle more than 260 characters. Moreover if you look it up on web, you will find that IE 6 fails to work if it is not patched at ab...
[ "asp.net" ]
6
5
6,836
11
0
2008-10-07T16:17:52.500000
2008-10-07T20:15:12.773000
179,287
179,306
What is the best way to change text contained in an XML file using Python?
Let's say I have an existing trivial XML file named 'MyData.xml' that contains the following: foo I want to change the text value of 'foo' to 'bar' resulting in the following: bar Once I am done, I want to save the changes. What is the easiest and simplest way to accomplish all this?
Use Python's minidom Basically you will take the following steps: Read XML data into DOM object Use DOM methods to modify the document Save new DOM object to new XML document The python spec should hold your hand rather nicely though this process.
What is the best way to change text contained in an XML file using Python? Let's say I have an existing trivial XML file named 'MyData.xml' that contains the following: foo I want to change the text value of 'foo' to 'bar' resulting in the following: bar Once I am done, I want to save the changes. What is the easiest a...
TITLE: What is the best way to change text contained in an XML file using Python? QUESTION: Let's say I have an existing trivial XML file named 'MyData.xml' that contains the following: foo I want to change the text value of 'foo' to 'bar' resulting in the following: bar Once I am done, I want to save the changes. Wha...
[ "python", "xml", "text" ]
5
4
7,794
4
0
2008-10-07T16:23:52.473000
2008-10-07T16:29:06.753000
179,288
179,403
HTML Frameset alignment
Say I have 3 frames in a frameset arranged in 3 rows. Frames 1 and 3 are from my site and frame 2 (the central one) is from an external website. Is there a cunning way to force the browser to centre align the data in frame 2? I've found a small work-around which uses a frameset within a frameset which has 2 blank colum...
I think what you are looking for is a way to inject some CSS into the other frame, even though it comes from another site. I think this will not be possible without a server side script to request the page and modify it. Javascript has ways to modify other frames using window.frames[] and using DOM traversal just like ...
HTML Frameset alignment Say I have 3 frames in a frameset arranged in 3 rows. Frames 1 and 3 are from my site and frame 2 (the central one) is from an external website. Is there a cunning way to force the browser to centre align the data in frame 2? I've found a small work-around which uses a frameset within a frameset...
TITLE: HTML Frameset alignment QUESTION: Say I have 3 frames in a frameset arranged in 3 rows. Frames 1 and 3 are from my site and frame 2 (the central one) is from an external website. Is there a cunning way to force the browser to centre align the data in frame 2? I've found a small work-around which uses a frameset...
[ "html", "frameset" ]
1
2
4,569
2
0
2008-10-07T16:23:59.993000
2008-10-07T16:53:07.720000
179,291
179,469
Setting up pipelines reading from named pipes without blocking in bash
I'm looking to call a subprocess with a file descriptor opened to a given pipe such that the open() call does not hang waiting for the other side of the pipe to receive a connection. To demonstrate: $ mkfifo /tmp/foobar.pipe $ some_program --command-fd=5 5 In this case, some_program is not run until some process has /t...
Opening the FD read/write rather than read-only when setting up the pipeline prevents blocking. To be a bit more specific: $ mkfifo /tmp/foobar.pipe $ some_program --command-fd=5 5<>/tmp/foobar.pipe prevents the undesired blocking behavior, as 5<>/tmp/foobar.pipe opens in RW mode (as opposed to opening in read-only mod...
Setting up pipelines reading from named pipes without blocking in bash I'm looking to call a subprocess with a file descriptor opened to a given pipe such that the open() call does not hang waiting for the other side of the pipe to receive a connection. To demonstrate: $ mkfifo /tmp/foobar.pipe $ some_program --command...
TITLE: Setting up pipelines reading from named pipes without blocking in bash QUESTION: I'm looking to call a subprocess with a file descriptor opened to a given pipe such that the open() call does not hang waiting for the other side of the pipe to receive a connection. To demonstrate: $ mkfifo /tmp/foobar.pipe $ some...
[ "bash", "unix", "shell", "pipe" ]
7
9
9,281
2
0
2008-10-07T16:25:05.637000
2008-10-07T17:12:31.267000
179,293
179,308
Should I Learn NHaml?
Should I learn NHaml? What does it provide me over a classic ASP.NET MVC view? What are the pros and cons? Are you using it via the MVC Contrib project? I have been seeing more and more about it. For example... I saw a blog post by Matthew Podwysocki using ASP.NET MVC, NHaml, and F#!
It should only take a few hours if you're familiar with the MVC framework, so I'd say yes, learn it. NHaml is a compact way to write HTML code. It is pretty easy to read and write once you get used to it. The downsides are that you lose the ASP.NET controls, so server-side processing is more difficult. Your team may be...
Should I Learn NHaml? Should I learn NHaml? What does it provide me over a classic ASP.NET MVC view? What are the pros and cons? Are you using it via the MVC Contrib project? I have been seeing more and more about it. For example... I saw a blog post by Matthew Podwysocki using ASP.NET MVC, NHaml, and F#!
TITLE: Should I Learn NHaml? QUESTION: Should I learn NHaml? What does it provide me over a classic ASP.NET MVC view? What are the pros and cons? Are you using it via the MVC Contrib project? I have been seeing more and more about it. For example... I saw a blog post by Matthew Podwysocki using ASP.NET MVC, NHaml, and...
[ "asp.net-mvc", "f#", "haml", "nhaml" ]
5
5
648
2
0
2008-10-07T16:26:23.060000
2008-10-07T16:29:37.190000
179,295
179,343
How do I indicate a validation requirement to users of my class?
I'm implementing a class that wraps around an xml document with a very strictly defined schema. I don't control the schema. One of the properties in the class is for an element value that the schema indicates must match a certain regular expression. In the setter for the property, if a string doesn't match the expressi...
Thanks for the advice. One idea I had while thinking about this was creating a new class named something like MatchedString to enforce the constraint. It'd have a constructor that required a regex string, and after construction the expression would only be exposed to users via a read-only property. Then it would have a...
How do I indicate a validation requirement to users of my class? I'm implementing a class that wraps around an xml document with a very strictly defined schema. I don't control the schema. One of the properties in the class is for an element value that the schema indicates must match a certain regular expression. In th...
TITLE: How do I indicate a validation requirement to users of my class? QUESTION: I'm implementing a class that wraps around an xml document with a very strictly defined schema. I don't control the schema. One of the properties in the class is for an element value that the schema indicates must match a certain regular...
[ ".net", "visual-studio", "validation", ".net-2.0" ]
3
0
243
5
0
2008-10-07T16:26:55.120000
2008-10-07T16:39:12.257000
179,299
179,318
How do shell text editors work?
I'm fairly new at programming, but I've wondered how shell text editors such as vim, emacs, nano, etc are able to control the command-line window. I'm primarily a Windows programmer, so maybe it's different on *nix. As far as I know, it's only possible to print text to a console, and ask for input. How do text editors ...
By using libraries such as the following which, in turn, use escape character sequences NAME ncurses - CRT screen handling and optimization package SYNOPSIS #include DESCRIPTION The ncurses library routines give the user a terminal-independent method of updating character screens with reasonable optimization. This im...
How do shell text editors work? I'm fairly new at programming, but I've wondered how shell text editors such as vim, emacs, nano, etc are able to control the command-line window. I'm primarily a Windows programmer, so maybe it's different on *nix. As far as I know, it's only possible to print text to a console, and ask...
TITLE: How do shell text editors work? QUESTION: I'm fairly new at programming, but I've wondered how shell text editors such as vim, emacs, nano, etc are able to control the command-line window. I'm primarily a Windows programmer, so maybe it's different on *nix. As far as I know, it's only possible to print text to ...
[ "shell", "text-editor" ]
10
10
3,023
8
0
2008-10-07T16:27:13.387000
2008-10-07T16:33:01.987000
179,311
179,331
Is O/R Mapping worth it?
The expressiveness of the query languages (QL) provided with ORMs can be very powerful. Unfortunately, once you have a fleet of complex queries, and then some puzzling schema or data problem arises, it is very difficult to enlist the DBA help that you need? Here they are, part of the team that is evolving the database,...
I think that what you want is a solution that maximizes the benefits of ORM without preventing you using other means. We have much the same issue as you do in our application; very heavy queries, and a large data model. Given the size of the data model, ORM is invaluable for the vast majority of the application. It all...
Is O/R Mapping worth it? The expressiveness of the query languages (QL) provided with ORMs can be very powerful. Unfortunately, once you have a fleet of complex queries, and then some puzzling schema or data problem arises, it is very difficult to enlist the DBA help that you need? Here they are, part of the team that ...
TITLE: Is O/R Mapping worth it? QUESTION: The expressiveness of the query languages (QL) provided with ORMs can be very powerful. Unfortunately, once you have a fleet of complex queries, and then some puzzling schema or data problem arises, it is very difficult to enlist the DBA help that you need? Here they are, part...
[ "orm" ]
13
8
2,407
3
0
2008-10-07T16:29:54.223000
2008-10-07T16:35:49.110000
179,315
179,354
Downloading Docx from IE - Setting MIME Types in IIS
I am sure there is a simple answer to this one. I have a docx file that I get an error when trying to download(document cannot be found).....doc is fine.txt is also fine. I am sure this is just an iis setting, the permissions on the server are all the same for all files.
Yes, it's just an IIS setting: by default, it will only serve files for which the extension matches a defined MIME type. To allow.docx files to be downloaded, follow the steps from the KB article linked above: Open the IIS Microsoft Management Console (MMC), right-click the local computer name, and then click Propertie...
Downloading Docx from IE - Setting MIME Types in IIS I am sure there is a simple answer to this one. I have a docx file that I get an error when trying to download(document cannot be found).....doc is fine.txt is also fine. I am sure this is just an iis setting, the permissions on the server are all the same for all fi...
TITLE: Downloading Docx from IE - Setting MIME Types in IIS QUESTION: I am sure there is a simple answer to this one. I have a docx file that I get an error when trying to download(document cannot be found).....doc is fine.txt is also fine. I am sure this is just an iis setting, the permissions on the server are all t...
[ "iis", "mime-types" ]
29
39
69,777
4
0
2008-10-07T16:30:50.230000
2008-10-07T16:41:49.567000
179,337
179,346
How to fix precision of variable
In c# double tmp = 3.0 * 0.05; tmp = 0.15000000000000002 This has to do with money. The value is really $0.15, but the system wants to round it up to $0.16. 0.151 should probably be rounded up to 0.16, but not 0.15000000000000002 What are some ways I can get the correct numbers (ie 0.15, or 0.16 if the decimal is high ...
Use a fixed-point variable type, or a base ten floating point type like Decimal. Floating point numbers are always somewhat inaccurate, and binary floating point representations add another layer of inaccuracy when they convert to/from base two.
How to fix precision of variable In c# double tmp = 3.0 * 0.05; tmp = 0.15000000000000002 This has to do with money. The value is really $0.15, but the system wants to round it up to $0.16. 0.151 should probably be rounded up to 0.16, but not 0.15000000000000002 What are some ways I can get the correct numbers (ie 0.15...
TITLE: How to fix precision of variable QUESTION: In c# double tmp = 3.0 * 0.05; tmp = 0.15000000000000002 This has to do with money. The value is really $0.15, but the system wants to round it up to $0.16. 0.151 should probably be rounded up to 0.16, but not 0.15000000000000002 What are some ways I can get the correc...
[ "c#", ".net", "math" ]
3
14
1,405
6
0
2008-10-07T16:38:05.470000
2008-10-07T16:39:40.943000
179,338
179,373
How to manage external dependencies which are constantly being modified
Our development uses lots of open-source code and I'm trying to figure out what the best way to manage these external dependencies. Our current configuration: we are developing for both linux and windows We use svn for our own code external dependencies (boost, log4cpp, etc) are not stored in svn. Instead I put them un...
I keep them in svn, and manage them as vendor branches. Keeping them loose externally makes it very hard to go back to a previous build, or fix bugs in a previous build (especially if the bug is from a change to the external dependency) Keeping them in svn has saved me lots of headache, and also allows you to get a new...
How to manage external dependencies which are constantly being modified Our development uses lots of open-source code and I'm trying to figure out what the best way to manage these external dependencies. Our current configuration: we are developing for both linux and windows We use svn for our own code external depende...
TITLE: How to manage external dependencies which are constantly being modified QUESTION: Our development uses lots of open-source code and I'm trying to figure out what the best way to manage these external dependencies. Our current configuration: we are developing for both linux and windows We use svn for our own cod...
[ "version-control", "build-process" ]
7
6
2,770
5
0
2008-10-07T16:38:17.513000
2008-10-07T16:47:56.170000
179,355
179,514
Clearing all cookies with JavaScript
How do you delete all the cookies for the current domain using JavaScript?
function deleteAllCookies() { const cookies = document.cookie.split(";"); for (let i = 0; i < cookies.length; i++) { const cookie = cookies[i]; const eqPos = cookie.indexOf("="); const name = eqPos > -1? cookie.substr(0, eqPos): cookie; document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT"; } } Note that ...
Clearing all cookies with JavaScript How do you delete all the cookies for the current domain using JavaScript?
TITLE: Clearing all cookies with JavaScript QUESTION: How do you delete all the cookies for the current domain using JavaScript? ANSWER: function deleteAllCookies() { const cookies = document.cookie.split(";"); for (let i = 0; i < cookies.length; i++) { const cookie = cookies[i]; const eqPos = cookie.indexOf("="); c...
[ "javascript", "cookies" ]
428
441
723,544
27
0
2008-10-07T16:41:55.480000
2008-10-07T17:27:03.080000
179,365
190,035
How can I connect to an Oracle database as SYS using an ADO connection string?
I am trying this: Provider=MSDASQL.1;Persist Security Info=False;User ID=sys;Password=pwd;Initial Catalog=DATABASE;Data Source=OdbcDataSource;DBA Privilege=SYSDBA But I get the error: [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed I'm using Delphi, but answers in any language are welcome. Clarificat...
You can't connect as SYSDBA using standard System.Data.OracleClient, as stated by this post: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2245591&SiteID=1. You can do that using ODP.NET (Oracle Data Provider for.NET), or other third parties library. If you're planning to build serious Oracle Application on.NET...
How can I connect to an Oracle database as SYS using an ADO connection string? I am trying this: Provider=MSDASQL.1;Persist Security Info=False;User ID=sys;Password=pwd;Initial Catalog=DATABASE;Data Source=OdbcDataSource;DBA Privilege=SYSDBA But I get the error: [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAt...
TITLE: How can I connect to an Oracle database as SYS using an ADO connection string? QUESTION: I am trying this: Provider=MSDASQL.1;Persist Security Info=False;User ID=sys;Password=pwd;Initial Catalog=DATABASE;Data Source=OdbcDataSource;DBA Privilege=SYSDBA But I get the error: [Microsoft][ODBC Driver Manager] Driver...
[ "oracle", "ado", "connection-string", "sysdba" ]
3
4
9,316
5
0
2008-10-07T16:44:55.537000
2008-10-10T03:37:54.250000
179,368
179,481
Bad Database Design - Is my table too large?
I have a poorly designed database. One of the most important tables has 11,000+ entries. We would like to expand our system, and I am wondering if this table grew to 5x its size, would this be a problem? It's 15360 kB in size... if that matters. I'm using phpMyAdmin, the server is a Fedora Linux box (nothing fancy), Th...
I understand that you are worried if increasing the number of records to around 55.000 in"your poorly designed database" will affect performance. If you system works as expected now I think you should be fine with 50.000 records as well unless you have some slight performance issues already. As most people mentioned 50...
Bad Database Design - Is my table too large? I have a poorly designed database. One of the most important tables has 11,000+ entries. We would like to expand our system, and I am wondering if this table grew to 5x its size, would this be a problem? It's 15360 kB in size... if that matters. I'm using phpMyAdmin, the ser...
TITLE: Bad Database Design - Is my table too large? QUESTION: I have a poorly designed database. One of the most important tables has 11,000+ entries. We would like to expand our system, and I am wondering if this table grew to 5x its size, would this be a problem? It's 15360 kB in size... if that matters. I'm using p...
[ "database", "database-design", "performance", "size" ]
4
8
5,260
14
0
2008-10-07T16:45:41.963000
2008-10-07T17:17:01.400000
179,369
179,608
How do I abort the execution of a Python script?
I have a simple Python script that I want to stop executing if a condition is met. For example: done = True if done: # quit/stop/exit else: # do other stuff Essentially, I am looking for something that behaves equivalently to the 'return' keyword in the body of a function which allows the flow of the code to exit the f...
To exit a script you can use, import sys sys.exit() You can also provide an exit status value, usually an integer. import sys sys.exit(0) Exits with zero, which is generally interpreted as success. Non-zero codes are usually treated as errors. The default is to exit with zero. import sys sys.exit("aa! errors!") Prints ...
How do I abort the execution of a Python script? I have a simple Python script that I want to stop executing if a condition is met. For example: done = True if done: # quit/stop/exit else: # do other stuff Essentially, I am looking for something that behaves equivalently to the 'return' keyword in the body of a functio...
TITLE: How do I abort the execution of a Python script? QUESTION: I have a simple Python script that I want to stop executing if a condition is met. For example: done = True if done: # quit/stop/exit else: # do other stuff Essentially, I am looking for something that behaves equivalently to the 'return' keyword in the...
[ "python", "syntax", "scripting", "exit" ]
198
333
479,456
8
0
2008-10-07T16:46:36.500000
2008-10-07T17:49:22.147000
179,405
179,419
Explain this mod_rewrite rule
Can anyone explain what this mod_rewrite rule is doing? I'm trying to comment the file, but the code seems to state the opposite of what I think it's doing # Enable rewriting of URLs RewriteEngine on # Allow specified file types to be accessed # Thing to test = URL # Condition = not starting with RewriteCond $1!^(inde...
^ = begin of line ( = begin group.* = any character, any number of times ) = end group The $1 in the second part is replaced by the group in the first part. Is this a Symfony rule? The idea is to pass the whole query string to the index.php (the front controller) as a parameter, so that the front controller can parse a...
Explain this mod_rewrite rule Can anyone explain what this mod_rewrite rule is doing? I'm trying to comment the file, but the code seems to state the opposite of what I think it's doing # Enable rewriting of URLs RewriteEngine on # Allow specified file types to be accessed # Thing to test = URL # Condition = not start...
TITLE: Explain this mod_rewrite rule QUESTION: Can anyone explain what this mod_rewrite rule is doing? I'm trying to comment the file, but the code seems to state the opposite of what I think it's doing # Enable rewriting of URLs RewriteEngine on # Allow specified file types to be accessed # Thing to test = URL # Con...
[ "regex", "apache", "mod-rewrite", "codeigniter" ]
2
4
1,051
3
0
2008-10-07T16:53:18.687000
2008-10-07T16:57:40.020000
179,415
179,431
Java2D: Is it always safe to cast Graphics into Graphics2D
Assuming we always use a Sun JVM (say, 1.5+), is it always safe to cast a Graphics reference to Graphics2D? I haven't seen it cause any problems yet and, to my understanding, the Graphics class is legacy code but the Java designers didn't want to change the interfaces for Swing and AWT classes in order to preserver bac...
According to the discussion here, it is always safe to cast from Graphics to Graphics2D. However I am not able to quickly find the official Sun statement on this. The reason it is valid to cast from Graphics to Graphics2D, is because Sun have said that all Graphics objects returned by the API in Java 1.2 or above will ...
Java2D: Is it always safe to cast Graphics into Graphics2D Assuming we always use a Sun JVM (say, 1.5+), is it always safe to cast a Graphics reference to Graphics2D? I haven't seen it cause any problems yet and, to my understanding, the Graphics class is legacy code but the Java designers didn't want to change the int...
TITLE: Java2D: Is it always safe to cast Graphics into Graphics2D QUESTION: Assuming we always use a Sun JVM (say, 1.5+), is it always safe to cast a Graphics reference to Graphics2D? I haven't seen it cause any problems yet and, to my understanding, the Graphics class is legacy code but the Java designers didn't want...
[ "java", "java-2d" ]
38
26
16,555
3
0
2008-10-07T16:56:21.723000
2008-10-07T17:00:08.423000
179,423
179,470
How to add to a textbox the red line (like bad spelling in Word)?
How can we produce the effect of the red line under a bad spelling word like the image below: alt text http://img505.imageshack.us/img505/7253/options285x395rg9.th.png Update I do not want to use Google or whatever spell program. I would like to know how to create the effect of the red line.
You can do this using a RichTextBox control, which will allow you to set the underline style and underline color on any portion of text. And here's an example doing exactly what you want to do.
How to add to a textbox the red line (like bad spelling in Word)? How can we produce the effect of the red line under a bad spelling word like the image below: alt text http://img505.imageshack.us/img505/7253/options285x395rg9.th.png Update I do not want to use Google or whatever spell program. I would like to know how...
TITLE: How to add to a textbox the red line (like bad spelling in Word)? QUESTION: How can we produce the effect of the red line under a bad spelling word like the image below: alt text http://img505.imageshack.us/img505/7253/options285x395rg9.th.png Update I do not want to use Google or whatever spell program. I woul...
[ "c#", ".net", ".net-2.0" ]
6
6
4,322
4
0
2008-10-07T16:58:06.943000
2008-10-07T17:12:48.863000
179,425
379,297
401 when POSTing using HttpWebRequest (yes I used Credentials)
I'm using HttpWebRequest to pull down XML, and POST data back to a 'WebService' and getting a 401 on the POST. When creating the requests I've added Credentials and now tried a credentials cache and setting PreAutenticate to True, still getting the 401!:( Watching the HTTP traffic on the router I set the get make an un...
Try setting the header manually: http://devproj20.blogspot.com/2008/02/assigning-basic-authorization-http.html
401 when POSTing using HttpWebRequest (yes I used Credentials) I'm using HttpWebRequest to pull down XML, and POST data back to a 'WebService' and getting a 401 on the POST. When creating the requests I've added Credentials and now tried a credentials cache and setting PreAutenticate to True, still getting the 401!:( W...
TITLE: 401 when POSTing using HttpWebRequest (yes I used Credentials) QUESTION: I'm using HttpWebRequest to pull down XML, and POST data back to a 'WebService' and getting a 401 on the POST. When creating the requests I've added Credentials and now tried a credentials cache and setting PreAutenticate to True, still ge...
[ "c#", "http", "compact-framework", "httpwebrequest", "credentials" ]
4
6
4,903
1
0
2008-10-07T16:59:14.883000
2008-12-18T21:15:24.307000
179,427
179,453
How to resolve a Java Rounding Double issue
Seems like the subtraction is triggering some kind of issue and the resulting value is wrong. double tempCommission = targetPremium.doubleValue()*rate.doubleValue()/100d; 78.75 = 787.5 * 10.0/100d double netToCompany = targetPremium.doubleValue() - tempCommission; 708.75 = 787.5 - 78.75 double dCommission = request.get...
To control the precision of floating point arithmetic, you should use java.math.BigDecimal. Read The need for BigDecimal by John Zukowski for more information. Given your example, the last line would be as following using BigDecimal. import java.math.BigDecimal; BigDecimal premium = BigDecimal.valueOf("1586.6"); BigDe...
How to resolve a Java Rounding Double issue Seems like the subtraction is triggering some kind of issue and the resulting value is wrong. double tempCommission = targetPremium.doubleValue()*rate.doubleValue()/100d; 78.75 = 787.5 * 10.0/100d double netToCompany = targetPremium.doubleValue() - tempCommission; 708.75 = 78...
TITLE: How to resolve a Java Rounding Double issue QUESTION: Seems like the subtraction is triggering some kind of issue and the resulting value is wrong. double tempCommission = targetPremium.doubleValue()*rate.doubleValue()/100d; 78.75 = 787.5 * 10.0/100d double netToCompany = targetPremium.doubleValue() - tempCommi...
[ "java", "math", "rounding" ]
88
106
203,026
13
0
2008-10-07T16:59:41.373000
2008-10-07T17:09:27.547000
179,439
179,450
How to change an Eclipse default project into a Java project
I checked out a project from SVN and did not specify the project type, so it checked out as a "default" project. What is the easiest way to quickly convert this into a "Java" project? I'm using Eclipse version 3.3.2.
Open the.project file and add java nature and builders. org.eclipse.jdt.core.javabuilder org.eclipse.jdt.core.javanature And in.classpath, reference the Java libs:
How to change an Eclipse default project into a Java project I checked out a project from SVN and did not specify the project type, so it checked out as a "default" project. What is the easiest way to quickly convert this into a "Java" project? I'm using Eclipse version 3.3.2.
TITLE: How to change an Eclipse default project into a Java project QUESTION: I checked out a project from SVN and did not specify the project type, so it checked out as a "default" project. What is the easiest way to quickly convert this into a "Java" project? I'm using Eclipse version 3.3.2. ANSWER: Open the.projec...
[ "java", "eclipse" ]
148
128
187,280
11
0
2008-10-07T17:03:22.363000
2008-10-07T17:07:49.327000
179,441
179,490
What content encoding does a Perl CGI script use by default?
I'm modifying a mature CGI application written in Perl and the question of content encoding has come up. The browser reports that the content is iso-8859-1 encoded and the application is declaring iso-8859-1 as the charset in the HTTP headers but doesn't ever seem to actually do the encoding. None of the various encodi...
By default Perl handles strings as being byte sequences, so if you read from a file, and print that to STDOUT, it will produce the same byte sequence. If your templates are Latin-1, your output will also be Latin-1. If you use a string in text string context (like with uc, lc and so on) perl assumes Latin-1 semantics, ...
What content encoding does a Perl CGI script use by default? I'm modifying a mature CGI application written in Perl and the question of content encoding has come up. The browser reports that the content is iso-8859-1 encoded and the application is declaring iso-8859-1 as the charset in the HTTP headers but doesn't ever...
TITLE: What content encoding does a Perl CGI script use by default? QUESTION: I'm modifying a mature CGI application written in Perl and the question of content encoding has come up. The browser reports that the content is iso-8859-1 encoded and the application is declaring iso-8859-1 as the charset in the HTTP header...
[ "perl", "iso-8859-1", "content-encoding" ]
4
8
2,322
4
0
2008-10-07T17:04:25.230000
2008-10-07T17:21:28.940000
179,447
179,456
Which online eBook reference library do you use?
I use Safari Books Online as a reference library and to evaluate book before I decide to buy a paper copy, but it doesn't include any Apress books. Is there a better alternative you would recommend? Edit: Safari Books Online now includes Apress titles which makes it the most complete reference library on the web in my ...
With my ACM membership, I get access to both Safari and Books24x7 (this includes Apress). The selection is reduced from the total offering of those sites (600 in Safari only available to professional members and 500 in Books24x7 available to both student and professional members), but I find it's well worth the ACM ann...
Which online eBook reference library do you use? I use Safari Books Online as a reference library and to evaluate book before I decide to buy a paper copy, but it doesn't include any Apress books. Is there a better alternative you would recommend? Edit: Safari Books Online now includes Apress titles which makes it the ...
TITLE: Which online eBook reference library do you use? QUESTION: I use Safari Books Online as a reference library and to evaluate book before I decide to buy a paper copy, but it doesn't include any Apress books. Is there a better alternative you would recommend? Edit: Safari Books Online now includes Apress titles w...
[ "reference-library" ]
19
18
11,888
4
0
2008-10-07T17:06:38.923000
2008-10-07T17:09:51.383000
179,448
181,125
configure knotify to execute a custom command
on KDE, there's a possibility to execute a command when some event happen. for example one can execute a script when kmail receives a mail or when a akregator fetches a new feed. I want to execute the script on a way I can retrieve the mail/feed subject in my script. is there a possibility to specify the program to exe...
No, but you can use dcop (KDE3) or qdbus (KDE4) from within the script to query KMail/Akregator about what the most recent new item is.
configure knotify to execute a custom command on KDE, there's a possibility to execute a command when some event happen. for example one can execute a script when kmail receives a mail or when a akregator fetches a new feed. I want to execute the script on a way I can retrieve the mail/feed subject in my script. is the...
TITLE: configure knotify to execute a custom command QUESTION: on KDE, there's a possibility to execute a command when some event happen. for example one can execute a script when kmail receives a mail or when a akregator fetches a new feed. I want to execute the script on a way I can retrieve the mail/feed subject in...
[ "linux", "kde-plasma" ]
1
1
1,157
2
0
2008-10-07T17:06:55.290000
2008-10-08T02:13:52.407000
179,452
179,563
How can I make use of .NET objects from within Excel VBA?
Can VBA code instantiate and use.NET objects? The specific class I'm interested in is System.IO.Compression.GZipStream. For Info GAC is the.NET Global Assembly Cache
I think Andy nailed this answer, but I'm not certain that the aspect regarding the CLR loading rules is exactly right. The.NET Assembly that holds the class acting as the wrapper for GZipStream would be exposed to COM and registered just like any other COM project library and class. In this regard, VBA would find the l...
How can I make use of .NET objects from within Excel VBA? Can VBA code instantiate and use.NET objects? The specific class I'm interested in is System.IO.Compression.GZipStream. For Info GAC is the.NET Global Assembly Cache
TITLE: How can I make use of .NET objects from within Excel VBA? QUESTION: Can VBA code instantiate and use.NET objects? The specific class I'm interested in is System.IO.Compression.GZipStream. For Info GAC is the.NET Global Assembly Cache ANSWER: I think Andy nailed this answer, but I'm not certain that the aspect ...
[ ".net", "excel", "vba" ]
9
12
15,001
2
0
2008-10-07T17:08:57.687000
2008-10-07T17:40:38.480000
179,459
200,058
CodeRush - Export type to file missing?
I'm currently evaluating CodeRush and one thing that I liked most when reading the featurelist was the "Export type to new file" or similar functionality. Now that CodeRush runs within my IDE, I cannot find this functionality. Is there a plug-in required for it or am I just missing something?
Are you possibly talking about the "Move Type to File" refactoring? If so, it's pretty easy, I use it pretty much daily when I'm defining new classes. Select a type's name (perhaps a class) Hit your refactor key (Usually Ctrl-`) or click on the triple dot refactor icon Select Move Type to File I suggest watching some o...
CodeRush - Export type to file missing? I'm currently evaluating CodeRush and one thing that I liked most when reading the featurelist was the "Export type to new file" or similar functionality. Now that CodeRush runs within my IDE, I cannot find this functionality. Is there a plug-in required for it or am I just missi...
TITLE: CodeRush - Export type to file missing? QUESTION: I'm currently evaluating CodeRush and one thing that I liked most when reading the featurelist was the "Export type to new file" or similar functionality. Now that CodeRush runs within my IDE, I cannot find this functionality. Is there a plug-in required for it ...
[ "visual-studio-addins", "coderush" ]
2
1
203
1
0
2008-10-07T17:10:11.833000
2008-10-14T05:01:33.473000
179,460
179,464
Correct behavior for interface methods that can't be implemented
If I have a class that needs to implement an interface but one or more of the methods on that interface don't make sense in the context of this particular class, what should I do? For example, lets say I'm implementing an adapter pattern where I want to create a wrapper class that implements java.util.Map by wrapping s...
Any method that cannot be implemented according to the semantics of the interface should throw an UnsupportedOperationException.
Correct behavior for interface methods that can't be implemented If I have a class that needs to implement an interface but one or more of the methods on that interface don't make sense in the context of this particular class, what should I do? For example, lets say I'm implementing an adapter pattern where I want to c...
TITLE: Correct behavior for interface methods that can't be implemented QUESTION: If I have a class that needs to implement an interface but one or more of the methods on that interface don't make sense in the context of this particular class, what should I do? For example, lets say I'm implementing an adapter pattern...
[ "java" ]
8
17
457
5
0
2008-10-07T17:10:17.513000
2008-10-07T17:11:10.163000
179,468
179,499
Focus on a Control When Switching Tabs
What I want to do is set the focus to a specific control (specifically a TextBox ) on a tab page when that tab page is selected. I've tried to call Focus during the Selected event of the containing tab control, but that isn't working. After that I tried to call focus during the VisibleChanged event of the control itsel...
I did this and it seems to work: Handle the SelectedIndexChanged for the tabControl. Check if tabControl1.SelectedIndex == the one I want and call textBox.Focus(); I'm using VS 2008, BTW. Something like this worked: private void tabControl1_selectedIndexChanged(object sender, EventArgs e) { if (tabControl1.SelectedInde...
Focus on a Control When Switching Tabs What I want to do is set the focus to a specific control (specifically a TextBox ) on a tab page when that tab page is selected. I've tried to call Focus during the Selected event of the containing tab control, but that isn't working. After that I tried to call focus during the Vi...
TITLE: Focus on a Control When Switching Tabs QUESTION: What I want to do is set the focus to a specific control (specifically a TextBox ) on a tab page when that tab page is selected. I've tried to call Focus during the Selected event of the containing tab control, but that isn't working. After that I tried to call f...
[ "c#", ".net" ]
4
9
6,631
2
0
2008-10-07T17:12:19.320000
2008-10-07T17:23:24.647000
179,478
186,688
Learning resources - stack machines, JVM especially
I'm curious if anyone have any really good tutorials/articles/books for learning about stack machines in general, and the JVM in particular. I know these ones: http://www.artima.com/insidejvm/applets/EternalMath.html http://www.ibm.com/developerworks/ibm/library/it-haggar_bytecode/ http://www.theserverside.com/tt/artic...
I learned what the JVM did by reading The "Java Virtual Machine Specification" by Tim Lindholm back in 1999. I don't really know where to find as good a resource about more modern technologies like the JIT compilation that the Hotspot VM can do.
Learning resources - stack machines, JVM especially I'm curious if anyone have any really good tutorials/articles/books for learning about stack machines in general, and the JVM in particular. I know these ones: http://www.artima.com/insidejvm/applets/EternalMath.html http://www.ibm.com/developerworks/ibm/library/it-ha...
TITLE: Learning resources - stack machines, JVM especially QUESTION: I'm curious if anyone have any really good tutorials/articles/books for learning about stack machines in general, and the JVM in particular. I know these ones: http://www.artima.com/insidejvm/applets/EternalMath.html http://www.ibm.com/developerworks...
[ "jvm", "stack-machine" ]
4
2
834
2
0
2008-10-07T17:15:33.697000
2008-10-09T10:36:32.703000
179,480
180,678
Creating local users on remote windows server using c#
Provided I have admin access, I need a way to manage (Create, modify, remove) local accounts in a remote machine from an ASP.NET client. I'm clueless in how to approach this. Is WMI a possibility (System.Management namespace)? Any pointers?
Give this a try: DirectoryEntry directoryEntry = new DirectoryEntry("WinNT://ComputerName" & ",computer", "AdminUN", "AdminPW"); DirectoryEntry user = directoryEntry.Children.Add("username", "user"); user.Invoke("SetPassword", new object[] { "password"}); ser.CommitChanges(); If you do need to go the Active Directory r...
Creating local users on remote windows server using c# Provided I have admin access, I need a way to manage (Create, modify, remove) local accounts in a remote machine from an ASP.NET client. I'm clueless in how to approach this. Is WMI a possibility (System.Management namespace)? Any pointers?
TITLE: Creating local users on remote windows server using c# QUESTION: Provided I have admin access, I need a way to manage (Create, modify, remove) local accounts in a remote machine from an ASP.NET client. I'm clueless in how to approach this. Is WMI a possibility (System.Management namespace)? Any pointers? ANSWE...
[ "c#", ".net", "windows" ]
5
4
3,179
3
0
2008-10-07T17:16:55.940000
2008-10-07T22:18:35.097000
179,488
179,496
.NET Attributes List
Is there a list somewhere on common Attributes which are used in objects like Serializable? Thanks Edit ~ The reason I asked is that I came across an StoredProcedure attribute in ntiers ORMS.
Yes, look msdn has you covered please look here. EDIT: This link only answer sucked. Here is a working extractor for all loadable types (gac) that have Attribute in the name. using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; namespace ConsoleApp1 { class Program { stati...
.NET Attributes List Is there a list somewhere on common Attributes which are used in objects like Serializable? Thanks Edit ~ The reason I asked is that I came across an StoredProcedure attribute in ntiers ORMS.
TITLE: .NET Attributes List QUESTION: Is there a list somewhere on common Attributes which are used in objects like Serializable? Thanks Edit ~ The reason I asked is that I came across an StoredProcedure attribute in ntiers ORMS. ANSWER: Yes, look msdn has you covered please look here. EDIT: This link only answer suc...
[ ".net", "attributes" ]
11
12
4,064
5
0
2008-10-07T17:20:44.747000
2008-10-07T17:22:30.187000
179,492
179,950
F# changes to OCaml
F# is derived from OCaml, but what major items are missing or added? Specifically I'm curious as to whether the resources available for learning OCaml are also useful to someone who wants to learn F#.
The main differences are that F# does not support: functors OCaml-style objects polymorphic variants the camlp4/5 preprocessor or extension points (ppx) In addition, F# has a different syntax for labeled and optional parameters. In theory, OCaml programs that don't use these features can be compiled with F#. Learning O...
F# changes to OCaml F# is derived from OCaml, but what major items are missing or added? Specifically I'm curious as to whether the resources available for learning OCaml are also useful to someone who wants to learn F#.
TITLE: F# changes to OCaml QUESTION: F# is derived from OCaml, but what major items are missing or added? Specifically I'm curious as to whether the resources available for learning OCaml are also useful to someone who wants to learn F#. ANSWER: The main differences are that F# does not support: functors OCaml-style ...
[ "f#", "ocaml", "functor" ]
131
94
28,483
3
0
2008-10-07T17:21:40.687000
2008-10-07T19:27:14.523000
179,510
179,532
CSS - Is there a way to get rid of the selection rectangle after clicking a link?
Is there a way to get rid of the selection rectangle when clicking a link which does not refresh the current page entirely?
Do you mean the dotted outline of a target? Try::focus { outline: 0; } This would remove all focus outlines. IT's essentially the same as onclick in JavaScript terms. You might prefer to apply this to a:focus.
CSS - Is there a way to get rid of the selection rectangle after clicking a link? Is there a way to get rid of the selection rectangle when clicking a link which does not refresh the current page entirely?
TITLE: CSS - Is there a way to get rid of the selection rectangle after clicking a link? QUESTION: Is there a way to get rid of the selection rectangle when clicking a link which does not refresh the current page entirely? ANSWER: Do you mean the dotted outline of a target? Try::focus { outline: 0; } This would remov...
[ "css", "hyperlink" ]
47
74
27,073
2
0
2008-10-07T17:26:20.180000
2008-10-07T17:30:31.810000
179,512
179,527
Does Google Chrome display pages the same as Safari?
Given that Chrome and Safari use webkit has anyone yet found anything that renders differently on Chrome than Safari? Is there any reason at the moment to test sites on both, or would testing Safari be sufficient for right now?
Part of this is knowing what is dependent on the rendering engine and what isn't. Javascript, for example, is handled differently in both browsers (google has their own custom javascript renderer), so if your page uses javascript substantially I'd test it in both. This is probably a good place to note that Chrome has b...
Does Google Chrome display pages the same as Safari? Given that Chrome and Safari use webkit has anyone yet found anything that renders differently on Chrome than Safari? Is there any reason at the moment to test sites on both, or would testing Safari be sufficient for right now?
TITLE: Does Google Chrome display pages the same as Safari? QUESTION: Given that Chrome and Safari use webkit has anyone yet found anything that renders differently on Chrome than Safari? Is there any reason at the moment to test sites on both, or would testing Safari be sufficient for right now? ANSWER: Part of this...
[ "safari", "google-chrome", "webkit" ]
18
18
6,999
10
0
2008-10-07T17:26:25.360000
2008-10-07T17:30:00.373000
179,513
179,629
What is the proper size for a sequence-generated primary key?
Currently, primary keys in our system are 10 digits longs, just over the limit for Java Integers. I want to avoid any maintenance problems down the road caused by numeric overflow in these keys, but at the same time I do not want to sacrifice much system performance to store infinitely large numbers that I will never n...
I've always gone with long keys (number(18,0) in database) because they simply remove the possibility of this situation happening in pretty much all situations (extreme data hoarding style applications aside). Having the same data-type across all tables for the key means you can share that field across all of your mode...
What is the proper size for a sequence-generated primary key? Currently, primary keys in our system are 10 digits longs, just over the limit for Java Integers. I want to avoid any maintenance problems down the road caused by numeric overflow in these keys, but at the same time I do not want to sacrifice much system per...
TITLE: What is the proper size for a sequence-generated primary key? QUESTION: Currently, primary keys in our system are 10 digits longs, just over the limit for Java Integers. I want to avoid any maintenance problems down the road caused by numeric overflow in these keys, but at the same time I do not want to sacrifi...
[ "java", "database", "integer", "primary-key", "long-integer" ]
0
2
394
5
0
2008-10-07T17:26:31.990000
2008-10-07T17:55:04.257000
179,538
185,134
Refactoring XSD Schemas
I'm working in a project which needs to clean up some third party XSD Schemas and I want to do some refactoring of common elements in them. There is any suitable tool to automate this? I tried by sfactor from XMLBeans but it doesn't work (it throws a weird exception which even Google can't answer!).
With lack of answers, I pulled out some spare time and I build xnikt, a Java tool which fulfills my actual need to extract common elements from XSD. I free it as GPL, so anyone can fork it, enhance it, etc. I'm open to collaboration, so if anyone has ideas and time, contact me! And I tested it against the XSD schemas w...
Refactoring XSD Schemas I'm working in a project which needs to clean up some third party XSD Schemas and I want to do some refactoring of common elements in them. There is any suitable tool to automate this? I tried by sfactor from XMLBeans but it doesn't work (it throws a weird exception which even Google can't answe...
TITLE: Refactoring XSD Schemas QUESTION: I'm working in a project which needs to clean up some third party XSD Schemas and I want to do some refactoring of common elements in them. There is any suitable tool to automate this? I tried by sfactor from XMLBeans but it doesn't work (it throws a weird exception which even ...
[ "xml", "refactoring", "xsd" ]
6
4
1,346
1
0
2008-10-07T17:32:47.263000
2008-10-08T22:17:14.740000
179,539
179,578
In PHP, for what reasons can I not include a variable from external file?
If I have $var defined in Page1.php and in Page2.php I have //Page2.php include('Page1.php'); echo $var; For what reasons will it not print the value of $var to the screen? The files are in the same directory so paths shouldn't be the issue. I've checked the php.ini file and nothing really jumps out at me. Any ideas?
If it were a path problem you would see a warning in your error log. You could also change to require instead of include and it would become obvious. echo getcwd(); You can also print your working directory to figure out what's wrong. Is $var created in a function? If so, make sure you have global $var; before the firs...
In PHP, for what reasons can I not include a variable from external file? If I have $var defined in Page1.php and in Page2.php I have //Page2.php include('Page1.php'); echo $var; For what reasons will it not print the value of $var to the screen? The files are in the same directory so paths shouldn't be the issue. I'v...
TITLE: In PHP, for what reasons can I not include a variable from external file? QUESTION: If I have $var defined in Page1.php and in Page2.php I have //Page2.php include('Page1.php'); echo $var; For what reasons will it not print the value of $var to the screen? The files are in the same directory so paths shouldn't...
[ "php" ]
1
0
312
4
0
2008-10-07T17:33:09.837000
2008-10-07T17:42:06.387000
179,542
493,958
What to keep in mind while migrating SSIS packages from SQL Server 2005 to 2008?
What are best practices for moving/exporting SQL Server Integration Services Packages from a SQL Server 2005 DB over to 2008? What are some of the security concerns?
It turns out that migrating from 2005 to 2008 isn't as ugly as it may seem. Everything I've read indicates that the Visual Studio 2008 environment will automatically convert the SSIS package to the newer format. An important thing to note is that Visual Studio 2008 will be able to run SSIS 2005 packages. However, the m...
What to keep in mind while migrating SSIS packages from SQL Server 2005 to 2008? What are best practices for moving/exporting SQL Server Integration Services Packages from a SQL Server 2005 DB over to 2008? What are some of the security concerns?
TITLE: What to keep in mind while migrating SSIS packages from SQL Server 2005 to 2008? QUESTION: What are best practices for moving/exporting SQL Server Integration Services Packages from a SQL Server 2005 DB over to 2008? What are some of the security concerns? ANSWER: It turns out that migrating from 2005 to 2008 ...
[ "sql-server-2005", "sql-server-2008", "ssis", "migration", "upgrade" ]
5
8
20,133
1
0
2008-10-07T17:34:57.947000
2009-01-29T23:35:42.613000
179,543
179,616
What is the return value of feof() on a closed file?
for a FILE* stream, if I read as much data as possible, feof(stream) returns me non-zero. Then, If I fclose stream, it feof(stream) will continue to returns me a non-zero value? Is it GUARANTEED?
Calling feof() on a closed file is meaningless (actually worse than meaningless - it's undefined so anything can happen). From the C standard: The value of a pointer to a FILE object is indeterminate after the associated file is closed (including the standard text streams). and A successful call to the fclose function ...
What is the return value of feof() on a closed file? for a FILE* stream, if I read as much data as possible, feof(stream) returns me non-zero. Then, If I fclose stream, it feof(stream) will continue to returns me a non-zero value? Is it GUARANTEED?
TITLE: What is the return value of feof() on a closed file? QUESTION: for a FILE* stream, if I read as much data as possible, feof(stream) returns me non-zero. Then, If I fclose stream, it feof(stream) will continue to returns me a non-zero value? Is it GUARANTEED? ANSWER: Calling feof() on a closed file is meaningle...
[ "c", "file" ]
3
12
1,280
4
0
2008-10-07T17:35:04
2008-10-07T17:51:16.167000
179,556
179,686
Will app_offline.htm stop current requests or just new requests?
Like the title says, If I place an app_offline.htm in the application root, will it cut off currently running requests, or just new ones?
Here is my lame experiment; I created an ASPX page with the following code: protected void Page_Load(object sender, EventArgs e) { Response.BufferOutput = false; Response.Write("Step 1 "); System.Threading.Thread.Sleep(10000); Response.Write("Step 2 "); System.Threading.Thread.Sleep(10000); Response.Write("Step 3 "); }...
Will app_offline.htm stop current requests or just new requests? Like the title says, If I place an app_offline.htm in the application root, will it cut off currently running requests, or just new ones?
TITLE: Will app_offline.htm stop current requests or just new requests? QUESTION: Like the title says, If I place an app_offline.htm in the application root, will it cut off currently running requests, or just new ones? ANSWER: Here is my lame experiment; I created an ASPX page with the following code: protected void...
[ "iis" ]
26
33
11,439
2
0
2008-10-07T17:39:44.943000
2008-10-07T18:10:28.203000
179,559
179,571
Does CLI mean anything other than "command line interface"?
According to Wikipedia, on the Comparison of programming languages page, it says that F# uses CLI. Does that mean that F# is designed for the purpose of making command-line applications and not graphical applications, or is there another meaning of CLI?
in.NET it's the Common Language Infrastructure. http://en.wikipedia.org/wiki/Common_Language_Infrastructure
Does CLI mean anything other than "command line interface"? According to Wikipedia, on the Comparison of programming languages page, it says that F# uses CLI. Does that mean that F# is designed for the purpose of making command-line applications and not graphical applications, or is there another meaning of CLI?
TITLE: Does CLI mean anything other than "command line interface"? QUESTION: According to Wikipedia, on the Comparison of programming languages page, it says that F# uses CLI. Does that mean that F# is designed for the purpose of making command-line applications and not graphical applications, or is there another mean...
[ "f#", "command-line-interface" ]
2
12
808
5
0
2008-10-07T17:40:12.303000
2008-10-07T17:41:16.327000
179,565
179,652
Exit codes bigger than 255 — possible?
If yes, on which operating system, shell or whatever? Consider the following Java program (I'm using Java just as an example; any language would be good for this question, which is more about operation systems): public class ExitCode { public static void main(String args[]) { System.exit(Integer.parseInt(args[0])); } }...
Using wait() or waitpid() It is not possible on Unix and derivatives using POSIX functions like wait() and waitpid(). The exit status information returned consists of two 8-bit fields, one containing the exit status, and the other containing information about the cause of death (0 implying orderly exit under program co...
Exit codes bigger than 255 — possible? If yes, on which operating system, shell or whatever? Consider the following Java program (I'm using Java just as an example; any language would be good for this question, which is more about operation systems): public class ExitCode { public static void main(String args[]) { Syst...
TITLE: Exit codes bigger than 255 — possible? QUESTION: If yes, on which operating system, shell or whatever? Consider the following Java program (I'm using Java just as an example; any language would be good for this question, which is more about operation systems): public class ExitCode { public static void main(Str...
[ "shell", "operating-system", "exit-code" ]
42
40
16,974
3
0
2008-10-07T17:40:52.647000
2008-10-07T18:00:27.787000
179,569
179,599
.NET Open Source CODE for SFTP?
I googled a lot, and could not find a single open source implementation of SFTP in.NET. All i got is 3rd party component for SFTP. can anyone help me with SFTP implenetation in.NET?
See this question and shrpssh, which was the accepted answer.
.NET Open Source CODE for SFTP? I googled a lot, and could not find a single open source implementation of SFTP in.NET. All i got is 3rd party component for SFTP. can anyone help me with SFTP implenetation in.NET?
TITLE: .NET Open Source CODE for SFTP? QUESTION: I googled a lot, and could not find a single open source implementation of SFTP in.NET. All i got is 3rd party component for SFTP. can anyone help me with SFTP implenetation in.NET? ANSWER: See this question and shrpssh, which was the accepted answer.
[ ".net-2.0", "sftp" ]
1
8
12,057
2
0
2008-10-07T17:40:59.433000
2008-10-07T17:47:02.557000
179,582
179,651
Can/how do you add a circle of references without breaking RI?
I'm primarily interested in pgsql for this, but I was wondering if there is a way in any RDBMS to do an insert operation, without disabling and re-enabling any FOREIGN KEY or NOT NULL constraints, on two tables that refer to each other. (You might think of this as a chicken that was somehow born from its own egg.) For ...
I think that you answered your own question - you have to make a transaction block. In PostgreSQL this should work: BEGIN; SET CONSTRAINTS ALL DEFERRED; INSERT INTO questions (questionid, answerid, question) VALUES (1, 100, 'How long are Abraham Lincoln\'s legs?'); INSERT INTO answers (answerid, questionid, answer) VAL...
Can/how do you add a circle of references without breaking RI? I'm primarily interested in pgsql for this, but I was wondering if there is a way in any RDBMS to do an insert operation, without disabling and re-enabling any FOREIGN KEY or NOT NULL constraints, on two tables that refer to each other. (You might think of ...
TITLE: Can/how do you add a circle of references without breaking RI? QUESTION: I'm primarily interested in pgsql for this, but I was wondering if there is a way in any RDBMS to do an insert operation, without disabling and re-enabling any FOREIGN KEY or NOT NULL constraints, on two tables that refer to each other. (Y...
[ "sql", "postgresql", "foreign-keys" ]
3
4
281
3
0
2008-10-07T17:42:22.097000
2008-10-07T18:00:23.870000
179,591
179,647
How to do a LINQ Outer Join of a SubTable?
I have a data tables with this type of setup. Table A AID AName --------------------- 1 A_Name1 2 A_Name2 3 A_Name3 Table B BID BName --------------------- 10 B_Name1 20 B_Name2 30 B_Name3 Table C AID BID --------------------- 1 10 2 10 2 20 2 30 3 20 3 30 I want to use LINQ to write a query that for a given ID of A gi...
For LinqToSql, database optimizer will handle this appropriately. Use the "Not Any" pattern. IQueryable query = db.BTable.Where(b =>!db.CTable.Where(c=> c.AID == 1).Any(c => c.BID == b.BID) ) For LinqToObjects, we don't want to enumerate the CList for each item in BList. Do that enumeration one time. List BIDList = CLi...
How to do a LINQ Outer Join of a SubTable? I have a data tables with this type of setup. Table A AID AName --------------------- 1 A_Name1 2 A_Name2 3 A_Name3 Table B BID BName --------------------- 10 B_Name1 20 B_Name2 30 B_Name3 Table C AID BID --------------------- 1 10 2 10 2 20 2 30 3 20 3 30 I want to use LINQ t...
TITLE: How to do a LINQ Outer Join of a SubTable? QUESTION: I have a data tables with this type of setup. Table A AID AName --------------------- 1 A_Name1 2 A_Name2 3 A_Name3 Table B BID BName --------------------- 10 B_Name1 20 B_Name2 30 B_Name3 Table C AID BID --------------------- 1 10 2 10 2 20 2 30 3 20 3 30 I ...
[ ".net", "linq-to-sql", "join" ]
1
6
1,640
1
0
2008-10-07T17:44:44.557000
2008-10-07T17:57:59.803000
179,595
179,709
Is there an MSBuild task that will extract the path give from a file name?
I use the following to get a list of project files that need to be compiled. Each project is stored in a subdirectory of the projects directory. Is there a task that I can use to extract to extract the directory that each project file is in? I know I can write my own task to do this but I was hoping that one already ex...
If I understand the question correctly, you shouldn't need a task - you can do this with well-known meta data. Does this do the trick? From the tests I ran, it shouldn't list a directory twice in the new item group.
Is there an MSBuild task that will extract the path give from a file name? I use the following to get a list of project files that need to be compiled. Each project is stored in a subdirectory of the projects directory. Is there a task that I can use to extract to extract the directory that each project file is in? I k...
TITLE: Is there an MSBuild task that will extract the path give from a file name? QUESTION: I use the following to get a list of project files that need to be compiled. Each project is stored in a subdirectory of the projects directory. Is there a task that I can use to extract to extract the directory that each proje...
[ "msbuild" ]
7
5
3,835
1
0
2008-10-07T17:45:11.047000
2008-10-07T18:17:07.940000
179,617
180,013
Strange Hibernate Cache Issue
We are using Hibernate 3.1 with Spring MVC 2.0. Our problem occurs when data is updated on the database directly (not in the application). We use a Filter to filter a collection of results by whether the orders are opened or closed. If we change an order on the DB to be closed, the filter returns the correct list, howe...
The Session always has a "first-level" cache, so if you're using one Session everything you read through it is going to be cached. Hibernate will execute the query against the database, but then as it's building the objects it checks the Session cache to avoid building a new object, so any columns changed in the databa...
Strange Hibernate Cache Issue We are using Hibernate 3.1 with Spring MVC 2.0. Our problem occurs when data is updated on the database directly (not in the application). We use a Filter to filter a collection of results by whether the orders are opened or closed. If we change an order on the DB to be closed, the filter ...
TITLE: Strange Hibernate Cache Issue QUESTION: We are using Hibernate 3.1 with Spring MVC 2.0. Our problem occurs when data is updated on the database directly (not in the application). We use a Filter to filter a collection of results by whether the orders are opened or closed. If we change an order on the DB to be c...
[ "java", "hibernate", "spring" ]
2
5
4,880
4
0
2008-10-07T17:52:00.033000
2008-10-07T19:40:25.917000
179,619
179,632
What's the difference between a schema namespace and an assembly reference in WPF?
Why is it that there are two kinds of references in xaml. One looks like this: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" But mine look like this: xmlns:WPFToolKit="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit" Why can't I do this: xmlns:local="http://myschema.mydomain.com/MyControlNamespace...
The second instance is basically an unmapped, but explicit reference to a namespace in an assembly. The first instance is a mapped reference to a namespace in some assembly referenced by your project. XAML Namespaces and Namespace Mapping, over at MSDN explains this in more detail: WPF defines a CLR attribute that is c...
What's the difference between a schema namespace and an assembly reference in WPF? Why is it that there are two kinds of references in xaml. One looks like this: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" But mine look like this: xmlns:WPFToolKit="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit...
TITLE: What's the difference between a schema namespace and an assembly reference in WPF? QUESTION: Why is it that there are two kinds of references in xaml. One looks like this: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" But mine look like this: xmlns:WPFToolKit="clr-namespace:Microsoft.Windows.Controls;a...
[ "wpf" ]
6
9
1,420
2
0
2008-10-07T17:52:09.473000
2008-10-07T17:55:24.583000
179,622
179,885
What kind of programming environment do you use to write your Windows-based Games?
I've used XNA and Visual Studio 2005 integrated with Flash. I'm curious to see what environments other people use and prefer.
I developed some cross-platform 2D games (Windows as well) and used C++ with Geany and SDL. I find SDL to be a great library to make casual games. Of course, if cross-platform means Windows and XBOX for you, then there are other libraries that might be a better choice.
What kind of programming environment do you use to write your Windows-based Games? I've used XNA and Visual Studio 2005 integrated with Flash. I'm curious to see what environments other people use and prefer.
TITLE: What kind of programming environment do you use to write your Windows-based Games? QUESTION: I've used XNA and Visual Studio 2005 integrated with Flash. I'm curious to see what environments other people use and prefer. ANSWER: I developed some cross-platform 2D games (Windows as well) and used C++ with Geany a...
[ "development-environment" ]
1
1
396
6
0
2008-10-07T17:52:54.057000
2008-10-07T19:07:21.473000
179,643
179,662
Optimize Frustum Culling
i am writing a game in C++ and have a level consisting of many seperate meshes, each with their own vertex buffer. i am using vmmlib ( brilliant free gl compat. vector/matrix library ) to create my frustum culler and testing it against the bounding sphere of every mesh in the level. sadly my level can consist of up to ...
Yes bounding object is the way to go, you should take care in choosing an adequate bounding volume, for example for meshes that move about the scene like bots and dont lie down a cylinder is the best volume, other are better represented by cubes (axis aligned or not). Then you create a quadtree or octree to hierarchica...
Optimize Frustum Culling i am writing a game in C++ and have a level consisting of many seperate meshes, each with their own vertex buffer. i am using vmmlib ( brilliant free gl compat. vector/matrix library ) to create my frustum culler and testing it against the bounding sphere of every mesh in the level. sadly my le...
TITLE: Optimize Frustum Culling QUESTION: i am writing a game in C++ and have a level consisting of many seperate meshes, each with their own vertex buffer. i am using vmmlib ( brilliant free gl compat. vector/matrix library ) to create my frustum culler and testing it against the bounding sphere of every mesh in the ...
[ "c++", "3d", "frustum", "space-partitioning" ]
2
4
2,235
3
0
2008-10-07T17:57:30.210000
2008-10-07T18:04:02.693000
179,653
179,694
How do I get the integer value of a char in C++?
I want to take the value stored in a 32 bit unsigned int, put it into four chars and then store the integer value of each of these chars in a string. I think the first part goes like this: char a = orig << 8; char b = orig << 8; char c = orig << 8; char d = orig << 8;
If you really want to extract the individual bytes first: unsigned char a = orig & 0xff; unsigned char b = (orig >> 8) & 0xff; unsigned char c = (orig >> 16) & 0xff; unsigned char d = (orig >> 24) & 0xff; Or: unsigned char *chars = (unsigned char *)(&orig); unsigned char a = chars[0]; unsigned char b = chars[1]; unsign...
How do I get the integer value of a char in C++? I want to take the value stored in a 32 bit unsigned int, put it into four chars and then store the integer value of each of these chars in a string. I think the first part goes like this: char a = orig << 8; char b = orig << 8; char c = orig << 8; char d = orig << 8;
TITLE: How do I get the integer value of a char in C++? QUESTION: I want to take the value stored in a 32 bit unsigned int, put it into four chars and then store the integer value of each of these chars in a string. I think the first part goes like this: char a = orig << 8; char b = orig << 8; char c = orig << 8; char...
[ "c++", "bit-manipulation", "endianness" ]
4
10
3,226
5
0
2008-10-07T18:00:37.990000
2008-10-07T18:12:14.767000
179,665
190,099
NSMutableArray destruction
I have an array NSMutableArray with happy objects. These objects viciously turn on (leak) me whenever I try to clear the array of all the objects and repopulate it. It's allocated in the init function like so self.list = [NSMutableArray array]; The different methods I have used to clear it out include: self.list = nil;...
How did you create the objects that are leaking? If you did something like this: - (void)addObjectsToArray { [list addObject:[[MyClass alloc] init]; OtherClass *anotherObject = [[OtherClass alloc] init]; [list addObject:anotherObject]; } then you will leak two objects when list is deallocated. You should replace any ...
NSMutableArray destruction I have an array NSMutableArray with happy objects. These objects viciously turn on (leak) me whenever I try to clear the array of all the objects and repopulate it. It's allocated in the init function like so self.list = [NSMutableArray array]; The different methods I have used to clear it ou...
TITLE: NSMutableArray destruction QUESTION: I have an array NSMutableArray with happy objects. These objects viciously turn on (leak) me whenever I try to clear the array of all the objects and repopulate it. It's allocated in the init function like so self.list = [NSMutableArray array]; The different methods I have u...
[ "objective-c", "cocoa" ]
14
8
19,958
5
0
2008-10-07T18:05:04.640000
2008-10-10T04:13:29.763000
179,680
180,001
How can you make use of the add-in framework in .NET 3.0?
There are some updates with.NET 3.0 concerning how to create and use add-ins for your own applications. I read about some " pipeline " you have to create for the communication between add-in and host-application but couldn't find further information about it. How would you made an add-in functionality in an application...
Definitely check out the Managed Extensibility Framework at www.codeplex.com/mef. It's a framework that helps with creating extensible applications. It takes care of all the plumbing when creating a pluggable app. I'm currently writing a series of articles that show the basic functionality of mef at http://www.jenswint...
How can you make use of the add-in framework in .NET 3.0? There are some updates with.NET 3.0 concerning how to create and use add-ins for your own applications. I read about some " pipeline " you have to create for the communication between add-in and host-application but couldn't find further information about it. Ho...
TITLE: How can you make use of the add-in framework in .NET 3.0? QUESTION: There are some updates with.NET 3.0 concerning how to create and use add-ins for your own applications. I read about some " pipeline " you have to create for the communication between add-in and host-application but couldn't find further inform...
[ "c#", "add-in", ".net-3.0" ]
1
1
607
3
0
2008-10-07T18:08:58.860000
2008-10-07T19:38:41.037000
179,684
179,899
Is C++ CLI a superset of C++?
Would a C++ CLI compiler be able to compile some large sets of C++ classes without modifications? Is C++ CLI a superset of C++?
technically no, but depending how standard the C++ code is, you'll probably be just fine. when you get into windows stuff you may run into issues. I compiled the whole game engine we use at work in C++/CLI once and it worked just fine. A colleague did the same for all of mozilla and no such luck.
Is C++ CLI a superset of C++? Would a C++ CLI compiler be able to compile some large sets of C++ classes without modifications? Is C++ CLI a superset of C++?
TITLE: Is C++ CLI a superset of C++? QUESTION: Would a C++ CLI compiler be able to compile some large sets of C++ classes without modifications? Is C++ CLI a superset of C++? ANSWER: technically no, but depending how standard the C++ code is, you'll probably be just fine. when you get into windows stuff you may run i...
[ "c++", "c++-cli", "clr" ]
13
4
1,152
6
0
2008-10-07T18:10:03.400000
2008-10-07T19:11:09.530000
179,690
179,710
Would you use C++/CLI if supported like C# & VB.NET?
I've always had a thing for C++/CLI. Maybe because not many developers use it... or just because it's different. Suppose Microsoft fully supported C++/CLI as they do VB.NET and C# (ie. LINQ, WPF, etc.). Would you use it? If not, why?
I do use it. Even with the relative lack of tool support, it still beats raw P/Invoke for dealing with Win32. As for LINQ, i don't really care to see too much more hacked into the C++ language. LINQ is usable enough as-is - if they're gonna enhance the compiler, they should work on C++ 0x support...
Would you use C++/CLI if supported like C# & VB.NET? I've always had a thing for C++/CLI. Maybe because not many developers use it... or just because it's different. Suppose Microsoft fully supported C++/CLI as they do VB.NET and C# (ie. LINQ, WPF, etc.). Would you use it? If not, why?
TITLE: Would you use C++/CLI if supported like C# & VB.NET? QUESTION: I've always had a thing for C++/CLI. Maybe because not many developers use it... or just because it's different. Suppose Microsoft fully supported C++/CLI as they do VB.NET and C# (ie. LINQ, WPF, etc.). Would you use it? If not, why? ANSWER: I do u...
[ "c++-cli" ]
3
14
1,199
8
0
2008-10-07T18:11:24.503000
2008-10-07T18:17:14.133000
179,700
179,724
Get the name of a class as a string in C#
Is there a way to take a class name and convert it to a string in C#? As part of the Entity Framework, the.Include method takes in a dot-delimited list of strings to join on when performing a query. I have the class model of what I want to join, and for reasons of refactoring and future code maintenance, I want to be a...
Include requires a property name, not a class name. Hence, it's the name of the property you want, not the name of its type. You can get that with reflection.
Get the name of a class as a string in C# Is there a way to take a class name and convert it to a string in C#? As part of the Entity Framework, the.Include method takes in a dot-delimited list of strings to join on when performing a query. I have the class model of what I want to join, and for reasons of refactoring a...
TITLE: Get the name of a class as a string in C# QUESTION: Is there a way to take a class name and convert it to a string in C#? As part of the Entity Framework, the.Include method takes in a dot-delimited list of strings to join on when performing a query. I have the class model of what I want to join, and for reason...
[ "c#", "entity-framework" ]
70
12
102,803
7
0
2008-10-07T18:14:46.120000
2008-10-07T18:21:19.757000
179,706
179,820
Adding dummy Column to strongly typed dataset
I am writing a site that uses strongly typed datasets. The DBA who created the table made gave a column a value that represents a negative. The column is 'Do_Not_Estimate_Flag' where the column can contain 'T' or 'F'. I can't change the underlying table or the logic that fills it. What I want to do is to add a 'ESTIMAT...
The DataBinder will see that you're binding to a DataRow and use its fields rather than any property you define. You could create a method to do what you want, e.g.: <%#FormatFlag(DataBinder.Eval(Container.DataItem, "Do_Not_Estimate_Flag" ))%> where you have a method: protected string FormatFlag(object doNotEstimateFla...
Adding dummy Column to strongly typed dataset I am writing a site that uses strongly typed datasets. The DBA who created the table made gave a column a value that represents a negative. The column is 'Do_Not_Estimate_Flag' where the column can contain 'T' or 'F'. I can't change the underlying table or the logic that fi...
TITLE: Adding dummy Column to strongly typed dataset QUESTION: I am writing a site that uses strongly typed datasets. The DBA who created the table made gave a column a value that represents a negative. The column is 'Do_Not_Estimate_Flag' where the column can contain 'T' or 'F'. I can't change the underlying table or...
[ "c#", "ado.net", "dataset", "strongly-typed-dataset" ]
2
1
2,828
2
0
2008-10-07T18:15:31.033000
2008-10-07T18:47:55.490000
179,713
179,717
How to change the href attribute for a hyperlink using jQuery
How can you change the href attribute (link target) for a hyperlink using jQuery?
Using $("a").attr("href", "http://www.google.com/") will modify the href of all hyperlinks to point to Google. You probably want a somewhat more refined selector though. For instance, if you have a mix of link source (hyperlink) and link target (a.k.a. "anchor") anchor tags: The CodeProject...Then you probably don't wa...
How to change the href attribute for a hyperlink using jQuery How can you change the href attribute (link target) for a hyperlink using jQuery?
TITLE: How to change the href attribute for a hyperlink using jQuery QUESTION: How can you change the href attribute (link target) for a hyperlink using jQuery? ANSWER: Using $("a").attr("href", "http://www.google.com/") will modify the href of all hyperlinks to point to Google. You probably want a somewhat more refi...
[ "javascript", "html", "jquery", "hyperlink" ]
1,465
2,068
1,757,627
13
0
2008-10-07T18:17:33.977000
2008-10-07T18:19:42.817000
179,716
179,761
Average difference between dates in Python
I have a series of datetime objects and would like to calculate the average delta between them. For example, if the input was (2008-10-01 12:15:00, 2008-10-01 12:25:00, 2008-10-01 12:35:00), then the average delta would be exactly 00:10:00, or 10 minutes. Any suggestions on how to calculate this using Python?
You can subtract each successive date from the one prior (resulting in a timedelta object which represents the difference in days, seconds). You can then average the timedelta objects to find your answer.
Average difference between dates in Python I have a series of datetime objects and would like to calculate the average delta between them. For example, if the input was (2008-10-01 12:15:00, 2008-10-01 12:25:00, 2008-10-01 12:35:00), then the average delta would be exactly 00:10:00, or 10 minutes. Any suggestions on ho...
TITLE: Average difference between dates in Python QUESTION: I have a series of datetime objects and would like to calculate the average delta between them. For example, if the input was (2008-10-01 12:15:00, 2008-10-01 12:25:00, 2008-10-01 12:35:00), then the average delta would be exactly 00:10:00, or 10 minutes. Any...
[ "python", "algorithm", "datetime" ]
4
0
7,099
5
0
2008-10-07T18:18:48.450000
2008-10-07T18:32:56.160000
179,720
179,857
is there something like alternate data streams on any linux filesystem?
On Windows NTFS there is a nice but mostly unused feature called "Alternate Data Streams" (ADS) which I recently used in a hobby-dev project. On Mac HFS+ there is also a similarly nice but mostly unused feature called "named forks". I am thinking of porting this project to Linux, but I do not know if any Filesystem on ...
There are file systems on both Windows and Linux (and other OSes) that support extended attributes (EAs). The Windows support was added for OS/2 compat and does not have any documented interface, except for a hacky method through the backup API (that's what Cygwin does). EAs are designed to store small values only. On ...
is there something like alternate data streams on any linux filesystem? On Windows NTFS there is a nice but mostly unused feature called "Alternate Data Streams" (ADS) which I recently used in a hobby-dev project. On Mac HFS+ there is also a similarly nice but mostly unused feature called "named forks". I am thinking o...
TITLE: is there something like alternate data streams on any linux filesystem? QUESTION: On Windows NTFS there is a nice but mostly unused feature called "Alternate Data Streams" (ADS) which I recently used in a hobby-dev project. On Mac HFS+ there is also a similarly nice but mostly unused feature called "named forks...
[ "linux", "filesystems", "ntfs", "alternate-data-stream" ]
30
20
20,595
6
0
2008-10-07T18:20:54.187000
2008-10-07T18:56:54.240000
179,723
179,733
What is the best way of implementing assertion checking in C++?
By that I mean, what do I need to do to have useful assertions in my code? MFC is quite easy, i just use ASSERT(something). What's the non-MFC way? Edit: Is it possible to stop assert breaking in assert.c rather than than my file which called assert()? Edit: What's the difference between &? Accepted Answer: Loads of gr...
#include assert(something); and for compile-time checking, Boost's static asserts are pretty useful: #include BOOST_STATIC_ASSERT(sizeof(int) == 4); // compile fails if ints aren't 32-bit
What is the best way of implementing assertion checking in C++? By that I mean, what do I need to do to have useful assertions in my code? MFC is quite easy, i just use ASSERT(something). What's the non-MFC way? Edit: Is it possible to stop assert breaking in assert.c rather than than my file which called assert()? Edi...
TITLE: What is the best way of implementing assertion checking in C++? QUESTION: By that I mean, what do I need to do to have useful assertions in my code? MFC is quite easy, i just use ASSERT(something). What's the non-MFC way? Edit: Is it possible to stop assert breaking in assert.c rather than than my file which ca...
[ "c++", "debugging", "assert", "debugbreak" ]
21
30
17,874
11
0
2008-10-07T18:21:18.413000
2008-10-07T18:23:00.360000
179,735
180,753
What are some good resources on 2D game engine design?
I'm messing around with 2D game development using C++ and DirectX in my spare time. I'm finding that the enterprisey problem domain modeling approach doesn't help as much as I'd like;) I'm more or less looking for a "best practices" equivalent to basic game engine design. How entities should interact with each other, h...
Gamedev.net is usually where I turn to get an idea of what other people in the game development community are doing. That said, I'm afraid that you'll find that the idea of "best practices" in game development is more volatile than most. Games tend to be such specialized applications that it's near impossible to give a...
What are some good resources on 2D game engine design? I'm messing around with 2D game development using C++ and DirectX in my spare time. I'm finding that the enterprisey problem domain modeling approach doesn't help as much as I'd like;) I'm more or less looking for a "best practices" equivalent to basic game engine ...
TITLE: What are some good resources on 2D game engine design? QUESTION: I'm messing around with 2D game development using C++ and DirectX in my spare time. I'm finding that the enterprisey problem domain modeling approach doesn't help as much as I'd like;) I'm more or less looking for a "best practices" equivalent to ...
[ "c++", "directx" ]
11
15
11,329
5
0
2008-10-07T18:25:03.867000
2008-10-07T22:53:02.673000
179,741
179,744
How do I decompile a .NET EXE into readable C# source code?
I wrote a C# application for a client a couple of years ago, but I no longer have the source code. All I have is the EXE that I deployed on the client's PC. Is there a way I can generate C# source code from the EXE?
Reflector and its add-in FileDisassembler. Reflector will allow to see the source code. FileDisassembler will allow you to convert it into a VS solution.
How do I decompile a .NET EXE into readable C# source code? I wrote a C# application for a client a couple of years ago, but I no longer have the source code. All I have is the EXE that I deployed on the client's PC. Is there a way I can generate C# source code from the EXE?
TITLE: How do I decompile a .NET EXE into readable C# source code? QUESTION: I wrote a C# application for a client a couple of years ago, but I no longer have the source code. All I have is the EXE that I deployed on the client's PC. Is there a way I can generate C# source code from the EXE? ANSWER: Reflector and its...
[ "c#", ".net", "reverse-engineering", "decompiling" ]
295
211
670,282
10
0
2008-10-07T18:27:08.950000
2008-10-07T18:28:00.850000
179,742
179,824
How to associate all textbox controls on a form with the same event handler
VB 2008. I have several text boxes on a form and I want each of them to use the same event handler. I know how to manually wire each one up to the handler, but I'm looking for a more generic way so if I add more text boxes they will automatically be hooked up to the event handler. Ideas? EDIT: Using the C# sample from ...
Do something like this in your form's load event (C#, sorry, but it's easy to translate): private void Form1_Load(object sender, EventArgs e) { foreach (Control ctrl in this.Controls) { if (ctrl is TextBox) { TextBox tb = (TextBox)ctrl; tb.TextChanged += new EventHandler(tb_TextChanged); } } } void tb_TextChanged(obj...
How to associate all textbox controls on a form with the same event handler VB 2008. I have several text boxes on a form and I want each of them to use the same event handler. I know how to manually wire each one up to the handler, but I'm looking for a more generic way so if I add more text boxes they will automatical...
TITLE: How to associate all textbox controls on a form with the same event handler QUESTION: VB 2008. I have several text boxes on a form and I want each of them to use the same event handler. I know how to manually wire each one up to the handler, but I'm looking for a more generic way so if I add more text boxes the...
[ "vb.net" ]
8
10
12,460
6
0
2008-10-07T18:27:32.910000
2008-10-07T18:48:33.913000
179,743
179,767
Why does HttpServlet implement Serializable?
In my understanding of Servlet, the Servlet will be instantiated by the Container, its init() method will be called once, and the servlet will live like a singleton until the JVM shuts down. I do not expect my servlet to be serialized, since it will be constructed new when the app server recovers or is starts up normal...
Technically, I believe the servlet container is allowed to "passivate" the servlet object to disk, in a similar way that EJB session beans can be. So you're correct to ask the question if your app will fail due to non-serializable fields. In practise, I've never heard of a container doing this, so it's really just lega...
Why does HttpServlet implement Serializable? In my understanding of Servlet, the Servlet will be instantiated by the Container, its init() method will be called once, and the servlet will live like a singleton until the JVM shuts down. I do not expect my servlet to be serialized, since it will be constructed new when t...
TITLE: Why does HttpServlet implement Serializable? QUESTION: In my understanding of Servlet, the Servlet will be instantiated by the Container, its init() method will be called once, and the servlet will live like a singleton until the JVM shuts down. I do not expect my servlet to be serialized, since it will be cons...
[ "java", "session", "servlets", "serializable" ]
80
61
14,702
5
0
2008-10-07T18:27:52.410000
2008-10-07T18:33:48.280000
179,748
182,136
Can I specify a JPA compliant persistence.xml file on the java command line?
I've got an UberJar with all my java classes, but want to execute this jar with an external persistence.xml file. Per the specification, Hibernate (or any other JPA provider) looks for the persistence.xml file in any META-INF folder that's on the classpath, but I haven't been able to make this work with an UberJar. Any...
From the -jar command line option: "-jar" When you use this option, the JAR file is the source of all user classes, and other user class path settings are ignored So, it the seems the direct answer is no. You could write your own bootstrap class that uses the usual java classpath (including your persistence.xml) and th...
Can I specify a JPA compliant persistence.xml file on the java command line? I've got an UberJar with all my java classes, but want to execute this jar with an external persistence.xml file. Per the specification, Hibernate (or any other JPA provider) looks for the persistence.xml file in any META-INF folder that's on ...
TITLE: Can I specify a JPA compliant persistence.xml file on the java command line? QUESTION: I've got an UberJar with all my java classes, but want to execute this jar with an external persistence.xml file. Per the specification, Hibernate (or any other JPA provider) looks for the persistence.xml file in any META-INF...
[ "java", "jpa", "maven-shade-plugin", "uberjar" ]
0
1
2,268
2
0
2008-10-07T18:29:33.827000
2008-10-08T10:57:44.207000
179,764
179,798
An open-source license that doesn't let users compile the application unless they've purchased it?
I've been developing GPL'd software for years, but now I need a more restrictive license. This is for a commercial application, and I want to share my source code with the whole world, regardless of whether they've purchased the application from me or not. I also want to allow people to produce derivative works, but I ...
that's not OS, it sounds like shared source. Specifically, it's a lot like Ms-RSL. From WikiPedia: Microsoft Reference Source License (Ms-RSL) This is the most restrictive of the Microsoft Shared Source licenses. The source code is made available to view for reference purposes only.[14] Developers may not distribute or...
An open-source license that doesn't let users compile the application unless they've purchased it? I've been developing GPL'd software for years, but now I need a more restrictive license. This is for a commercial application, and I want to share my source code with the whole world, regardless of whether they've purcha...
TITLE: An open-source license that doesn't let users compile the application unless they've purchased it? QUESTION: I've been developing GPL'd software for years, but now I need a more restrictive license. This is for a commercial application, and I want to share my source code with the whole world, regardless of whet...
[ "open-source", "licensing" ]
10
19
2,382
13
0
2008-10-07T18:33:35.067000
2008-10-07T18:41:10.263000
179,768
179,780
MS Access questions - Scalability / indexing / transactions
A few questions on MS Access databases - Size: Are there limits to the size of an access database? The reason i ask is that we have an access database that has a few simple tables. The size of the db is about 1GB. When I do a query on it, i see it taking over 10 minutes to run. With proper indexing, should MS Access be...
You will get many varied answers here, but in MY OPINION access is just not there as a scalable solution. It doesn't handle multi-user situations very well, as you start to approach 1Gb in size, stability starts to become a MAJOR concern, and in reality it just doesn't have the performance. In regards to transaction su...
MS Access questions - Scalability / indexing / transactions A few questions on MS Access databases - Size: Are there limits to the size of an access database? The reason i ask is that we have an access database that has a few simple tables. The size of the db is about 1GB. When I do a query on it, i see it taking over ...
TITLE: MS Access questions - Scalability / indexing / transactions QUESTION: A few questions on MS Access databases - Size: Are there limits to the size of an access database? The reason i ask is that we have an access database that has a few simple tables. The size of the db is about 1GB. When I do a query on it, i s...
[ "ms-access", "rdbms" ]
3
4
4,007
8
0
2008-10-07T18:34:28.543000
2008-10-07T18:37:02.033000
179,779
181,882
What regex will match text excluding what lies within HTML tags?
I am writing code for a search results page that needs to highlight search terms. The terms happen to occur within table cells (the app is iterating through GridView Row Cells), and these table cells may have HTML. Currently, my code looks like this (relevant hunks shown below): const string highlightPattern = @" $0 ";...
This regex should do the job: (? ]*)(regex you want to check: Fred|span) It checks that it is impossible to match the regex <[^>]* going backward starting from a matching string. Modified code below: const string notInsideBracketsRegex = @"(? ]*)"; const string highlightPattern = @" $0 "; DataBoundLiteralControl litCus...
What regex will match text excluding what lies within HTML tags? I am writing code for a search results page that needs to highlight search terms. The terms happen to occur within table cells (the app is iterating through GridView Row Cells), and these table cells may have HTML. Currently, my code looks like this (rele...
TITLE: What regex will match text excluding what lies within HTML tags? QUESTION: I am writing code for a search results page that needs to highlight search terms. The terms happen to occur within table cells (the app is iterating through GridView Row Cells), and these table cells may have HTML. Currently, my code loo...
[ "c#", "regex" ]
5
11
5,625
4
0
2008-10-07T18:36:51.143000
2008-10-08T08:56:52.190000
179,791
179,792
How to Reset a Working folder VSS 2005
In Visual Source Safe 6.0, you could "reset" a working folder by setting it to a blank string. This meant that the working folder would be determined by the working folder of the parent. How do I do this in Visual Source Safe 2005?
This can't be done in the normal VSS 2005 "Set Working Folder" dialog. However, if you hold the shift key while invoking the "Set Working Folder" dialog, it shows the old VSS 6.0 dialog. Here you can reset the working folder by deleting the string and pressing OK.
How to Reset a Working folder VSS 2005 In Visual Source Safe 6.0, you could "reset" a working folder by setting it to a blank string. This meant that the working folder would be determined by the working folder of the parent. How do I do this in Visual Source Safe 2005?
TITLE: How to Reset a Working folder VSS 2005 QUESTION: In Visual Source Safe 6.0, you could "reset" a working folder by setting it to a blank string. This meant that the working folder would be determined by the working folder of the parent. How do I do this in Visual Source Safe 2005? ANSWER: This can't be done in ...
[ "visual-sourcesafe", "visual-sourcesafe-2005" ]
27
68
12,717
2
0
2008-10-07T18:38:57.130000
2008-10-07T18:39:01.843000
179,796
180,159
Visual Studio 2008 Design Surface Error: "The operation could not be completed. Invalid formatetc structure."
In a VS2008 web site project, I have a page open in split view. I try to drag an Infragistics web control onto the page's design surface. Nothing happens. I try to drag same onto the htmlz. Dialog box with The operation could not be completed. Invalid formatetc structure. Subsequently the dragged control does not appea...
The assembly reference to the control library dll is incorrect/absent in the project's web.config. Add/correct the dll reference to fix.
Visual Studio 2008 Design Surface Error: "The operation could not be completed. Invalid formatetc structure." In a VS2008 web site project, I have a page open in split view. I try to drag an Infragistics web control onto the page's design surface. Nothing happens. I try to drag same onto the htmlz. Dialog box with The ...
TITLE: Visual Studio 2008 Design Surface Error: "The operation could not be completed. Invalid formatetc structure." QUESTION: In a VS2008 web site project, I have a page open in split view. I try to drag an Infragistics web control onto the page's design surface. Nothing happens. I try to drag same onto the htmlz. Di...
[ "asp.net", "visual-studio", "configuration", "asp.net-ajax" ]
3
3
3,605
5
0
2008-10-07T18:39:50.297000
2008-10-07T20:10:28.803000
179,826
180,197
Crossbrowser equivalent of explicitOriginalTarget event parameter
Does anyone know of crossbrowser equivalent of explicitOriginalTarget event parameter? This parameter is Mozilla specific and it gives me the element that caused the blur. Let's say i have a text input and a link on my page. Text input has the focus. If I click on the link, text input's blur event gives me the link ele...
There is no equivalent to explicitOriginalTarget in any of the other than Gecko-based browsers. In Gecko this is an internal property and it is not supposed to be used by an application developer (maybe by XBL binding writers).
Crossbrowser equivalent of explicitOriginalTarget event parameter Does anyone know of crossbrowser equivalent of explicitOriginalTarget event parameter? This parameter is Mozilla specific and it gives me the element that caused the blur. Let's say i have a text input and a link on my page. Text input has the focus. If ...
TITLE: Crossbrowser equivalent of explicitOriginalTarget event parameter QUESTION: Does anyone know of crossbrowser equivalent of explicitOriginalTarget event parameter? This parameter is Mozilla specific and it gives me the element that caused the blur. Let's say i have a text input and a link on my page. Text input ...
[ "javascript", "events", "cross-browser", "scriptaculous" ]
18
9
14,956
7
0
2008-10-07T18:48:59.513000
2008-10-07T20:17:34.717000
179,834
179,866
What is the best way to detect and store the timezone the client of a web app is in?
I have a multi-timezone web application that stores all of the datetime values in UTC in the database, when actions happen on the server, I can easily convert the time into UTC. However, when a client enters a time or time span, what is the best way to detect and store it? I am currently doing the following: Get the va...
I was doing something very similar, but I now think I prefer to use javascript to convert all times to local on the client-side. The server will give all times in UTC in the generated page, and the javascript will convert it once the page loads. This eliminates confusion on the server-side code, as I always know what t...
What is the best way to detect and store the timezone the client of a web app is in? I have a multi-timezone web application that stores all of the datetime values in UTC in the database, when actions happen on the server, I can easily convert the time into UTC. However, when a client enters a time or time span, what i...
TITLE: What is the best way to detect and store the timezone the client of a web app is in? QUESTION: I have a multi-timezone web application that stores all of the datetime values in UTC in the database, when actions happen on the server, I can easily convert the time into UTC. However, when a client enters a time or...
[ "c#", "javascript", "timezone" ]
5
4
1,912
2
0
2008-10-07T18:50:55.547000
2008-10-07T18:59:38.510000
179,839
179,870
Bulk Row Transfer between Oracle Databases with a Select Filter
Basically, I'm trying to selectively copy a table from one database to another. I have two different [Oracle] databases (e.g., running on different hosts) with the same schema. I'm interested in a efficient way to load Table A in DB1 with the result of running a select on Table A in DB2. I'm using JDBC, if that's relev...
Use a database link, and use create table as select. create database link other_db connect to remote_user identified by remote_passwd using remote_tnsname; create table a as select * from a@other_db;
Bulk Row Transfer between Oracle Databases with a Select Filter Basically, I'm trying to selectively copy a table from one database to another. I have two different [Oracle] databases (e.g., running on different hosts) with the same schema. I'm interested in a efficient way to load Table A in DB1 with the result of run...
TITLE: Bulk Row Transfer between Oracle Databases with a Select Filter QUESTION: Basically, I'm trying to selectively copy a table from one database to another. I have two different [Oracle] databases (e.g., running on different hosts) with the same schema. I'm interested in a efficient way to load Table A in DB1 with...
[ "java", "database", "oracle", "html-select" ]
0
8
1,565
3
0
2008-10-07T18:52:13.203000
2008-10-07T19:01:24.263000
179,840
388,307
Integrating with Great Plains, best way?
I can't find much information around the web about it. Has anyone used both eConnect and the Dynamics web services to interact (read/write) with Great Plains. I am looking for the pros and cons of both approaches. This product will be installed and configured on various sites, so ease of configuration is really importa...
We have done sites based off of web services for GP 9. Don't worry about IIS, there isn't much you have to worry about with that. The install process is very easy. It did not require me to do any configuration with IIS. Some of the configuration is a little tricky at first, like adding users, and setting up policies. B...
Integrating with Great Plains, best way? I can't find much information around the web about it. Has anyone used both eConnect and the Dynamics web services to interact (read/write) with Great Plains. I am looking for the pros and cons of both approaches. This product will be installed and configured on various sites, s...
TITLE: Integrating with Great Plains, best way? QUESTION: I can't find much information around the web about it. Has anyone used both eConnect and the Dynamics web services to interact (read/write) with Great Plains. I am looking for the pros and cons of both approaches. This product will be installed and configured o...
[ "web-services", "dynamics-gp", "econnect" ]
7
2
8,325
2
0
2008-10-07T18:52:29.007000
2008-12-23T06:34:53.220000
179,849
179,944
Best solution for migration from Oracle Forms 6i to the web?
I work in an Oracle shop. There's a toolset that consists of roughly 1000 Oracle Forms (using the Forms builder from 6i, early 90's software) with Oracle 10g on the back end. It's serving roughly 500 unique people a month, with 200 concurrent connections at any given time during the work day. Obviously this is somethin...
That's exactly what I am currently doing using... Oracle Application Express The learning curve is much smaller than most web-based alternatives for Forms developers, as all the code is in PL/SQL (unless you start getting fancy with Javascript, which you can). Also, in the latest release of Application Express (3.2), t...
Best solution for migration from Oracle Forms 6i to the web? I work in an Oracle shop. There's a toolset that consists of roughly 1000 Oracle Forms (using the Forms builder from 6i, early 90's software) with Oracle 10g on the back end. It's serving roughly 500 unique people a month, with 200 concurrent connections at a...
TITLE: Best solution for migration from Oracle Forms 6i to the web? QUESTION: I work in an Oracle shop. There's a toolset that consists of roughly 1000 Oracle Forms (using the Forms builder from 6i, early 90's software) with Oracle 10g on the back end. It's serving roughly 500 unique people a month, with 200 concurren...
[ "java", "oracle", "migration", "oracleforms" ]
12
14
30,393
12
0
2008-10-07T18:55:33.243000
2008-10-07T19:24:08.693000
179,860
179,881
Problem with width of auto-generated columns in DataGrid
Maybe world peace would be easier, but I have a problem with the widths of auto generated columns when a DataGrid has no rows. The column headings all squeeze up with no spacing between them. I've tried adding the following CSS to no avail: td.gridHeader { padding-left:20px; padding-right: 20px; }
I beleive headings are rendered as not. th.gridHeader { padding-left:20px; padding-right: 20px; } I also assume you have applied in the DataGrid markup. I didn't think people used DataGrids anymnore? or is it actually a GridView?
Problem with width of auto-generated columns in DataGrid Maybe world peace would be easier, but I have a problem with the widths of auto generated columns when a DataGrid has no rows. The column headings all squeeze up with no spacing between them. I've tried adding the following CSS to no avail: td.gridHeader { paddin...
TITLE: Problem with width of auto-generated columns in DataGrid QUESTION: Maybe world peace would be easier, but I have a problem with the widths of auto generated columns when a DataGrid has no rows. The column headings all squeeze up with no spacing between them. I've tried adding the following CSS to no avail: td.g...
[ "asp.net" ]
1
1
747
1
0
2008-10-07T18:57:55.207000
2008-10-07T19:04:47.080000