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
139,926
140,077
Regular expression to match common SQL syntax?
I was writing some Unit tests last week for a piece of code that generated some SQL statements. I was trying to figure out a regex to match SELECT, INSERT and UPDATE syntax so I could verify that my methods were generating valid SQL, and after 3-4 hours of searching and messing around with various regex editors I gave ...
Regular expressions can match languages only a finite state automaton can parse, which is very limited, whereas SQL is a syntax. It can be demonstrated you can't validate SQL with a regex. So, you can stop trying.
Regular expression to match common SQL syntax? I was writing some Unit tests last week for a piece of code that generated some SQL statements. I was trying to figure out a regex to match SELECT, INSERT and UPDATE syntax so I could verify that my methods were generating valid SQL, and after 3-4 hours of searching and me...
TITLE: Regular expression to match common SQL syntax? QUESTION: I was writing some Unit tests last week for a piece of code that generated some SQL statements. I was trying to figure out a regex to match SELECT, INSERT and UPDATE syntax so I could verify that my methods were generating valid SQL, and after 3-4 hours o...
[ "sql", "regex", "unit-testing" ]
17
40
30,181
13
0
2008-09-26T14:38:08.450000
2008-09-26T15:04:30.507000
139,927
140,076
Is there a buffered version of CComBSTR that makes string concatenation more efficient?
I have several projects where I need to append strings to a BSTR/CComBSTR/_bstr_t object (e.g. building a dynamic SQL statement). Is there an out-of-the-box type in the WinAPI to buffer the concatenation (like StringBuilder in.NET), or do I have to write my own? From what I know about the append methods, they perform r...
Copy the BSTR into a CString, do all the modifications there and then copy it back into the BSTR/CComBSTR. CString's allocations are faster than SysAllocStringLen.
Is there a buffered version of CComBSTR that makes string concatenation more efficient? I have several projects where I need to append strings to a BSTR/CComBSTR/_bstr_t object (e.g. building a dynamic SQL statement). Is there an out-of-the-box type in the WinAPI to buffer the concatenation (like StringBuilder in.NET),...
TITLE: Is there a buffered version of CComBSTR that makes string concatenation more efficient? QUESTION: I have several projects where I need to append strings to a BSTR/CComBSTR/_bstr_t object (e.g. building a dynamic SQL statement). Is there an out-of-the-box type in the WinAPI to buffer the concatenation (like Stri...
[ "string", "winapi", "concatenation" ]
0
2
608
2
0
2008-09-26T14:38:10.323000
2008-09-26T15:04:27.747000
139,954
139,986
Need some ASP.NET MVC Routing Help
I've started with ASP.NET MVC recently, reading blogs, tutorials, trying some routes, etc. Now, i've stumbled on a issue where i need some help. Basically, i have an URL like /products.aspx?categoryid=foo&productid=bar Most tutorials/examples propose to map this to something like: /products/category/foo/bar where "prod...
(your English is just fine, no need to apologize!) You can define a route like this: routes.MapRoute("productsByCategory", "products/{category}/{productid}", new { controller="products", action="findByCategory" }) This will match products/foo/bar and call an action looking like this: public class ProductsController: Co...
Need some ASP.NET MVC Routing Help I've started with ASP.NET MVC recently, reading blogs, tutorials, trying some routes, etc. Now, i've stumbled on a issue where i need some help. Basically, i have an URL like /products.aspx?categoryid=foo&productid=bar Most tutorials/examples propose to map this to something like: /pr...
TITLE: Need some ASP.NET MVC Routing Help QUESTION: I've started with ASP.NET MVC recently, reading blogs, tutorials, trying some routes, etc. Now, i've stumbled on a issue where i need some help. Basically, i have an URL like /products.aspx?categoryid=foo&productid=bar Most tutorials/examples propose to map this to s...
[ "asp.net-mvc" ]
2
5
300
2
0
2008-09-26T14:42:24.057000
2008-09-26T14:47:45.010000
139,964
152,283
MSBuild directory structure limit workarounds
Does anyone have a method to overcome the 260 character limit of the MSBuild tool for building Visual Studio projects and solutions from the command line? I'm trying to get the build automated using CruiseControl (CruiseControl.NET isn't an option, so I'm trying to tie it into normal ant scripts) and I keep on running ...
It seems that it is limitation of the MSBuild. We had the same problem, and in the end, we had to get paths shortened, because did not find any other solution that worked properly.
MSBuild directory structure limit workarounds Does anyone have a method to overcome the 260 character limit of the MSBuild tool for building Visual Studio projects and solutions from the command line? I'm trying to get the build automated using CruiseControl (CruiseControl.NET isn't an option, so I'm trying to tie it i...
TITLE: MSBuild directory structure limit workarounds QUESTION: Does anyone have a method to overcome the 260 character limit of the MSBuild tool for building Visual Studio projects and solutions from the command line? I'm trying to get the build automated using CruiseControl (CruiseControl.NET isn't an option, so I'm ...
[ "visual-studio", "command-line", "msbuild" ]
19
12
12,669
8
0
2008-09-26T14:44:51.443000
2008-09-30T08:51:45.083000
139,971
140,139
SqlParameter Size - negative effects of setting to max size?
I have a SqlCommand that I want to call Prepare() on whose CommandType = Text (it cannot be a stored procedure). In order to do this, I need to set the Size attribute on the parameters to be non-zero otherwise an exception is thrown. Are there any negative effects from setting the Size on all parameters to the maximum ...
I think the only potential negative side effect of doing something like that would be the cost of memory allocation for the parameters. Since you're calling 'Prepare()' I'm guessing you're planning to use the SqlCommand multiple times against the same SqlConnection which suggests a discrete section of code where it's l...
SqlParameter Size - negative effects of setting to max size? I have a SqlCommand that I want to call Prepare() on whose CommandType = Text (it cannot be a stored procedure). In order to do this, I need to set the Size attribute on the parameters to be non-zero otherwise an exception is thrown. Are there any negative ef...
TITLE: SqlParameter Size - negative effects of setting to max size? QUESTION: I have a SqlCommand that I want to call Prepare() on whose CommandType = Text (it cannot be a stored procedure). In order to do this, I need to set the Size attribute on the parameters to be non-zero otherwise an exception is thrown. Are the...
[ "c#", "sql-server", "ado.net" ]
2
3
1,650
4
0
2008-09-26T14:45:39.930000
2008-09-26T15:14:26.723000
139,972
140,360
Committing a Directory to Subversion
Kind of a newbie question, but I am having problems using SNVKit. I am using SVNKit in an application to commit changes to files. I have it successfully adding the files and folders to the working copy, but I am having problems committing it to the respository. The command I am trying to run is 'commit -m "Test Add" /s...
I have it tracked down to a possible bug somewhere. If I don't add a message it works. Time for more digging. Thanks for the pointers.
Committing a Directory to Subversion Kind of a newbie question, but I am having problems using SNVKit. I am using SVNKit in an application to commit changes to files. I have it successfully adding the files and folders to the working copy, but I am having problems committing it to the respository. The command I am tryi...
TITLE: Committing a Directory to Subversion QUESTION: Kind of a newbie question, but I am having problems using SNVKit. I am using SVNKit in an application to commit changes to files. I have it successfully adding the files and folders to the working copy, but I am having problems committing it to the respository. The...
[ "svn", "svnkit" ]
11
0
35,478
9
0
2008-09-26T14:45:44.577000
2008-09-26T15:49:25.953000
139,979
139,999
Do generic interfaces in C# prevent boxing? (.NET vs Mono performance)
I have a C# interface with certain method parameters declared as object types. However, the actual type passed around can differ depending on the class implementing the interface: public interface IMyInterface { void MyMethod(object arg); } public class MyClass1: IMyInterface { public void MyMethod(object arg) { MyObj...
I'm not sure how it is implemented in mono, but generic interfaces will help because the compiler creates a new function of the specific type for each different type used (internally, there are a few cases where it can utilize the same generated function). If a function of the specific type is generated, there is no ne...
Do generic interfaces in C# prevent boxing? (.NET vs Mono performance) I have a C# interface with certain method parameters declared as object types. However, the actual type passed around can differ depending on the class implementing the interface: public interface IMyInterface { void MyMethod(object arg); } public ...
TITLE: Do generic interfaces in C# prevent boxing? (.NET vs Mono performance) QUESTION: I have a C# interface with certain method parameters declared as object types. However, the actual type passed around can differ depending on the class implementing the interface: public interface IMyInterface { void MyMethod(objec...
[ "c#", "performance", "generics", "mono", "boxing" ]
5
8
5,833
6
0
2008-09-26T14:46:40.113000
2008-09-26T14:51:19.557000
139,988
140,180
Advice for someone who wants to start in Business Intelligence?
What advice would you have for someone who wants to start in the BI (Business Intelligence) domain? I where and what I should start with: Books, Blogs, WebCasts... What I should pay attention to and what I should stay away from. Are the Microsoft technologies worth while?
The MS technology stack is quite good and is by far the most accessible (try to get hold of a copy of Cognos Reportnet for self-learning). Where you will run into trouble (and this is the main barrier to entry for gaining a B.I. skillset) is to actually get experience working with real data. It's quite hard to come up ...
Advice for someone who wants to start in Business Intelligence? What advice would you have for someone who wants to start in the BI (Business Intelligence) domain? I where and what I should start with: Books, Blogs, WebCasts... What I should pay attention to and what I should stay away from. Are the Microsoft technolog...
TITLE: Advice for someone who wants to start in Business Intelligence? QUESTION: What advice would you have for someone who wants to start in the BI (Business Intelligence) domain? I where and what I should start with: Books, Blogs, WebCasts... What I should pay attention to and what I should stay away from. Are the M...
[ "business-intelligence" ]
18
12
6,700
8
0
2008-09-26T14:48:48.113000
2008-09-26T15:21:45.227000
139,989
140,563
How do I make my colleagues not despise SVN?
Many of my colleagues use SVN in groups of 1-5 people partly working on the specific project. Half of them are inexperienced students. In fact non of us are real software developers with year-long experience. Most of them use Eclipse and subclipse to read and write their contributions to the SVN repositories. Some of t...
In my experience, one of the main reasons why so many people are "afraid" of, or don't like, version control is because they don't understand the underlying concepts and how the system works. This is, unfortunately, also true for many experienced developers. I know people who have used CVS and Subversion for years, but...
How do I make my colleagues not despise SVN? Many of my colleagues use SVN in groups of 1-5 people partly working on the specific project. Half of them are inexperienced students. In fact non of us are real software developers with year-long experience. Most of them use Eclipse and subclipse to read and write their con...
TITLE: How do I make my colleagues not despise SVN? QUESTION: Many of my colleagues use SVN in groups of 1-5 people partly working on the specific project. Half of them are inexperienced students. In fact non of us are real software developers with year-long experience. Most of them use Eclipse and subclipse to read a...
[ "svn", "version-control" ]
14
18
3,282
21
0
2008-09-26T14:49:14.883000
2008-09-26T16:31:21.610000
139,996
140,039
How to best serialize a java.awt.Image?
I have a Serializable object which is supposed to hold a java.awt.Image as its member. How should I go about serializing it? (Edited from a not so clear first version, sorry.)
ImageIcon implements Serializable and it can be used to wrap an Image class http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/ImageIcon.html
How to best serialize a java.awt.Image? I have a Serializable object which is supposed to hold a java.awt.Image as its member. How should I go about serializing it? (Edited from a not so clear first version, sorry.)
TITLE: How to best serialize a java.awt.Image? QUESTION: I have a Serializable object which is supposed to hold a java.awt.Image as its member. How should I go about serializing it? (Edited from a not so clear first version, sorry.) ANSWER: ImageIcon implements Serializable and it can be used to wrap an Image class h...
[ "java", "image", "serialization" ]
12
13
13,793
3
0
2008-09-26T14:50:45.610000
2008-09-26T14:58:19.540000
140,000
140,363
How do I change the Status labels in Bugzilla
I don't want to change how the Status field works I just want to change the labels to the states that the old system uses. (the old systems consists of spreadsheets and paper:P We are using 3.0 * UNCONFIRMED --> PRELIMARY * NEW --> DESIGN REVIEW * ASSIGNED --> STR1 * RESOLVED --> STR2 * REOPEN * VERIIFED --> BMR * CLOS...
I think this can be done by modifying the templates look here: http://www.bugzilla.org/docs/2.22/html/cust-templates.html specifically: global/variables.none.tmpl
How do I change the Status labels in Bugzilla I don't want to change how the Status field works I just want to change the labels to the states that the old system uses. (the old systems consists of spreadsheets and paper:P We are using 3.0 * UNCONFIRMED --> PRELIMARY * NEW --> DESIGN REVIEW * ASSIGNED --> STR1 * RESOLV...
TITLE: How do I change the Status labels in Bugzilla QUESTION: I don't want to change how the Status field works I just want to change the labels to the states that the old system uses. (the old systems consists of spreadsheets and paper:P We are using 3.0 * UNCONFIRMED --> PRELIMARY * NEW --> DESIGN REVIEW * ASSIGNED...
[ "bugzilla" ]
6
2
4,091
2
0
2008-09-26T14:51:22.757000
2008-09-26T15:49:53.520000
140,002
140,163
VBScript: How to utiliize a dictionary object returned from a function?
I'm trying to return a dictionary from a function. I believe the function is working correctly, but I'm not sure how to utilize the returned dictionary. Here is the relevant part of my function: Function GetSomeStuff() ' ' Get a recordset... ' Dim stuff Set stuff = CreateObject("Scripting.Dictionary") rs.MoveFirst Do ...
I wasn't too sure of what was your problem, so I experimented a bit. It appears that you just missed that to assign a reference to an object, you have to use set, even for a return value: Function GetSomeStuff Dim stuff Set stuff = CreateObject("Scripting.Dictionary") stuff.Add "A", "Anaconda" stuff.Add "B", "Boa" stuf...
VBScript: How to utiliize a dictionary object returned from a function? I'm trying to return a dictionary from a function. I believe the function is working correctly, but I'm not sure how to utilize the returned dictionary. Here is the relevant part of my function: Function GetSomeStuff() ' ' Get a recordset... ' Dim...
TITLE: VBScript: How to utiliize a dictionary object returned from a function? QUESTION: I'm trying to return a dictionary from a function. I believe the function is working correctly, but I'm not sure how to utilize the returned dictionary. Here is the relevant part of my function: Function GetSomeStuff() ' ' Get a r...
[ "vbscript" ]
10
25
31,834
3
0
2008-09-26T14:51:57.417000
2008-09-26T15:18:29.117000
140,012
140,390
Checking ftp return codes from Unix script
I am currently creating an overnight job that calls a Unix script which in turn creates and transfers a file using ftp. I would like to check all possible return codes. The man page for ftp doesn't list return codes. Does anyone know where to find a list? Anyone with experience with this? We have other scripts that gre...
I think it is easier to run the ftp and check the exit code of ftp if something gone wrong. I did this like the example below: #... ftp -i -n $HOST 2>&1 1> $FTPLOG << EOF quote USER $USER quote PASS $PASSWD cd $RFOLDER binary put $FOLDER/$FILE.sql.Z $FILE.sql.Z bye EOF # Check the ftp util exit code (0 is ok, every el...
Checking ftp return codes from Unix script I am currently creating an overnight job that calls a Unix script which in turn creates and transfers a file using ftp. I would like to check all possible return codes. The man page for ftp doesn't list return codes. Does anyone know where to find a list? Anyone with experienc...
TITLE: Checking ftp return codes from Unix script QUESTION: I am currently creating an overnight job that calls a Unix script which in turn creates and transfers a file using ftp. I would like to check all possible return codes. The man page for ftp doesn't list return codes. Does anyone know where to find a list? Any...
[ "unix", "ftp", "scripting", "return" ]
4
3
45,256
9
0
2008-09-26T14:53:58.083000
2008-09-26T15:57:47.010000
140,026
142,306
Writing a Domain Specific Language for selecting rows from a table
I'm writing a server that I expect to be run by many different people, not all of whom I will have direct contact with. The servers will communicate with each other in a cluster. Part of the server's functionality involves selecting a small subset of rows from a potentially very large table. The exact choice of what ro...
Building a DSL to be interpreted by Python. Step 1. Build the run-time classes and objects. These classes will have all the cursor loops and SQL statements and all of that algorithmic processing tucked away in their methods. You'll make heavy use of the Command and Strategy design patterns to build these classes. Most ...
Writing a Domain Specific Language for selecting rows from a table I'm writing a server that I expect to be run by many different people, not all of whom I will have direct contact with. The servers will communicate with each other in a cluster. Part of the server's functionality involves selecting a small subset of ro...
TITLE: Writing a Domain Specific Language for selecting rows from a table QUESTION: I'm writing a server that I expect to be run by many different people, not all of whom I will have direct contact with. The servers will communicate with each other in a cluster. Part of the server's functionality involves selecting a ...
[ "python", "database", "algorithm", "dsl" ]
5
4
2,947
9
0
2008-09-26T14:56:05.303000
2008-09-26T22:14:14.890000
140,030
140,171
Possible causes of Java VM EXCEPTION_ACCESS_VIOLATION?
When a Java VM crashes with an EXCEPTION_ACCESS_VIOLATION and produces an hs_err_pidXXX.log file, what does that indicate? The error itself is basically a null pointer exception. Is it always caused by a bug in the JVM, or are there other causes like malfunctioning hardware or software conflicts? Edit: there is a nativ...
Most of the times this is a bug in the VM. But it can be caused by any native code (e.g. JNI calls). The hs_err_pidXXX.log file should contain some information about where the problem happened. You can also check the "Heap" section inside the file. Many of the VM bugs are caused by the garbage collection (expecially in...
Possible causes of Java VM EXCEPTION_ACCESS_VIOLATION? When a Java VM crashes with an EXCEPTION_ACCESS_VIOLATION and produces an hs_err_pidXXX.log file, what does that indicate? The error itself is basically a null pointer exception. Is it always caused by a bug in the JVM, or are there other causes like malfunctioning...
TITLE: Possible causes of Java VM EXCEPTION_ACCESS_VIOLATION? QUESTION: When a Java VM crashes with an EXCEPTION_ACCESS_VIOLATION and produces an hs_err_pidXXX.log file, what does that indicate? The error itself is basically a null pointer exception. Is it always caused by a bug in the JVM, or are there other causes l...
[ "java", "null", "jvm", "crash", "swt" ]
38
20
105,696
7
0
2008-09-26T14:56:36.940000
2008-09-26T15:19:46.493000
140,033
140,048
boost::shared_ptr standard container
Assume I have a class foo, and wish to use a std::map to store some boost::shared_ptrs, e.g.: class foo; typedef boost::shared_ptr foo_sp; typeded std::map foo_sp_map; foo_sp_map m; If I add a new foo_sp to the map but the key used already exists, will the existing entry be deleted? For example: foo_sp_map m; void f...
First off, your question title says boost::auto_ptr, but you actually mean boost::shared_ptr And yes, the original pointer will be freed (if there are no further shared references to it).
boost::shared_ptr standard container Assume I have a class foo, and wish to use a std::map to store some boost::shared_ptrs, e.g.: class foo; typedef boost::shared_ptr foo_sp; typeded std::map foo_sp_map; foo_sp_map m; If I add a new foo_sp to the map but the key used already exists, will the existing entry be delete...
TITLE: boost::shared_ptr standard container QUESTION: Assume I have a class foo, and wish to use a std::map to store some boost::shared_ptrs, e.g.: class foo; typedef boost::shared_ptr foo_sp; typeded std::map foo_sp_map; foo_sp_map m; If I add a new foo_sp to the map but the key used already exists, will the existi...
[ "c++", "smart-pointers", "std", "stdmap" ]
6
7
7,405
3
0
2008-09-26T14:57:41.977000
2008-09-26T15:00:20.190000
140,043
140,060
Loop through all Resources in ResourceManager - C#
How do I loop into all the resources in the resourcemanager? Ie: foreach (string resource in ResourceManager) //Do something with the recource. Thanks
Use ResourceManager. GetResourceSet () for a list of all resources for a given culture. The returned ResourceSet implements IEnumerable (you can use foreach). To answer Nico's question: you can count the elements of an IEnumerable by casting it to the generic IEnumerable and use the Enumerable.Count () extension method...
Loop through all Resources in ResourceManager - C# How do I loop into all the resources in the resourcemanager? Ie: foreach (string resource in ResourceManager) //Do something with the recource. Thanks
TITLE: Loop through all Resources in ResourceManager - C# QUESTION: How do I loop into all the resources in the resourcemanager? Ie: foreach (string resource in ResourceManager) //Do something with the recource. Thanks ANSWER: Use ResourceManager. GetResourceSet () for a list of all resources for a given culture. The...
[ "c#", "resources" ]
18
30
26,173
2
0
2008-09-26T14:58:37.107000
2008-09-26T15:01:55.320000
140,049
164,548
AVR or PIC to start programming Microcontroller?
Which family should I start to learn? (Never did any programming on microcontroller)
Today AVR and PIC are probably the most common microcontrollers among hobbyists. Both have a very wide range of device variants and both can be used to achieve similar results. For a beginner I would suggest AVR due to various reasons: AVR family (tiny, mega) is coherent and easy to understand. The architecture is powe...
AVR or PIC to start programming Microcontroller? Which family should I start to learn? (Never did any programming on microcontroller)
TITLE: AVR or PIC to start programming Microcontroller? QUESTION: Which family should I start to learn? (Never did any programming on microcontroller) ANSWER: Today AVR and PIC are probably the most common microcontrollers among hobbyists. Both have a very wide range of device variants and both can be used to achieve...
[ "embedded", "microcontroller" ]
37
54
28,504
20
0
2008-09-26T15:00:20.660000
2008-10-02T20:53:00.293000
140,054
140,285
Using InstallUtil and silently setting a windows service logon username/password
I need to use InstallUtil to install a C# windows service. I need to set the service logon credentials (username and password). All of this needs to be done silently. Is there are way to do something like this: installutil.exe myservice.exe /customarg1=username /customarg2=password
Bravo to my co-worker (Bruce Eddy). He found a way we can make this command-line call: installutil.exe /user=uname /password=pw myservice.exe It is done by overriding OnBeforeInstall in the installer class: namespace Test { [RunInstaller(true)] public class TestInstaller: Installer { private ServiceInstaller serviceIns...
Using InstallUtil and silently setting a windows service logon username/password I need to use InstallUtil to install a C# windows service. I need to set the service logon credentials (username and password). All of this needs to be done silently. Is there are way to do something like this: installutil.exe myservice.ex...
TITLE: Using InstallUtil and silently setting a windows service logon username/password QUESTION: I need to use InstallUtil to install a C# windows service. I need to set the service logon credentials (username and password). All of this needs to be done silently. Is there are way to do something like this: installuti...
[ ".net", "windows-services", "installation", "windows-installer" ]
51
54
82,366
5
0
2008-09-26T15:01:19.160000
2008-09-26T15:36:15.783000
140,056
140,119
Java: Advice on handling large data volumes. (Part Deux)
Alright. So I have a very large amount of binary data (let's say, 10GB) distributed over a bunch of files (let's say, 5000) of varying lengths. I am writing a Java application to process this data, and I wish to institute a good design for the data access. Typically what will happen is such: One way or another, all the...
Use Java NIO and MappedByteBuffers, and treat your files as a list of byte arrays. Then, let the OS worry about the details of caching, read, flushing etc.
Java: Advice on handling large data volumes. (Part Deux) Alright. So I have a very large amount of binary data (let's say, 10GB) distributed over a bunch of files (let's say, 5000) of varying lengths. I am writing a Java application to process this data, and I wish to institute a good design for the data access. Typica...
TITLE: Java: Advice on handling large data volumes. (Part Deux) QUESTION: Alright. So I have a very large amount of binary data (let's say, 10GB) distributed over a bunch of files (let's say, 5000) of varying lengths. I am writing a Java application to process this data, and I wish to institute a good design for the d...
[ "java", "performance", "data-access" ]
4
9
3,598
9
0
2008-09-26T15:01:30.047000
2008-09-26T15:10:43.113000
140,061
140,100
When to use dynamic vs. static libraries
When creating a class library in C++, you can choose between dynamic (.dll,.so ) and static (.lib,.a ) libraries. What is the difference between them and when is it appropriate to use which?
Static libraries increase the size of the code in your binary. They're always loaded and whatever version of the code you compiled with is the version of the code that will run. Dynamic libraries are stored and versioned separately. It's possible for a version of the dynamic library to be loaded that wasn't the origina...
When to use dynamic vs. static libraries When creating a class library in C++, you can choose between dynamic (.dll,.so ) and static (.lib,.a ) libraries. What is the difference between them and when is it appropriate to use which?
TITLE: When to use dynamic vs. static libraries QUESTION: When creating a class library in C++, you can choose between dynamic (.dll,.so ) and static (.lib,.a ) libraries. What is the difference between them and when is it appropriate to use which? ANSWER: Static libraries increase the size of the code in your binary...
[ "c++", "dll", "shared-libraries", "static-linking", "dynamic-linking" ]
510
358
305,972
20
0
2008-09-26T15:02:01.607000
2008-09-26T15:08:14.663000
140,090
140,108
Where should a Subversion repository be?
Should it be on the development servers or a Subversion server? I suppose this could be expanded to any client-server version control system.
The physical repository should be on a stable system that gets regular backups. Generally, a development server does not fit this description... it may be acceptable to put the apache server on the dev server and host the files remotely on a stable, backed-up file server (though there are a number of pitfalls with this...
Where should a Subversion repository be? Should it be on the development servers or a Subversion server? I suppose this could be expanded to any client-server version control system.
TITLE: Where should a Subversion repository be? QUESTION: Should it be on the development servers or a Subversion server? I suppose this could be expanded to any client-server version control system. ANSWER: The physical repository should be on a stable system that gets regular backups. Generally, a development serve...
[ "svn", "version-control" ]
11
21
727
8
0
2008-09-26T15:06:55.730000
2008-09-26T15:09:10.967000
140,104
140,154
How can I return a custom HTTP status code from a WCF REST method?
If something goes wrong in a WCF REST call, such as the requested resource is not found, how can I play with the HTTP response code (setting it to something like HTTP 404, for example) in my OperationContract method?
There is a WebOperationContext that you can access and it has a OutgoingResponse property of type OutgoingWebResponseContext which has a StatusCode property that can be set. WebOperationContext ctx = WebOperationContext.Current; ctx.OutgoingResponse.StatusCode = System.Net.HttpStatusCode.OK;
How can I return a custom HTTP status code from a WCF REST method? If something goes wrong in a WCF REST call, such as the requested resource is not found, how can I play with the HTTP response code (setting it to something like HTTP 404, for example) in my OperationContract method?
TITLE: How can I return a custom HTTP status code from a WCF REST method? QUESTION: If something goes wrong in a WCF REST call, such as the requested resource is not found, how can I play with the HTTP response code (setting it to something like HTTP 404, for example) in my OperationContract method? ANSWER: There is ...
[ "c#", ".net", "wcf", "rest" ]
92
121
75,353
7
0
2008-09-26T15:08:27.287000
2008-09-26T15:16:29.730000
140,111
140,394
Sending an arbitrary Signal in Windows?
Linux supports sending an arbitrary Posix-Signal such as SIGINT or SIGTERM to a process using the kill -Command. While SIGINT and SIGTERM are just boring old ways to end a process in a friendly or not-so-friendly kind of way, SIGQUIT is meant to trigger a core dump. This can be used to trigger a running Java VM to prin...
If what you want is to explicitly/programmatically kill another program/process of any kind, within the SysInternals' pstools there is a small tool named "pskill" that behaves just like Unixen "kill" would do. If you want something else, keep reading (though I may be wrong on some of the specifics below - it's been eon...
Sending an arbitrary Signal in Windows? Linux supports sending an arbitrary Posix-Signal such as SIGINT or SIGTERM to a process using the kill -Command. While SIGINT and SIGTERM are just boring old ways to end a process in a friendly or not-so-friendly kind of way, SIGQUIT is meant to trigger a core dump. This can be u...
TITLE: Sending an arbitrary Signal in Windows? QUESTION: Linux supports sending an arbitrary Posix-Signal such as SIGINT or SIGTERM to a process using the kill -Command. While SIGINT and SIGTERM are just boring old ways to end a process in a friendly or not-so-friendly kind of way, SIGQUIT is meant to trigger a core d...
[ "java", "windows", "utilities" ]
39
19
49,190
7
0
2008-09-26T15:09:23.727000
2008-09-26T15:58:44.030000
140,113
140,142
Consume Webservice using https protocol
I want to consume a web service over https from a java client. What steps will i need to take in order to do this?
Really, there shouldn't much different from consuming a web service over HTTP. The big thing is that the process calling the web service will have to trust the server's SSL certificate. If the certificate was purchased from a well-known certificate-issuing authority, this usually isn't a problem. Otherwise, the client ...
Consume Webservice using https protocol I want to consume a web service over https from a java client. What steps will i need to take in order to do this?
TITLE: Consume Webservice using https protocol QUESTION: I want to consume a web service over https from a java client. What steps will i need to take in order to do this? ANSWER: Really, there shouldn't much different from consuming a web service over HTTP. The big thing is that the process calling the web service w...
[ "java", "web-services", "https" ]
1
3
3,081
3
0
2008-09-26T15:09:42.413000
2008-09-26T15:14:45.693000
140,115
140,136
Reading hidden share in C#
So I have a small C# app that needs to periodically check the contents of directories on multiple machines on the network. I thought I could just read \hostname\C$ as a directory path, but with the normal Directory class there doesn't seem to be a way to authenticate against the other servers so you can access the hidd...
From http://bytes.com/forum/thread689145.html: All processes run in the context of a logged-in user account. If you want to open a file on another computer, your application must be running in the context of a user that has permissions to open files on that machine. You can do this with Impersonation. The easiest way s...
Reading hidden share in C# So I have a small C# app that needs to periodically check the contents of directories on multiple machines on the network. I thought I could just read \hostname\C$ as a directory path, but with the normal Directory class there doesn't seem to be a way to authenticate against the other servers...
TITLE: Reading hidden share in C# QUESTION: So I have a small C# app that needs to periodically check the contents of directories on multiple machines on the network. I thought I could just read \hostname\C$ as a directory path, but with the normal Directory class there doesn't seem to be a way to authenticate against...
[ "c#", "impersonation", "fileshare" ]
7
6
3,119
3
0
2008-09-26T15:09:49.623000
2008-09-26T15:13:25.603000
140,117
140,157
Available space left on drive - WinAPI - Windows CE
I've forgotten the WinAPI call to find out how much space is remaining on a particular drive and pinvoke.net isn't giving me any love. It's compact framework by the way, so I figure coredll.dll. Can anyone with a better memory jog mine?
GetDiskFreeSpaceEx. That links to pinvoke.net's desktop page; simply replace kernel32 with coredll. Unfortunately System.IO.DriveInfo is not present on Compact Framework. It doesn't quite fit with Windows CE's Unix-style singly-rooted tree.
Available space left on drive - WinAPI - Windows CE I've forgotten the WinAPI call to find out how much space is remaining on a particular drive and pinvoke.net isn't giving me any love. It's compact framework by the way, so I figure coredll.dll. Can anyone with a better memory jog mine?
TITLE: Available space left on drive - WinAPI - Windows CE QUESTION: I've forgotten the WinAPI call to find out how much space is remaining on a particular drive and pinvoke.net isn't giving me any love. It's compact framework by the way, so I figure coredll.dll. Can anyone with a better memory jog mine? ANSWER: GetD...
[ "winapi", "pinvoke", "windows-ce", "diskspace" ]
2
5
1,974
1
0
2008-09-26T15:10:32.913000
2008-09-26T15:16:41.697000
140,131
140,861
Convert a string representation of a hex dump to a byte array using Java?
I am looking for a way to convert a long string (from a dump), that represents hex values into a byte array. I couldn't have phrased it better than the person that posted the same question here. But to keep it original, I'll phrase it my own way: suppose I have a string "00A0BF" that I would like interpreted as the byt...
Update (2021) - Java 17 now includes java.util.HexFormat (only took 25 years): HexFormat.of().parseHex(s) For older versions of Java: Here's a solution that I think is better than any posted so far: /* s must be an even-length string. */ public static byte[] hexStringToByteArray(String s) { int len = s.length(); byte[]...
Convert a string representation of a hex dump to a byte array using Java? I am looking for a way to convert a long string (from a dump), that represents hex values into a byte array. I couldn't have phrased it better than the person that posted the same question here. But to keep it original, I'll phrase it my own way:...
TITLE: Convert a string representation of a hex dump to a byte array using Java? QUESTION: I am looking for a way to convert a long string (from a dump), that represents hex values into a byte array. I couldn't have phrased it better than the person that posted the same question here. But to keep it original, I'll phr...
[ "java", "byte", "hex", "dump" ]
454
778
625,004
25
0
2008-09-26T15:12:45.573000
2008-09-26T17:38:37.017000
140,149
140,185
Deleting Windows performance counter categories
I have a custom performance counter category. Visual Studio Server Explorer refuses to delete it, claiming it is 'not registered or a system category'. Short of doing it programmatically, how can I delete the category? Is there a registry key I can delete?
As far as I know, there is no way to safely delete them except programatically (they're intended for apps to create and remove during install) but it is trivial to do from a PowerShell command-line console. Just run this command: [Diagnostics.PerformanceCounterCategory]::Delete( "Your Category Name" ) HOWEVER: (EDIT) Y...
Deleting Windows performance counter categories I have a custom performance counter category. Visual Studio Server Explorer refuses to delete it, claiming it is 'not registered or a system category'. Short of doing it programmatically, how can I delete the category? Is there a registry key I can delete?
TITLE: Deleting Windows performance counter categories QUESTION: I have a custom performance counter category. Visual Studio Server Explorer refuses to delete it, claiming it is 'not registered or a system category'. Short of doing it programmatically, how can I delete the category? Is there a registry key I can delet...
[ "windows", "performancecounter" ]
25
41
17,885
4
0
2008-09-26T15:15:26.537000
2008-09-26T15:22:36.267000
140,153
140,192
How to access Subversion from Oracle PL/SQL?
For a governmental agency, we build a release management system developped in PHP and Oracle. The data for this application is stored in database tables and is processed with PL/SQL packages and procedures. The release management process is extensively based on metadata coming from Subversion repositories. We access th...
If your using Oracle's Java JVM, you could try to use SVNKit to communicate with the SVN server nativly from Java, instead of shelling out to the operating system to execute commands.
How to access Subversion from Oracle PL/SQL? For a governmental agency, we build a release management system developped in PHP and Oracle. The data for this application is stored in database tables and is processed with PL/SQL packages and procedures. The release management process is extensively based on metadata comi...
TITLE: How to access Subversion from Oracle PL/SQL? QUESTION: For a governmental agency, we build a release management system developped in PHP and Oracle. The data for this application is stored in database tables and is processed with PL/SQL packages and procedures. The release management process is extensively base...
[ "oracle", "svn", "plsql" ]
9
2
8,925
4
0
2008-09-26T15:16:28.840000
2008-09-26T15:23:36.127000
140,161
140,215
What triggers ConstraintException when loading DataSet?
How can I find out which column and value is violating the constraint? The exception message isn't helpful at all: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
There is a property called RowError you can check. See http://dotnetdebug.net/2006/07/16/constraintexception-a-helpful-tip/ Edited to add this link showing iteration of rows to see which had errors. http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework.adonet/topic58812.aspx
What triggers ConstraintException when loading DataSet? How can I find out which column and value is violating the constraint? The exception message isn't helpful at all: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
TITLE: What triggers ConstraintException when loading DataSet? QUESTION: How can I find out which column and value is violating the constraint? The exception message isn't helpful at all: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. ANSWER: Ther...
[ "c#", ".net", "dataset" ]
36
12
14,986
5
0
2008-09-26T15:18:13.160000
2008-09-26T15:27:01.437000
140,182
140,209
Regular expressions but for writing in the match
When using regular expressions we generally, if not always use them to extract some kind of information. What I need is to replace the match value with some other value... Right now I'm doing this... def getExpandedText(pattern, text, replaceValue): """ One liner... really ugly but it's only used in here. """ return t...
sub (replacement, string[, count = 0]) sub returns the string obtained by replacing the leftmost non-overlapping occurrences of the RE in string by the replacement replacement. If the pattern isn't found, string is returned unchanged. p = re.compile( '(blue|white|red)') >>> p.sub( 'colour', 'blue socks and red shoes') ...
Regular expressions but for writing in the match When using regular expressions we generally, if not always use them to extract some kind of information. What I need is to replace the match value with some other value... Right now I'm doing this... def getExpandedText(pattern, text, replaceValue): """ One liner... real...
TITLE: Regular expressions but for writing in the match QUESTION: When using regular expressions we generally, if not always use them to extract some kind of information. What I need is to replace the match value with some other value... Right now I'm doing this... def getExpandedText(pattern, text, replaceValue): """...
[ "python", "regex" ]
1
7
504
5
0
2008-09-26T15:22:06.160000
2008-09-26T15:26:22.907000
140,205
140,596
Combining split date ranges in a SQL query
I'm working on a query that needs to have some data rows combined based on date ranges. These rows are duplicated in all the data values, except the date ranges are split. For example the table data may look like StudentID StartDate EndDate Field1 Field2 1 9/3/2007 10/20/2007 3 True 1 10/21/2007 6/12/2008 3 True 2 10/1...
The following code should work. I've made a few assumptions as follows: there are no overlaps of date ranges, there are no NULL values in any of the fields, and the start date for a given row is always less than the end date. If your data doesn't fit these criteria, you'll need to adjust this method, but it should poin...
Combining split date ranges in a SQL query I'm working on a query that needs to have some data rows combined based on date ranges. These rows are duplicated in all the data values, except the date ranges are split. For example the table data may look like StudentID StartDate EndDate Field1 Field2 1 9/3/2007 10/20/2007 ...
TITLE: Combining split date ranges in a SQL query QUESTION: I'm working on a query that needs to have some data rows combined based on date ranges. These rows are duplicated in all the data values, except the date ranges are split. For example the table data may look like StudentID StartDate EndDate Field1 Field2 1 9/...
[ "sql", "database", "ms-access", "database-design" ]
4
2
7,693
10
0
2008-09-26T15:25:46.150000
2008-09-26T16:38:16.943000
140,224
1,394,568
Reusable code / class Repositories
I've got several modules containing functions, classes and templates that I keep in a directory called (hah!) 'reuse'. I know the content reasonably well, so to find a particular class or bit of code doesn't take too long, but it is slowly growing in size and I need some sensible method to store them for easy search & ...
This question covers much the same ground & I'll close this question in it's favor.
Reusable code / class Repositories I've got several modules containing functions, classes and templates that I keep in a directory called (hah!) 'reuse'. I know the content reasonably well, so to find a particular class or bit of code doesn't take too long, but it is slowly growing in size and I need some sensible meth...
TITLE: Reusable code / class Repositories QUESTION: I've got several modules containing functions, classes and templates that I keep in a directory called (hah!) 'reuse'. I know the content reasonably well, so to find a particular class or bit of code doesn't take too long, but it is slowly growing in size and I need ...
[ "search", "development-environment", "repository", "code-reuse" ]
2
0
686
8
0
2008-09-26T15:28:31.620000
2009-09-08T15:11:28.777000
140,236
1,833,531
Which issue trackers support sub-tickets, and how well do they work for bridging the gap between project managers and developers?
There's a feature that I'd like to see in issue tracking software that just doesn't seem to be all that common, and that is the ability to divide a ticket (bug, feature request, etc) into sub-tasks and view them in a hierarchical fashion, perhaps with some kind of progress bar style report of progress on a particular t...
You want version 7 of Fogbugz. This support multi-levels of hierachy and shows it in a treeview.
Which issue trackers support sub-tickets, and how well do they work for bridging the gap between project managers and developers? There's a feature that I'd like to see in issue tracking software that just doesn't seem to be all that common, and that is the ability to divide a ticket (bug, feature request, etc) into su...
TITLE: Which issue trackers support sub-tickets, and how well do they work for bridging the gap between project managers and developers? QUESTION: There's a feature that I'd like to see in issue tracking software that just doesn't seem to be all that common, and that is the ability to divide a ticket (bug, feature req...
[ "project-management", "bug-tracking" ]
22
9
5,991
15
0
2008-09-26T15:30:47.467000
2009-12-02T15:14:12.993000
140,239
140,280
Targeting .NET Framework 3.5, Using .NET 2.0 Runtime. Caveats?
I'm developing an application that is targeting the.NET 3.5 Framework. The application's setup installs the.NET 2.0 runtime on the target machine. So far I haven't had any issues with doing this, but I'm wondering what problems I'm going to have down the line. Do I need to be installing the 3.5 runtime? I must package ...
This is a tough question to answer, because ultimately it depends on what.NET 3.5 features you are using. If you are using some of the new libraries, such as LINQ, then yes, you'll need to install the 3.5 runtimes. However, if you are just using some of the new syntatic sugars introduced in 3.5, you may not. The reason...
Targeting .NET Framework 3.5, Using .NET 2.0 Runtime. Caveats? I'm developing an application that is targeting the.NET 3.5 Framework. The application's setup installs the.NET 2.0 runtime on the target machine. So far I haven't had any issues with doing this, but I'm wondering what problems I'm going to have down the li...
TITLE: Targeting .NET Framework 3.5, Using .NET 2.0 Runtime. Caveats? QUESTION: I'm developing an application that is targeting the.NET 3.5 Framework. The application's setup installs the.NET 2.0 runtime on the target machine. So far I haven't had any issues with doing this, but I'm wondering what problems I'm going t...
[ ".net", ".net-3.5" ]
5
2
2,120
5
0
2008-09-26T15:30:54.783000
2008-09-26T15:35:50.713000
140,241
145,414
Will the Javascript performance improvements from Trace Trees find their way into other interpreted languages?
It sounds like Mozilla is having good luck improving JavaScript performance with TraceMonkey. See also Andreas Gal's paper on Trace Trees. Are these improvements available to other interpreters/compilers and if so, does this mean we'll see a cascade of improvements in other interpreted languages?
There's a research JVM by Andreas Gal called HotPath, and some people from his team are currently working on adding nested trace tree based JITting to Maxine (Sun's new research JVM written in Java) and HotSpot. So, at least it is showing up in other VMs for other languages as well. Also, the new PyPy JIT compiler (cur...
Will the Javascript performance improvements from Trace Trees find their way into other interpreted languages? It sounds like Mozilla is having good luck improving JavaScript performance with TraceMonkey. See also Andreas Gal's paper on Trace Trees. Are these improvements available to other interpreters/compilers and i...
TITLE: Will the Javascript performance improvements from Trace Trees find their way into other interpreted languages? QUESTION: It sounds like Mozilla is having good luck improving JavaScript performance with TraceMonkey. See also Andreas Gal's paper on Trace Trees. Are these improvements available to other interprete...
[ "javascript", "performance", "compiler-construction", "interpreter" ]
7
7
532
2
0
2008-09-26T15:30:58.183000
2008-09-28T07:22:37.980000
140,253
140,419
How can I simulate ext3 filesystem corruption?
I would like to simulate filesystem corruption for the purpose of testing how our embedded systems react to it and ultimately have them fail as gracefully as possible. We use different kinds of block device emulated flash storage for data which is modified often and unsuitable for storage in NAND/NOR. Since I have a pr...
If you already know what to modify, dd can read a file containing the bytes you want to write, and you tell it where to write them. To figure out where to write, debugfs from the e2fsprogs package could help you.
How can I simulate ext3 filesystem corruption? I would like to simulate filesystem corruption for the purpose of testing how our embedded systems react to it and ultimately have them fail as gracefully as possible. We use different kinds of block device emulated flash storage for data which is modified often and unsuit...
TITLE: How can I simulate ext3 filesystem corruption? QUESTION: I would like to simulate filesystem corruption for the purpose of testing how our embedded systems react to it and ultimately have them fail as gracefully as possible. We use different kinds of block device emulated flash storage for data which is modifie...
[ "linux", "testing", "filesystems", "fault-tolerance", "ext3" ]
17
2
4,117
2
0
2008-09-26T15:32:48.303000
2008-09-26T16:05:13.077000
140,255
140,725
Is there a way to return different types from a WCF REST method?
I am trying to write a web service to spec and it requires a different response body depending on whether the method completes successfully or not. I have tried creating two different DataContract classes, but how can I return them and have them serialized correctly?
The answer is yes but it is tricky and you lose strong typing on your interface. If you return a Stream then the data could be xml, text, or even a binary image. For DataContract classes, you'd then serialize the data using the DataContractSerializer. See the BlogSvc and more specifically the RestAtomPubService.cs WCF ...
Is there a way to return different types from a WCF REST method? I am trying to write a web service to spec and it requires a different response body depending on whether the method completes successfully or not. I have tried creating two different DataContract classes, but how can I return them and have them serialize...
TITLE: Is there a way to return different types from a WCF REST method? QUESTION: I am trying to write a web service to spec and it requires a different response body depending on whether the method completes successfully or not. I have tried creating two different DataContract classes, but how can I return them and h...
[ "c#", ".net", "wcf", "rest" ]
6
1
2,838
3
0
2008-09-26T15:32:58.317000
2008-09-26T17:12:34.303000
140,287
140,301
Catching 'external drive inserted' event in a windows service
I'm trying to write a super-simple podcast-to-device downloading service to use for running. I imagine that it'll like this: Whenever a particular device is plugged in (via USB), it: Deletes everything from the device Checks for all the latest entries in a number of RSS Podcast feeds Downloads those to the device Notif...
The simplest solution would be to periodically enumerate the devices! CodeProject has a comprehensive C# article for this here: http://www.codeproject.com/KB/system/DriveDetector.aspx
Catching 'external drive inserted' event in a windows service I'm trying to write a super-simple podcast-to-device downloading service to use for running. I imagine that it'll like this: Whenever a particular device is plugged in (via USB), it: Deletes everything from the device Checks for all the latest entries in a n...
TITLE: Catching 'external drive inserted' event in a windows service QUESTION: I'm trying to write a super-simple podcast-to-device downloading service to use for running. I imagine that it'll like this: Whenever a particular device is plugged in (via USB), it: Deletes everything from the device Checks for all the lat...
[ "c#", ".net", "windows", "windows-services", "podcast" ]
3
2
926
1
0
2008-09-26T15:36:33.100000
2008-09-26T15:38:51.393000
140,295
142,802
Using locale.setlocale in embedded Python without breaking file parsing in C thread
We're using a third-party middleware product that allows us to write code in an embedded Python interpreter, and which exposes an API that we can call into. Some of these API calls allow us to load various kinds of file, and the loading code is implemented in C. File loading happens in a separate thread, and calls back...
Setting the locale after multiple threads have started operating may have unexpected results. Unless I could figure out a more subtle approach, I'd probably just split file loading and the user interface into separate processes, communicating through a pipe or a file socket.
Using locale.setlocale in embedded Python without breaking file parsing in C thread We're using a third-party middleware product that allows us to write code in an embedded Python interpreter, and which exposes an API that we can call into. Some of these API calls allow us to load various kinds of file, and the loading...
TITLE: Using locale.setlocale in embedded Python without breaking file parsing in C thread QUESTION: We're using a third-party middleware product that allows us to write code in an embedded Python interpreter, and which exposes an API that we can call into. Some of these API calls allow us to load various kinds of fil...
[ "python", "internationalization", "locale" ]
3
1
1,663
1
0
2008-09-26T15:38:00.273000
2008-09-27T02:42:40.407000
140,303
140,517
ASP.NET: Unable to validate data
What is the cause of this exception in ASP.NET? Obviously it is a viewstate exception, but I can't reproduce the error on the page that is throwing the exception (a simple two TextBox form with a button and navigation links). FWIW, I'm not running a web farm. Exception Error Message: Unable to validate data. Error Sour...
The most likely cause of this error is when a postback is stopped before all the viewstate loads (the user hits the stop or back buttons), the viewstate will fail to validate and throw the error. Other potential causes: An application pool recycling between the time the viewstate was generated and the time that the use...
ASP.NET: Unable to validate data What is the cause of this exception in ASP.NET? Obviously it is a viewstate exception, but I can't reproduce the error on the page that is throwing the exception (a simple two TextBox form with a button and navigation links). FWIW, I'm not running a web farm. Exception Error Message: Un...
TITLE: ASP.NET: Unable to validate data QUESTION: What is the cause of this exception in ASP.NET? Obviously it is a viewstate exception, but I can't reproduce the error on the page that is throwing the exception (a simple two TextBox form with a button and navigation links). FWIW, I'm not running a web farm. Exception...
[ "asp.net", "validation", "exception", "viewstate" ]
10
18
37,025
8
0
2008-09-26T15:39:30.893000
2008-09-26T16:21:46.500000
140,329
140,801
How can I redirect to a page when the user session expires?
I am currently working on an web application that uses ASP.NET 2.0 framework. I need to redirect to a certain page, say SessionExpired.aspx, when the user session expires. There are lot of pages in the project, so adding code to every page of the site is not really a good solution. I have MasterPages though, which I th...
You can handle this in global.asax in the Session_Start event. You can check for a session cookie in the request there. If the session cookie exists, the session has expired: public void Session_OnStart() { if (HttpContext.Current.Request.Cookies.Contains("ASP.NET_SessionId")!= null) { HttpContext.Current.Response.Redi...
How can I redirect to a page when the user session expires? I am currently working on an web application that uses ASP.NET 2.0 framework. I need to redirect to a certain page, say SessionExpired.aspx, when the user session expires. There are lot of pages in the project, so adding code to every page of the site is not r...
TITLE: How can I redirect to a page when the user session expires? QUESTION: I am currently working on an web application that uses ASP.NET 2.0 framework. I need to redirect to a certain page, say SessionExpired.aspx, when the user session expires. There are lot of pages in the project, so adding code to every page of...
[ "c#", "asp.net" ]
12
5
8,339
11
0
2008-09-26T15:44:19.540000
2008-09-26T17:27:22.240000
140,347
140,373
Win32/MFC Get window rect from client rect
I know there is a function somewhere that will accept a client rect and it will convert it into a window rect for you. I just can't find / remember it! Does anyone know what it is? It will do something similar to: const CRect client(0, 0, 200, 200); const CRect window = ClientRectToWindowRect(client); SetWindowPos(...)
You're probably thinking of AdjustWindowRectEx(). Keep in mind, this is intended for use when creating a window - there's no guarantee that it will produce an accurate set of window dimensions for an existing window; for that, use GetWindowRect().
Win32/MFC Get window rect from client rect I know there is a function somewhere that will accept a client rect and it will convert it into a window rect for you. I just can't find / remember it! Does anyone know what it is? It will do something similar to: const CRect client(0, 0, 200, 200); const CRect window = Client...
TITLE: Win32/MFC Get window rect from client rect QUESTION: I know there is a function somewhere that will accept a client rect and it will convert it into a window rect for you. I just can't find / remember it! Does anyone know what it is? It will do something similar to: const CRect client(0, 0, 200, 200); const CRe...
[ "c++", "windows", "winapi", "mfc" ]
2
5
12,598
5
0
2008-09-26T15:47:16.303000
2008-09-26T15:51:39.240000
140,355
140,393
What are the advantages and disadvantages of using XML schemas?
We are utilizing the XML data type in Microsoft SQL Server 2005 for a project. Some members of the team and I feel that we should also use XSDs while members of the other camp feel that we should keep the XMLs ad hoc and not treat them as "types". The XMLs are an effort to bring structure and centrality to a number of ...
Unfortunately even the authoring body of XSD (W3C) understands that XSD is a pretty bad technology. That said, it's intention isn't necessarily bad. One of C#'s major benefits is that it is statically typed. Statically typing your XML documents gives them the same benefits. What's probably best here is reverse engineer...
What are the advantages and disadvantages of using XML schemas? We are utilizing the XML data type in Microsoft SQL Server 2005 for a project. Some members of the team and I feel that we should also use XSDs while members of the other camp feel that we should keep the XMLs ad hoc and not treat them as "types". The XMLs...
TITLE: What are the advantages and disadvantages of using XML schemas? QUESTION: We are utilizing the XML data type in Microsoft SQL Server 2005 for a project. Some members of the team and I feel that we should also use XSDs while members of the other camp feel that we should keep the XMLs ad hoc and not treat them as...
[ "xml", "xsd" ]
5
2
15,787
7
0
2008-09-26T15:48:46.860000
2008-09-26T15:58:42.173000
140,406
140,436
How can I programmatically determine how to fit smaller boxes into a larger package?
Does anyone know of existing software or algorithms to calculate a package size for shipping multiple items? I have a bunch of items in our inventory database with length, width and height dimesions defined. Given these dimensions I need to calculate how many of the purchased items will fit into predefined box sizes.
This is a Bin Packing problem, and it's NP-hard. For small number of objects and packages, you might be able to simply use the brute force method of trying every possibility. Beyond that, you'll need to use a heuristic of some sort. The Wikipedia article has some details, along with references to papers you probably wa...
How can I programmatically determine how to fit smaller boxes into a larger package? Does anyone know of existing software or algorithms to calculate a package size for shipping multiple items? I have a bunch of items in our inventory database with length, width and height dimesions defined. Given these dimensions I ne...
TITLE: How can I programmatically determine how to fit smaller boxes into a larger package? QUESTION: Does anyone know of existing software or algorithms to calculate a package size for shipping multiple items? I have a bunch of items in our inventory database with length, width and height dimesions defined. Given the...
[ "algorithm", "bin-packing" ]
51
65
67,818
8
0
2008-09-26T16:03:10.913000
2008-09-26T16:07:35.270000
140,409
140,486
Why avoid pessimistic locking in a version control system?
Based on a few posts I've read concerning version control, it seems people think pessimistic locking in a version control system is a bad thing. Why? I understand that it prevents one developer from submitting a change while another has the file checked out, but so what? If your code files are so big that you constantl...
It depends on your project and team generally. Pessimistic locking is good because it is easy to understand - one dev at a time, and no merging required! However, the bad thing about is is exactly that - one dev at a time. I have the situation right now where a colleague has gone on-site, and before he left, he checked...
Why avoid pessimistic locking in a version control system? Based on a few posts I've read concerning version control, it seems people think pessimistic locking in a version control system is a bad thing. Why? I understand that it prevents one developer from submitting a change while another has the file checked out, bu...
TITLE: Why avoid pessimistic locking in a version control system? QUESTION: Based on a few posts I've read concerning version control, it seems people think pessimistic locking in a version control system is a bad thing. Why? I understand that it prevents one developer from submitting a change while another has the fi...
[ "version-control", "locking" ]
14
7
3,455
10
0
2008-09-26T16:04:03.110000
2008-09-26T16:17:18.803000
140,422
140,607
How do I translate 8bit characters into 7bit characters? (i.e. Ü to U)
I'm looking for pseudocode, or sample code, to convert higher bit ascii characters (like, Ü which is extended ascii 154) into U (which is ascii 85). My initial guess is that since there are only about 25 ascii characters that are similar to 7bit ascii characters, a translation array would have to be used. Let me know i...
Indeed as proposed by unexist: "iconv" function exists to handle all weird conversion for you, is available in almost all programming language and has a special option which tries to convert characters missing in the target set with approximations. Use iconv to simply convert your input UTF-8 string to 7bit ASCII. Othe...
How do I translate 8bit characters into 7bit characters? (i.e. Ü to U) I'm looking for pseudocode, or sample code, to convert higher bit ascii characters (like, Ü which is extended ascii 154) into U (which is ascii 85). My initial guess is that since there are only about 25 ascii characters that are similar to 7bit asc...
TITLE: How do I translate 8bit characters into 7bit characters? (i.e. Ü to U) QUESTION: I'm looking for pseudocode, or sample code, to convert higher bit ascii characters (like, Ü which is extended ascii 154) into U (which is ascii 85). My initial guess is that since there are only about 25 ascii characters that are s...
[ "ascii" ]
26
5
21,096
15
0
2008-09-26T16:05:27.647000
2008-09-26T16:41:24.707000
140,439
140,495
Authenticating against active directory using python + ldap
How do I authenticate against AD using Python + LDAP. I'm currently using the python-ldap library and all it is producing is tears. I can't even bind to perform a simple query: import sys import ldap Server = "ldap://my-ldap-server" DN, Secret, un = sys.argv[1:4] Base = "dc=mydomain,dc=co,dc=uk" Scope = ldap.SCOPE_SU...
I was missing l.set_option(ldap.OPT_REFERRALS, 0) From the init.
Authenticating against active directory using python + ldap How do I authenticate against AD using Python + LDAP. I'm currently using the python-ldap library and all it is producing is tears. I can't even bind to perform a simple query: import sys import ldap Server = "ldap://my-ldap-server" DN, Secret, un = sys.argv[...
TITLE: Authenticating against active directory using python + ldap QUESTION: How do I authenticate against AD using Python + LDAP. I'm currently using the python-ldap library and all it is producing is tears. I can't even bind to perform a simple query: import sys import ldap Server = "ldap://my-ldap-server" DN, Secr...
[ "python", "authentication", "active-directory", "ldap" ]
100
52
115,625
12
0
2008-09-26T16:08:11.230000
2008-09-26T16:18:18.320000
140,453
140,466
Continuous Integration Servers
My company is considering changing continuous integration servers (I won't say which one we have now, so I won't skew your responses in anyway:) ) I wondering if anybody has any recommendations? Best user experience, level of difficulty to maintain, etc... Our code is all in java, and we use ANT as a build tool.
I recently implemented a Hudson server. Having previously used Cruise Control, I am very satisfied with Hudson and very impressed with its ease of setup and use. Adding new projects is infinitely easier than it was with Cruise Control.
Continuous Integration Servers My company is considering changing continuous integration servers (I won't say which one we have now, so I won't skew your responses in anyway:) ) I wondering if anybody has any recommendations? Best user experience, level of difficulty to maintain, etc... Our code is all in java, and we ...
TITLE: Continuous Integration Servers QUESTION: My company is considering changing continuous integration servers (I won't say which one we have now, so I won't skew your responses in anyway:) ) I wondering if anybody has any recommendations? Best user experience, level of difficulty to maintain, etc... Our code is al...
[ "java", "continuous-integration" ]
78
89
21,145
30
0
2008-09-26T16:11:06.417000
2008-09-26T16:13:45.443000
140,468
140,749
What is the maximum possible length of a .NET string?
What is the longest string that can be created in.NET? The docs for the String class are silent on this question as far as I can see, so an authoritative answer might require some knowledge of internals. Would the maximum change on a 64-bit system? [This is asked more for curiosity than for practical use - I don't inte...
The theoretical limit may be 2,147,483,647, but the practical limit is nowhere near that. Since no single object in a.NET program may be over 2GB and the string type uses UTF-16 (2 bytes for each character), the best you could do is 1,073,741,823, but you're not likely to ever be able to allocate that on a 32-bit machi...
What is the maximum possible length of a .NET string? What is the longest string that can be created in.NET? The docs for the String class are silent on this question as far as I can see, so an authoritative answer might require some knowledge of internals. Would the maximum change on a 64-bit system? [This is asked mo...
TITLE: What is the maximum possible length of a .NET string? QUESTION: What is the longest string that can be created in.NET? The docs for the String class are silent on this question as far as I can see, so an authoritative answer might require some knowledge of internals. Would the maximum change on a 64-bit system?...
[ ".net", "string", "limits" ]
278
401
424,340
8
0
2008-09-26T16:14:34.897000
2008-09-26T17:18:23.433000
140,490
140,505
Base constructor in C# - Which gets called first?
Which gets called first - the base constructor or "other stuff here"? public class MyExceptionClass: Exception { public MyExceptionClass(string message, string extrainfo): base(message) { //other stuff here } }
The base constructor will be called first. try it: public class MyBase { public MyBase() { Console.WriteLine("MyBase"); } } public class MyDerived: MyBase { public MyDerived():base() { Console.WriteLine("MyDerived"); } }
Base constructor in C# - Which gets called first? Which gets called first - the base constructor or "other stuff here"? public class MyExceptionClass: Exception { public MyExceptionClass(string message, string extrainfo): base(message) { //other stuff here } }
TITLE: Base constructor in C# - Which gets called first? QUESTION: Which gets called first - the base constructor or "other stuff here"? public class MyExceptionClass: Exception { public MyExceptionClass(string message, string extrainfo): base(message) { //other stuff here } } ANSWER: The base constructor will be cal...
[ "c#", ".net", "asp.net" ]
144
123
81,933
13
0
2008-09-26T16:17:42.360000
2008-09-26T16:20:13.400000
140,522
140,534
What options do you recommend for language translation on content driven Web sites?
Please read the whole question. I'm not looking for an approach to managing multi-lingual content, but I'm looking for a way to actually get that multi-lingual content. This usually falls within technical recommendations on most projects I work on, and I hope someone can offer some help. We are working with a client no...
I have yet to see a dynamic translation service that would be suitable for the content of a professional website. Language translation is not (yet) a mechanical activity - it requires thought and analysis. Your clients would best be served by outsourcing translation (or hiring a translator).
What options do you recommend for language translation on content driven Web sites? Please read the whole question. I'm not looking for an approach to managing multi-lingual content, but I'm looking for a way to actually get that multi-lingual content. This usually falls within technical recommendations on most project...
TITLE: What options do you recommend for language translation on content driven Web sites? QUESTION: Please read the whole question. I'm not looking for an approach to managing multi-lingual content, but I'm looking for a way to actually get that multi-lingual content. This usually falls within technical recommendatio...
[ "translation", "multilingual" ]
2
6
236
2
0
2008-09-26T16:22:32.910000
2008-09-26T16:25:25.617000
140,537
140,555
How to use Java reflection when the enum type is a Class?
I was using an enum in which the constant was a Class. I needed to invoke a method on the constant but could not introduce a compile time dependency and the enum was not always available at runtime (part of optional install). Therefore, I wanted to use reflection. This is easy, but I hadn't used reflection with enums b...
import java.lang.reflect.Method; class EnumReflection { public static void main(String[] args) throws Exception { Class clz = Class.forName("test.PropertyEnum"); /* Use method added in Java 1.5. */ Object[] consts = clz.getEnumConstants(); /* Enum constants are in order of declaration. */ Class sub = consts[0].getCla...
How to use Java reflection when the enum type is a Class? I was using an enum in which the constant was a Class. I needed to invoke a method on the constant but could not introduce a compile time dependency and the enum was not always available at runtime (part of optional install). Therefore, I wanted to use reflectio...
TITLE: How to use Java reflection when the enum type is a Class? QUESTION: I was using an enum in which the constant was a Class. I needed to invoke a method on the constant but could not introduce a compile time dependency and the enum was not always available at runtime (part of optional install). Therefore, I wante...
[ "java", "reflection", "enums" ]
21
42
36,294
1
0
2008-09-26T16:26:46.490000
2008-09-26T16:29:32.973000
140,549
140,586
What character set should I assume the encoded characters in a URL to be in?
RFC 1738 specifies the syntax for URL's, and mentions that URLs are written only with the graphic printable characters of the US-ASCII coded character set. The octets 80-FF hexadecimal are not used in US-ASCII, and the octets 00-1F and 7F hexadecimal represent control characters; these must be encoded. It does not, how...
As per your quote, URLs are ASCII. That's all. URIs OTOH, allow for bigger charsets; usually UTF-8 as you said yourself. The point to remember is that URLs are a subset of URIs. Therefore, the real question is, which of these is what you write in a browser? I'd guess you can write an URI, and the browser should try its...
What character set should I assume the encoded characters in a URL to be in? RFC 1738 specifies the syntax for URL's, and mentions that URLs are written only with the graphic printable characters of the US-ASCII coded character set. The octets 80-FF hexadecimal are not used in US-ASCII, and the octets 00-1F and 7F hexa...
TITLE: What character set should I assume the encoded characters in a URL to be in? QUESTION: RFC 1738 specifies the syntax for URL's, and mentions that URLs are written only with the graphic printable characters of the US-ASCII coded character set. The octets 80-FF hexadecimal are not used in US-ASCII, and the octets...
[ "url" ]
27
12
10,429
2
0
2008-09-26T16:28:20.337000
2008-09-26T16:36:49.960000
140,550
140,558
What is the best way to store a large amount of text in a SQL server table?
What is the best way to store a large amount of text in a table in SQL server? Is varchar(max) reliable?
In SQL 2005 and higher, VARCHAR(MAX) is indeed the preferred method. The TEXT type is still available, but primarily for backward compatibility with SQL 2000 and lower.
What is the best way to store a large amount of text in a SQL server table? What is the best way to store a large amount of text in a table in SQL server? Is varchar(max) reliable?
TITLE: What is the best way to store a large amount of text in a SQL server table? QUESTION: What is the best way to store a large amount of text in a table in SQL server? Is varchar(max) reliable? ANSWER: In SQL 2005 and higher, VARCHAR(MAX) is indeed the preferred method. The TEXT type is still available, but prima...
[ "sql-server" ]
54
79
130,040
8
0
2008-09-26T16:28:22.070000
2008-09-26T16:30:43.390000
140,574
140,595
Buying a machine for continuous integration - key factors?
I'm planning to propose to my (very small) company that we buy a computer to run continous integration on. If they say yes, the task of actually buying the machine will probably fall on me, so my question is: What do I look for in a computer that will be used for continuous integration for a very small (3 people) php t...
You're not really going to need that powerful of a machine. If you are running tests or other metrics, processing ability is probably your primary concern but really you could run that on an old pentium 1 and it would probably work. Your constraints are going to be your operating environment. If you are running LAMP yo...
Buying a machine for continuous integration - key factors? I'm planning to propose to my (very small) company that we buy a computer to run continous integration on. If they say yes, the task of actually buying the machine will probably fall on me, so my question is: What do I look for in a computer that will be used f...
TITLE: Buying a machine for continuous integration - key factors? QUESTION: I'm planning to propose to my (very small) company that we buy a computer to run continous integration on. If they say yes, the task of actually buying the machine will probably fall on me, so my question is: What do I look for in a computer t...
[ "language-agnostic", "continuous-integration", "automated-tests" ]
7
6
522
8
0
2008-09-26T16:33:36.427000
2008-09-26T16:38:10.907000
140,575
140,888
Enterprise App and the Enterprise App Client
I came aboard a new project with a new company and we are trying to use JPA to do some DB work. So we have an Ear with an EJB, a webservice, and then there is a app client in the ear that really does all the work. The Webservice, calls the EJB, and the EJB calls the client to do the DB work. So within the appclient I w...
This is a misuse of an app client. All your db processing should occur in the EJB. There doesn't seem to be any apparent reason for the app clients' existence. This link is to an old article, but gives examples as to what an app client is used for (Applications not backend services). Application Client
Enterprise App and the Enterprise App Client I came aboard a new project with a new company and we are trying to use JPA to do some DB work. So we have an Ear with an EJB, a webservice, and then there is a app client in the ear that really does all the work. The Webservice, calls the EJB, and the EJB calls the client t...
TITLE: Enterprise App and the Enterprise App Client QUESTION: I came aboard a new project with a new company and we are trying to use JPA to do some DB work. So we have an Ear with an EJB, a webservice, and then there is a app client in the ear that really does all the work. The Webservice, calls the EJB, and the EJB ...
[ "java", "jpa", "ejb" ]
0
0
407
1
0
2008-09-26T16:33:41.167000
2008-09-26T17:43:24.057000
140,608
140,635
What tools are available to measure the "health" of an enterprise web-based system?
I assist in maintaining an enterprise web-based system (programmed in J2EE, but this is a more general question) and I'd like to know: what good tools are out there to measure the "health" of an enterprise system? For instance, tools to check memory space on servers, check the status of batch runs, the number of record...
OpenNMS is a nice monitoring tool. Out of the box it can monitor various aspects of a server, mostly things like memory, network usage, disk space. But it's open source, and can be extended to monitor other things. We use it to monitor thousands of services. It's very good at what it does. It may not be a good fit for ...
What tools are available to measure the "health" of an enterprise web-based system? I assist in maintaining an enterprise web-based system (programmed in J2EE, but this is a more general question) and I'd like to know: what good tools are out there to measure the "health" of an enterprise system? For instance, tools to...
TITLE: What tools are available to measure the "health" of an enterprise web-based system? QUESTION: I assist in maintaining an enterprise web-based system (programmed in J2EE, but this is a more general question) and I'd like to know: what good tools are out there to measure the "health" of an enterprise system? For ...
[ "jakarta-ee", "monitoring", "enterprise" ]
2
4
515
3
0
2008-09-26T16:41:25.347000
2008-09-26T16:46:34.257000
140,613
140,626
How to address OpenID providers downtime?
OpenID is all good... UNTIL the provider goes down. At that point you're potentially locked out of EVERYTHING (since you jumped on the bandwagon and applied OpenID everywhere you could). This question came up because I can't, for the life of me, login with my myopenid.com provider.:-(
The fix is for your OpenID site to accept multiple OpenIDs per user account. Something that the spec recommends.
How to address OpenID providers downtime? OpenID is all good... UNTIL the provider goes down. At that point you're potentially locked out of EVERYTHING (since you jumped on the bandwagon and applied OpenID everywhere you could). This question came up because I can't, for the life of me, login with my myopenid.com provi...
TITLE: How to address OpenID providers downtime? QUESTION: OpenID is all good... UNTIL the provider goes down. At that point you're potentially locked out of EVERYTHING (since you jumped on the bandwagon and applied OpenID everywhere you could). This question came up because I can't, for the life of me, login with my ...
[ "openid" ]
10
20
550
3
0
2008-09-26T16:42:48.290000
2008-09-26T16:44:42.843000
140,614
140,639
How can I use post-commit hooks to copy committed files to a web directory from SVN?
My Ubuntu server has Apache and Subversion installed. I use this server as a staging server, purely for testing purposes. I use Apache to host the web application, and Subversion to keep versioned copies of the source code. My current workflow: Make changes to a file Commit the file to the Subversion repository Upload ...
The "official" answer is here. I'm managing a website in my repository. How can I make the live site automatically update after every commit?
How can I use post-commit hooks to copy committed files to a web directory from SVN? My Ubuntu server has Apache and Subversion installed. I use this server as a staging server, purely for testing purposes. I use Apache to host the web application, and Subversion to keep versioned copies of the source code. My current ...
TITLE: How can I use post-commit hooks to copy committed files to a web directory from SVN? QUESTION: My Ubuntu server has Apache and Subversion installed. I use this server as a staging server, purely for testing purposes. I use Apache to host the web application, and Subversion to keep versioned copies of the source...
[ "svn", "apache", "apache2" ]
10
11
7,421
3
0
2008-09-26T16:43:01.817000
2008-09-26T16:47:15.160000
140,616
141,174
Is there a NAnt task that will display all property name / values?
Is there a NAnt task that will echo out all property names and values that are currently set during a build? Something equivalent to the Ant echoproperties task maybe?
Try this snippet: You can just save and run with nant. And no, there isn't a task or function to do this for you already.
Is there a NAnt task that will display all property name / values? Is there a NAnt task that will echo out all property names and values that are currently set during a build? Something equivalent to the Ant echoproperties task maybe?
TITLE: Is there a NAnt task that will display all property name / values? QUESTION: Is there a NAnt task that will echo out all property names and values that are currently set during a build? Something equivalent to the Ant echoproperties task maybe? ANSWER: Try this snippet: You can just save and run with nant. And...
[ ".net", "ant", "build", "build-automation", "nant" ]
13
25
2,575
4
0
2008-09-26T16:43:25.310000
2008-09-26T18:36:10.873000
140,627
140,656
Session Variables and Web Services
I just wrote my first web service so lets make the assumption that my web service knowlege is non existant. I want to try to call a dbClass function from the web service. However I need some params that are in the session. Is there any way I can get these call these session variables from the webservice??
If you are using ASP.NET web services and you want to have a session environment maintained for you, you need to embellish your web service method with an attribute that indicates you require a session. [WebMethod(EnableSession = true)] public void MyWebService() { Foo foo; Session["MyObjectName"] = new Foo(); foo = Se...
Session Variables and Web Services I just wrote my first web service so lets make the assumption that my web service knowlege is non existant. I want to try to call a dbClass function from the web service. However I need some params that are in the session. Is there any way I can get these call these session variables ...
TITLE: Session Variables and Web Services QUESTION: I just wrote my first web service so lets make the assumption that my web service knowlege is non existant. I want to try to call a dbClass function from the web service. However I need some params that are in the session. Is there any way I can get these call these ...
[ "web-services", "session" ]
10
21
33,679
7
0
2008-09-26T16:44:43.293000
2008-09-26T16:51:08.117000
140,643
140,665
ORA-01031: insufficient privileges when selecting view
When I try to execute a view that includes tables from different schemas an ORA-001031 Insufficient privileges is thrown. These tables have execute permission for the schema where the view was created. If I execute the view's SQL Statement it works. What am I missing?
As the table owner you need to grant SELECT access on the underlying tables to the user you are running the SELECT statement as. grant SELECT on TABLE_NAME to READ_USERNAME;
ORA-01031: insufficient privileges when selecting view When I try to execute a view that includes tables from different schemas an ORA-001031 Insufficient privileges is thrown. These tables have execute permission for the schema where the view was created. If I execute the view's SQL Statement it works. What am I missi...
TITLE: ORA-01031: insufficient privileges when selecting view QUESTION: When I try to execute a view that includes tables from different schemas an ORA-001031 Insufficient privileges is thrown. These tables have execute permission for the schema where the view was created. If I execute the view's SQL Statement it work...
[ "oracle", "view" ]
30
19
212,186
8
0
2008-09-26T16:47:51.977000
2008-09-26T16:53:33.290000
140,648
140,676
Where can I find documentation for the Erlang shell?
The Erlang documentation contains the documentation of modules. Where can I find the documentation of the Erlang shell? (Which is not a module, I suppose.)
This page in the documentation seems to be a starting point. Especially the link in it. Check also the first link in it, with the shell's manpage.
Where can I find documentation for the Erlang shell? The Erlang documentation contains the documentation of modules. Where can I find the documentation of the Erlang shell? (Which is not a module, I suppose.)
TITLE: Where can I find documentation for the Erlang shell? QUESTION: The Erlang documentation contains the documentation of modules. Where can I find the documentation of the Erlang shell? (Which is not a module, I suppose.) ANSWER: This page in the documentation seems to be a starting point. Especially the link in ...
[ "erlang" ]
5
3
928
4
0
2008-09-26T16:48:36.157000
2008-09-26T16:58:37.847000
140,677
140,683
How often should you refactor?
I had a discussion a few weeks back with some co-workers on refactoring, and I seem to be in a minority that believes "Refactor early, refactor often" is a good approach that keeps code from getting messy and unmaintainable. A number of other people thought that it just belongs in the maintenance phases of a project. I...
Just like you said: refactor early, refactor often. Refactoring early means the necessary changes are still fresh on my mind. Refactoring often means the changes tend to be smaller. Delaying refactoring only ends up making a big mess which further makes it harder to refactor. Cleaning up as soon as I notice the mess pr...
How often should you refactor? I had a discussion a few weeks back with some co-workers on refactoring, and I seem to be in a minority that believes "Refactor early, refactor often" is a good approach that keeps code from getting messy and unmaintainable. A number of other people thought that it just belongs in the mai...
TITLE: How often should you refactor? QUESTION: I had a discussion a few weeks back with some co-workers on refactoring, and I seem to be in a minority that believes "Refactor early, refactor often" is a good approach that keeps code from getting messy and unmaintainable. A number of other people thought that it just ...
[ "refactoring" ]
63
83
12,712
25
0
2008-09-26T16:59:24.850000
2008-09-26T17:00:42.460000
140,680
140,692
Firebug - how can I run multiline scripts or create a new JavaScript file?
Is there a way in Firebug to start a new script file to apply to page? Basically I want to do work like I'd normally do on the Firebug console but be able to to paste in multi-line functions, etc. It doesn't seem like the console is amenable to that.
Down in the lower-right corner of the FireBug UI you should see a red square icon with an up arrow. Use that and stretch it to a size you like.
Firebug - how can I run multiline scripts or create a new JavaScript file? Is there a way in Firebug to start a new script file to apply to page? Basically I want to do work like I'd normally do on the Firebug console but be able to to paste in multi-line functions, etc. It doesn't seem like the console is amenable to ...
TITLE: Firebug - how can I run multiline scripts or create a new JavaScript file? QUESTION: Is there a way in Firebug to start a new script file to apply to page? Basically I want to do work like I'd normally do on the Firebug console but be able to to paste in multi-line functions, etc. It doesn't seem like the conso...
[ "javascript", "firefox", "firebug" ]
4
15
4,192
3
0
2008-09-26T17:00:19.263000
2008-09-26T17:03:03.093000
140,728
141,011
How do I ensure that user entered data containing international characters doesn't get corrupted?
It often happens that characters such as é gets transformed to é, even though the collation for the MySQL DB, table and field is set to utf8_general_ci. The encoding in the Content-Type for the page is also set to UTF8. I know about utf8_encode/decode, but I'm not quite sure about where and how to use it. I have read ...
On the first look at http://www.nicknettleton.com/zine/php/php-utf-8-cheatsheet I think that one important thing is missing (perhaps I overlooked this one). Depending on your MySQL installation and/or configuration you have to set the connection encoding so that MySQL knows what encoding you're expecting on the client ...
How do I ensure that user entered data containing international characters doesn't get corrupted? It often happens that characters such as é gets transformed to é, even though the collation for the MySQL DB, table and field is set to utf8_general_ci. The encoding in the Content-Type for the page is also set to UTF8. I...
TITLE: How do I ensure that user entered data containing international characters doesn't get corrupted? QUESTION: It often happens that characters such as é gets transformed to é, even though the collation for the MySQL DB, table and field is set to utf8_general_ci. The encoding in the Content-Type for the page is a...
[ "php", "mysql", "internationalization" ]
20
14
12,841
5
0
2008-09-26T17:13:02.273000
2008-09-26T18:01:31.050000
140,734
1,975,086
Best way to cache resized images using PHP and MySQL
What would be the best practice way to handle the caching of images using PHP. The filename is currently stored in a MySQL database which is renamed to a GUID on upload, along with the original filename and alt tag. When the image is put into the HTML pages it is done so using a url such as '/images/get/200x200/{guid}....
There is two typos in Dan Udey's rewrite example (and I can't comment on it), it should rather be: RewriteCond %{REQUEST_URI} ^/images/cached/ RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI}!-f RewriteRule (.*) /images/generate.php?$1 [L] Regards.
Best way to cache resized images using PHP and MySQL What would be the best practice way to handle the caching of images using PHP. The filename is currently stored in a MySQL database which is renamed to a GUID on upload, along with the original filename and alt tag. When the image is put into the HTML pages it is don...
TITLE: Best way to cache resized images using PHP and MySQL QUESTION: What would be the best practice way to handle the caching of images using PHP. The filename is currently stored in a MySQL database which is renamed to a GUID on upload, along with the original filename and alt tag. When the image is put into the HT...
[ "php", "image", "caching", "resize" ]
14
10
12,231
9
0
2008-09-26T17:13:31.277000
2009-12-29T15:02:58.823000
140,750
140,777
Is it possible to compile .NET IL code to machine code?
I would like to distribute my.NET programs without the.NET framework. Is it possible to compile a.NET program to machine code?
Yes, you can precompile using Ngen.exe, however this does not remove the CLR dependence. You must still ship the IL assemblies as well, the only benefit of Ngen is that your application can start without invoking the JIT, so you get a real fast startup time. According to CLR Via C#: Also, assemblies precompiled using N...
Is it possible to compile .NET IL code to machine code? I would like to distribute my.NET programs without the.NET framework. Is it possible to compile a.NET program to machine code?
TITLE: Is it possible to compile .NET IL code to machine code? QUESTION: I would like to distribute my.NET programs without the.NET framework. Is it possible to compile a.NET program to machine code? ANSWER: Yes, you can precompile using Ngen.exe, however this does not remove the CLR dependence. You must still ship t...
[ ".net", "visual-studio", "compiler-construction" ]
30
21
18,599
14
0
2008-09-26T17:18:32.840000
2008-09-26T17:23:46.353000
140,758
140,818
Looking for File Traversal Functions in Python that are Like Java's
In Java you can do File.listFiles() and receive all of the files in a directory. You can then easily recurse through directory trees. Is there an analogous way to do this in Python?
Yes, there is. The Python way is even better. There are three possibilities: 1) Like File.listFiles(): Python has the function os.listdir(path). It works like the Java method. 2) pathname pattern expansion with glob: The module glob contains functions to list files on the file system using Unix shell like pattern, e.g....
Looking for File Traversal Functions in Python that are Like Java's In Java you can do File.listFiles() and receive all of the files in a directory. You can then easily recurse through directory trees. Is there an analogous way to do this in Python?
TITLE: Looking for File Traversal Functions in Python that are Like Java's QUESTION: In Java you can do File.listFiles() and receive all of the files in a directory. You can then easily recurse through directory trees. Is there an analogous way to do this in Python? ANSWER: Yes, there is. The Python way is even bette...
[ "java", "python", "file-traversal" ]
10
25
9,278
9
0
2008-09-26T17:20:14.830000
2008-09-26T17:30:39.347000
140,765
140,943
How do I know WHEN to close an HTTP 1.1 Keep-Alive Connection?
I am writing a web server in Java and I want it to support HTTP 1.1 Keep-Alive connections. But how can I tell when the client is done sending requests for a given connection? (like a double end-of-line or something). Lets see how stackoverflow handles this very obscure question -- answers for which, on Google, are mir...
If you're building your server to meet the standard, then you've got a lot of information to guide you here already. Simple spoken, it should be based on a time since a connection was used, and not so much at the level of request data. In a longer-winded way, the practical considerations section of the HTTP/1.1 documen...
How do I know WHEN to close an HTTP 1.1 Keep-Alive Connection? I am writing a web server in Java and I want it to support HTTP 1.1 Keep-Alive connections. But how can I tell when the client is done sending requests for a given connection? (like a double end-of-line or something). Lets see how stackoverflow handles this...
TITLE: How do I know WHEN to close an HTTP 1.1 Keep-Alive Connection? QUESTION: I am writing a web server in Java and I want it to support HTTP 1.1 Keep-Alive connections. But how can I tell when the client is done sending requests for a given connection? (like a double end-of-line or something). Lets see how stackove...
[ "java", "http", "http-headers", "network-protocols" ]
8
8
9,632
4
0
2008-09-26T17:21:46.840000
2008-09-26T17:52:38.607000
140,786
140,865
How to simplify this code (generates a random int between min and max base on unsigned int)?
The code is return min + static_cast (static_cast (max - min + 1.0) * (number / (UINT_MAX + 1.0))); number is a random number obtained by rand_s. min and max are ints and represent minimum and maximum values (inclusive). If you provide a solution not using unsigned int as a number, please also explain how to make it be...
The static_cast is redundant because the "+1.0"s will cause promotion to double anyway.
How to simplify this code (generates a random int between min and max base on unsigned int)? The code is return min + static_cast (static_cast (max - min + 1.0) * (number / (UINT_MAX + 1.0))); number is a random number obtained by rand_s. min and max are ints and represent minimum and maximum values (inclusive). If you...
TITLE: How to simplify this code (generates a random int between min and max base on unsigned int)? QUESTION: The code is return min + static_cast (static_cast (max - min + 1.0) * (number / (UINT_MAX + 1.0))); number is a random number obtained by rand_s. min and max are ints and represent minimum and maximum values (...
[ "c++", "random" ]
0
3
835
5
0
2008-09-26T17:24:55.647000
2008-09-26T17:39:20.527000
140,825
140,853
Can a macro be used for read-only access to a variable?
Can you define a macro that accesses a normal variable, but in a read-only fashion (other than defining it as a call to a function)? For example, can the VALUE macro in the following code be defined in such a way that the dostuff() function causes a compile error? struct myobj { int value; } /* This macro does not sat...
If the variable is always numeric, this works: #define VALUE(x) (x+0) or in the context of your example, #define VALUE(x) (x->value+0)
Can a macro be used for read-only access to a variable? Can you define a macro that accesses a normal variable, but in a read-only fashion (other than defining it as a call to a function)? For example, can the VALUE macro in the following code be defined in such a way that the dostuff() function causes a compile error?...
TITLE: Can a macro be used for read-only access to a variable? QUESTION: Can you define a macro that accesses a normal variable, but in a read-only fashion (other than defining it as a call to a function)? For example, can the VALUE macro in the following code be defined in such a way that the dostuff() function cause...
[ "c", "c-preprocessor" ]
2
7
1,009
5
0
2008-09-26T17:31:27.067000
2008-09-26T17:37:44.820000
140,843
145,433
Has anyone used Raven?
What do you think about this build tool? I'm thinking of migrating from maven2 to raven (my poms are getting bigger and bigger), but I'd like to hear some opinions first. Thanks! @andre: Thank's for writing but I was actually looking for real experiences using raven. Anyway, the fact that nobody wrote is an indicator b...
I haven't used either Raven or Buildr, but I have heard good things about the latter. In this blog article by Assaf Arkin, there is a nice case study: a 5,443 line, 52 file Maven configuration was reduced to 485 lines of Buildr. And, even though everybody says "Ruby is slow", Buildr was 2-6x faster than Maven. Also, un...
Has anyone used Raven? What do you think about this build tool? I'm thinking of migrating from maven2 to raven (my poms are getting bigger and bigger), but I'd like to hear some opinions first. Thanks! @andre: Thank's for writing but I was actually looking for real experiences using raven. Anyway, the fact that nobody ...
TITLE: Has anyone used Raven? QUESTION: What do you think about this build tool? I'm thinking of migrating from maven2 to raven (my poms are getting bigger and bigger), but I'd like to hear some opinions first. Thanks! @andre: Thank's for writing but I was actually looking for real experiences using raven. Anyway, the...
[ "ruby", "build-process", "build-automation" ]
0
2
363
3
0
2008-09-26T17:35:54.950000
2008-09-28T07:48:45.220000
140,858
140,915
Can you make a site with ASP.NET MVC Framework using .NET 2.0?
Is it possible to make a site with ASP.NET MVC Framework using.NET 2.0? I am limited to using.NET 2.0 (we use VS 2008, but we have to use the 2.0 Framework) and I really want to try out the MVC Framework.
Scott Hanselman described a way to make it work, with some caveats, in his blog: Deploying ASP.NET MVC on ASP.NET 2.0
Can you make a site with ASP.NET MVC Framework using .NET 2.0? Is it possible to make a site with ASP.NET MVC Framework using.NET 2.0? I am limited to using.NET 2.0 (we use VS 2008, but we have to use the 2.0 Framework) and I really want to try out the MVC Framework.
TITLE: Can you make a site with ASP.NET MVC Framework using .NET 2.0? QUESTION: Is it possible to make a site with ASP.NET MVC Framework using.NET 2.0? I am limited to using.NET 2.0 (we use VS 2008, but we have to use the 2.0 Framework) and I really want to try out the MVC Framework. ANSWER: Scott Hanselman described...
[ "asp.net", "asp.net-mvc", ".net-2.0" ]
1
4
289
2
0
2008-09-26T17:38:23.557000
2008-09-26T17:47:35.500000
140,869
140,995
Is there ever any reason not to take the advice of the Database Engine Tuning Advisor?
I'm on a team maintaining a.Net web app with a SQL Server 2005 back end. The system's been running a little slow in places lately, so after doing all the tuning kind of stuff we could think of (adding indexes, cleaning up really badly written stored procedures, etc.) I ran a typical workload through the Tuning Advisor ...
Sql Server does a good job of managing statistics if you have enabled auto-create and auto-update of statistics (you should), so ignore the statistics recommendations. Take the indexes and analyze them to make sure you can handle the extra space requirements, and also make sure they aren't duplicating some other index ...
Is there ever any reason not to take the advice of the Database Engine Tuning Advisor? I'm on a team maintaining a.Net web app with a SQL Server 2005 back end. The system's been running a little slow in places lately, so after doing all the tuning kind of stuff we could think of (adding indexes, cleaning up really badl...
TITLE: Is there ever any reason not to take the advice of the Database Engine Tuning Advisor? QUESTION: I'm on a team maintaining a.Net web app with a SQL Server 2005 back end. The system's been running a little slow in places lately, so after doing all the tuning kind of stuff we could think of (adding indexes, clean...
[ "asp.net", "sql-server", "performance" ]
4
2
457
8
0
2008-09-26T17:39:40.900000
2008-09-26T17:58:25.707000
140,899
140,932
IE Script debugging pop up
In order to debug an asp.net web app I have to have IE Script debugging enabled. Unfortunately, in the past week or so google's analytics javascript has developed a problem. So that when I browse to a site that has google analytics I receive the little pop up "A runtime error has occurred. Do you wish to debug?" Yes, e...
I would suggest using IE for debugging purposes only, and Firefox for darn near everything else. Your life will benefit from this.
IE Script debugging pop up In order to debug an asp.net web app I have to have IE Script debugging enabled. Unfortunately, in the past week or so google's analytics javascript has developed a problem. So that when I browse to a site that has google analytics I receive the little pop up "A runtime error has occurred. Do...
TITLE: IE Script debugging pop up QUESTION: In order to debug an asp.net web app I have to have IE Script debugging enabled. Unfortunately, in the past week or so google's analytics javascript has developed a problem. So that when I browse to a site that has google analytics I receive the little pop up "A runtime erro...
[ "asp.net", "debugging" ]
2
4
1,462
4
0
2008-09-26T17:45:02.043000
2008-09-26T17:50:02.700000
140,908
140,911
Querying XML like SQL?
Is there any framework for querying XML SQL Syntax, I seriously tire of iterating through node lists. Or is this just wishful thinking (if not idiotic) and certainly not possible since XML isn't a relational database?
XQuery and XPath... XQuery is more what you are looking for if a SQL structure is desirable.
Querying XML like SQL? Is there any framework for querying XML SQL Syntax, I seriously tire of iterating through node lists. Or is this just wishful thinking (if not idiotic) and certainly not possible since XML isn't a relational database?
TITLE: Querying XML like SQL? QUESTION: Is there any framework for querying XML SQL Syntax, I seriously tire of iterating through node lists. Or is this just wishful thinking (if not idiotic) and certainly not possible since XML isn't a relational database? ANSWER: XQuery and XPath... XQuery is more what you are look...
[ "sql", "xml", "language-agnostic", "frameworks" ]
6
13
1,844
7
0
2008-09-26T17:46:32.333000
2008-09-26T17:47:07.090000
140,922
154,843
Has anyone used Ruby/Rails with a Sales Logix database?
Has anyone used Ruby/Rails with a Sales Logix database?
This page says SalesLogix runs on MS SQL Server or Oracle, both of which can connect with Rails through ActiveRecord. Here is a page that details setting up for MS SQL (which is what is more likely to be running on).
Has anyone used Ruby/Rails with a Sales Logix database? Has anyone used Ruby/Rails with a Sales Logix database?
TITLE: Has anyone used Ruby/Rails with a Sales Logix database? QUESTION: Has anyone used Ruby/Rails with a Sales Logix database? ANSWER: This page says SalesLogix runs on MS SQL Server or Oracle, both of which can connect with Rails through ActiveRecord. Here is a page that details setting up for MS SQL (which is wha...
[ "ruby-on-rails", "ruby", "database", "saleslogix" ]
1
2
252
1
0
2008-09-26T17:48:19.443000
2008-09-30T20:20:13.697000
140,926
141,069
Normalize newlines in C#
I have a data stream that may contain \r, \n, \r\n, \n\r or any combination of them. Is there a simple way to normalize the data to make all of them simply become \r\n pairs to make display more consistent? So something that would yield this kind of translation table: \r --> \r\n \n --> \r\n \n\n --> \r\n\r\n \n\r --> ...
I believe this will do what you need: using System.Text.RegularExpressions; //... string normalized = Regex.Replace(originalString, @"\r\n|\n\r|\n|\r", "\r\n"); I'm not 100% sure on the exact syntax, and I don't have a.Net compiler handy to check. I wrote it in perl, and converted it into (hopefully correct) C#. The on...
Normalize newlines in C# I have a data stream that may contain \r, \n, \r\n, \n\r or any combination of them. Is there a simple way to normalize the data to make all of them simply become \r\n pairs to make display more consistent? So something that would yield this kind of translation table: \r --> \r\n \n --> \r\n \n...
TITLE: Normalize newlines in C# QUESTION: I have a data stream that may contain \r, \n, \r\n, \n\r or any combination of them. Is there a simple way to normalize the data to make all of them simply become \r\n pairs to make display more consistent? So something that would yield this kind of translation table: \r --> \...
[ "c#", ".net" ]
35
45
15,848
8
0
2008-09-26T17:48:59.333000
2008-09-26T18:14:56.917000
140,935
140,944
Partial class definition on C++?
Anyone knows if is possible to have partial class definition on C++? Something like: file1.h: class Test { public: int test1(); }; file2.h: class Test { public: int test2(); }; For me it seems quite useful for definining multi-platform classes that have common functions between them that are platform-independent becaus...
This is not possible in C++, it will give you an error about redefining already-defined classes. If you'd like to share behavior, consider inheritance.
Partial class definition on C++? Anyone knows if is possible to have partial class definition on C++? Something like: file1.h: class Test { public: int test1(); }; file2.h: class Test { public: int test2(); }; For me it seems quite useful for definining multi-platform classes that have common functions between them tha...
TITLE: Partial class definition on C++? QUESTION: Anyone knows if is possible to have partial class definition on C++? Something like: file1.h: class Test { public: int test1(); }; file2.h: class Test { public: int test2(); }; For me it seems quite useful for definining multi-platform classes that have common function...
[ "c++" ]
46
44
48,210
19
0
2008-09-26T17:51:06.053000
2008-09-26T17:52:50.150000
140,937
141,048
Is there a way to make Strongly Typed Resource files public (as opposed to internal)?
Here's what I'd like to do: I want to create a library project that contains my Resource files (ie, UI Labels and whatnot). I'd like to then use the resource library both in my UI and in my Tests. (Ie, basically have a common place for my resources that I reference from multiple projects.) Unfortunately, because the St...
Not sure which version of Visual Studio you are using, so I will put steps for either one: VS 2008 - When you open the resx file in design view, there is an option at the top beside Add Resource and Remove Resource, called Access Modifier, it is a drop down where you can change the generated code from internal to publi...
Is there a way to make Strongly Typed Resource files public (as opposed to internal)? Here's what I'd like to do: I want to create a library project that contains my Resource files (ie, UI Labels and whatnot). I'd like to then use the resource library both in my UI and in my Tests. (Ie, basically have a common place fo...
TITLE: Is there a way to make Strongly Typed Resource files public (as opposed to internal)? QUESTION: Here's what I'd like to do: I want to create a library project that contains my Resource files (ie, UI Labels and whatnot). I'd like to then use the resource library both in my UI and in my Tests. (Ie, basically have...
[ "c#", "asp.net", ".net-2.0", "resources", "strong-typing" ]
23
39
7,334
3
0
2008-09-26T17:51:15.957000
2008-09-26T18:11:00.513000
140,993
141,033
Grab and move application windows from a .NET app?
Is it possible for a.NET application to grab all the window handles currently open, and move/resize these windows? I'd pretty sure its possible using P/Invoke, but I was wondering if there were some managed code wrappers for this functionality.
Yes, it is possible using the Windows API. This post has information on how to get all window handles from active processes: http://www.c-sharpcorner.com/Forums/ShowMessages.aspx?ThreadID=35545 using System; using System.Diagnostics; class Program { static void Main() { Process[] procs = Process.GetProcesses(); IntPtr...
Grab and move application windows from a .NET app? Is it possible for a.NET application to grab all the window handles currently open, and move/resize these windows? I'd pretty sure its possible using P/Invoke, but I was wondering if there were some managed code wrappers for this functionality.
TITLE: Grab and move application windows from a .NET app? QUESTION: Is it possible for a.NET application to grab all the window handles currently open, and move/resize these windows? I'd pretty sure its possible using P/Invoke, but I was wondering if there were some managed code wrappers for this functionality. ANSWE...
[ ".net", "window-handles" ]
7
14
1,706
1
0
2008-09-26T17:58:23.680000
2008-09-26T18:05:51.790000
140,996
141,008
How can I set the text of a WPF Hyperlink via data binding?
In WPF, I want to create a hyperlink that navigates to the details of an object, and I want the text of the hyperlink to be the name of the object. Right now, I have this: Object Name But I want "Object Name" to be bound to the actual name of the object. I would like to do something like this: However, the Hyperlink cl...
It looks strange, but it works. We do it in about 20 different places in our app. Hyperlink implicitly constructs a if you put text in its "content", but in.NET 3.5 won't let you bind to it, so you've got to explicitly use a TextBlock. Update: Note that as of.NET 4.0 the Run.Text property can now be bound:
How can I set the text of a WPF Hyperlink via data binding? In WPF, I want to create a hyperlink that navigates to the details of an object, and I want the text of the hyperlink to be the name of the object. Right now, I have this: Object Name But I want "Object Name" to be bound to the actual name of the object. I wou...
TITLE: How can I set the text of a WPF Hyperlink via data binding? QUESTION: In WPF, I want to create a hyperlink that navigates to the details of an object, and I want the text of the hyperlink to be the name of the object. Right now, I have this: Object Name But I want "Object Name" to be bound to the actual name of...
[ "wpf", "data-binding", "hyperlink" ]
138
233
80,479
3
0
2008-09-26T17:58:32.133000
2008-09-26T18:00:57.463000
141,002
141,079
Javascript error: [elementname] has no properties
I'm doing some maintenance coding on a webapp and I am getting a javascript error of the form: "[elementname] has no properties" Part of the code is being generated on the fly with an AJAX call that changes innerHTML for part of the page, after this is finished I need to copy a piece of data from a hidden input field t...
"[elementname] has no properties" is javascript error speak for "the element you tried to reference doesn't exist or is nil" This means you've got one or more of a few possible problems: Your page hasn't rendered yet and you're trying to reference it before it exists You've got a spelling error You've named your id the...
Javascript error: [elementname] has no properties I'm doing some maintenance coding on a webapp and I am getting a javascript error of the form: "[elementname] has no properties" Part of the code is being generated on the fly with an AJAX call that changes innerHTML for part of the page, after this is finished I need t...
TITLE: Javascript error: [elementname] has no properties QUESTION: I'm doing some maintenance coding on a webapp and I am getting a javascript error of the form: "[elementname] has no properties" Part of the code is being generated on the fly with an AJAX call that changes innerHTML for part of the page, after this is...
[ "javascript", "ajax" ]
5
5
2,878
6
0
2008-09-26T17:59:45.783000
2008-09-26T18:17:52.977000
141,007
141,032
Creating a XAML Resource from Code Without a Key
Is there a way to add a resource to a ResourceDictionary from code without giving it a resource key? For instance, I have this resource in XAML: I need to create this resource dynamically from code and add it to the TreeView ResourceDictionary. However, in XAML having no Key means that it's used, by default, for all Fi...
Use the type that you want the template to apply to as the key: HierarchicalDataTemplate fieldPropertyTemplate = new HierarchicalDataTemplate("FieldProperyInfo"); fieldPropertyTemplate.SetBinding( HierarchialDataTemplate.ItemSourceProperty, new Binding("Value.Values"); this.Resources.Add(FieldPropertyInfo.GetType(), f...
Creating a XAML Resource from Code Without a Key Is there a way to add a resource to a ResourceDictionary from code without giving it a resource key? For instance, I have this resource in XAML: I need to create this resource dynamically from code and add it to the TreeView ResourceDictionary. However, in XAML having no...
TITLE: Creating a XAML Resource from Code Without a Key QUESTION: Is there a way to add a resource to a ResourceDictionary from code without giving it a resource key? For instance, I have this resource in XAML: I need to create this resource dynamically from code and add it to the TreeView ResourceDictionary. However,...
[ "c#", "wpf", "xaml", "code-behind" ]
7
8
3,226
2
0
2008-09-26T18:00:56.543000
2008-09-26T18:05:37.670000
141,019
141,040
Roll Up Task in Team Foundation Server
We are using TFS 2008 for project managmeent and I am looking for a method to roll up smaller tasks into larger tasks within tfs. Our work flow works like this: I create a new large work item, say 'Implement web page X' and assign it to my developer (lets call him Brad) Brad receives the task. Now he has never designed...
There is no such support in TFS yet. However it will be possible to do something like this in rosario because it will support nested tasks, just like a tree structure. You could utilize iterations and areas within TFS to accommodate this need. Use these links as inspiration: http://blogs.msdn.com/ericlee/archive/2006/0...
Roll Up Task in Team Foundation Server We are using TFS 2008 for project managmeent and I am looking for a method to roll up smaller tasks into larger tasks within tfs. Our work flow works like this: I create a new large work item, say 'Implement web page X' and assign it to my developer (lets call him Brad) Brad recei...
TITLE: Roll Up Task in Team Foundation Server QUESTION: We are using TFS 2008 for project managmeent and I am looking for a method to roll up smaller tasks into larger tasks within tfs. Our work flow works like this: I create a new large work item, say 'Implement web page X' and assign it to my developer (lets call hi...
[ "tfs", "project-management" ]
0
2
1,186
1
0
2008-09-26T18:03:16.070000
2008-09-26T18:08:07.027000
141,023
141,047
What's a good API for recording/capturing and playing back sound in Delphi and/or C#?
I want to create a spelling test program for my grade schoolers that would let them enter and record their spelling words then test them on them through out the week. What's a good Delphi API with which I could select a recording device, capture and save sound files, then play them back? I'm also toying with doing the ...
An alternative to recording would be to use the MS Speech API with C#, enter the words via keyboard, and have it state what was keyed in. Just a thought... Good luck on your app -- it sounds like a really cool program!
What's a good API for recording/capturing and playing back sound in Delphi and/or C#? I want to create a spelling test program for my grade schoolers that would let them enter and record their spelling words then test them on them through out the week. What's a good Delphi API with which I could select a recording devi...
TITLE: What's a good API for recording/capturing and playing back sound in Delphi and/or C#? QUESTION: I want to create a spelling test program for my grade schoolers that would let them enter and record their spelling words then test them on them through out the week. What's a good Delphi API with which I could selec...
[ "c#", "delphi", "desktop-application" ]
3
2
1,019
6
0
2008-09-26T18:04:26.333000
2008-09-26T18:10:46.160000
141,024
149,263
ActionScript3 User Interface Components?
After using AS2 for several years, I'm getting started with writing applications in AS3 (Flash9/Flash10). I've come to the point where I need some full sets of GUI components, and I need to decide which set I'm going to use. Back in the AS2 days, the built in components included with flash were pretty crappy - bloated ...
I'm actually a fan of the CS3 ones mainly because it is so easy to just double click on those bad boys and edit right in the Flash IDE using the drawing tools. Very helpful for those times where you have to rapidly push a skinned video player to production... On the open source side there's also Thimbault Imbert's Liqu...
ActionScript3 User Interface Components? After using AS2 for several years, I'm getting started with writing applications in AS3 (Flash9/Flash10). I've come to the point where I need some full sets of GUI components, and I need to decide which set I'm going to use. Back in the AS2 days, the built in components included...
TITLE: ActionScript3 User Interface Components? QUESTION: After using AS2 for several years, I'm getting started with writing applications in AS3 (Flash9/Flash10). I've come to the point where I need some full sets of GUI components, and I need to decide which set I'm going to use. Back in the AS2 days, the built in c...
[ "flash", "actionscript-3", "user-interface", "components" ]
8
5
3,535
7
0
2008-09-26T18:04:30.327000
2008-09-29T15:43:07.940000
141,052
141,087
MS Paint command line switches
I have been looking for documentation related to interacting with MSPaint from the command line. I have only found references to /p, /pt and /wia, but no guidance as to how to use them and their limitations. I am trying to send some graphics files to the printer and when I drop the file on my printer driver I get a dif...
I know that mspaint /p filename and mspaint /pt filename both print straight to the default printer. Not sure what /wia does, maybe something to do with Windows Image Acquisition? Also, as others have pointed out, there are many programs a lot more capable for doing what you want than MSPaint.
MS Paint command line switches I have been looking for documentation related to interacting with MSPaint from the command line. I have only found references to /p, /pt and /wia, but no guidance as to how to use them and their limitations. I am trying to send some graphics files to the printer and when I drop the file o...
TITLE: MS Paint command line switches QUESTION: I have been looking for documentation related to interacting with MSPaint from the command line. I have only found references to /p, /pt and /wia, but no guidance as to how to use them and their limitations. I am trying to send some graphics files to the printer and when...
[ "command-line", "file-conversion" ]
9
3
35,405
5
0
2008-09-26T18:11:40.933000
2008-09-26T18:19:58.247000
141,088
141,098
How to iterate over a dictionary?
I've seen a few different ways to iterate over a dictionary in C#. Is there a standard way?
foreach(KeyValuePair entry in myDictionary) { // do something with entry.Value or entry.Key }
How to iterate over a dictionary? I've seen a few different ways to iterate over a dictionary in C#. Is there a standard way?
TITLE: How to iterate over a dictionary? QUESTION: I've seen a few different ways to iterate over a dictionary in C#. Is there a standard way? ANSWER: foreach(KeyValuePair entry in myDictionary) { // do something with entry.Value or entry.Key }
[ "c#", "dictionary", "loops" ]
3,303
4,521
2,398,486
20
0
2008-09-26T18:20:06.357000
2008-09-26T18:22:10.423000
141,090
142,392
Are "dirty reads" safe to use in Terracotta?
"Dirty reads", meaning reading an object's value even though it is write-locked by another thread, are described on Terracotta's website, yet I've heard that they shouldn't be used, even if you don't care about the possibility that you might get old data when you dirty-read the locked object. Does anyone have any exper...
A dirty read is a dirty read. Terracotta, being distributed/clustered, only adds the possibility to read even older values of the shared mutable state that you are accessing without proper synchronization. You should note that, under the memory model in Java 5, you are not guaranteed to ever read an updated value if yo...
Are "dirty reads" safe to use in Terracotta? "Dirty reads", meaning reading an object's value even though it is write-locked by another thread, are described on Terracotta's website, yet I've heard that they shouldn't be used, even if you don't care about the possibility that you might get old data when you dirty-read ...
TITLE: Are "dirty reads" safe to use in Terracotta? QUESTION: "Dirty reads", meaning reading an object's value even though it is write-locked by another thread, are described on Terracotta's website, yet I've heard that they shouldn't be used, even if you don't care about the possibility that you might get old data wh...
[ "java", "cluster-computing", "terracotta" ]
3
3
419
2
0
2008-09-26T18:20:37.977000
2008-09-26T22:42:48.580000
141,104
142,735
How do I integrate the ASP .Net Model View Presenter (MVP) pattern and static page methods marked as [WebMethod]?
In an asp.net application, I would like to combine the use of the Webclient Software Factory (WCSF), and its associated Model View Presenter pattern (MVP), with Page Method, that is static methods on the.aspx Views marked with the [WebMethod] attribute. However, static methods on the aspx page would seem to break the M...
I had a similar problem recently when doing a MVP patterened project and wanting a lot of AJAX integration. You're best off having web services which conform to the MVP pattern that you call. Keep in mind that a PageMethod is little more than a web service, just in the current page. It doesn't have access to any page-l...
How do I integrate the ASP .Net Model View Presenter (MVP) pattern and static page methods marked as [WebMethod]? In an asp.net application, I would like to combine the use of the Webclient Software Factory (WCSF), and its associated Model View Presenter pattern (MVP), with Page Method, that is static methods on the.as...
TITLE: How do I integrate the ASP .Net Model View Presenter (MVP) pattern and static page methods marked as [WebMethod]? QUESTION: In an asp.net application, I would like to combine the use of the Webclient Software Factory (WCSF), and its associated Model View Presenter pattern (MVP), with Page Method, that is static...
[ "asp.net", "json", "mvp", "wcsf" ]
5
4
2,563
2
0
2008-09-26T18:22:39.643000
2008-09-27T01:51:26.880000
141,108
141,114
How to find the foreach index?
Is it possible to find the foreach index? in a for loop as follows: for ($i = 0; $i < 10; ++$i) { echo $i. ' '; } $i will give you the index. Do I have to use the for loop or is there some way to get the index in the foreach loop?
foreach($array as $key=>$value) { // do stuff } $key is the index of each $array element
How to find the foreach index? Is it possible to find the foreach index? in a for loop as follows: for ($i = 0; $i < 10; ++$i) { echo $i. ' '; } $i will give you the index. Do I have to use the for loop or is there some way to get the index in the foreach loop?
TITLE: How to find the foreach index? QUESTION: Is it possible to find the foreach index? in a for loop as follows: for ($i = 0; $i < 10; ++$i) { echo $i. ' '; } $i will give you the index. Do I have to use the for loop or is there some way to get the index in the foreach loop? ANSWER: foreach($array as $key=>$value)...
[ "php", "loops", "foreach" ]
658
1,199
1,024,552
14
0
2008-09-26T18:23:15.413000
2008-09-26T18:24:33.833000
141,123
141,157
Why is deleting a branch in CVS not recommended?
Under what circumstances would this or would this not be safe? I have a branch that has a four changes (no file add or deletes). Would this be safe to delete? Edit: The reason for wanting to delete it is that it was misnamed and is going to lead to confusion.
I believe that CVS won't actually delete the branch, it will just remove the tag from the branch -- so the branch is still present in each ",v" file that is affected, it just won't be trivially accessible any more. The result is weird, but probably not dangerous.
Why is deleting a branch in CVS not recommended? Under what circumstances would this or would this not be safe? I have a branch that has a four changes (no file add or deletes). Would this be safe to delete? Edit: The reason for wanting to delete it is that it was misnamed and is going to lead to confusion.
TITLE: Why is deleting a branch in CVS not recommended? QUESTION: Under what circumstances would this or would this not be safe? I have a branch that has a four changes (no file add or deletes). Would this be safe to delete? Edit: The reason for wanting to delete it is that it was misnamed and is going to lead to conf...
[ "cvs" ]
26
16
25,709
5
0
2008-09-26T18:26:13.130000
2008-09-26T18:32:41.133000
141,128
141,153
Does TCP/IP prevent packet replays?
Does TCP/IP prevent multiple copies of the same packet from reaching the destination? Or is it up to the endpoint to layer idempotency logic above it? Please reference specific paragraphs from the TCP/IP specification if possible.
It's the TCP stack's job to recover from duplicate packets: The TCP must recover from data that is damaged, lost, duplicated, or delivered out of order by the internet communication system. This is achieved by assigning a sequence number to each octet transmitted, and requiring a positive acknowledgment (ACK) from the ...
Does TCP/IP prevent packet replays? Does TCP/IP prevent multiple copies of the same packet from reaching the destination? Or is it up to the endpoint to layer idempotency logic above it? Please reference specific paragraphs from the TCP/IP specification if possible.
TITLE: Does TCP/IP prevent packet replays? QUESTION: Does TCP/IP prevent multiple copies of the same packet from reaching the destination? Or is it up to the endpoint to layer idempotency logic above it? Please reference specific paragraphs from the TCP/IP specification if possible. ANSWER: It's the TCP stack's job t...
[ "tcp" ]
3
9
9,671
8
0
2008-09-26T18:27:01.723000
2008-09-26T18:32:06.843000
141,136
141,159
Calculate timespan in JavaScript
I have a.net 2.0 ascx control with a start time and end time textboxes. The data is as follows: txtStart.Text = 09/19/2008 07:00:00 txtEnd.Text = 09/19/2008 05:00:00 I would like to calculate the total time (hours and minutes) in JavaScript then display it in a textbox on the page.
Once your textbox date formats are known in advance, you can use Matt Kruse's Date functions in Javascript to convert the two to a timestamp, subtract and then write to the resulting text box. Equally the JQuery Date Input code for stringToDate could be adapted for your purposes - the below takes a string in the format...
Calculate timespan in JavaScript I have a.net 2.0 ascx control with a start time and end time textboxes. The data is as follows: txtStart.Text = 09/19/2008 07:00:00 txtEnd.Text = 09/19/2008 05:00:00 I would like to calculate the total time (hours and minutes) in JavaScript then display it in a textbox on the page.
TITLE: Calculate timespan in JavaScript QUESTION: I have a.net 2.0 ascx control with a start time and end time textboxes. The data is as follows: txtStart.Text = 09/19/2008 07:00:00 txtEnd.Text = 09/19/2008 05:00:00 I would like to calculate the total time (hours and minutes) in JavaScript then display it in a textbox...
[ "asp.net", "javascript" ]
14
6
33,344
7
0
2008-09-26T18:28:18.427000
2008-09-26T18:33:26.357000
141,140
141,158
Why does Java not have block-scoped variable declarations?
The following method does not work because the inner block declares a variable of the same name as one in the outer block. Apparently variables belong to the method or class in which they are declared, not to the block in which they are declared, so I therefore can't write a short little temporary block for debugging t...
I believe the rationale is that most of the time, that isn't intentional, it is a programming or logic flaw. in an example as trivial as yours, its obvious, but in a large block of code, accidentally redeclaring a variable may not be obvious. ETA: it might also be related to exception handling in java. i thought part o...
Why does Java not have block-scoped variable declarations? The following method does not work because the inner block declares a variable of the same name as one in the outer block. Apparently variables belong to the method or class in which they are declared, not to the block in which they are declared, so I therefore...
TITLE: Why does Java not have block-scoped variable declarations? QUESTION: The following method does not work because the inner block declares a variable of the same name as one in the outer block. Apparently variables belong to the method or class in which they are declared, not to the block in which they are declar...
[ "java", "syntax", "language-design" ]
10
14
4,830
6
0
2008-09-26T18:28:59.753000
2008-09-26T18:33:14.953000
141,144
141,944
SQL trace in Great Plains shows Invalid column name 'desSPRkmhBBCreh'
This error seems to just pop up now and again. It is not restricted to a single table and even happens on tables it just created. Anybody else see this weird behavior? [Edit w/solution] It turns out that this query is used to determine if the table exists. Apparently it is much quicker to query an invalid column than j...
Yes, it looks like someone else has seen it: http://microsoft-programming.hostweb.com/TopicMessages/microsoft.public.greatplains/1866812/1/Default.aspx Unfortunately, I can't find the knowledge base article they refer to. Victoria Yudin there says "Take a look at KB article 875229 - it addresses this exact question. Ba...
SQL trace in Great Plains shows Invalid column name 'desSPRkmhBBCreh' This error seems to just pop up now and again. It is not restricted to a single table and even happens on tables it just created. Anybody else see this weird behavior? [Edit w/solution] It turns out that this query is used to determine if the table e...
TITLE: SQL trace in Great Plains shows Invalid column name 'desSPRkmhBBCreh' QUESTION: This error seems to just pop up now and again. It is not restricted to a single table and even happens on tables it just created. Anybody else see this weird behavior? [Edit w/solution] It turns out that this query is used to determ...
[ "sql-server", "sql-server-profiler", "dynamics-gp" ]
1
2
1,379
1
0
2008-09-26T18:29:22.933000
2008-09-26T20:58:53.323000