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
161,984
162,107
Using Selenium IDE with random values
Is it possible to create Selenium tests using the Firefox plugin that use randomly generated values to help do regression tests? The full story: I would like to help my clients do acceptance testing by providing them with a suite of tests that use some smarts to create random (or at least pseudo-random) values for the ...
First off, the Selenium IDE is rather limited, you should consider switching to Selenium RC, which can be driven by Java or Perl or Ruby or some other languages. Using just Selenium IDE, you can embed JavaScript expressions to derive command parameters. You should be able to type a random number into a text field, for ...
Using Selenium IDE with random values Is it possible to create Selenium tests using the Firefox plugin that use randomly generated values to help do regression tests? The full story: I would like to help my clients do acceptance testing by providing them with a suite of tests that use some smarts to create random (or a...
TITLE: Using Selenium IDE with random values QUESTION: Is it possible to create Selenium tests using the Firefox plugin that use randomly generated values to help do regression tests? The full story: I would like to help my clients do acceptance testing by providing them with a suite of tests that use some smarts to c...
[ "testing", "user-interface", "selenium" ]
49
48
95,843
12
0
2008-10-02T12:21:33.923000
2008-10-02T12:54:38.710000
161,988
162,145
could not read column value from result set ; String index out of range: 0
I'm reading data from a table( from a MySQL Database) with Hibernate SQL Query. The thing is, the table contains a colum that is mapped to a char in Hibernate Model, and sometimes this column is empty. And I suppose this is where my exception comes from. How can I map a colum of char to my hibernate model without getti...
I am assuming from your question that you're mapping this to a primitive character. Next time, please post the stacktrace that you receive (you may leave out where you call it, you could only include the hibernate stuff if your project is too sensitive). If you do map to a primitive character, and it is null, you will ...
could not read column value from result set ; String index out of range: 0 I'm reading data from a table( from a MySQL Database) with Hibernate SQL Query. The thing is, the table contains a colum that is mapped to a char in Hibernate Model, and sometimes this column is empty. And I suppose this is where my exception co...
TITLE: could not read column value from result set ; String index out of range: 0 QUESTION: I'm reading data from a table( from a MySQL Database) with Hibernate SQL Query. The thing is, the table contains a colum that is mapped to a char in Hibernate Model, and sometimes this column is empty. And I suppose this is whe...
[ "java", "hibernate" ]
1
3
12,321
3
0
2008-10-02T12:22:21.940000
2008-10-02T13:05:45.640000
161,993
162,038
Visual Studio 2008: make Ctrl + K, Ctrl + N (next bookmark) stay within the same file
In Visual Studio 2003 you could jump to the next bookmark with Ctrl + K, Ctrl + N; it stayed within the same file and wrapped around to the top of the file when there were no furter bookmarks in the file. Now in VS 2008 this seems to have changed, and Ctrl + K, Ctrl + N jumps to other files with bookmarks. How can I ch...
Actually, you have two other commands that by default are not assigned a shortcut: Previous Bookmark In Document Next Bookmark In Document You'll see them if you go to the Edit->Bookmarks menu. You can bind them to a shortcut if you go to Options->Preferences->Environment->Keyboard and look them up as Edit.PreviousBook...
Visual Studio 2008: make Ctrl + K, Ctrl + N (next bookmark) stay within the same file In Visual Studio 2003 you could jump to the next bookmark with Ctrl + K, Ctrl + N; it stayed within the same file and wrapped around to the top of the file when there were no furter bookmarks in the file. Now in VS 2008 this seems to ...
TITLE: Visual Studio 2008: make Ctrl + K, Ctrl + N (next bookmark) stay within the same file QUESTION: In Visual Studio 2003 you could jump to the next bookmark with Ctrl + K, Ctrl + N; it stayed within the same file and wrapped around to the top of the file when there were no furter bookmarks in the file. Now in VS 2...
[ "visual-studio-2008", "keyboard-shortcuts" ]
18
29
7,133
1
0
2008-10-02T12:24:07.520000
2008-10-02T12:37:33.557000
161,994
162,012
Is there any way to determine the amount of time a client spends on a web page
Assuming I have an open source web server or proxy I can enhance, let's say apache or squid. Is there a way to determine the time each client spends on a web page? HTTP is of course stateless, so it's not trivial, but maybe someone has an idea on how to approach this problem?
Not without having some javascript constantly hit your server on the client side and then checking when it stops (but of course that assumes the user has javascript enabled). There are also various (ugly) ways to detect windows being closed with javascript, but of course these won't always trigger. eg. browser crash. I...
Is there any way to determine the amount of time a client spends on a web page Assuming I have an open source web server or proxy I can enhance, let's say apache or squid. Is there a way to determine the time each client spends on a web page? HTTP is of course stateless, so it's not trivial, but maybe someone has an id...
TITLE: Is there any way to determine the amount of time a client spends on a web page QUESTION: Assuming I have an open source web server or proxy I can enhance, let's say apache or squid. Is there a way to determine the time each client spends on a web page? HTTP is of course stateless, so it's not trivial, but maybe...
[ "apache", "proxy", "apache2", "squid" ]
6
4
561
5
0
2008-10-02T12:24:31.060000
2008-10-02T12:27:59.617000
162,007
162,063
Making every pixel of an image having a specific color transparent
I have an object of the type System.Drawing.Image and want to make every pixel which has some specific color, for example black, transparent (that is, set alpha to 0 for this pixel). What is the best way to do this?
One good approach is to use the ImageAttributes class to setup a list of colors to remap when drawing takes place. The advantage of this is good performance as well as allowing you to alter the remapping colors very easily. Try something like this code... ImageAttributes attribs = new ImageAttributes(); List colorMaps ...
Making every pixel of an image having a specific color transparent I have an object of the type System.Drawing.Image and want to make every pixel which has some specific color, for example black, transparent (that is, set alpha to 0 for this pixel). What is the best way to do this?
TITLE: Making every pixel of an image having a specific color transparent QUESTION: I have an object of the type System.Drawing.Image and want to make every pixel which has some specific color, for example black, transparent (that is, set alpha to 0 for this pixel). What is the best way to do this? ANSWER: One good a...
[ "c#", ".net", "image", "transparency" ]
6
6
3,142
3
0
2008-10-02T12:27:14.143000
2008-10-02T12:42:41.033000
162,011
162,055
CruiseControl.NET view NUnit xml test result when Nant build file executes NUnit
I have a Nant build file which executes NUnit after compiling the dll's. I am executing the NAnt build file with a task in CruiseControl. So NAnt is running the tests not CruiseControl. How do I configure it so that the CruiseControl web dashboard can be used to view the NUnit output? This fixed it: build\*.test-result...
You want to use the merge capabilities of CruiseControl to grab your NUnit XML output. This is the situation my company has going, and it seems to work fairly well. Here is a config snippet (This goes in the element in CCNet.config): \*.xml Hope this works for you.
CruiseControl.NET view NUnit xml test result when Nant build file executes NUnit I have a Nant build file which executes NUnit after compiling the dll's. I am executing the NAnt build file with a task in CruiseControl. So NAnt is running the tests not CruiseControl. How do I configure it so that the CruiseControl web d...
TITLE: CruiseControl.NET view NUnit xml test result when Nant build file executes NUnit QUESTION: I have a Nant build file which executes NUnit after compiling the dll's. I am executing the NAnt build file with a task in CruiseControl. So NAnt is running the tests not CruiseControl. How do I configure it so that the C...
[ "nunit", "nant", "cruisecontrol" ]
9
6
4,664
3
0
2008-10-02T12:27:55.873000
2008-10-02T12:41:28.540000
162,025
164,603
Disable Intellisense in XAML Editor in VS2008?
Is there a way to disable Intellisense in the XAML editor in Visual Studio 2008? It is often a big performance drain while typing, and sometimes I'll sit for ten or more seconds waiting while the list automatically popups up. It appears that in Options->Text Editors->XAML, the Intellisense section is section is unavail...
Found my own answer: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Text Editor\XAML\Auto List Members Setting to 0x00000000 solves it. The "Auto List Params" Key seems to have no effect. To top it off, you can still use to open it up on demand (for setting an attribute you can't think of the name of, etc.) Pret...
Disable Intellisense in XAML Editor in VS2008? Is there a way to disable Intellisense in the XAML editor in Visual Studio 2008? It is often a big performance drain while typing, and sometimes I'll sit for ten or more seconds waiting while the list automatically popups up. It appears that in Options->Text Editors->XAML,...
TITLE: Disable Intellisense in XAML Editor in VS2008? QUESTION: Is there a way to disable Intellisense in the XAML editor in Visual Studio 2008? It is often a big performance drain while typing, and sometimes I'll sit for ten or more seconds waiting while the list automatically popups up. It appears that in Options->T...
[ "visual-studio-2008", "xaml", "ide", "editor", "intellisense" ]
6
5
2,182
1
0
2008-10-02T12:33:16.670000
2008-10-02T21:04:27.003000
162,031
162,212
New site creation and security/authentication,- should I use ASP.net Membership Provider?
There seem to many ways to skin this particular cat - but which is the best and easiest to implement. It would seem that the ASP.net Membership Provider is the one that will save more time, so my questions are: What are the pros/cons of Membership? How do you integrate the auto generated user db with your own custom ma...
Membership is lightweight and easy to set up. You can also use the various providers to use Active Directory or some other member location. You shouldn't need to integrate the databases, you can use one to authenticate users and then as long as they are valid, go query another database for the data. This is a good way ...
New site creation and security/authentication,- should I use ASP.net Membership Provider? There seem to many ways to skin this particular cat - but which is the best and easiest to implement. It would seem that the ASP.net Membership Provider is the one that will save more time, so my questions are: What are the pros/c...
TITLE: New site creation and security/authentication,- should I use ASP.net Membership Provider? QUESTION: There seem to many ways to skin this particular cat - but which is the best and easiest to implement. It would seem that the ASP.net Membership Provider is the one that will save more time, so my questions are: W...
[ "c#", "asp.net", "security", "authentication", "asp.net-membership" ]
6
5
634
3
0
2008-10-02T12:34:53.673000
2008-10-02T13:17:34.600000
162,037
162,585
Unknown Outlook MailItem EntryID
My Outlook add-in handles NewInspector event of the Inspector object, in order to display a custom form for the mail item. I can get EntryID of the CurrentItem of the Inspector object which is passed as a parameter of the event. But, the problem is that the EntryID of the current mail item is shorter than it should be,...
The idea is to remember every EntryID of the MailItem that was created by an add-in, so that it can be treated differently later. Problem was that EntryID of the item opened by an Inspector was the short one, and not in the list of remembered ids, although it should be. Few lines of code where I was creating mail item ...
Unknown Outlook MailItem EntryID My Outlook add-in handles NewInspector event of the Inspector object, in order to display a custom form for the mail item. I can get EntryID of the CurrentItem of the Inspector object which is passed as a parameter of the event. But, the problem is that the EntryID of the current mail i...
TITLE: Unknown Outlook MailItem EntryID QUESTION: My Outlook add-in handles NewInspector event of the Inspector object, in order to display a custom form for the mail item. I can get EntryID of the CurrentItem of the Inspector object which is passed as a parameter of the event. But, the problem is that the EntryID of ...
[ "c#", ".net", "visual-studio-2008", "outlook", "add-in" ]
0
3
3,450
2
0
2008-10-02T12:36:40.017000
2008-10-02T14:27:30.530000
162,042
162,090
Are there any viable alternatives to the GOF Singleton Pattern?
Let's face it. The Singleton Pattern is highly controversial topic with hordes programmers on both sides of the fence. There are those who feel like the Singleton is nothing more then a glorified global variable, and others who swear by pattern and use it incessantly. I don't want the Singleton Controversy to lie at th...
Alex Miller in " Patterns I Hate " quotes the following: "When a singleton seems like the answer, I find it is often wiser to: Create an interface and a default implementation of your singleton Construct a single instance of your default implementation at the “top” of your system. This might be in a Spring config, or i...
Are there any viable alternatives to the GOF Singleton Pattern? Let's face it. The Singleton Pattern is highly controversial topic with hordes programmers on both sides of the fence. There are those who feel like the Singleton is nothing more then a glorified global variable, and others who swear by pattern and use it ...
TITLE: Are there any viable alternatives to the GOF Singleton Pattern? QUESTION: Let's face it. The Singleton Pattern is highly controversial topic with hordes programmers on both sides of the fence. There are those who feel like the Singleton is nothing more then a glorified global variable, and others who swear by p...
[ "design-patterns", "singleton" ]
94
77
24,588
16
0
2008-10-02T12:38:46.097000
2008-10-02T12:50:04.180000
162,079
171,192
How to merge jsp pre-compiled web.xml fragment with main web.xml using Ant
We have the usual web.xml for our web application which includes some jsp and jsp tag files. I want to switch to using pre-compiled jsp's. I have the pre-compilation happening in the build ok, and it generates the web.xml fragment and now I want to merge the fragment into the main web.xml. Is there an include type dire...
I use the Tomcat jasper ANT tasks in my project, which precompile the JSPs into servlets and add the new servlet mappings to the original web.xml. In the DEV builds, just skip this step and deploy the JSPs without pre-compile and modification of the web.xml. If you already have the JSP compilation working and just want...
How to merge jsp pre-compiled web.xml fragment with main web.xml using Ant We have the usual web.xml for our web application which includes some jsp and jsp tag files. I want to switch to using pre-compiled jsp's. I have the pre-compilation happening in the build ok, and it generates the web.xml fragment and now I want...
TITLE: How to merge jsp pre-compiled web.xml fragment with main web.xml using Ant QUESTION: We have the usual web.xml for our web application which includes some jsp and jsp tag files. I want to switch to using pre-compiled jsp's. I have the pre-compilation happening in the build ok, and it generates the web.xml fragm...
[ "java", "jsp", "tomcat", "ant", "web.xml" ]
6
4
9,487
5
0
2008-10-02T12:47:16.077000
2008-10-04T23:38:16.747000
162,086
162,127
web.xml and relative paths
in web.xml i set my welcome file to a jsp within web.xml WEB-INF/index.jsp inside index.jsp i then forward on to a servlet <% response.sendRedirect(response.encodeRedirectURL("myServlet/")); %> however the application tries to find the servlet at the following path applicationName/WEB-INF/myServlet the problem is that ...
<% response.sendRedirect(response.encodeRedirectURL("/myServlet/")); %>` since the jsp is served from the WEB-INF directory the servlet url is also resolved from that relative path. adding a / before will resolve the url from the context root
web.xml and relative paths in web.xml i set my welcome file to a jsp within web.xml WEB-INF/index.jsp inside index.jsp i then forward on to a servlet <% response.sendRedirect(response.encodeRedirectURL("myServlet/")); %> however the application tries to find the servlet at the following path applicationName/WEB-INF/myS...
TITLE: web.xml and relative paths QUESTION: in web.xml i set my welcome file to a jsp within web.xml WEB-INF/index.jsp inside index.jsp i then forward on to a servlet <% response.sendRedirect(response.encodeRedirectURL("myServlet/")); %> however the application tries to find the servlet at the following path applicati...
[ "deployment", "tomcat", "web.xml", "descriptor" ]
0
0
5,017
3
0
2008-10-02T12:49:03.840000
2008-10-02T13:00:25.497000
162,099
162,134
Best Way To Get Started With Mac Development
I just recently got my first mac. I do lots of programming on windows but now I want to get into Mac development. What are some languages i should know or tools i should use to get started with mac development?
Cocoa(R) Programming for Mac(R) OS X (3rd Edition) by Aaron Hillegass: Fantastic book and the author has alot of credibility - Apple brought him in to train their developers on Cocoa.
Best Way To Get Started With Mac Development I just recently got my first mac. I do lots of programming on windows but now I want to get into Mac development. What are some languages i should know or tools i should use to get started with mac development?
TITLE: Best Way To Get Started With Mac Development QUESTION: I just recently got my first mac. I do lots of programming on windows but now I want to get into Mac development. What are some languages i should know or tools i should use to get started with mac development? ANSWER: Cocoa(R) Programming for Mac(R) OS X ...
[ "macos" ]
9
14
2,581
9
0
2008-10-02T12:52:42.770000
2008-10-02T13:02:30.767000
162,112
162,153
Events in C#
Just how much slower are events? I have written a streaming XML parser (that can handle open-ended and incomplete documents) and by tearing out the events and using an interface instead I got a significant speed boost. Does any one else have any war stories? (Let's not open the GC can of worms here, we all know it's br...
Events firing are delegate invocations, which are a a bit slower than virtual calls (source: microsoft.com ) But dealing with interfaces for subscriber/publisher/observer/observable scenario is more painful that using events.
Events in C# Just how much slower are events? I have written a streaming XML parser (that can handle open-ended and incomplete documents) and by tearing out the events and using an interface instead I got a significant speed boost. Does any one else have any war stories? (Let's not open the GC can of worms here, we all...
TITLE: Events in C# QUESTION: Just how much slower are events? I have written a streaming XML parser (that can handle open-ended and incomplete documents) and by tearing out the events and using an interface instead I got a significant speed boost. Does any one else have any war stories? (Let's not open the GC can of ...
[ "c#", ".net", "performance", "events" ]
2
20
839
5
0
2008-10-02T12:56:33.213000
2008-10-02T13:06:42.160000
162,113
162,131
Sorting sets of ordered linked lists
I'm looking for an elegant, high performance solution to the following problem. There are 256 linked lists. Each list contains the same types of object that among other things holds a whole number that is used to define a sort order. All numbers across all lists are unique Each individual list is sorted in ascending or...
You could use a priority queue that holds the “topmost” item of each of the 256 linked lists. This “topmost” item is the one that is scheduled to be inserted into the resulting list. This way, you can just take the smallest element from the priority queue, insert it into your resulting queue, and insert its next elemen...
Sorting sets of ordered linked lists I'm looking for an elegant, high performance solution to the following problem. There are 256 linked lists. Each list contains the same types of object that among other things holds a whole number that is used to define a sort order. All numbers across all lists are unique Each indi...
TITLE: Sorting sets of ordered linked lists QUESTION: I'm looking for an elegant, high performance solution to the following problem. There are 256 linked lists. Each list contains the same types of object that among other things holds a whole number that is used to define a sort order. All numbers across all lists ar...
[ "language-agnostic", "sorting", "linked-list" ]
3
3
576
4
0
2008-10-02T12:56:33.293000
2008-10-02T13:00:59.913000
162,149
162,320
Avoid being blocked by web mail companies for mass/bulk emailing?
Our company is sending out a lot of emails per day and planning to send even more in future. (thousands) Also there are mass mailouts as well in the ten thousands every now and then. Anybody has experience with hotmail, yahoo (web.de, gmx.net) and similar webmail companies blocking your emails because "too many from th...
You want to look at the following: add a bulk-header to your outgoing email ( Precedence: bulk ) look into SPF look into SenderID look into DomainKeys or DKIM look into CAN-SPAM act setup and handle email to abuse@ build relationships with the important providers monitor the usual spam lists, work with them when you ar...
Avoid being blocked by web mail companies for mass/bulk emailing? Our company is sending out a lot of emails per day and planning to send even more in future. (thousands) Also there are mass mailouts as well in the ten thousands every now and then. Anybody has experience with hotmail, yahoo (web.de, gmx.net) and simila...
TITLE: Avoid being blocked by web mail companies for mass/bulk emailing? QUESTION: Our company is sending out a lot of emails per day and planning to send even more in future. (thousands) Also there are mass mailouts as well in the ten thousands every now and then. Anybody has experience with hotmail, yahoo (web.de, g...
[ "email", "bulk", "webmail", "massmail", "sendgrid" ]
16
29
13,773
6
0
2008-10-02T13:06:05.470000
2008-10-02T13:40:19.053000
162,154
162,171
C#, Get other application text from TextBox and TextArea?
Good morgning, I would like to be able to analyze text where I am writting whatever the application I am. Example, If I am here, typing in this TextArea, I would like to be able to get the text, same way if I were in the Subject Textbox in my Outlook. I have search Google without success, maybe it's because it require ...
CodingTheWheels series on building a poker bot goes into detail on how to capture window events from other applications. Its not exactly what your looking for, but it has some good info. http://www.codingthewheel.com/archives/how-i-built-a-working-poker-bot
C#, Get other application text from TextBox and TextArea? Good morgning, I would like to be able to analyze text where I am writting whatever the application I am. Example, If I am here, typing in this TextArea, I would like to be able to get the text, same way if I were in the Subject Textbox in my Outlook. I have sea...
TITLE: C#, Get other application text from TextBox and TextArea? QUESTION: Good morgning, I would like to be able to analyze text where I am writting whatever the application I am. Example, If I am here, typing in this TextArea, I would like to be able to get the text, same way if I were in the Subject Textbox in my O...
[ "c#", "textbox", "hook" ]
2
3
6,411
2
0
2008-10-02T13:07:25.153000
2008-10-02T13:11:27.500000
162,159
162,579
JavaScript: client-side vs. server-side validation
Which is better to do client side or server side validation? In our situation we are using jQuery and MVC. JSON data to pass between our View and Controller. A lot of the validation I do is validating data as users enter it. For example I use the the keypress event to prevent letters in a text box, set a max number of ...
As others have said, you should do both. Here's why: Client Side You want to validate input on the client side first because you can give better feedback to the average user. For example, if they enter an invalid email address and move to the next field, you can show an error message immediately. That way the user can ...
JavaScript: client-side vs. server-side validation Which is better to do client side or server side validation? In our situation we are using jQuery and MVC. JSON data to pass between our View and Controller. A lot of the validation I do is validating data as users enter it. For example I use the the keypress event to ...
TITLE: JavaScript: client-side vs. server-side validation QUESTION: Which is better to do client side or server side validation? In our situation we are using jQuery and MVC. JSON data to pass between our View and Controller. A lot of the validation I do is validating data as users enter it. For example I use the the ...
[ "javascript", "security", "validation" ]
210
389
156,016
13
0
2008-10-02T13:09:15.040000
2008-10-02T14:26:28.333000
162,163
162,330
Registering a COM server with WiX
I have been trying to determine a best case solution for registering a COM server using WiX to create a Windows Installer package and am struggling. In this post Deployment Engineering Archive: HOWTO: Use Regsvr32.exe with WIX, there is an open request for the "Setup police" to crack down on using regsvr32 through an e...
Read "Do not use the SelfReg and TypeLib tables" at: https://msdn.microsoft.com/en-us/library/bb204770#no_selfreg For WiX, take a look at the Component element in the schema reference at: http://wixtoolset.org/documentation/manual/v3/xsd/wix/component.html Take notice of certain child elements such as AppId, Class, Pro...
Registering a COM server with WiX I have been trying to determine a best case solution for registering a COM server using WiX to create a Windows Installer package and am struggling. In this post Deployment Engineering Archive: HOWTO: Use Regsvr32.exe with WIX, there is an open request for the "Setup police" to crack d...
TITLE: Registering a COM server with WiX QUESTION: I have been trying to determine a best case solution for registering a COM server using WiX to create a Windows Installer package and am struggling. In this post Deployment Engineering Archive: HOWTO: Use Regsvr32.exe with WIX, there is an open request for the "Setup ...
[ "wix", "windows-installer", "installation" ]
4
4
6,644
5
0
2008-10-02T13:09:42.357000
2008-10-02T13:42:58.143000
162,176
162,263
Reading very large files in PHP
fopen is failing when I try to read in a very moderately sized file in PHP. A 6 meg file makes it choke, though smaller files around 100k are just fine. i've read that it is sometimes necessary to recompile PHP with the -D_FILE_OFFSET_BITS=64 flag in order to read files over 20 gigs or something ridiculous, but shouldn...
Are you sure that it's fopen that's failing and not your script's timeout setting? The default is usually around 30 seconds or so, and if your file is taking longer than that to read in, it may be tripping that up. Another thing to consider may be the memory limit on your script - reading the file into an array may tri...
Reading very large files in PHP fopen is failing when I try to read in a very moderately sized file in PHP. A 6 meg file makes it choke, though smaller files around 100k are just fine. i've read that it is sometimes necessary to recompile PHP with the -D_FILE_OFFSET_BITS=64 flag in order to read files over 20 gigs or s...
TITLE: Reading very large files in PHP QUESTION: fopen is failing when I try to read in a very moderately sized file in PHP. A 6 meg file makes it choke, though smaller files around 100k are just fine. i've read that it is sometimes necessary to recompile PHP with the -D_FILE_OFFSET_BITS=64 flag in order to read files...
[ "php", "file", "large-files" ]
32
59
101,192
8
0
2008-10-02T13:11:45.953000
2008-10-02T13:29:17.193000
162,177
176,022
How to transfer data from one database to another with Hibernate?
I have an application A with a domain-model which is mapped to a database using Hibernate. I have another application B that uses exactly the same domain-model-classes as A and adds some additional classes. My goal is to read data from database A in application B and transfer that data into the database of B (to make a...
I've done this before to transfer data between two different database types (in my case DB2 and MS SQL Server). What I did was to create two separate session factories, and give both of them the same list of mapping files. Then I simply read records from one, and saved them to the other. Of course, this assumed that bo...
How to transfer data from one database to another with Hibernate? I have an application A with a domain-model which is mapped to a database using Hibernate. I have another application B that uses exactly the same domain-model-classes as A and adds some additional classes. My goal is to read data from database A in appl...
TITLE: How to transfer data from one database to another with Hibernate? QUESTION: I have an application A with a domain-model which is mapped to a database using Hibernate. I have another application B that uses exactly the same domain-model-classes as A and adds some additional classes. My goal is to read data from ...
[ "hibernate" ]
10
8
15,918
4
0
2008-10-02T13:11:50.150000
2008-10-06T20:21:09.483000
162,187
162,195
What does the "static" modifier after "import" mean?
When used like this: import static com.showboy.Myclass; public class Anotherclass{} what's the difference between import static com.showboy.Myclass and import com.showboy.Myclass?
See Documentation The static import declaration is analogous to the normal import declaration. Where the normal import declaration imports classes from packages, allowing them to be used without package qualification, the static import declaration imports static members from classes, allowing them to be used without cl...
What does the "static" modifier after "import" mean? When used like this: import static com.showboy.Myclass; public class Anotherclass{} what's the difference between import static com.showboy.Myclass and import com.showboy.Myclass?
TITLE: What does the "static" modifier after "import" mean? QUESTION: When used like this: import static com.showboy.Myclass; public class Anotherclass{} what's the difference between import static com.showboy.Myclass and import com.showboy.Myclass? ANSWER: See Documentation The static import declaration is analogou...
[ "java", "modifier", "static-import" ]
477
416
153,383
8
0
2008-10-02T13:13:04.047000
2008-10-02T13:14:33.857000
162,192
162,223
Visual Studio 2008 - Add Reference
When adding a DLL as a reference to an ASP.Net project, VS2008 adds several files to the bin directory. If the DLL is called foo.dll, VS2008 adds foo.dll.refresh, foo.pdb and foo.xml. I know what foo.dll is:-), why does VS2008 add the other three files? What do those three files do? Can I delete them? Do they need to b...
Source Control: Ben Straub said in a comment to this post: The.dll.refresh files should be added to the source control if required, while the.xml,.pdb and of course the.dll files should not be added. John Rudy explained when to add the.refresh file: Why is this a good thing (sometimes)? Let's say you're in a team envir...
Visual Studio 2008 - Add Reference When adding a DLL as a reference to an ASP.Net project, VS2008 adds several files to the bin directory. If the DLL is called foo.dll, VS2008 adds foo.dll.refresh, foo.pdb and foo.xml. I know what foo.dll is:-), why does VS2008 add the other three files? What do those three files do? C...
TITLE: Visual Studio 2008 - Add Reference QUESTION: When adding a DLL as a reference to an ASP.Net project, VS2008 adds several files to the bin directory. If the DLL is called foo.dll, VS2008 adds foo.dll.refresh, foo.pdb and foo.xml. I know what foo.dll is:-), why does VS2008 add the other three files? What do those...
[ "visual-studio-2008", "version-control", "intellisense", "pdb-files", ".refresh" ]
17
20
10,996
5
0
2008-10-02T13:13:33.640000
2008-10-02T13:21:04.107000
162,205
162,240
How does a "Schema changed after the target table was created" error occur?
I hit this error while my web application was trying to execute a SELECT INTO on a MSSQL 2005 database. I really have two questions: What does this error mean and how does this happen? Is there a way to prevent these errors by coding in a different way?
Besides the obvious, that somebody changed the table while the code was executing, it could be a naming conflict with temp tables created in the SQL. It could be that there are two temp tables with different schemas, but they have the same name.
How does a "Schema changed after the target table was created" error occur? I hit this error while my web application was trying to execute a SELECT INTO on a MSSQL 2005 database. I really have two questions: What does this error mean and how does this happen? Is there a way to prevent these errors by coding in a diffe...
TITLE: How does a "Schema changed after the target table was created" error occur? QUESTION: I hit this error while my web application was trying to execute a SELECT INTO on a MSSQL 2005 database. I really have two questions: What does this error mean and how does this happen? Is there a way to prevent these errors by...
[ "sql", "sql-server", "sql-server-2005" ]
8
6
10,724
4
0
2008-10-02T13:16:15.490000
2008-10-02T13:23:32.573000
162,225
162,259
How do I preserve markup tags?
I've got an XML document containing news stories, and the body element of a news story contains p tags amongst the plain text. When I use XSL to retrieve the body, e.g. the p tags seem to get stripped out. I'm using Visual Studio 2005's implementation of XSL. Does anyone have any ideas how to avoid this? Thanks.
Try to use instead. From w3schools' documentation on same: The element creates a copy of the current node. Note: Namespace nodes, child nodes, and attributes of the current node are automatically copied as well!
How do I preserve markup tags? I've got an XML document containing news stories, and the body element of a news story contains p tags amongst the plain text. When I use XSL to retrieve the body, e.g. the p tags seem to get stripped out. I'm using Visual Studio 2005's implementation of XSL. Does anyone have any ideas ho...
TITLE: How do I preserve markup tags? QUESTION: I've got an XML document containing news stories, and the body element of a news story contains p tags amongst the plain text. When I use XSL to retrieve the body, e.g. the p tags seem to get stripped out. I'm using Visual Studio 2005's implementation of XSL. Does anyone...
[ "xml", "xslt" ]
18
25
8,933
5
0
2008-10-02T13:21:31.970000
2008-10-02T13:27:31.253000
162,231
162,251
What constitutes 'high cpu' for SQL Server
What level of CPU usage should be considered high for SQL Server? ie 80% 90% 100%?
if under normal loads the CPU averages above 40% I start to get nervous. However, that's because I know the nature of our traffic and the spikes we get. Your mileage may vary.
What constitutes 'high cpu' for SQL Server What level of CPU usage should be considered high for SQL Server? ie 80% 90% 100%?
TITLE: What constitutes 'high cpu' for SQL Server QUESTION: What level of CPU usage should be considered high for SQL Server? ie 80% 90% 100%? ANSWER: if under normal loads the CPU averages above 40% I start to get nervous. However, that's because I know the nature of our traffic and the spikes we get. Your mileage m...
[ "sql-server", "cpu" ]
6
7
4,311
4
0
2008-10-02T13:22:27.193000
2008-10-02T13:26:08.777000
162,255
162,381
How to check the maximum number of allowed connections to an Oracle database?
What's the best way, using SQL, to check the maximum number of connections that is allowed for an Oracle database? In the end, I would like to show the current number of sessions and the total number allowed, e.g. "Currently, 23 out of 80 connections are used".
There are a few different limits that might come in to play in determining the number of connections an Oracle database supports. The simplest approach would be to use the SESSIONS parameter and V$SESSION, i.e. The number of sessions the database was configured to allow SELECT name, value FROM v$parameter WHERE name = ...
How to check the maximum number of allowed connections to an Oracle database? What's the best way, using SQL, to check the maximum number of connections that is allowed for an Oracle database? In the end, I would like to show the current number of sessions and the total number allowed, e.g. "Currently, 23 out of 80 con...
TITLE: How to check the maximum number of allowed connections to an Oracle database? QUESTION: What's the best way, using SQL, to check the maximum number of connections that is allowed for an Oracle database? In the end, I would like to show the current number of sessions and the total number allowed, e.g. "Currently...
[ "sql", "oracle" ]
100
132
568,073
7
0
2008-10-02T13:27:00.350000
2008-10-02T13:53:36.057000
162,276
162,317
JQuery Facebox Plugin : Get it inside the form tag
I am wanting to use the Facebox plugin for JQuery but am having a few issues getting it running how I want. The div that houses the facebox content is created outside of the tag so even though I am loading up some web controls none of them are firing back to the server. Has anyone dealt with this that can give me some ...
poking around the facebox.js I came across this line in the function init(settings)... $('body').append($.facebox.settings.faceboxHtml) I changed that to... $('#aspnetForm').append($.facebox.settings.faceboxHtml) and it loads up in the form tag, not sure yet if there are any side effects
JQuery Facebox Plugin : Get it inside the form tag I am wanting to use the Facebox plugin for JQuery but am having a few issues getting it running how I want. The div that houses the facebox content is created outside of the tag so even though I am loading up some web controls none of them are firing back to the server...
TITLE: JQuery Facebox Plugin : Get it inside the form tag QUESTION: I am wanting to use the Facebox plugin for JQuery but am having a few issues getting it running how I want. The div that houses the facebox content is created outside of the tag so even though I am loading up some web controls none of them are firing ...
[ "c#", "asp.net", "jquery", "facebox" ]
3
3
8,198
4
0
2008-10-02T13:31:23.910000
2008-10-02T13:39:58.850000
162,295
165,379
Font problems in charts (Reporting services 2008)
While generating charts using RS 2008 betas, RC0 and such., I never specified any fonts for axis labels, legends etc. They were all rendered with the Arial font by default, which looked awesome. But as soon as we switched to RS 2008 final, the fonts got all messed up - they are rendered in some kind of bold console fon...
I have seen this behaviour before. Not in SSRS, but in GDI+ rendering in.NET desktop applications. It has to do with antialiasing and palettes that don't support transparency - all the nearly-transparent pixels surrounding the glyphs are coerced to solid colour. You don't get this effect with post-LCD fonts like Calibr...
Font problems in charts (Reporting services 2008) While generating charts using RS 2008 betas, RC0 and such., I never specified any fonts for axis labels, legends etc. They were all rendered with the Arial font by default, which looked awesome. But as soon as we switched to RS 2008 final, the fonts got all messed up - ...
TITLE: Font problems in charts (Reporting services 2008) QUESTION: While generating charts using RS 2008 betas, RC0 and such., I never specified any fonts for axis labels, legends etc. They were all rendered with the Arial font by default, which looked awesome. But as soon as we switched to RS 2008 final, the fonts go...
[ "reporting-services" ]
2
3
2,547
1
0
2008-10-02T13:35:34.667000
2008-10-03T01:56:10.470000
162,296
162,466
How to replay soap message?
I would like to replay soap message against my server. I've recorded a few messages and i've tampered with Timestamps, soapbodies etc and now I would like to see that my SecurityAssertions lites up like xmastrees. The deployed server will use clientcertificates and servercertifivcates for authentisation, and the whole ...
You could try soapUI. It has quite a few capabilities for interacting with web services including creating tests for them in which you can replay messages.
How to replay soap message? I would like to replay soap message against my server. I've recorded a few messages and i've tampered with Timestamps, soapbodies etc and now I would like to see that my SecurityAssertions lites up like xmastrees. The deployed server will use clientcertificates and servercertifivcates for au...
TITLE: How to replay soap message? QUESTION: I would like to replay soap message against my server. I've recorded a few messages and i've tampered with Timestamps, soapbodies etc and now I would like to see that my SecurityAssertions lites up like xmastrees. The deployed server will use clientcertificates and serverce...
[ "web-services", "security", "soap" ]
0
0
1,004
1
0
2008-10-02T13:35:48.847000
2008-10-02T14:08:50.233000
162,298
162,334
RoR: Model validation question
I have a basic ActiveRecord model in which i have two fields that i would like to validate. The requirement is that at least one of the fields must have a value. Both can have values, but at least one needs a value. How do i express this with validates_presence_of statements? For example: validates_presence_of:main_fil...
validates_presence_of:main_file,:if => Proc.new { |p| p.alt_file.blank? } validates_presence_of:alt_file,:if => Proc.new { |p| p.main_file.blank? }
RoR: Model validation question I have a basic ActiveRecord model in which i have two fields that i would like to validate. The requirement is that at least one of the fields must have a value. Both can have values, but at least one needs a value. How do i express this with validates_presence_of statements? For example:...
TITLE: RoR: Model validation question QUESTION: I have a basic ActiveRecord model in which i have two fields that i would like to validate. The requirement is that at least one of the fields must have a value. Both can have values, but at least one needs a value. How do i express this with validates_presence_of statem...
[ "ruby-on-rails", "ruby" ]
4
5
527
2
0
2008-10-02T13:36:30.387000
2008-10-02T13:44:16.953000
162,303
162,323
Convert Char[] to a List<byte> (c#)
How can I convert a Char[] (of any length) to a List?
First you need to understand that chars aren't bytes in.NET. To convert between chars (a textual type) and bytes (a binary type) you need to use an encoding (see System.Text.Encoding). Encoding will let you convert between string/char[] and byte[]. Once you've got a byte array, there are various ways of converting that...
Convert Char[] to a List<byte> (c#) How can I convert a Char[] (of any length) to a List?
TITLE: Convert Char[] to a List<byte> (c#) QUESTION: How can I convert a Char[] (of any length) to a List? ANSWER: First you need to understand that chars aren't bytes in.NET. To convert between chars (a textual type) and bytes (a binary type) you need to use an encoding (see System.Text.Encoding). Encoding will let ...
[ "c#", "generics" ]
4
16
10,897
2
0
2008-10-02T13:36:59.687000
2008-10-02T13:40:42.610000
162,304
162,305
How do I shutdown, restart, or log off Windows via a bat file?
I've been using Remote Desktop Connection to get into a workstation. But in this environment, I cannot use the power options in Start Menu. I need an alternative way to shutdown or restart. How do I control my computer's power state through the command line?
The most common ways to use the shutdown command are: shutdown -s — Shuts down. shutdown -r — Restarts. shutdown -l — Logs off. shutdown -h — Hibernates. Note: There is a common pitfall wherein users think -h means "help" (which it does for every other command-line program... except shutdown.exe, where it means "hibern...
How do I shutdown, restart, or log off Windows via a bat file? I've been using Remote Desktop Connection to get into a workstation. But in this environment, I cannot use the power options in Start Menu. I need an alternative way to shutdown or restart. How do I control my computer's power state through the command line...
TITLE: How do I shutdown, restart, or log off Windows via a bat file? QUESTION: I've been using Remote Desktop Connection to get into a workstation. But in this environment, I cannot use the power options in Start Menu. I need an alternative way to shutdown or restart. How do I control my computer's power state throug...
[ "windows", "batch-file", "command-line", "restart", "shutdown" ]
684
1,193
2,495,263
10
0
2008-10-02T13:37:01.527000
2008-10-02T13:37:28.357000
162,309
2,801,958
How to launch a Windows process as 64-bit from 32-bit code?
To pop up the UAC dialog in Vista when writing to the HKLM registry hive, we opt to not use the Win32 Registry API, as when Vista permissions are lacking, we'd need to relaunch our entire application with administrator rights. Instead, we do this trick: ShellExecute(hWnd, "runas" /* display UAC prompt on Vista */, wind...
try this (from a 32bit process): > %WINDIR%\sysnative\reg.exe query... (found that here ).
How to launch a Windows process as 64-bit from 32-bit code? To pop up the UAC dialog in Vista when writing to the HKLM registry hive, we opt to not use the Win32 Registry API, as when Vista permissions are lacking, we'd need to relaunch our entire application with administrator rights. Instead, we do this trick: ShellE...
TITLE: How to launch a Windows process as 64-bit from 32-bit code? QUESTION: To pop up the UAC dialog in Vista when writing to the HKLM registry hive, we opt to not use the Win32 Registry API, as when Vista permissions are lacking, we'd need to relaunch our entire application with administrator rights. Instead, we do ...
[ "c++", "winapi", "64-bit", "registry" ]
11
14
15,571
4
0
2008-10-02T13:37:46.827000
2010-05-10T10:40:14.493000
162,310
162,341
What is the role of Spring in Struts + Spring + Hibernate?
What role is Spring taking in Struts + Spring + Hibernate?
Spring provides many different "modules" and different programmers will use different parts of Spring. However, commonly in this sort of stack, you will see Spring being used as a provider of An inversion of control container for dependency injection An abstraction to Hibernate called "HibernateTemplate" Framework clas...
What is the role of Spring in Struts + Spring + Hibernate? What role is Spring taking in Struts + Spring + Hibernate?
TITLE: What is the role of Spring in Struts + Spring + Hibernate? QUESTION: What role is Spring taking in Struts + Spring + Hibernate? ANSWER: Spring provides many different "modules" and different programmers will use different parts of Spring. However, commonly in this sort of stack, you will see Spring being used ...
[ "java", "hibernate", "spring", "struts" ]
10
16
2,811
3
0
2008-10-02T13:37:48.560000
2008-10-02T13:44:48.480000
162,322
172,723
Firebird 1.5.3: How to add FK with connected users to the DB?
I use FB1.5.3 and need to eventually add some FK to the database. It happens that if I try to do it while anyone else is connected to the DB I get an exception. Is there a way to add an FK while the system is running?
There's no way. It's a known limitation that has been removed in Firebird 2.0. You should either upgrade, or live with it.
Firebird 1.5.3: How to add FK with connected users to the DB? I use FB1.5.3 and need to eventually add some FK to the database. It happens that if I try to do it while anyone else is connected to the DB I get an exception. Is there a way to add an FK while the system is running?
TITLE: Firebird 1.5.3: How to add FK with connected users to the DB? QUESTION: I use FB1.5.3 and need to eventually add some FK to the database. It happens that if I try to do it while anyone else is connected to the DB I get an exception. Is there a way to add an FK while the system is running? ANSWER: There's no wa...
[ "database", "foreign-keys", "firebird" ]
3
3
462
2
0
2008-10-02T13:40:30.643000
2008-10-05T21:49:38.090000
162,325
162,660
SQL Duplicate Delete Query over Millions of Rows for Performance
This has been an adventure. I started with the looping duplicate query located in my previous question, but each loop would go over all 17 million records, meaning it would take weeks (just running *select count * from MyTable* takes my server 4:30 minutes using MSSQL 2005). I gleamed information from this site and at ...
Seeing the QueryPlan would help. Is this feasible? SELECT m.* into #temp FROM tl_acxiomimport.dbo.tblacxiomlistings m inner join (SELECT RecordID, Rank() over (Partition BY BusinessName, latitude, longitude, Phone ORDER BY webaddress DESC, caption1 DESC, caption2 DESC ) AS Rank FROM tl_acxiomimport.dbo.tblacxiomlisting...
SQL Duplicate Delete Query over Millions of Rows for Performance This has been an adventure. I started with the looping duplicate query located in my previous question, but each loop would go over all 17 million records, meaning it would take weeks (just running *select count * from MyTable* takes my server 4:30 minute...
TITLE: SQL Duplicate Delete Query over Millions of Rows for Performance QUESTION: This has been an adventure. I started with the looping duplicate query located in my previous question, but each loop would go over all 17 million records, meaning it would take weeks (just running *select count * from MyTable* takes my ...
[ "sql", "sql-server", "duplicate-data", "sql-delete" ]
2
6
5,908
11
0
2008-10-02T13:41:58.580000
2008-10-02T14:38:52.220000
162,331
162,351
Finding the default application for opening a particular file type on Windows
I'm developing an application targeting.NET Framework 2.0 using C# for which I need to be able to find the default application that is used for opening a particular file type. I know that, for example, if you just want to open a file using that application you can use something like: System.Diagnostics.Process.Start( "...
You can check under registry section HKEY_CLASSES_ROOT for the extension and action details. Documentation for this is on MSDN. Alternatively, you can use the IQueryAssociations interface.
Finding the default application for opening a particular file type on Windows I'm developing an application targeting.NET Framework 2.0 using C# for which I need to be able to find the default application that is used for opening a particular file type. I know that, for example, if you just want to open a file using th...
TITLE: Finding the default application for opening a particular file type on Windows QUESTION: I'm developing an application targeting.NET Framework 2.0 using C# for which I need to be able to find the default application that is used for opening a particular file type. I know that, for example, if you just want to op...
[ "c#", ".net", "windows", "file-type" ]
64
17
54,059
6
0
2008-10-02T13:43:07.330000
2008-10-02T13:47:17.383000
162,335
162,348
What is wrong with DateTime.Parse(myString)?
I was browsing Scott Hanselman's Developer Interview question list, and ran across this question: What is wrong with DateTime.Parse(myString)? While I know there are inherent risks in parsing a string of unknow format or origin, are there other reasons? Is it to use DateTime.ParseExact instead? Should it be myString.To...
In addition the locale problem, DateTime.Parse() could also throw an exception which you would then have to catch. Use DateTime.TryParse() or DateTime.TryParseExact() instead.
What is wrong with DateTime.Parse(myString)? I was browsing Scott Hanselman's Developer Interview question list, and ran across this question: What is wrong with DateTime.Parse(myString)? While I know there are inherent risks in parsing a string of unknow format or origin, are there other reasons? Is it to use DateTime...
TITLE: What is wrong with DateTime.Parse(myString)? QUESTION: I was browsing Scott Hanselman's Developer Interview question list, and ran across this question: What is wrong with DateTime.Parse(myString)? While I know there are inherent risks in parsing a string of unknow format or origin, are there other reasons? Is ...
[ "c#", "datetime" ]
23
28
16,737
8
0
2008-10-02T13:44:16.970000
2008-10-02T13:46:48.833000
162,375
176,139
Streaming audio to a browser
I have a large amount of audio stored on my web server in a very custom format that can't be replayed by anything other than my own application. That application is a Win32 app that can connect to my web server and stream and replay that audio. I'd really like to be able to do the streaming and replaying from within a ...
Apart from converting server-side: Implement a decoder for your format in ActionScript or Java. Then you can write a Flash movie or Java applet that plays it. Both languages/runtimes should be fast enough to decode in realtime unless your format is very complex. Flash would be the more accessible of the two, since near...
Streaming audio to a browser I have a large amount of audio stored on my web server in a very custom format that can't be replayed by anything other than my own application. That application is a Win32 app that can connect to my web server and stream and replay that audio. I'd really like to be able to do the streaming...
TITLE: Streaming audio to a browser QUESTION: I have a large amount of audio stored on my web server in a very custom format that can't be replayed by anything other than my own application. That application is a Win32 app that can connect to my web server and stream and replay that audio. I'd really like to be able t...
[ "browser", "audio" ]
4
2
3,750
4
0
2008-10-02T13:52:51.830000
2008-10-06T20:50:28.473000
162,376
189,585
Web Services authentication - best practices?
We have SOAP web services in production that are relying on SOAP Headers (containing plain client credentials) for the authentication. The WS are used in heterogeneous environments with.NET/Java/PHP/Python/C++ clients both web app or desktop app. We are considering a v2 for those WS and I am wondering what are consider...
The easiest way to handle it across a variety of platforms is to use HTTP basic authentication and HTTPS for the transport layer. WS-Security would be good if your needs go beyond simple username/password but the support is going to vary quite a bit between platforms. HTTP authentication is supported by every decent SO...
Web Services authentication - best practices? We have SOAP web services in production that are relying on SOAP Headers (containing plain client credentials) for the authentication. The WS are used in heterogeneous environments with.NET/Java/PHP/Python/C++ clients both web app or desktop app. We are considering a v2 for...
TITLE: Web Services authentication - best practices? QUESTION: We have SOAP web services in production that are relying on SOAP Headers (containing plain client credentials) for the authentication. The WS are used in heterogeneous environments with.NET/Java/PHP/Python/C++ clients both web app or desktop app. We are co...
[ "web-services", "authentication", "soap" ]
21
15
29,279
3
0
2008-10-02T13:52:55.513000
2008-10-09T23:28:27.903000
162,399
162,420
SQL count query
Hi why doesn't this work in SQL Server 2005? select HALID, count(HALID) as CH from Outages.FaultsInOutages where CH > 3 group by HALID I get invalid column name 'CH' i think having was the right way to go but still receive the error: Invalid column name 'CH'. When running: select HALID, count(HALID) as CH from Outage...
You can't use the alias in the where clause or having clause, as it isn't processed until AFTER the result set is generated, the proper syntax is SELECT HALID, COUNT(HALID) AS CH FROM Outages.FaultsInOutages GROUP BY HALID HAVING COUNT(HALID) > 3 This will group items on HALID, then ONLY return results that have more t...
SQL count query Hi why doesn't this work in SQL Server 2005? select HALID, count(HALID) as CH from Outages.FaultsInOutages where CH > 3 group by HALID I get invalid column name 'CH' i think having was the right way to go but still receive the error: Invalid column name 'CH'. When running: select HALID, count(HALID) a...
TITLE: SQL count query QUESTION: Hi why doesn't this work in SQL Server 2005? select HALID, count(HALID) as CH from Outages.FaultsInOutages where CH > 3 group by HALID I get invalid column name 'CH' i think having was the right way to go but still receive the error: Invalid column name 'CH'. When running: select HAL...
[ "sql", "sql-server", "sql-server-2005" ]
2
14
1,506
2
0
2008-10-02T13:56:22.167000
2008-10-02T13:59:58.413000
162,409
162,422
What is the point of @import?
Can someone explain what are the benefits of using the @import syntax comparing to just including css using the standard link method?
It allows you to keep your logic CSS file spread over multiple physical files. Helps in team development, for example. Also useful when you have a lot of CSS files that you want to separate by functional areas (one for grids, one for lists, etc), let have accessible in the same logical file.
What is the point of @import? Can someone explain what are the benefits of using the @import syntax comparing to just including css using the standard link method?
TITLE: What is the point of @import? QUESTION: Can someone explain what are the benefits of using the @import syntax comparing to just including css using the standard link method? ANSWER: It allows you to keep your logic CSS file spread over multiple physical files. Helps in team development, for example. Also usefu...
[ "css" ]
7
1
682
7
0
2008-10-02T13:58:24.267000
2008-10-02T14:00:25.043000
162,444
162,460
Track started applications in Windows
We're trying to put together kiosk solution where we can charge people by hour for applications they use. As such, we need a way to figure out when an application is started, when it is closed and log this information for billing. I am a reasonably experienced.NET programmer so a managed code solution would be great. I...
This is simple enough with WMI calls. You can actually catch events from the OS on when an app is started, when it's closed, how long it was running, how much memory it used, etc. Here is one example of monitoring process creating, deletion, etc. http://weblogs.asp.net/whaggard/archive/2006/02/11/438006.aspx
Track started applications in Windows We're trying to put together kiosk solution where we can charge people by hour for applications they use. As such, we need a way to figure out when an application is started, when it is closed and log this information for billing. I am a reasonably experienced.NET programmer so a m...
TITLE: Track started applications in Windows QUESTION: We're trying to put together kiosk solution where we can charge people by hour for applications they use. As such, we need a way to figure out when an application is started, when it is closed and log this information for billing. I am a reasonably experienced.NET...
[ "windows" ]
2
3
531
2
0
2008-10-02T14:05:13.283000
2008-10-02T14:08:29.047000
162,445
162,448
How to know the real size of a web page?
I wan't to know the real size of a web page (HTML + CSS + Javascript + Images + etc.) but from the browser side, maybe with a software, Firefox Add-On or similar?
Use firefox, and get FireBug. Then get the YSlow addon for firefox. For IE, you can get the DebugBar which comes pretty close to giving the same information.
How to know the real size of a web page? I wan't to know the real size of a web page (HTML + CSS + Javascript + Images + etc.) but from the browser side, maybe with a software, Firefox Add-On or similar?
TITLE: How to know the real size of a web page? QUESTION: I wan't to know the real size of a web page (HTML + CSS + Javascript + Images + etc.) but from the browser side, maybe with a software, Firefox Add-On or similar? ANSWER: Use firefox, and get FireBug. Then get the YSlow addon for firefox. For IE, you can get t...
[ "performance" ]
12
14
12,806
5
0
2008-10-02T14:05:35.887000
2008-10-02T14:06:14.013000
162,459
162,483
SQL Join question
I have 3 tables Links Link ID Link Name GroupID (FK into Groups) SubGroupID (FK into Subgroups) Groups GroupID GroupName SubGroup SubGroupID SubGroupName GroupID (FK into Groups) Every link needs to have a GroupID but teh SubGroupID is optional. How do i write a SQL query to show: Links.LinkName, Groups.GroupName, SubG...
This assumes that there is at most only 1 subgroup per group. if there are more, then you have the potential to get additional records. select links.linkname, groups.groupname, subgroup.subgroupname from links inner join groups on (links.groupid = groups.groupid) left outer join subgroup on (links.subgroupid = subgroup...
SQL Join question I have 3 tables Links Link ID Link Name GroupID (FK into Groups) SubGroupID (FK into Subgroups) Groups GroupID GroupName SubGroup SubGroupID SubGroupName GroupID (FK into Groups) Every link needs to have a GroupID but teh SubGroupID is optional. How do i write a SQL query to show: Links.LinkName, Grou...
TITLE: SQL Join question QUESTION: I have 3 tables Links Link ID Link Name GroupID (FK into Groups) SubGroupID (FK into Subgroups) Groups GroupID GroupName SubGroup SubGroupID SubGroupName GroupID (FK into Groups) Every link needs to have a GroupID but teh SubGroupID is optional. How do i write a SQL query to show: Li...
[ "sql" ]
2
5
680
10
0
2008-10-02T14:08:21.450000
2008-10-02T14:11:26.623000
162,480
162,504
'const int' vs. 'int const' as function parameters in C++ and C
Consider: int testfunc1 (const int a) { return a; } int testfunc2 (int const a) { return a; } Are these two functions the same in every aspect or is there a difference? I'm interested in an answer for the C language, but if there is something interesting in the C++ language, I'd like to know as well.
const T and T const are identical. With pointer types it becomes more complicated: const char* is a pointer to a constant char char const* is a pointer to a constant char char* const is a constant pointer to a (mutable) char In other words, (1) and (2) are identical. The only way of making the pointer (rather than the ...
'const int' vs. 'int const' as function parameters in C++ and C Consider: int testfunc1 (const int a) { return a; } int testfunc2 (int const a) { return a; } Are these two functions the same in every aspect or is there a difference? I'm interested in an answer for the C language, but if there is something interesting ...
TITLE: 'const int' vs. 'int const' as function parameters in C++ and C QUESTION: Consider: int testfunc1 (const int a) { return a; } int testfunc2 (int const a) { return a; } Are these two functions the same in every aspect or is there a difference? I'm interested in an answer for the C language, but if there is some...
[ "c++", "c", "constants" ]
142
207
119,999
9
0
2008-10-02T14:11:02.130000
2008-10-02T14:14:57.317000
162,520
162,549
Is there a way to script diagrams in SQL 2000 (or save them another way)?
It's possible to create digrams in SQL Server 2000 that can be useful to show the relationships between tables. The problem we run into is that when somebody refreshes our development database, the diagrams get lost. We can load tables, stored procedures, views, etc. with SQL scripts, but we have to create the diagrams...
It can be done for SQL Server 2005 - see here. And info. on SQL Server 2000 - here.
Is there a way to script diagrams in SQL 2000 (or save them another way)? It's possible to create digrams in SQL Server 2000 that can be useful to show the relationships between tables. The problem we run into is that when somebody refreshes our development database, the diagrams get lost. We can load tables, stored pr...
TITLE: Is there a way to script diagrams in SQL 2000 (or save them another way)? QUESTION: It's possible to create digrams in SQL Server 2000 that can be useful to show the relationships between tables. The problem we run into is that when somebody refreshes our development database, the diagrams get lost. We can load...
[ "sql-server", "sql-server-2000", "diagram" ]
2
3
854
2
0
2008-10-02T14:16:26.453000
2008-10-02T14:22:16.050000
162,534
1,093,800
Mock IIdentity and IPrincipal
I just wanna ask what would be better approach to supply these objects in my unit tests. In my unit test I am testing CSLA object. CSLA object is internally using one property and one method of ApplicationUser object. ApplicationUser is inherited from IPrincipal. The properties are: 1) ApplicationContext.User.IsInRole(...
The reason you're getting a null reference error is because IPrincipal.Identity is null; it hasn't been set in your mocked IPrincipal yet. Calling.Name the null Identity results in your exception. The answer, as Carlton pointed out, is to mock IIdentity also, and set it up to return "ju" for its Name property. Then you...
Mock IIdentity and IPrincipal I just wanna ask what would be better approach to supply these objects in my unit tests. In my unit test I am testing CSLA object. CSLA object is internally using one property and one method of ApplicationUser object. ApplicationUser is inherited from IPrincipal. The properties are: 1) App...
TITLE: Mock IIdentity and IPrincipal QUESTION: I just wanna ask what would be better approach to supply these objects in my unit tests. In my unit test I am testing CSLA object. CSLA object is internally using one property and one method of ApplicationUser object. ApplicationUser is inherited from IPrincipal. The prop...
[ "mocking", "iprincipal" ]
10
10
10,044
2
0
2008-10-02T14:19:22.423000
2009-07-07T17:53:59.697000
162,537
162,554
What is the difference between "global::System" and "System" in .NET?
I just upgraded a VS 2005 project to VS 2008 and was examining the changes. I noticed one of the.Designer.cs files had changed significantly. The majority of the changes were simply replacements of System with global::System. For example, protected override System.Data.DataTable CreateInstance() became protected overri...
The:: operator is called a Namespace Alias Qualifier. global::System.Data.DataTable is the same as: System.Data.DataTable Visual Studio 2008 added it to the designer generated code to avoid ambigious reference issues that occasionally happened when people created classes named System...For example: class TestApp { // D...
What is the difference between "global::System" and "System" in .NET? I just upgraded a VS 2005 project to VS 2008 and was examining the changes. I noticed one of the.Designer.cs files had changed significantly. The majority of the changes were simply replacements of System with global::System. For example, protected o...
TITLE: What is the difference between "global::System" and "System" in .NET? QUESTION: I just upgraded a VS 2005 project to VS 2008 and was examining the changes. I noticed one of the.Designer.cs files had changed significantly. The majority of the changes were simply replacements of System with global::System. For ex...
[ ".net", "visual-studio-2008", "namespaces" ]
4
14
1,010
2
0
2008-10-02T14:19:35.620000
2008-10-02T14:23:19.357000
162,542
162,590
Performing AJAX delete operations restfully in rails
How do you perform delete and put operations restfully in rails? I have read the documentation and thought I was doing everything properly, but I can't seem to get it to work. For example, if I wanted to delete an employee I would create a controller called "EmployeesController" and create a destroy method to perform t...
Try:url => employee_url(@employee) IIRC, *_path is a named route generated by the:resource directive which includes the method, thus overwriting your:method =>:delete
Performing AJAX delete operations restfully in rails How do you perform delete and put operations restfully in rails? I have read the documentation and thought I was doing everything properly, but I can't seem to get it to work. For example, if I wanted to delete an employee I would create a controller called "Employee...
TITLE: Performing AJAX delete operations restfully in rails QUESTION: How do you perform delete and put operations restfully in rails? I have read the documentation and thought I was doing everything properly, but I can't seem to get it to work. For example, if I wanted to delete an employee I would create a controlle...
[ "ruby-on-rails", "rest" ]
6
6
3,652
4
0
2008-10-02T14:20:43.230000
2008-10-02T14:28:45.100000
162,551
162,719
How to find unused/dead code in java projects
What tools do you use to find unused/dead code in large java projects? Our product has been in development for some years, and it is getting very hard to manually detect code that is no longer in use. We do however try to delete as much unused code as possible. Suggestions for general strategies/techniques (other than ...
I would instrument the running system to keep logs of code usage, and then start inspecting code that is not used for months or years. For example if you are interested in unused classes, all classes could be instrumented to log when instances are created. And then a small script could compare these logs against the co...
How to find unused/dead code in java projects What tools do you use to find unused/dead code in large java projects? Our product has been in development for some years, and it is getting very hard to manually detect code that is no longer in use. We do however try to delete as much unused code as possible. Suggestions ...
TITLE: How to find unused/dead code in java projects QUESTION: What tools do you use to find unused/dead code in large java projects? Our product has been in development for some years, and it is getting very hard to manually detect code that is no longer in use. We do however try to delete as much unused code as poss...
[ "java", "refactoring", "dead-code" ]
318
43
182,409
21
0
2008-10-02T14:22:52.663000
2008-10-02T14:48:19.343000
162,564
162,584
Update Month value on datefield in MS sql 2005
I need a way to update the month value on a dateTime field in my db. I'm being past an int value for the month and need to use that for the update. Is it possible to do this in the sql statement or would I be best doing it in c# in the webservice?
Shift down and then up again: UPDATE table SET datecol = DATEADD(m, @newmonth, DATEADD(m, -MONTH(datecol), datecol)) WHERE id = @id or, more simply: UPDATE table SET datecol = DATEADD(m, @newmonth - MONTH(datecol), datecol) WHERE id = @id
Update Month value on datefield in MS sql 2005 I need a way to update the month value on a dateTime field in my db. I'm being past an int value for the month and need to use that for the update. Is it possible to do this in the sql statement or would I be best doing it in c# in the webservice?
TITLE: Update Month value on datefield in MS sql 2005 QUESTION: I need a way to update the month value on a dateTime field in my db. I'm being past an int value for the month and need to use that for the update. Is it possible to do this in the sql statement or would I be best doing it in c# in the webservice? ANSWER...
[ ".net", "sql", "web-services" ]
0
2
1,718
2
0
2008-10-02T14:24:55.513000
2008-10-02T14:27:10.110000
162,571
162,629
How do I get the row count in JDBC?
I've executed a JDBC query to obtain a resultset. Before iterating over it, I'd like to quickly find out how many rows were returned. How can I do this with high performance? I'm using Java 6, Oracle 11g, and the latest Oracle JDBC drivers.
You're going to have to do this as a separate query, for example: SELECT COUNT(1) FROM table_name Some JDBC drivers might tell you but this is optional behaviour and, more to the point, the driver may not know yet. This can be due to how the query is optimised eg two example execution strategies in Oracle are to get al...
How do I get the row count in JDBC? I've executed a JDBC query to obtain a resultset. Before iterating over it, I'd like to quickly find out how many rows were returned. How can I do this with high performance? I'm using Java 6, Oracle 11g, and the latest Oracle JDBC drivers.
TITLE: How do I get the row count in JDBC? QUESTION: I've executed a JDBC query to obtain a resultset. Before iterating over it, I'd like to quickly find out how many rows were returned. How can I do this with high performance? I'm using Java 6, Oracle 11g, and the latest Oracle JDBC drivers. ANSWER: You're going to ...
[ "java", "jdbc", "resultset" ]
32
34
98,337
7
0
2008-10-02T14:25:36.480000
2008-10-02T14:34:26.100000
162,576
162,611
How can I save email attachments to the server in PHP?
I've been battling PHP's email reading functions for the better part of two days. I'm writing a script to read emails from a mailbox and save any attachments onto the server. If you've ever done something similar, you might understand my pain: PHP doesn't play well with email! I've connected to the POP3 server and I ca...
I found a quick guide how to treat emails with PHP: here. At the bottom of that page there's a attachment-body echo: if (substr($ContentType,0,4) == "text") { echo imap_qprint($fileContent); } else { echo imap_base64($fileContent); } I guess this is what you might need... (edit: in your case if it's image always you ca...
How can I save email attachments to the server in PHP? I've been battling PHP's email reading functions for the better part of two days. I'm writing a script to read emails from a mailbox and save any attachments onto the server. If you've ever done something similar, you might understand my pain: PHP doesn't play well...
TITLE: How can I save email attachments to the server in PHP? QUESTION: I've been battling PHP's email reading functions for the better part of two days. I'm writing a script to read emails from a mailbox and save any attachments onto the server. If you've ever done something similar, you might understand my pain: PHP...
[ "php", "email", "mime" ]
6
4
16,901
4
0
2008-10-02T14:26:01.313000
2008-10-02T14:32:27.803000
162,583
162,592
Different team members on Visual Studio 2005 and 2008
I am currently working on an asp.net application in Visual Studio 2005. I would like to upgrade to 2008 to take advantage of some of the new features, but my remote team won't be able to upgrade to it for a while. Is it possible for only a few people on my team to upgrade to Visual Studio 2008, while the rest of the te...
Yes, the project files between 2005 and 2008 are compatible. The solutions are not, but those are easy to remake or copy. There is one gotcha with the project files, if you're using Web Applications projects. The two versions reference different MSBuild target files. Steven Harman has a blog with a fix to add to the pr...
Different team members on Visual Studio 2005 and 2008 I am currently working on an asp.net application in Visual Studio 2005. I would like to upgrade to 2008 to take advantage of some of the new features, but my remote team won't be able to upgrade to it for a while. Is it possible for only a few people on my team to u...
TITLE: Different team members on Visual Studio 2005 and 2008 QUESTION: I am currently working on an asp.net application in Visual Studio 2005. I would like to upgrade to 2008 to take advantage of some of the new features, but my remote team won't be able to upgrade to it for a while. Is it possible for only a few peop...
[ ".net", "visual-studio", "visual-studio-2008", "visual-studio-2005" ]
5
1
365
4
0
2008-10-02T14:26:53.683000
2008-10-02T14:29:58.527000
162,591
162,630
Subversion: deleting old feature branches vs. keeping them
I have a subversion repository with the standard layout, i.e. trunk/ and branches/ (and tags/). When working on a bigger change, a feature branch is used, regularly synced with trunk, and later reintegrated back into trunk (using 1.5 now). Pretty standard stuff. What I am wondering is whether such a feature branch, onc...
If you are really worried about deleting them, lest they be forgotten, then simply create a folder under branches called 'inactive' and svn move your older, inactive branches into that folder. This might be the best of both worlds for you.
Subversion: deleting old feature branches vs. keeping them I have a subversion repository with the standard layout, i.e. trunk/ and branches/ (and tags/). When working on a bigger change, a feature branch is used, regularly synced with trunk, and later reintegrated back into trunk (using 1.5 now). Pretty standard stuff...
TITLE: Subversion: deleting old feature branches vs. keeping them QUESTION: I have a subversion repository with the standard layout, i.e. trunk/ and branches/ (and tags/). When working on a bigger change, a feature branch is used, regularly synced with trunk, and later reintegrated back into trunk (using 1.5 now). Pre...
[ "svn", "version-control", "branch" ]
40
29
8,867
4
0
2008-10-02T14:29:00.467000
2008-10-02T14:34:51.713000
162,617
162,811
How can I automatically add some skeleton code when creating a new file with vim
When creating a new file with vim, I would like to automatically add some skeleton code. For example, when creating a new xml file, I would like to add the first line: Or when creating an html file, I would like to add:
If you want to adapt your skeleton to the context, or to the user choices, have a look at the template-expander plugins listed on vim.wikia
How can I automatically add some skeleton code when creating a new file with vim When creating a new file with vim, I would like to automatically add some skeleton code. For example, when creating a new xml file, I would like to add the first line: Or when creating an html file, I would like to add:
TITLE: How can I automatically add some skeleton code when creating a new file with vim QUESTION: When creating a new file with vim, I would like to automatically add some skeleton code. For example, when creating a new xml file, I would like to add the first line: Or when creating an html file, I would like to add: ...
[ "vim", "code-generation" ]
35
5
15,878
8
0
2008-10-02T14:33:26.117000
2008-10-02T15:00:22.463000
162,618
190,646
.NET : How do you remove a specific node from an XMLDocument using XPATH?
Using C# How do you remove a specific node from an XMLDocument using XPATH?
XPath can only select nodes from a document, not modify the document.
.NET : How do you remove a specific node from an XMLDocument using XPATH? Using C# How do you remove a specific node from an XMLDocument using XPATH?
TITLE: .NET : How do you remove a specific node from an XMLDocument using XPATH? QUESTION: Using C# How do you remove a specific node from an XMLDocument using XPATH? ANSWER: XPath can only select nodes from a document, not modify the document.
[ "c#", ".net", "xpath" ]
9
2
19,631
3
0
2008-10-02T14:33:31.030000
2008-10-10T09:36:30.033000
162,650
162,658
How do I detect "Easter Egg" mode in my Palm OS application?
Since the early days, Palm OS has had a special "easter egg" mode that's enabled by making the right gesture in one of the Preference panels. On current Palm Treo and Centro devices, this is turned on by doing a clockwise swirl above the "Tips" button in the Power panel. Some applications, like the Blazer web browser, ...
The standard system preference for this is prefAllowEasterEggs (see Preference.h). This setting can be accessed using the PrefGetPreference API: UInt32 enableEasterEggs = PrefGetPreference(prefAllowEasterEggs); The value will be non-zero when the user has requested that Easter eggs be available.
How do I detect "Easter Egg" mode in my Palm OS application? Since the early days, Palm OS has had a special "easter egg" mode that's enabled by making the right gesture in one of the Preference panels. On current Palm Treo and Centro devices, this is turned on by doing a clockwise swirl above the "Tips" button in the ...
TITLE: How do I detect "Easter Egg" mode in my Palm OS application? QUESTION: Since the early days, Palm OS has had a special "easter egg" mode that's enabled by making the right gesture in one of the Preference panels. On current Palm Treo and Centro devices, this is turned on by doing a clockwise swirl above the "Ti...
[ "c", "palm-os", "garnet-os" ]
4
6
651
1
0
2008-10-02T14:38:16.497000
2008-10-02T14:38:45.450000
162,651
162,706
What is the difference with these two sets of code
What is the difference between these two pieces of code type IInterface1 = interface procedure Proc1; end; IInterface2 = interface procedure Proc2; end; TMyClass = class(TInterfacedObject, IInterface1, IInterface2) protected procedure Proc1; procedure Proc2; end; And the following: type IInterface1 = interface proced...
First off, I'm assuming that the second example's declaration for IInterface2 is a typo and should be IInterface2 = interface(Interface1) because inheriting from itself is nonsensical (even if the compiler accepted it). And "inheriting" is the key word there for answering your question. In example 1 the two interfaces ...
What is the difference with these two sets of code What is the difference between these two pieces of code type IInterface1 = interface procedure Proc1; end; IInterface2 = interface procedure Proc2; end; TMyClass = class(TInterfacedObject, IInterface1, IInterface2) protected procedure Proc1; procedure Proc2; end; And...
TITLE: What is the difference with these two sets of code QUESTION: What is the difference between these two pieces of code type IInterface1 = interface procedure Proc1; end; IInterface2 = interface procedure Proc2; end; TMyClass = class(TInterfacedObject, IInterface1, IInterface2) protected procedure Proc1; procedu...
[ "delphi", "oop", "interface" ]
4
4
304
4
0
2008-10-02T14:38:17.917000
2008-10-02T14:46:18.350000
162,656
162,707
Interface to versioned dictionary
I have an versioned document store which I want to access through an dict like interface. Common usage is to access the latest revision (get, set, del), but one should be able to access specific revisions too (keys are always str/unicode or int). from UserDict import DictMixin class VDict(DictMixin): def __getitem__(se...
Yes, provide a different API for getting different versions. Either a single methodcall for doing a retrieval of a particular item of a particular revision, or a methodcall for getting a 'view' of a particular revision, which you could then access like a normal dict, depending on whether such a 'view' would see much us...
Interface to versioned dictionary I have an versioned document store which I want to access through an dict like interface. Common usage is to access the latest revision (get, set, del), but one should be able to access specific revisions too (keys are always str/unicode or int). from UserDict import DictMixin class VD...
TITLE: Interface to versioned dictionary QUESTION: I have an versioned document store which I want to access through an dict like interface. Common usage is to access the latest revision (get, set, del), but one should be able to access specific revisions too (keys are always str/unicode or int). from UserDict import ...
[ "python" ]
2
4
361
1
0
2008-10-02T14:38:43.907000
2008-10-02T14:46:31.140000
162,677
162,724
How can I handle HTTP file uploads?
How would I write a Perl CGI script that receives a file via a HTTP post and saves that to the file system?
Just a note: however you will write it, don't save it in a place accessible from your web-server. And now to the point: below is a script which I was using for some time for photo-uploading. It might need some tweaking, but should show you the way. As the image isnt uploaded to web-accesible directory, we then have sep...
How can I handle HTTP file uploads? How would I write a Perl CGI script that receives a file via a HTTP post and saves that to the file system?
TITLE: How can I handle HTTP file uploads? QUESTION: How would I write a Perl CGI script that receives a file via a HTTP post and saves that to the file system? ANSWER: Just a note: however you will write it, don't save it in a place accessible from your web-server. And now to the point: below is a script which I was...
[ "perl", "cgi", "file-upload" ]
4
7
1,220
4
0
2008-10-02T14:41:38.673000
2008-10-02T14:49:09.090000
162,680
162,736
The value of hobby game development
Does attempting to develop some sort of game, even just as a hobby during leisure time provide useful (professional) experience or is it a childish waste of time? I have pursued small personal game projects on and off throughout my programming career. I've found the (often) strict performance requirements and escalatin...
You can learn a lot from game development. Game development requires a discipline that you can't find in other programming projects. Here are just a small set of things game development has taught me: Optimization for speed Sacrificing computational depth for speed Developing under small constraints of memory Building ...
The value of hobby game development Does attempting to develop some sort of game, even just as a hobby during leisure time provide useful (professional) experience or is it a childish waste of time? I have pursued small personal game projects on and off throughout my programming career. I've found the (often) strict pe...
TITLE: The value of hobby game development QUESTION: Does attempting to develop some sort of game, even just as a hobby during leisure time provide useful (professional) experience or is it a childish waste of time? I have pursued small personal game projects on and off throughout my programming career. I've found the...
[ "language-agnostic" ]
14
22
2,419
9
0
2008-10-02T14:42:33.663000
2008-10-02T14:50:27.137000
162,681
163,075
How to parse formatted email address into display name and email address?
Given the email address: "Jim" If I try to pass this to MailAddress I get the exception: The specified string is not in the form required for an e-mail address. How do I parse this address into a display name (Jim) and email address (jim@example.com) in C#? EDIT: I'm looking for C# code to parse it. EDIT2: I found that...
If you are looking to parse the email address manually, you want to read RFC2822 ( https://www.rfc-editor.org/rfc/rfc822.html#section-3.4 ). Section 3.4 talks about the address format. But parsing email addresses correctly is not easy and MailAddress should be able to handle most scenarios. According to the MSDN docume...
How to parse formatted email address into display name and email address? Given the email address: "Jim" If I try to pass this to MailAddress I get the exception: The specified string is not in the form required for an e-mail address. How do I parse this address into a display name (Jim) and email address (jim@example....
TITLE: How to parse formatted email address into display name and email address? QUESTION: Given the email address: "Jim" If I try to pass this to MailAddress I get the exception: The specified string is not in the form required for an e-mail address. How do I parse this address into a display name (Jim) and email add...
[ "c#", "parsing", "mailaddress" ]
18
21
29,903
14
0
2008-10-02T14:42:35.940000
2008-10-02T15:40:53.023000
162,696
162,750
Doing your own custom .NET event processing loop
A few years ago, I read a book that described how you could override the default event 'dispatcher' implementation in.NET with your own processor. class foo { public event EventHandler myEvent;... }... myFoo.myEvent += myBar1.EventHandler; myFoo.myEvent += myBar2.EventHandler; Whenever the event fires, both myBar1 and ...
It could have been one of many books or web articles. There are various reasons why you might want to change how events are subscribed/unsubscribed: If you have many events, many of which may well not be subscribed to, you may want to use EventHandlerList to lower your memory usage You may wish to log subscription/unsu...
Doing your own custom .NET event processing loop A few years ago, I read a book that described how you could override the default event 'dispatcher' implementation in.NET with your own processor. class foo { public event EventHandler myEvent;... }... myFoo.myEvent += myBar1.EventHandler; myFoo.myEvent += myBar2.EventHa...
TITLE: Doing your own custom .NET event processing loop QUESTION: A few years ago, I read a book that described how you could override the default event 'dispatcher' implementation in.NET with your own processor. class foo { public event EventHandler myEvent;... }... myFoo.myEvent += myBar1.EventHandler; myFoo.myEvent...
[ "c#", ".net", "dispatchertimer" ]
0
8
1,160
3
0
2008-10-02T14:45:41.393000
2008-10-02T14:52:18.957000
162,717
162,737
Using system's standard Edit menu in a Palm OS app
How can I use the standard Edit menu in my Palm OS application, instead of having to implement my own Cut/Copy/Paste/Keyboard handlers?
Palm OS's system form code had built-in handlers for the command IDs in the Edit menu. If you use a standard form for these menus, you have the advantage of not needing to write code and being compatible with system extensions that look for this particular menu construction. If your form has a menubar that consists of ...
Using system's standard Edit menu in a Palm OS app How can I use the standard Edit menu in my Palm OS application, instead of having to implement my own Cut/Copy/Paste/Keyboard handlers?
TITLE: Using system's standard Edit menu in a Palm OS app QUESTION: How can I use the standard Edit menu in my Palm OS application, instead of having to implement my own Cut/Copy/Paste/Keyboard handlers? ANSWER: Palm OS's system form code had built-in handlers for the command IDs in the Edit menu. If you use a standa...
[ "c", "menu", "palm-os", "garnet-os" ]
0
3
148
1
0
2008-10-02T14:47:58.423000
2008-10-02T14:50:29.133000
162,718
162,767
How to embed a browser object, other than IE<n>, in a Delphi application
Using the default TWebBrowser makes things easy to embed a web browser. Unfortunately the one that comes in by default is IE. I'm wondering how does one integrate a Gecko or WebKit one. Are there VCL examples somewhere? If not, how would one go about doing it? Where's the best place to find the core for Gecko and/or We...
TWebBrowser is IE. It is not a plugable construction for browsers. You can have other browsers integrated in your application. See http://www.adamlock.com/mozilla/ http://delphi.mozdev.org/articles/taming_the_lizard_with_delphi.html http://ftp.newbielabs.com/Delphi%20Gecko%20SDK/ Time has moved on This answer is from '...
How to embed a browser object, other than IE<n>, in a Delphi application Using the default TWebBrowser makes things easy to embed a web browser. Unfortunately the one that comes in by default is IE. I'm wondering how does one integrate a Gecko or WebKit one. Are there VCL examples somewhere? If not, how would one go ab...
TITLE: How to embed a browser object, other than IE<n>, in a Delphi application QUESTION: Using the default TWebBrowser makes things easy to embed a web browser. Unfortunately the one that comes in by default is IE. I'm wondering how does one integrate a Gecko or WebKit one. Are there VCL examples somewhere? If not, h...
[ "delphi", "webkit", "gecko", "browser", "embedded-control" ]
36
21
31,741
5
0
2008-10-02T14:48:16.567000
2008-10-02T14:54:52.307000
162,727
162,774
Read fixed width record from text file
I've got a text file full of records where each field in each record is a fixed width. My first approach would be to parse each record simply using string.Substring(). Is there a better way? For example, the format could be described as: And an example file with two records could look like: SomeData0000000000123456Some...
Substring sounds good to me. The only downside I can immediately think of is that it means copying the data each time, but I wouldn't worry about that until you prove it's a bottleneck. Substring is simple:) You could use a regex to match a whole record at a time and capture the fields, but I think that would be overki...
Read fixed width record from text file I've got a text file full of records where each field in each record is a fixed width. My first approach would be to parse each record simply using string.Substring(). Is there a better way? For example, the format could be described as: And an example file with two records could ...
TITLE: Read fixed width record from text file QUESTION: I've got a text file full of records where each field in each record is a fixed width. My first approach would be to parse each record simply using string.Substring(). Is there a better way? For example, the format could be described as: And an example file with ...
[ "c#", ".net", "parsing", "fixed-width" ]
21
8
33,489
7
0
2008-10-02T14:49:29.357000
2008-10-02T14:55:40.183000
162,730
162,771
Rendered pIxel width data for each character in a browser's font
I have a table column that needs to be limited to a certain width - say 100 pixels. At times the text in that column is wider than this and contains no spaces. For example: a_really_long_string_of_text_like_this_with_no_line_breaks_makes_the_table_unhappy I would like to calculate the width of text server-side and add ...
This would not only be impossible to do server-side, it would also not make sense. You don't what browser your client will be using, and you don't know what font settings on the client side will override whatever styling information you assign to a piece of HTML. You might think that you're using absolute positioning p...
Rendered pIxel width data for each character in a browser's font I have a table column that needs to be limited to a certain width - say 100 pixels. At times the text in that column is wider than this and contains no spaces. For example: a_really_long_string_of_text_like_this_with_no_line_breaks_makes_the_table_unhappy...
TITLE: Rendered pIxel width data for each character in a browser's font QUESTION: I have a table column that needs to be limited to a certain width - say 100 pixels. At times the text in that column is wider than this and contains no spaces. For example: a_really_long_string_of_text_like_this_with_no_line_breaks_makes...
[ "javascript", "jquery", "html", "css", "font-size" ]
6
2
10,127
13
0
2008-10-02T14:49:46.907000
2008-10-02T14:55:24.583000
162,733
163,409
Dojo DnD acceptance of outside objects
Is it possible to code a Dojo DnD target to accept external objects, such as files or folders from a file explorer? Windows Explorer, for example.
I doubt it, because it will be the browser that will receive the DnD event... At best you can count on a plugin or extension to handle it, like the excellent DragDropUpload extension does for file upload fields in Firefox.
Dojo DnD acceptance of outside objects Is it possible to code a Dojo DnD target to accept external objects, such as files or folders from a file explorer? Windows Explorer, for example.
TITLE: Dojo DnD acceptance of outside objects QUESTION: Is it possible to code a Dojo DnD target to accept external objects, such as files or folders from a file explorer? Windows Explorer, for example. ANSWER: I doubt it, because it will be the browser that will receive the DnD event... At best you can count on a pl...
[ "dojo", "drag-and-drop" ]
1
1
915
2
0
2008-10-02T14:50:11.007000
2008-10-02T16:53:23.160000
162,748
162,768
What are your favorite tools to backport modifications from branch to trunk in subversion directories?
On a project I'm working on, we use subversion, with tortoiseSVN as a client, under windows XP. As we enter in production and continue development in parallel, many branches are created. Often, we have to backport modifications made on the branch to the trunk, or to older branches. Backporting is a very delicate task, ...
I am using BeyondCompare. I believe it's one of the most essential tools for a developper, up there with TortoiseSVN.
What are your favorite tools to backport modifications from branch to trunk in subversion directories? On a project I'm working on, we use subversion, with tortoiseSVN as a client, under windows XP. As we enter in production and continue development in parallel, many branches are created. Often, we have to backport mod...
TITLE: What are your favorite tools to backport modifications from branch to trunk in subversion directories? QUESTION: On a project I'm working on, we use subversion, with tortoiseSVN as a client, under windows XP. As we enter in production and continue development in parallel, many branches are created. Often, we ha...
[ "windows", "svn", "tortoisesvn", "backport" ]
0
1
621
2
0
2008-10-02T14:52:03.357000
2008-10-02T14:55:09.357000
162,752
195,931
Algorithm to calculate next set in sequence
I am looking for an algorithm to calculate the next set of operations in a sequence. Here is the simple definition of the sequence. Task 1A will be done every 500 hours Task 2A will be done every 1000 hours Task 3A will be done every 1500 hours So at t=500, do 1A. At t=1000, do both 1A and 2A, at t=1500 do 1A and 3A, b...
Bill the Lizard is right. Here is how to determine the task intervals from the history (in Python): history = [list of tuples like (timestamp, (A, B,...)), ordered by timestamp] lastTaskTime = {} taskIntervals = {} for timestamp, tasks in history: for task in tasks: if task not in lastTaskTime: lastTaskTime[task] = ti...
Algorithm to calculate next set in sequence I am looking for an algorithm to calculate the next set of operations in a sequence. Here is the simple definition of the sequence. Task 1A will be done every 500 hours Task 2A will be done every 1000 hours Task 3A will be done every 1500 hours So at t=500, do 1A. At t=1000, ...
TITLE: Algorithm to calculate next set in sequence QUESTION: I am looking for an algorithm to calculate the next set of operations in a sequence. Here is the simple definition of the sequence. Task 1A will be done every 500 hours Task 2A will be done every 1000 hours Task 3A will be done every 1500 hours So at t=500, ...
[ "algorithm" ]
4
1
813
6
0
2008-10-02T14:52:33.060000
2008-10-12T19:49:33.573000
162,753
165,847
Using Length() with multi-dimensional dynamic arrays in Delphi
I am using a multi-dimensional dynamic array in delphi and am trying to figure this out: I have 2 seperate values for the first index and second index that are totally seperate of each other. As new values come I want to grow the array if that new value is outside of either bound. For new values x, y I check: if Length...
I think you forgot to use the second index on the second dimension; Your code should probably read like this: if Length(List) < (x + 1) then SetLength(List, x + 1); if Length(List[x]) < (y + 1) then SetLength(List[x], y + 1); Note the use of 'x' as the first dimension index when growing the second dimension. One cautio...
Using Length() with multi-dimensional dynamic arrays in Delphi I am using a multi-dimensional dynamic array in delphi and am trying to figure this out: I have 2 seperate values for the first index and second index that are totally seperate of each other. As new values come I want to grow the array if that new value is ...
TITLE: Using Length() with multi-dimensional dynamic arrays in Delphi QUESTION: I am using a multi-dimensional dynamic array in delphi and am trying to figure this out: I have 2 seperate values for the first index and second index that are totally seperate of each other. As new values come I want to grow the array if ...
[ "delphi", "arrays" ]
3
2
24,692
3
0
2008-10-02T14:52:52.640000
2008-10-03T05:57:31.980000
162,762
162,801
Ora 12154 error
I recently deploy one web application in one of my development servers. I'm using oracle, asp.net and c#. When I run the application in the server everything works fine, but when I try to run the application outside of the server (using my pc, for example) i get this error: ORA-12154: TNS:could not resolve the connect ...
Guess: An oracle client is not installed on Server B. If you do have an oracle client installed then you can still put a tnsnames file in any location (Such as a directory on a network share). In order to do this, set a TNS_ADMIN system variable (System Properties->Advanced->Environment Variables on XP) to the director...
Ora 12154 error I recently deploy one web application in one of my development servers. I'm using oracle, asp.net and c#. When I run the application in the server everything works fine, but when I try to run the application outside of the server (using my pc, for example) i get this error: ORA-12154: TNS:could not reso...
TITLE: Ora 12154 error QUESTION: I recently deploy one web application in one of my development servers. I'm using oracle, asp.net and c#. When I run the application in the server everything works fine, but when I try to run the application outside of the server (using my pc, for example) i get this error: ORA-12154: ...
[ "database", "oracle", "ora-12541", "ora-12154" ]
4
0
9,161
10
0
2008-10-02T14:53:38.737000
2008-10-02T14:59:28.193000
162,764
251,742
Sql Server 2005 how to change dbo login name
I have a database with user 'dbo' that has a login name "domain\xzy". How do I change it from "domain\xzy" to "domain\abc".
I figured it out. Within SQL Management Studio you have to right-click on the database -> Properties -> Files -> Owner field. Change this field to the login name/account that you want associated with the "dbo" username for that database. Please keep in mind that the login name/account you choose must already be setup i...
Sql Server 2005 how to change dbo login name I have a database with user 'dbo' that has a login name "domain\xzy". How do I change it from "domain\xzy" to "domain\abc".
TITLE: Sql Server 2005 how to change dbo login name QUESTION: I have a database with user 'dbo' that has a login name "domain\xzy". How do I change it from "domain\xzy" to "domain\abc". ANSWER: I figured it out. Within SQL Management Studio you have to right-click on the database -> Properties -> Files -> Owner field...
[ "sql-server", "sql-server-2005", "security", "active-directory" ]
56
105
70,366
4
0
2008-10-02T14:54:09.967000
2008-10-30T20:55:35.373000
162,778
162,799
Best way to store urls locally
I am creating an RSS reader as a hobby project, and at the point where the user is adding his own URL's. I was thinking of two things. A plaintext file where each url is a single line SQLite where i can have unique ID's and descriptions following the URL Is the SQLite idea to much of an overhead or is there a better wa...
What about as an OPML file? It's XML, so if you needed to store more data then the OPML specification supplies, you can always add your own namespace. Additionally, importing and exporting from other RSS readers is all done via OPML. Often there is library support for it. If you're interested in having users switch the...
Best way to store urls locally I am creating an RSS reader as a hobby project, and at the point where the user is adding his own URL's. I was thinking of two things. A plaintext file where each url is a single line SQLite where i can have unique ID's and descriptions following the URL Is the SQLite idea to much of an o...
TITLE: Best way to store urls locally QUESTION: I am creating an RSS reader as a hobby project, and at the point where the user is adding his own URL's. I was thinking of two things. A plaintext file where each url is a single line SQLite where i can have unique ID's and descriptions following the URL Is the SQLite id...
[ "c#", "sqlite", "plaintext" ]
2
2
1,154
5
0
2008-10-02T14:56:01.710000
2008-10-02T14:59:21.110000
162,798
162,854
Subclassing a class with private members
One of the really nice things about python is the simplicity with which you can name variables that have the same name as the accessor: self.__value = 1 def value(): return self.__value Is there a simple way of providing access to the private members of a class that I wish to subclass? Often I wish to simply work with...
Not conveniently, without further breaking encapsulation. The double-underscore attribute is name-mangled by prepending '_ClassName' for the class it is being accessed in. So, if you have a 'ContainerThing' class that has a '__value' attribute, the attribute is actually being stored as ' _ContainerThing__value '. Chang...
Subclassing a class with private members One of the really nice things about python is the simplicity with which you can name variables that have the same name as the accessor: self.__value = 1 def value(): return self.__value Is there a simple way of providing access to the private members of a class that I wish to s...
TITLE: Subclassing a class with private members QUESTION: One of the really nice things about python is the simplicity with which you can name variables that have the same name as the accessor: self.__value = 1 def value(): return self.__value Is there a simple way of providing access to the private members of a clas...
[ "python", "oop", "encapsulation" ]
2
5
2,322
3
0
2008-10-02T14:59:18.987000
2008-10-02T15:06:26.490000
162,804
162,837
How to retrieve n characters from char array
I have a char array in a C application that I have to split into parts of 250 so that I can send it along to another application that doesn't accept more at one time. How would I do that? Platform: win32.
From the MSDN documentation: The strncpy function copies the initial count characters of strSource to strDest and returns strDest. If count is less than or equal to the length of strSource, a null character is not appended automatically to the copied string. If count is greater than the length of strSource, the destina...
How to retrieve n characters from char array I have a char array in a C application that I have to split into parts of 250 so that I can send it along to another application that doesn't accept more at one time. How would I do that? Platform: win32.
TITLE: How to retrieve n characters from char array QUESTION: I have a char array in a C application that I have to split into parts of 250 so that I can send it along to another application that doesn't accept more at one time. How would I do that? Platform: win32. ANSWER: From the MSDN documentation: The strncpy fu...
[ "c", "arrays", "char" ]
4
4
4,927
4
0
2008-10-02T14:59:44.277000
2008-10-02T15:03:18.573000
162,808
163,163
Django and Python 2.6
I'm just starting to get into Django, and of course as of last night one of the two new Python versions went final (2.6 obviously;)) so I'm wondering if 2.6 plus Django is ready for actual use or do the Django team need more time to finish with tweaks/cleanup? All the google searches I did were inconclusive, I saw bits...
The impression I get is that 2.6 should work fine with Django 1.0. As found here: http://simonwillison.net/2008/Oct/2/whatus/
Django and Python 2.6 I'm just starting to get into Django, and of course as of last night one of the two new Python versions went final (2.6 obviously;)) so I'm wondering if 2.6 plus Django is ready for actual use or do the Django team need more time to finish with tweaks/cleanup? All the google searches I did were in...
TITLE: Django and Python 2.6 QUESTION: I'm just starting to get into Django, and of course as of last night one of the two new Python versions went final (2.6 obviously;)) so I'm wondering if 2.6 plus Django is ready for actual use or do the Django team need more time to finish with tweaks/cleanup? All the google sear...
[ "python", "django" ]
6
7
4,158
3
0
2008-10-02T15:00:00.203000
2008-10-02T15:58:41.310000
162,810
163,362
How do you log the machine name via log4net?
I am using Log4Net with the AdoNetAppender to log messages from a simple systray application into a SQL Server 2005 database. I want to log the machine name along with the log message because this application will be running on multiple machines and I need to know on which one the message originated. But, I cannot find...
You can use the pre-populated property log4net:HostName, for example: This way you don't need to populate the MDC.
How do you log the machine name via log4net? I am using Log4Net with the AdoNetAppender to log messages from a simple systray application into a SQL Server 2005 database. I want to log the machine name along with the log message because this application will be running on multiple machines and I need to know on which o...
TITLE: How do you log the machine name via log4net? QUESTION: I am using Log4Net with the AdoNetAppender to log messages from a simple systray application into a SQL Server 2005 database. I want to log the machine name along with the log message because this application will be running on multiple machines and I need ...
[ "c#", ".net", "logging", "log4net" ]
45
91
20,747
2
0
2008-10-02T15:00:21.420000
2008-10-02T16:40:31.913000
162,819
672,504
Using PostMessage in Windows Mobile to simulate a menu pick
I'm writing a routine to provide user definable keyboard short-cuts for any menu item in my Windows Mobile 5 application, which is in C++/MFC. To do this I am getting all of the available menu command IDs, and using the CWnd::PostMessage(WM_COMMAND,MyMenuID) to post it to the application. I use this technique to good e...
The only reason I can think of is the message is going to the wrong window. Don't forget that not all menu commands are always processed by a particular window. Some menu commands like Cut are usually processed by a view window. Others are processed by frame windows and some possibly by the application object. Hope thi...
Using PostMessage in Windows Mobile to simulate a menu pick I'm writing a routine to provide user definable keyboard short-cuts for any menu item in my Windows Mobile 5 application, which is in C++/MFC. To do this I am getting all of the available menu command IDs, and using the CWnd::PostMessage(WM_COMMAND,MyMenuID) t...
TITLE: Using PostMessage in Windows Mobile to simulate a menu pick QUESTION: I'm writing a routine to provide user definable keyboard short-cuts for any menu item in my Windows Mobile 5 application, which is in C++/MFC. To do this I am getting all of the available menu command IDs, and using the CWnd::PostMessage(WM_C...
[ "windows", "windows-mobile", "mfc", "windows-ce", "postmessage" ]
0
2
971
1
0
2008-10-02T15:01:28.127000
2009-03-23T07:50:26.873000
162,852
162,865
Is there a way to compact a SQL2000/2005 MDF file?
I deleted millions of rows of old data from a production SQL database recently, and it didn't seem to shrink the size of the.MDF file much. We have a finite amount of disk space. I am wondering if there is anything else I can do to "tighten" the file (like something analogous to Access' Compact and Repair function)?
Use the Shrink File option in Sql Server Management Studio Right-click on Database > Tasks > Shrink > Database (or Files)
Is there a way to compact a SQL2000/2005 MDF file? I deleted millions of rows of old data from a production SQL database recently, and it didn't seem to shrink the size of the.MDF file much. We have a finite amount of disk space. I am wondering if there is anything else I can do to "tighten" the file (like something an...
TITLE: Is there a way to compact a SQL2000/2005 MDF file? QUESTION: I deleted millions of rows of old data from a production SQL database recently, and it didn't seem to shrink the size of the.MDF file much. We have a finite amount of disk space. I am wondering if there is anything else I can do to "tighten" the file ...
[ "sql-server" ]
5
7
4,222
4
0
2008-10-02T15:05:58.037000
2008-10-02T15:07:56.330000
162,874
1,058,310
Why do Jars get Excluded from Enunciate's Deployment?
I'm using Enunciate to build a prototype REST api and need to include a jar containing custom code as a library. My Ant Script looks like this: The problem is that my custom jar is being excluded from the WAR file. It is necessary to compile the enunciate annotated classes so the jar is obviously on the classpath at co...
As it turns out one of the jars we're attempting to include has a dependency listed in it's Manifest file of a jar that Enunciate depends on (freemarker). Enunciate automatically excludes freemarker and at first glance it seems as though it automatically excludes anything that depends on freemarker as well. If we remov...
Why do Jars get Excluded from Enunciate's Deployment? I'm using Enunciate to build a prototype REST api and need to include a jar containing custom code as a library. My Ant Script looks like this: The problem is that my custom jar is being excluded from the WAR file. It is necessary to compile the enunciate annotated ...
TITLE: Why do Jars get Excluded from Enunciate's Deployment? QUESTION: I'm using Enunciate to build a prototype REST api and need to include a jar containing custom code as a library. My Ant Script looks like this: The problem is that my custom jar is being excluded from the WAR file. It is necessary to compile the en...
[ "java", "ant", "war", "enunciate" ]
0
1
666
3
0
2008-10-02T15:08:56.173000
2009-06-29T13:28:45.793000
162,879
162,913
Same property, different types
Let's say you have a class with a Uri property. Is there any way to get that property to accept both a string value and a Uri? How would you build it? I'd like to be able to do something like one of the following, but neither are supported (using VB, since it lets you specify type in the Set declaration for the 2nd one...
Alternatively, you can of course forego overloading and just name the properties appropriately: Public WriteOnly Property UriString() As String Set(ByVal value As String) m_Uri = new Uri(value) End Set End Property Of course you don't have to make this WriteOnly but it seems appropriate.
Same property, different types Let's say you have a class with a Uri property. Is there any way to get that property to accept both a string value and a Uri? How would you build it? I'd like to be able to do something like one of the following, but neither are supported (using VB, since it lets you specify type in the ...
TITLE: Same property, different types QUESTION: Let's say you have a class with a Uri property. Is there any way to get that property to accept both a string value and a Uri? How would you build it? I'd like to be able to do something like one of the following, but neither are supported (using VB, since it lets you sp...
[ ".net", ".net-2.0", "properties", "overloading" ]
3
3
1,467
4
0
2008-10-02T15:09:40.057000
2008-10-02T15:14:57.843000
162,886
162,980
Tracking Changes to a Directory Tree over Time
Does anyone know of an application or system out there for tracking changes (files added/removed, diffs on text files) to a non-source controlled directory over time? Something that would let you Take a snapshot of a certain directory tree at time A Come back at time period B and see what has changed Come back at time ...
Write a scripted scheduled task which copies the directory tree to another place, perhaps on a different machine, which is part of a version controlled repostiory. Then, the scheduled task would automatically commit changes, using the version control system of your choice (Mercurial should work nicely for this system, ...
Tracking Changes to a Directory Tree over Time Does anyone know of an application or system out there for tracking changes (files added/removed, diffs on text files) to a non-source controlled directory over time? Something that would let you Take a snapshot of a certain directory tree at time A Come back at time perio...
TITLE: Tracking Changes to a Directory Tree over Time QUESTION: Does anyone know of an application or system out there for tracking changes (files added/removed, diffs on text files) to a non-source controlled directory over time? Something that would let you Take a snapshot of a certain directory tree at time A Come ...
[ "svn", "version-control", "visual-sourcesafe", "perforce", "deployment-project" ]
1
4
868
7
0
2008-10-02T15:10:29.600000
2008-10-02T15:23:18.337000
162,896
162,907
Emacs on Mac OS X Leopard key bindings
I'm a Mac user and I've decided to learn Emacs. I've read that to reduce hand strain and improve accuracy the CTRL and CAPS LOCK keys should be swapped. How do I do this in Leopard? Also, in Terminal I have to use the ESC key to invoke meta. Is there any way to get the alt/option key to invoke meta instead? update: Whi...
Swapping CTRL and CAPS LOCK Go into System Preferences Enter the Keyboard & Mouse preference pane In the Keyboard tab, click Modifier Keys... Swap the actions for Caps Lock and Control. Using ALT/OPTION as META In the menu bar, click Terminal Click Preferences... Under the Settings tab, go to the Keyboard tab Check the...
Emacs on Mac OS X Leopard key bindings I'm a Mac user and I've decided to learn Emacs. I've read that to reduce hand strain and improve accuracy the CTRL and CAPS LOCK keys should be swapped. How do I do this in Leopard? Also, in Terminal I have to use the ESC key to invoke meta. Is there any way to get the alt/option ...
TITLE: Emacs on Mac OS X Leopard key bindings QUESTION: I'm a Mac user and I've decided to learn Emacs. I've read that to reduce hand strain and improve accuracy the CTRL and CAPS LOCK keys should be swapped. How do I do this in Leopard? Also, in Terminal I have to use the ESC key to invoke meta. Is there any way to g...
[ "macos", "emacs", "keyboard-shortcuts", "key-bindings" ]
106
166
75,811
13
0
2008-10-02T15:12:57.597000
2008-10-02T15:14:23.507000
162,897
163,573
Marshal "char *" in C#
Given the following C function in a DLL: char * GetDir(char* path ); How would you P/Invoke this function into C# and marshal the char * properly..NET seems to know how to do LPCTSTR but when I can't figure out any marshaling that doesn't cause a NotSupportedException to fire when calling this function.
OregonGhost's answer is only correct if the char* returned from GetDir is either allocated in HGlobal or LocalAlloc. I can't remember which one but the CLR will assume that any string return type from a PInvoke function was allocated with one or the other. A more robust way is to type the return of GetDir to be IntPtr....
Marshal "char *" in C# Given the following C function in a DLL: char * GetDir(char* path ); How would you P/Invoke this function into C# and marshal the char * properly..NET seems to know how to do LPCTSTR but when I can't figure out any marshaling that doesn't cause a NotSupportedException to fire when calling this fu...
TITLE: Marshal "char *" in C# QUESTION: Given the following C function in a DLL: char * GetDir(char* path ); How would you P/Invoke this function into C# and marshal the char * properly..NET seems to know how to do LPCTSTR but when I can't figure out any marshaling that doesn't cause a NotSupportedException to fire wh...
[ ".net", "pinvoke", "marshalling" ]
25
25
41,561
2
0
2008-10-02T15:12:59.627000
2008-10-02T17:32:45.250000
162,911
1,146,921
How do I call Java code from JavaScript code in Wicket?
If I can do this, how do I call Java code (methods for instance) from within JavaScript code, in Wicket.
erk. The correct answer would be ajax call backs. You can either manually code the js to hook into the wicket js, or you can setup the callbacks from wicket components in java. For example, from AjaxLazyLoadPanel: component.add( new AbstractDefaultAjaxBehavior() { @Override protected void respond(AjaxRequestTarget tar...
How do I call Java code from JavaScript code in Wicket? If I can do this, how do I call Java code (methods for instance) from within JavaScript code, in Wicket.
TITLE: How do I call Java code from JavaScript code in Wicket? QUESTION: If I can do this, how do I call Java code (methods for instance) from within JavaScript code, in Wicket. ANSWER: erk. The correct answer would be ajax call backs. You can either manually code the js to hook into the wicket js, or you can setup t...
[ "java", "javascript", "wicket" ]
15
14
19,815
4
0
2008-10-02T15:14:34.803000
2009-07-18T07:15:04.790000
162,915
163,157
SQL Server 2005 encryption trigger
I have a script that successfully encrypts a credit card. I need it to work as a trigger, so that any insert done to the creditcard column automatically encrypts it. Right now, my trigger works BUT the creditcard column is a varchar. When an app tries to insert, I do this: DECLARE @encryptedCreditCardNumber varbinary(m...
Your simplest approach is going to be to convert the binary to base64 and store that in the varchar column. Base64 is a method for rendering binary data using ascii encoding so that it could be represented in formats such as XML. You can perform the conversion by doing: select cast(N'' as xml).value('xs:base64Binary(xs...
SQL Server 2005 encryption trigger I have a script that successfully encrypts a credit card. I need it to work as a trigger, so that any insert done to the creditcard column automatically encrypts it. Right now, my trigger works BUT the creditcard column is a varchar. When an app tries to insert, I do this: DECLARE @en...
TITLE: SQL Server 2005 encryption trigger QUESTION: I have a script that successfully encrypts a credit card. I need it to work as a trigger, so that any insert done to the creditcard column automatically encrypts it. Right now, my trigger works BUT the creditcard column is a varchar. When an app tries to insert, I do...
[ "sql-server-2005", "encryption", "types" ]
0
1
1,489
1
0
2008-10-02T15:15:17.327000
2008-10-02T15:57:06.587000
162,917
164,686
How do I report an error midway through a chunked http repsonse without closing the connection?
I have an HTTP server that returns large bodies in response to POST requests (it is a SOAP server). These bodies are "streamed" via chunking. If I encounter an error midway through streaming the response how can I report that error to the client and still keep the connection open? The implementation uses a proprietary ...
Once the server has sent the status line (the very first line of the response) to the client, you can't change the status code of the response anymore. Many servers delay sending the response by buffering it internally until the buffer is full. While the buffer is filling up, you can still change your mind about the re...
How do I report an error midway through a chunked http repsonse without closing the connection? I have an HTTP server that returns large bodies in response to POST requests (it is a SOAP server). These bodies are "streamed" via chunking. If I encounter an error midway through streaming the response how can I report tha...
TITLE: How do I report an error midway through a chunked http repsonse without closing the connection? QUESTION: I have an HTTP server that returns large bodies in response to POST requests (it is a SOAP server). These bodies are "streamed" via chunking. If I encounter an error midway through streaming the response ho...
[ "http", "soap" ]
3
2
445
3
0
2008-10-02T15:15:36.220000
2008-10-02T21:27:28.727000
162,919
2,321,899
Spawning multiple SQL tasks in SQL Server 2005
I have a number of stored procs which I would like to all run simultaneously on the server. Ideally all on the server without reliance on connections to an external client. What options are there to launch all these and have them run simultaneously (I don't even need to wait until all the processes are done to do addit...
In the end, I created a C# management console program which launches the processes Async as they are able to be run and keeps track of the connections.
Spawning multiple SQL tasks in SQL Server 2005 I have a number of stored procs which I would like to all run simultaneously on the server. Ideally all on the server without reliance on connections to an external client. What options are there to launch all these and have them run simultaneously (I don't even need to wa...
TITLE: Spawning multiple SQL tasks in SQL Server 2005 QUESTION: I have a number of stored procs which I would like to all run simultaneously on the server. Ideally all on the server without reliance on connections to an external client. What options are there to launch all these and have them run simultaneously (I don...
[ "sql", "sql-server", "sql-server-2005", "automation", "parallel-processing" ]
2
1
1,124
4
0
2008-10-02T15:15:59.667000
2010-02-23T21:33:22.930000
162,931
163,019
Formatting a field using ToText in a Crystal Reports formula field
I'm trying to create a Crystal Reports formula field (to calculate the percentage change in a price) that will return "N/A" if a particular report field is null, but return a number to two decimal places using accounting format (negative numbers surrounded by parentheses) if it is not. The closest I have been able to m...
I think you are looking for ToText(CCur(@Price}/{ValuationReport.YestPrice}*100-100)) You can use CCur to convert numbers or string to Curency formats. CCur(number) or CCur(string) I think this may be what you are looking for, Replace (ToText(CCur({field})),"$", "") that will give the parentheses for negative numbers I...
Formatting a field using ToText in a Crystal Reports formula field I'm trying to create a Crystal Reports formula field (to calculate the percentage change in a price) that will return "N/A" if a particular report field is null, but return a number to two decimal places using accounting format (negative numbers surroun...
TITLE: Formatting a field using ToText in a Crystal Reports formula field QUESTION: I'm trying to create a Crystal Reports formula field (to calculate the percentage change in a price) that will return "N/A" if a particular report field is null, but return a number to two decimal places using accounting format (negati...
[ "crystal-reports" ]
10
11
134,426
2
0
2008-10-02T15:17:49.567000
2008-10-02T15:29:02.163000
162,940
241,959
Would it be possible to use web services from a Cobol program?
We have some COBOL programs in our financial applications which need to interact with some of our backend systems. One of the available interfaces is through a web service. Can a program written in Cobol make requests to a web service?
Microfocus provide a tool called Enterprise Server which allows COBOL to interact with web services. If you have a COBOL program A and another COBOL program B and A calls B via the interface section, the tool allows you to expose B's interface section as a web service. For program A, you then generate a client proxy an...
Would it be possible to use web services from a Cobol program? We have some COBOL programs in our financial applications which need to interact with some of our backend systems. One of the available interfaces is through a web service. Can a program written in Cobol make requests to a web service?
TITLE: Would it be possible to use web services from a Cobol program? QUESTION: We have some COBOL programs in our financial applications which need to interact with some of our backend systems. One of the available interfaces is through a web service. Can a program written in Cobol make requests to a web service? AN...
[ "web-services", "integration", "communication", "cobol" ]
3
3
7,229
6
0
2008-10-02T15:19:16.537000
2008-10-28T01:22:10.517000
162,960
162,970
Is there a source-control system that allows tracking of file name changes?
So, I've been living with my cvs repositories for some time. Though there is a thing I miss - if i rename a file that is already in repository, I need to delete the one with old name from there and add the new one. Hence, I loose all my change-history. And sometimes there's a need to rename a file in alredy existing pr...
Subversion can do this, but you have to do it with svn move Edit: And in this decade, we do git mv, or just use mv and git usually figures it out on its own.
Is there a source-control system that allows tracking of file name changes? So, I've been living with my cvs repositories for some time. Though there is a thing I miss - if i rename a file that is already in repository, I need to delete the one with old name from there and add the new one. Hence, I loose all my change-...
TITLE: Is there a source-control system that allows tracking of file name changes? QUESTION: So, I've been living with my cvs repositories for some time. Though there is a thing I miss - if i rename a file that is already in repository, I need to delete the one with old name from there and add the new one. Hence, I lo...
[ "svn", "version-control", "cvs" ]
6
12
275
5
0
2008-10-02T15:21:09.730000
2008-10-02T15:22:28.667000
162,962
162,987
Why do I get an error after closing my Windows Forms application?
When I run my Visual Studio Windows Forms application by clicking F5 (debug mode), after I click on the close button (which calls Application.Exit() ), after a few seconds I get an error that says: cannot acess a disposed object: Object name 'SampleForm'. A bit of background, I have another thread that runs every x sec...
Mark your thread as BackgroundThread, and it will stop running as soon as you close the window.
Why do I get an error after closing my Windows Forms application? When I run my Visual Studio Windows Forms application by clicking F5 (debug mode), after I click on the close button (which calls Application.Exit() ), after a few seconds I get an error that says: cannot acess a disposed object: Object name 'SampleForm'...
TITLE: Why do I get an error after closing my Windows Forms application? QUESTION: When I run my Visual Studio Windows Forms application by clicking F5 (debug mode), after I click on the close button (which calls Application.Exit() ), after a few seconds I get an error that says: cannot acess a disposed object: Object...
[ "winforms", "multithreading", "debugging" ]
2
4
816
6
0
2008-10-02T15:21:21.337000
2008-10-02T15:24:37.383000
162,969
164,334
SWT Link flickers with gradient background
I'm developing a an eclipse plugin that uses an SWT interface. I need to display text, and within that text there needs to be links. The only two widgets that I've found that will allow me to include clickable links in text are Link and Browser. Browser, however, is overkill for my needs, and I couldn't properly custom...
After spending the day working on this, I came up with a workaround. I created a Composite for the text area. For each word that isn't part of a url,got its own label. For links, each letter got its own label. Then the labels for the url characters got a listener to launch a browser. Using this method provided the Link...
SWT Link flickers with gradient background I'm developing a an eclipse plugin that uses an SWT interface. I need to display text, and within that text there needs to be links. The only two widgets that I've found that will allow me to include clickable links in text are Link and Browser. Browser, however, is overkill f...
TITLE: SWT Link flickers with gradient background QUESTION: I'm developing a an eclipse plugin that uses an SWT interface. I need to display text, and within that text there needs to be links. The only two widgets that I've found that will allow me to include clickable links in text are Link and Browser. Browser, howe...
[ "java", "eclipse", "user-interface", "swt", "widget" ]
1
1
1,314
2
0
2008-10-02T15:22:08.810000
2008-10-02T20:12:14.900000
162,985
175,879
Eclipse RCP Splash Screen
I'm involved in a project that is attempting to use the Eclipse RCP splash screen to gather user credentials, language, etc. If this screen loses focus, it is not available (under Windows at least) through the ALt-Tab functionality, and can only be found by minimizing all other windows and uncovering it. Any way of hav...
I think it might be time to examine those unknown reasons. Even eclipse doesn't use the splash screen in this way. If it needs to prompt for information, it opens a new dialog to ask for it. Good luck. [Edit] I stand corrected. This thread seems to have a solution to this. Good luck, I'm no SWT/RCP guru.
Eclipse RCP Splash Screen I'm involved in a project that is attempting to use the Eclipse RCP splash screen to gather user credentials, language, etc. If this screen loses focus, it is not available (under Windows at least) through the ALt-Tab functionality, and can only be found by minimizing all other windows and unc...
TITLE: Eclipse RCP Splash Screen QUESTION: I'm involved in a project that is attempting to use the Eclipse RCP splash screen to gather user credentials, language, etc. If this screen loses focus, it is not available (under Windows at least) through the ALt-Tab functionality, and can only be found by minimizing all oth...
[ "eclipse-rcp" ]
5
5
2,549
3
0
2008-10-02T15:23:55.967000
2008-10-06T19:46:28.353000
162,986
163,134
Including arrary index in XML Serialization
I have a class that looks like this public class SomeClass { public SomeChildClass[] childArray; } which will output XML from the XMLSerializer like this:...... But I want the XML to look like this:...... Where the index attribute is equal to the items position in the array. I could add an index property to SomeChildCl...
The best approach would be to do what you said and add a property to the "SomeChildClass" like this [XmlAttribute("Index")] public int Order { { get; set; } } Then however you are adding these items to your array, make sure that this property get's set. Then when you serialize....Presto!
Including arrary index in XML Serialization I have a class that looks like this public class SomeClass { public SomeChildClass[] childArray; } which will output XML from the XMLSerializer like this:...... But I want the XML to look like this:...... Where the index attribute is equal to the items position in the array. ...
TITLE: Including arrary index in XML Serialization QUESTION: I have a class that looks like this public class SomeClass { public SomeChildClass[] childArray; } which will output XML from the XMLSerializer like this:...... But I want the XML to look like this:...... Where the index attribute is equal to the items posit...
[ "c#", ".net", "xml-serialization" ]
2
2
1,402
3
0
2008-10-02T15:24:09.600000
2008-10-02T15:51:14.603000
162,989
167,132
Dynamically Load Embedded Resource Report Using Microsoft.Reporting.WinForms
How does one dynamically load a new report from an embedded resource? I have created a reporting project that contains a report as an embedded resource. I added a second report file and use the following code to switch reports: this.reportViewer1.LocalReport.ReportEmbeddedResource = "ReportsApplication2.Report2.rdlc"; ...
The answer: you have to call.Reset(); prior to changing the value of ReportEmbeddedResource or calling LoadReportDefinition. After you do so, you'll also have to call.LocalReport.DataSources.Add(... ); to re-establish the data sources.
Dynamically Load Embedded Resource Report Using Microsoft.Reporting.WinForms How does one dynamically load a new report from an embedded resource? I have created a reporting project that contains a report as an embedded resource. I added a second report file and use the following code to switch reports: this.reportView...
TITLE: Dynamically Load Embedded Resource Report Using Microsoft.Reporting.WinForms QUESTION: How does one dynamically load a new report from an embedded resource? I have created a reporting project that contains a report as an embedded resource. I added a second report file and use the following code to switch report...
[ "c#", "reporting-services", "report" ]
13
9
22,157
2
0
2008-10-02T15:24:41.157000
2008-10-03T14:27:07.517000