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
62,226
62,249
How do I access class variables of a parent object in PHP?
An instance of class A instantiates a couple of other objects, say for example from class B: $foo = new B(); I would like to access A's public class variables from methods within B. Unless I'm missing something, the only way to do this is to pass the current object to the instances of B: $foo = new B($this); Is this be...
That looks fine to me, I tend to use a rule of thumb of "would someone maintaining this understand it?" and that's an easily understood solution. If there's only one "A", you could consider using the registry pattern, see for example http://www.phppatterns.com/docs/design/the_registry
How do I access class variables of a parent object in PHP? An instance of class A instantiates a couple of other objects, say for example from class B: $foo = new B(); I would like to access A's public class variables from methods within B. Unless I'm missing something, the only way to do this is to pass the current ob...
TITLE: How do I access class variables of a parent object in PHP? QUESTION: An instance of class A instantiates a couple of other objects, say for example from class B: $foo = new B(); I would like to access A's public class variables from methods within B. Unless I'm missing something, the only way to do this is to p...
[ "php", "oop" ]
2
2
7,578
4
0
2008-09-15T11:45:06.700000
2008-09-15T11:56:50.853000
62,232
62,238
How to view web pages at different resolutions
I am developing a web site and need to see how it will look at different resolutions. The catch is that it must work on our Intranet. Is there a free solution?
For Internet Explorer there's the Internet Explorer Developer Toolbar. It lets you select resolutions quite easily.
How to view web pages at different resolutions I am developing a web site and need to see how it will look at different resolutions. The catch is that it must work on our Intranet. Is there a free solution?
TITLE: How to view web pages at different resolutions QUESTION: I am developing a web site and need to see how it will look at different resolutions. The catch is that it must work on our Intranet. Is there a free solution? ANSWER: For Internet Explorer there's the Internet Explorer Developer Toolbar. It lets you sel...
[ "internet-explorer", "resolution" ]
2
2
6,386
6
0
2008-09-15T11:47:13.463000
2008-09-15T11:50:38.700000
62,241
62,257
How to convert a Reader to InputStream and a Writer to OutputStream?
Is there an easy way to avoid dealing with text encoding problems?
You can't really avoid dealing with the text encoding issues, but there are existing solutions in Apache Commons: Reader to InputStream: ReaderInputStream Writer to OutputStream: WriterOutputStream You just need to pick the encoding of your choice.
How to convert a Reader to InputStream and a Writer to OutputStream? Is there an easy way to avoid dealing with text encoding problems?
TITLE: How to convert a Reader to InputStream and a Writer to OutputStream? QUESTION: Is there an easy way to avoid dealing with text encoding problems? ANSWER: You can't really avoid dealing with the text encoding issues, but there are existing solutions in Apache Commons: Reader to InputStream: ReaderInputStream Wr...
[ "java", "stream" ]
101
51
161,365
13
0
2008-09-15T11:51:48.197000
2008-09-15T12:01:47.050000
62,245
62,898
Merging records for Mnesia
I am trying to refactor some code I have for software that collects current status of agents in a call queue. Currently, for each of the 6 or so events that I listen to, I check in a Mnesia table if an agent exists and change some values in the row depending on the event or add it as new if the agent doesn't exist. Cur...
I wrote some code a while ago that merges two records. Is not entirely dynamic, but whith macros you could easily use it for several records. It works like this: The merge/2 function takes two records and converts them to lists together with the empty record for reference (the record type is defined at compile time, an...
Merging records for Mnesia I am trying to refactor some code I have for software that collects current status of agents in a call queue. Currently, for each of the 6 or so events that I listen to, I check in a Mnesia table if an agent exists and change some values in the row depending on the event or add it as new if t...
TITLE: Merging records for Mnesia QUESTION: I am trying to refactor some code I have for software that collects current status of agents in a call queue. Currently, for each of the 6 or so events that I listen to, I check in a Mnesia table if an agent exists and change some values in the row depending on the event or ...
[ "erlang", "mnesia" ]
3
2
977
2
0
2008-09-15T11:54:16.990000
2008-09-15T13:32:15.083000
62,264
72,874
Dealing with SVN keyword expansion with git-svn
I recently asked about keyword expansion in Git and I'm willing to accept the design not to really support this idea in Git. For better or worse, the project I'm working on at the moment requires SVN keyword expansion like this: svn propset svn:keywords "Id" expl3.dtx to keep this string up-to-date: $Id: expl3.dtx 803 ...
What's going on here: Git is optimized to switch between branches as quickly as possible. In particular, git checkout is designed to not touch any files that are identical in both branches. Unfortunately, RCS keyword substitution breaks this. For example, using $Date$ would require git checkout to touch every file in t...
Dealing with SVN keyword expansion with git-svn I recently asked about keyword expansion in Git and I'm willing to accept the design not to really support this idea in Git. For better or worse, the project I'm working on at the moment requires SVN keyword expansion like this: svn propset svn:keywords "Id" expl3.dtx to ...
TITLE: Dealing with SVN keyword expansion with git-svn QUESTION: I recently asked about keyword expansion in Git and I'm willing to accept the design not to really support this idea in Git. For better or worse, the project I'm working on at the moment requires SVN keyword expansion like this: svn propset svn:keywords ...
[ "svn", "git", "version-control" ]
44
42
19,759
4
0
2008-09-15T12:04:31.833000
2008-09-16T14:25:23.437000
62,268
62,390
Error consuming Web Service from Winform App - "Cannot execute a program..."
I have a winform app that calls a web service to check for updates. This works in dev and it also works everywhere else I've tried it, just not on the installed copy on my machine (which happens to be the same in dev). The error is: Cannot execute a program. The command being executed was "C:\WINDOWS\Microsoft.NET\Fram...
The ".cmdline" file is an autogenerated file produced by the.NET framework. The application is attempting to real-time compile an XML Serializer used to parse the data from the web service. Have you verified that you can execute "csc.exe" from a command-line window? Even just typing "C:\WINDOWS\Microsoft.NET\Framework\...
Error consuming Web Service from Winform App - "Cannot execute a program..." I have a winform app that calls a web service to check for updates. This works in dev and it also works everywhere else I've tried it, just not on the installed copy on my machine (which happens to be the same in dev). The error is: Cannot exe...
TITLE: Error consuming Web Service from Winform App - "Cannot execute a program..." QUESTION: I have a winform app that calls a web service to check for updates. This works in dev and it also works everywhere else I've tried it, just not on the installed copy on my machine (which happens to be the same in dev). The er...
[ ".net", "winforms", "web-services" ]
1
2
8,206
4
0
2008-09-15T12:07:18.173000
2008-09-15T12:36:07.810000
62,276
62,335
Java package cycle detection: how do I find the specific classes involved?
What tool would you recommend to detect Java package cyclic dependencies, knowing that the goal is to list explicitly the specific classes involved in the detected 'across-packages cycle'? I know about classycle and JDepend, but they both fail to list the classes involved in a cyclic package dependency. Metrics has an ...
Findbugs can detect circular class dependencies and has an Eclipse plugin too. http://findbugs.sourceforge.net/
Java package cycle detection: how do I find the specific classes involved? What tool would you recommend to detect Java package cyclic dependencies, knowing that the goal is to list explicitly the specific classes involved in the detected 'across-packages cycle'? I know about classycle and JDepend, but they both fail t...
TITLE: Java package cycle detection: how do I find the specific classes involved? QUESTION: What tool would you recommend to detect Java package cyclic dependencies, knowing that the goal is to list explicitly the specific classes involved in the detected 'across-packages cycle'? I know about classycle and JDepend, bu...
[ "java", "class", "dependencies", "package" ]
41
15
36,493
9
0
2008-09-15T12:11:08.913000
2008-09-15T12:27:35.410000
62,292
62,306
Are liquid layouts still relevant?
Now that most of the major browsers support full page zoom (at present, the only notable exception being Google Chrome), are liquid or elastic layouts no longer needed? Is the relative pain of building liquid/elastic layouts worth the effort? Are there any situations where a liquid layout would still be of benefit? Is ...
Yes, because there are a vast variety of screens out there commonly ranging from 15" to 32". There is also some variation in what people consider a "comfortable" font size. All of which adds up to quite a range of sizes that your content will need to fit into. If anything, liquid layout is becoming even more necessary ...
Are liquid layouts still relevant? Now that most of the major browsers support full page zoom (at present, the only notable exception being Google Chrome), are liquid or elastic layouts no longer needed? Is the relative pain of building liquid/elastic layouts worth the effort? Are there any situations where a liquid la...
TITLE: Are liquid layouts still relevant? QUESTION: Now that most of the major browsers support full page zoom (at present, the only notable exception being Google Chrome), are liquid or elastic layouts no longer needed? Is the relative pain of building liquid/elastic layouts worth the effort? Are there any situations...
[ "html", "css", "layout" ]
12
15
1,683
10
0
2008-09-15T12:18:42.220000
2008-09-15T12:22:19.607000
62,294
63,683
How to modify the default Check-in Action in TFS?
The default check-in action for a work-item is "resolve". I'd like to set it to "associate" so that this work item isn't automaticaly closed if I check-in stuff too fast. How can I do that?
Yup, the check-in action can only be associated to a state transition (i.e. Active to Resolved). In my blog post that Fredrick linked to ( http://www.woodwardweb.com/vsts/top_tfs_tip_3_r.html ) I talk about how to remove that. You'll need to customize the work item for everyone in your team project to make this happen....
How to modify the default Check-in Action in TFS? The default check-in action for a work-item is "resolve". I'd like to set it to "associate" so that this work item isn't automaticaly closed if I check-in stuff too fast. How can I do that?
TITLE: How to modify the default Check-in Action in TFS? QUESTION: The default check-in action for a work-item is "resolve". I'd like to set it to "associate" so that this work item isn't automaticaly closed if I check-in stuff too fast. How can I do that? ANSWER: Yup, the check-in action can only be associated to a ...
[ "version-control", "tfs", "tfs-workitem" ]
10
7
3,883
4
0
2008-09-15T12:19:21.140000
2008-09-15T15:00:52.017000
62,317
62,367
PHP: How to expand/contract Tinyurls
In PHP, how can I replicate the expand/contract feature for Tinyurls as on search.twitter.com?
If you want to find out where a tinyurl is going, use fsockopen to get a connection to tinyurl.com on port 80, and send it an HTTP request like this GET /dmsfm HTTP/1.0 Host: tinyurl.com The response you get back will look like HTTP/1.0 301 Moved Permanently Connection: close X-Powered-By: PHP/5.2.6 Location: http://en...
PHP: How to expand/contract Tinyurls In PHP, how can I replicate the expand/contract feature for Tinyurls as on search.twitter.com?
TITLE: PHP: How to expand/contract Tinyurls QUESTION: In PHP, how can I replicate the expand/contract feature for Tinyurls as on search.twitter.com? ANSWER: If you want to find out where a tinyurl is going, use fsockopen to get a connection to tinyurl.com on port 80, and send it an HTTP request like this GET /dmsfm H...
[ "php" ]
2
7
2,092
8
0
2008-09-15T12:24:45.060000
2008-09-15T12:33:16.957000
62,328
63,076
Is there an algorithm that tells the semantic similarity of two phrases
input: phrase 1, phrase 2 output: semantic similarity value (between 0 and 1), or the probability these two phrases are talking about the same thing
You might want to check out this paper: Sentence similarity based on semantic nets and corpus statistics (PDF) I've implemented the algorithm described. Our context was very general (effectively any two English sentences) and we found the approach taken was too slow and the results, while promising, not good enough (or...
Is there an algorithm that tells the semantic similarity of two phrases input: phrase 1, phrase 2 output: semantic similarity value (between 0 and 1), or the probability these two phrases are talking about the same thing
TITLE: Is there an algorithm that tells the semantic similarity of two phrases QUESTION: input: phrase 1, phrase 2 output: semantic similarity value (between 0 and 1), or the probability these two phrases are talking about the same thing ANSWER: You might want to check out this paper: Sentence similarity based on sem...
[ "algorithm", "nlp", "semantics" ]
65
44
49,239
11
0
2008-09-15T12:26:42.200000
2008-09-15T13:53:33.753000
62,334
62,345
What's a liquid layout?
My designer keeps throwing out the term "liquid" layout. What does this mean? Thanks for the clarification, I have always just called this a percentage layout, and thought he was saying that the pieces could be moved around, and that was liquid
A "liquid" layout is a site layout that expands to fill the entire available area as the browser window is resized. Typically this is done using CSS. Liquid layouts can be quite helpful for certain types of sites, but they also tend to be significantly more effort than fixed width layouts, and their usefulness depends ...
What's a liquid layout? My designer keeps throwing out the term "liquid" layout. What does this mean? Thanks for the clarification, I have always just called this a percentage layout, and thought he was saying that the pieces could be moved around, and that was liquid
TITLE: What's a liquid layout? QUESTION: My designer keeps throwing out the term "liquid" layout. What does this mean? Thanks for the clarification, I have always just called this a percentage layout, and thought he was saying that the pieces could be moved around, and that was liquid ANSWER: A "liquid" layout is a s...
[ "asp.net", "html", "css", "layout" ]
6
13
5,561
10
0
2008-09-15T12:27:34.553000
2008-09-15T12:29:44.253000
62,340
62,522
Does pop_back() really invalidate *all* iterators on an std::vector?
std::vector ints; //... fill ints with random values for(std::vector::iterator it = ints.begin(); it!= ints.end(); ) { if(*it < 10) { *it = ints.back(); ints.pop_back(); continue; } it++; } This code is not working because when pop_back() is called, it is invalidated. But I don't find any doc talking about invalidati...
The call to pop_back() removes the last element in the vector and so the iterator to that element is invalidated. The pop_back() call does not invalidate iterators to items before the last element, only reallocation will do that. From Josuttis' "C++ Standard Library Reference": Inserting or removing elements invalidate...
Does pop_back() really invalidate *all* iterators on an std::vector? std::vector ints; //... fill ints with random values for(std::vector::iterator it = ints.begin(); it!= ints.end(); ) { if(*it < 10) { *it = ints.back(); ints.pop_back(); continue; } it++; } This code is not working because when pop_back() is called,...
TITLE: Does pop_back() really invalidate *all* iterators on an std::vector? QUESTION: std::vector ints; //... fill ints with random values for(std::vector::iterator it = ints.begin(); it!= ints.end(); ) { if(*it < 10) { *it = ints.back(); ints.pop_back(); continue; } it++; } This code is not working because when pop...
[ "c++", "stl" ]
7
16
7,561
11
0
2008-09-15T12:28:49.370000
2008-09-15T12:51:20.410000
62,353
62,637
What are the best practices for using Assembly Attributes?
I have a solution with multiple project. I am trying to optimize AssemblyInfo.cs files by linking one solution wide assembly info file. What are the best practices for doing this? Which attributes should be in solution wide file and which are project/assembly specific? Edit: If you are interested there is a follow up q...
We're using a global file called GlobalAssemblyInfo.cs and a local one called AssemblyInfo.cs. The global file contains the following attributes: [assembly: AssemblyProduct("Your Product Name")] [assembly: AssemblyCompany("Your Company")] [assembly: AssemblyCopyright("Copyright © 2008...")] [assembly: AssemblyTrademar...
What are the best practices for using Assembly Attributes? I have a solution with multiple project. I am trying to optimize AssemblyInfo.cs files by linking one solution wide assembly info file. What are the best practices for doing this? Which attributes should be in solution wide file and which are project/assembly s...
TITLE: What are the best practices for using Assembly Attributes? QUESTION: I have a solution with multiple project. I am trying to optimize AssemblyInfo.cs files by linking one solution wide assembly info file. What are the best practices for doing this? Which attributes should be in solution wide file and which are ...
[ ".net", "assemblies", "attributes", "assemblyinfo" ]
167
215
56,285
8
0
2008-09-15T12:31:11.113000
2008-09-15T13:04:38.270000
62,365
62,381
Using reflection to call an ASP.NET web service
Say I have an ASMX web service, MyService. The service has a method, MyMethod. I could execute MyMethod on the server side as follows: MyService service = new MyService(); service.MyMethod(); I need to do similar, with service and method not known until runtime. I'm assuming that reflection is the way to go about that....
I'm not sure if this would be the best way to go about it. The most obvious way to me, would be to make an HTTP Request, and call the webservice using an actual HTTP GET or POST. Using your method, I'm not entirely sure how you'd set up the data you are sending to the web service. I've added some sample code in VB.Net ...
Using reflection to call an ASP.NET web service Say I have an ASMX web service, MyService. The service has a method, MyMethod. I could execute MyMethod on the server side as follows: MyService service = new MyService(); service.MyMethod(); I need to do similar, with service and method not known until runtime. I'm assum...
TITLE: Using reflection to call an ASP.NET web service QUESTION: Say I have an ASMX web service, MyService. The service has a method, MyMethod. I could execute MyMethod on the server side as follows: MyService service = new MyService(); service.MyMethod(); I need to do similar, with service and method not known until ...
[ "c#", "asp.net", "web-services", "reflection" ]
7
2
9,299
8
0
2008-09-15T12:32:39.970000
2008-09-15T12:35:20.230000
62,382
86,917
Can you animate a custom dependency property in Silverlight?
I might be missing something really obvious. I'm trying to write a custom Panel where the contents are laid out according to a couple of dependency properties (I'm assuming they have to be DPs because I want to be able to animate them.) However, when I try to run a storyboard to animate both of these properties, Silver...
It's a documented bug with Silverlight 2 Beta 2. You can't animate two custom dependancy properties on the same object.
Can you animate a custom dependency property in Silverlight? I might be missing something really obvious. I'm trying to write a custom Panel where the contents are laid out according to a couple of dependency properties (I'm assuming they have to be DPs because I want to be able to animate them.) However, when I try to...
TITLE: Can you animate a custom dependency property in Silverlight? QUESTION: I might be missing something really obvious. I'm trying to write a custom Panel where the contents are laid out according to a couple of dependency properties (I'm assuming they have to be DPs because I want to be able to animate them.) Howe...
[ "silverlight" ]
0
1
947
3
0
2008-09-15T12:35:33.847000
2008-09-17T19:49:23.057000
62,384
64,545
How to convert Apache .htaccess files into Lighttpd rules?
It's big problem to convert mod_rewrite rules to lighttpd format
It is generally a case of just going through one by one and converting them. I don't know of any automated means, The docs - http://redmine.lighttpd.net/projects/1/wiki/Docs:ModRewrite - has the regexes available, and some examples. if there are any particularly problematical items, I'd edit the question to show them, ...
How to convert Apache .htaccess files into Lighttpd rules? It's big problem to convert mod_rewrite rules to lighttpd format
TITLE: How to convert Apache .htaccess files into Lighttpd rules? QUESTION: It's big problem to convert mod_rewrite rules to lighttpd format ANSWER: It is generally a case of just going through one by one and converting them. I don't know of any automated means, The docs - http://redmine.lighttpd.net/projects/1/wiki/...
[ "apache", ".htaccess", "lighttpd" ]
5
3
14,109
2
0
2008-09-15T12:35:40.820000
2008-09-15T16:42:49.947000
62,389
62,416
What are the differences between Visual C++ 6.0 and Visual C++ 2008?
What are the advantages/disadvantages between MS VS C++ 6.0 and MSVS C++ 2008? The main reason for asking such a question is that there are still many decent programmers that prefer using the older version instead of the newest version. Is there any reason the might prefer the older over the new?
Well, for one thing it may be because the executables built with MSVS 6 require only msvcrt.dll (C runtime) which is shipped with Windows now. The MSVS 2008 executables need msvcrt9 shipped with them (or already installed). Plus, you have a lot of OSS libraries already compiled for Windows 32 bit with the 6.0 C runtime...
What are the differences between Visual C++ 6.0 and Visual C++ 2008? What are the advantages/disadvantages between MS VS C++ 6.0 and MSVS C++ 2008? The main reason for asking such a question is that there are still many decent programmers that prefer using the older version instead of the newest version. Is there any r...
TITLE: What are the differences between Visual C++ 6.0 and Visual C++ 2008? QUESTION: What are the advantages/disadvantages between MS VS C++ 6.0 and MSVS C++ 2008? The main reason for asking such a question is that there are still many decent programmers that prefer using the older version instead of the newest versi...
[ "c++", "visual-studio", "visual-c++-6" ]
10
4
13,452
14
0
2008-09-15T12:36:05.953000
2008-09-15T12:40:47.440000
62,403
62,487
What technical considerations must a system/network administrator worry about when a site gets onto social bookmarking/sharing sites?
The reason I ask is that Stack Overflow has been Slashdotted, and Redditted. First, what kinds of effect does this have on the servers that power a website? Second, what can be done by system administrators to ensure that their sites remain up and running as best as possible?
Unfortunately, if you haven't planned for this before it happens, it's probably too late and your users will have a poor experience. Scalability is your first immediate concern. You may start getting more hits per second than you were getting per month. Your first line of defense is good programming and design. Make su...
What technical considerations must a system/network administrator worry about when a site gets onto social bookmarking/sharing sites? The reason I ask is that Stack Overflow has been Slashdotted, and Redditted. First, what kinds of effect does this have on the servers that power a website? Second, what can be done by s...
TITLE: What technical considerations must a system/network administrator worry about when a site gets onto social bookmarking/sharing sites? QUESTION: The reason I ask is that Stack Overflow has been Slashdotted, and Redditted. First, what kinds of effect does this have on the servers that power a website? Second, wha...
[ "system-administration" ]
1
1
306
5
0
2008-09-15T12:37:48.243000
2008-09-15T12:47:58.920000
62,406
63,381
Alternative Style(CSS) methods in SAP Portal?
I am overriding a lot of SAP's Portal functionality in my current project. I have to create a custom fixed width framework, custom iView trays, custom KM API functionality, and more. With all of these custom parts, I will not be using a lot of the style functionality implemented by SAP's Theme editor. What I would like...
I'd consider it dirty hack, but as a non-Portal developer I'd consider using JavaScript to insert a new link element in the head pointing to your new CSS file. Of course you'd have a flash of un-styled content because the script probably won't run until after part of the page has been downloaded and rendered, but it ma...
Alternative Style(CSS) methods in SAP Portal? I am overriding a lot of SAP's Portal functionality in my current project. I have to create a custom fixed width framework, custom iView trays, custom KM API functionality, and more. With all of these custom parts, I will not be using a lot of the style functionality implem...
TITLE: Alternative Style(CSS) methods in SAP Portal? QUESTION: I am overriding a lot of SAP's Portal functionality in my current project. I have to create a custom fixed width framework, custom iView trays, custom KM API functionality, and more. With all of these custom parts, I will not be using a lot of the style fu...
[ "css", "sap-enterprise-portal" ]
1
2
2,739
2
0
2008-09-15T12:39:06.337000
2008-09-15T14:24:52.867000
62,418
62,457
Knowing which java.exe process to kill on a windows machine
When a java based application starts to misbehave on a windows machine, you want to be able to kill the process in the task manager if you can't quit the application normally. Most of the time, there's more than one java based application running on my machine. Is there a better way than just randomly killing java.exe ...
Download Sysinternal's Process Explorer. It's a task manager much more powerfull than Windows's own manager. One of it's features is that you can see all the resources that each process is using (like registry keys, hard disk directories, named pipes, etc). So, browsing the resources that each java.exe process holds mi...
Knowing which java.exe process to kill on a windows machine When a java based application starts to misbehave on a windows machine, you want to be able to kill the process in the task manager if you can't quit the application normally. Most of the time, there's more than one java based application running on my machine...
TITLE: Knowing which java.exe process to kill on a windows machine QUESTION: When a java based application starts to misbehave on a windows machine, you want to be able to kill the process in the task manager if you can't quit the application normally. Most of the time, there's more than one java based application run...
[ "java", "windows" ]
48
33
110,448
12
0
2008-09-15T12:41:13.913000
2008-09-15T12:45:38.083000
62,430
62,475
Regular expression that rejects all input?
Is is possible to construct a regular expression that rejects all input strings?
Probably this: [^\w\W] \w - word character (letter, digit, etc) \W - opposite of \w [^\w\W] - should always fail, because any character should belong to one of the character classes - \w or \W Another snippets: $.^ $ - assert position at the end of the string ^ - assert position at the start of the line. - any char (?#...
Regular expression that rejects all input? Is is possible to construct a regular expression that rejects all input strings?
TITLE: Regular expression that rejects all input? QUESTION: Is is possible to construct a regular expression that rejects all input strings? ANSWER: Probably this: [^\w\W] \w - word character (letter, digit, etc) \W - opposite of \w [^\w\W] - should always fail, because any character should belong to one of the chara...
[ "regex" ]
11
10
4,022
11
0
2008-09-15T12:42:53.067000
2008-09-15T12:47:14.117000
62,436
78,123
DevExpress eXpressApp Framework (XAF) and eXpress Persistent Objects (XPO): how do I speed up the loading time of associations?
I am having a problem with the speed of accessing an association property with a large number of records. I have an XAF app with a parent class called MyParent. There are 230 records in MyParent. MyParent has a child class called MyChild. There are 49,000 records in MyChild. I have an association defined between MyPare...
Firstly you are right to be sceptical that this operation should take this long, XPO on read operations should add only between 30 - 70% overhead, and on this tiny amount of data we should be talking milli-seconds not seconds. Some general perf tips are available in the DevExpress forums, and centre around object cachi...
DevExpress eXpressApp Framework (XAF) and eXpress Persistent Objects (XPO): how do I speed up the loading time of associations? I am having a problem with the speed of accessing an association property with a large number of records. I have an XAF app with a parent class called MyParent. There are 230 records in MyPare...
TITLE: DevExpress eXpressApp Framework (XAF) and eXpress Persistent Objects (XPO): how do I speed up the loading time of associations? QUESTION: I am having a problem with the speed of accessing an association property with a large number of records. I have an XAF app with a parent class called MyParent. There are 230...
[ "devexpress", "xpo", "xaf" ]
3
2
9,516
4
0
2008-09-15T12:43:28.667000
2008-09-16T22:50:20.837000
62,449
247,108
How to spread tcplistener incoming connections over threads in .NET?
When using the Net.Sockets.TcpListener, what is the best way to handle incoming connections (.AcceptSocket) in seperate threads? The idea is to start a new thread when a new incoming connection is accepted, while the tcplistener then stays available for further incoming connections (and for every new incoming connectio...
The code that I've been using looks like this: class Server { private AutoResetEvent connectionWaitHandle = new AutoResetEvent(false); public void Start() { TcpListener listener = new TcpListener(IPAddress.Any, 5555); listener.Start(); while(true) { IAsyncResult result = listener.BeginAcceptTcpClient(HandleAsyncConne...
How to spread tcplistener incoming connections over threads in .NET? When using the Net.Sockets.TcpListener, what is the best way to handle incoming connections (.AcceptSocket) in seperate threads? The idea is to start a new thread when a new incoming connection is accepted, while the tcplistener then stays available f...
TITLE: How to spread tcplistener incoming connections over threads in .NET? QUESTION: When using the Net.Sockets.TcpListener, what is the best way to handle incoming connections (.AcceptSocket) in seperate threads? The idea is to start a new thread when a new incoming connection is accepted, while the tcplistener then...
[ ".net", "multithreading", "tcplistener" ]
15
15
22,899
5
0
2008-09-15T12:44:48.240000
2008-10-29T14:54:22.593000
62,472
63,389
Any PHP editors supporting 5.3 syntax?
I'm using namespaces in a project and Eclipse PDT, my IDE of choice, recognizes them as syntax errors. Not only it renders its convenient error checking unusable, but it also ruins Eclipse's PHP explorer. 5.3 features are coming to PDT 2.0 scheduled for release in December. Are there any alternatives for the present mo...
Some threads that have been addressed by the various PHP IDE developers regarding the status of 5.3 syntax support: PHPEclipse: http://www.phpeclipse.net/ticket/636 or google Aptana: http://forums.aptana.com/viewtopic.php?t=6538 or google PDT: http://bugs.eclipse.org/bugs/show_bug.cgi?id=234938 or google TextMate: http...
Any PHP editors supporting 5.3 syntax? I'm using namespaces in a project and Eclipse PDT, my IDE of choice, recognizes them as syntax errors. Not only it renders its convenient error checking unusable, but it also ruins Eclipse's PHP explorer. 5.3 features are coming to PDT 2.0 scheduled for release in December. Are th...
TITLE: Any PHP editors supporting 5.3 syntax? QUESTION: I'm using namespaces in a project and Eclipse PDT, my IDE of choice, recognizes them as syntax errors. Not only it renders its convenient error checking unusable, but it also ruins Eclipse's PHP explorer. 5.3 features are coming to PDT 2.0 scheduled for release i...
[ "php", "ide" ]
4
6
3,217
8
0
2008-09-15T12:46:59.453000
2008-09-15T14:25:37.547000
62,491
62,615
How to create J2ME midlets for Nokia using Eclipse
Nokia has stopped offering its Developer's Suite, relying on other IDEs, including Eclipse. Meanwhile, Nokia changed its own development tools again and EclipseMe has also changed. This leaves most documentation irrelevant. I want to know what does it take to make a simple Hello-World? (I already found out myself, so t...
Here's what's needed to make a simple hello world - Get Eclipse IDE for Java. I used Ganymede. Set it up. Get Sun's Wireless Toolkit. I used 2.5.2. Install it. Get Nokia's SDK ( found here ), in my case for S40 6230i Edition, and install it choosing the option to integrate with Sun's WTK Follow the instructions at http...
How to create J2ME midlets for Nokia using Eclipse Nokia has stopped offering its Developer's Suite, relying on other IDEs, including Eclipse. Meanwhile, Nokia changed its own development tools again and EclipseMe has also changed. This leaves most documentation irrelevant. I want to know what does it take to make a si...
TITLE: How to create J2ME midlets for Nokia using Eclipse QUESTION: Nokia has stopped offering its Developer's Suite, relying on other IDEs, including Eclipse. Meanwhile, Nokia changed its own development tools again and EclipseMe has also changed. This leaves most documentation irrelevant. I want to know what does it...
[ "java", "eclipse", "java-me", "nokia", "java-wireless-toolkit" ]
9
10
22,828
3
0
2008-09-15T12:48:20.760000
2008-09-15T13:02:21.490000
62,496
84,253
Similarity between line strings
I have a number of tracks recorded by a GPS, which more formally can be described as a number of line strings. Now, some of the recorded tracks might be recordings of the same route, but because of inaccurasies in the GPS system, the fact that the recordings were made on separate occasions and that they might have been...
Compute the Fréchet distance on each pair of tracks. The distance can be used to gauge the similarity of your tracks. Math alert: Fréchet was a pioneer in the field of metric space which is relevant to your problem.
Similarity between line strings I have a number of tracks recorded by a GPS, which more formally can be described as a number of line strings. Now, some of the recorded tracks might be recordings of the same route, but because of inaccurasies in the GPS system, the fact that the recordings were made on separate occasio...
TITLE: Similarity between line strings QUESTION: I have a number of tracks recorded by a GPS, which more formally can be described as a number of line strings. Now, some of the recorded tracks might be recordings of the same route, but because of inaccurasies in the GPS system, the fact that the recordings were made o...
[ "sql-server", "algorithm", "gis" ]
13
12
3,440
6
0
2008-09-15T12:49:01.710000
2008-09-17T15:08:58.533000
62,501
62,560
Remote installing of windows service
I need to remotely install windows service on number of computers, so I use CreateService() and other service functions from winapi. I know admin password and user name for machines that I need access to. In order to gain access to remote machine I impersonate calling process with help of LogonUser like this: //all var...
You can do it, the account needs to exist on the remote machine and you need to use the machine name for the domain name in the LogonUser call.
Remote installing of windows service I need to remotely install windows service on number of computers, so I use CreateService() and other service functions from winapi. I know admin password and user name for machines that I need access to. In order to gain access to remote machine I impersonate calling process with h...
TITLE: Remote installing of windows service QUESTION: I need to remotely install windows service on number of computers, so I use CreateService() and other service functions from winapi. I know admin password and user name for machines that I need access to. In order to gain access to remote machine I impersonate call...
[ "c++", "windows", "windows-services" ]
0
2
1,580
3
0
2008-09-15T12:49:41.270000
2008-09-15T12:56:33.983000
62,503
62,738
Should I use int or Int32
In C#, int and Int32 are the same thing, but I've read a number of times that int is preferred over Int32 with no reason given. Is there a reason, and should I care?
ECMA-334:2006 C# Language Specification (p18): Each of the predefined types is shorthand for a system-provided type. For example, the keyword int refers to the struct System.Int32. As a matter of style, use of the keyword is favoured over use of the complete system type name.
Should I use int or Int32 In C#, int and Int32 are the same thing, but I've read a number of times that int is preferred over Int32 with no reason given. Is there a reason, and should I care?
TITLE: Should I use int or Int32 QUESTION: In C#, int and Int32 are the same thing, but I've read a number of times that int is preferred over Int32 with no reason given. Is there a reason, and should I care? ANSWER: ECMA-334:2006 C# Language Specification (p18): Each of the predefined types is shorthand for a system...
[ "c#", "variable-types" ]
376
152
216,484
32
0
2008-09-15T12:49:50.647000
2008-09-15T13:14:26.750000
62,504
65,027
Is there any way to create multiple insert statements in a ms-access query?
I am using MS Access 2003. I want to run a lot of insert SQL statements in what is called 'Query' in MS Access. Is there any easy(or indeed any way) to do it?
yes and no. You can't do: insert into foo (c1, c2, c3) values ("v1a", "v2a", "v3a"), ("v1b", "v2b", "v3b"), ("v1c", "v2c", "v3c") but you can do insert into foo (c1, c2, c3) select (v1, v2, v3) from bar What does that get you if you don't already have the data in a table? Well, you could craft a Select statement compos...
Is there any way to create multiple insert statements in a ms-access query? I am using MS Access 2003. I want to run a lot of insert SQL statements in what is called 'Query' in MS Access. Is there any easy(or indeed any way) to do it?
TITLE: Is there any way to create multiple insert statements in a ms-access query? QUESTION: I am using MS Access 2003. I want to run a lot of insert SQL statements in what is called 'Query' in MS Access. Is there any easy(or indeed any way) to do it? ANSWER: yes and no. You can't do: insert into foo (c1, c2, c3) val...
[ "ms-access" ]
17
39
59,114
8
0
2008-09-15T12:49:56.137000
2008-09-15T17:43:12.003000
62,505
62,581
How do I move tags in Subversion
I wish Subversion had a better way of moving tags. The only way that I know to move a tag is to remove the file from the tag and then copy it again. Revision tree browsers don't seem to handle that very well. This also requires keeping the directory structure under the trunk and tag in sync. Use case: We have thousands...
I don't think you can ever do this with the way that subversion operates. I believe the best solution would be to look at a tool like git which seems like it fits into your use case. You're production system could 'pull' in the "maps" that are accepted. While I realize this isn't subversion, using git might be closer m...
How do I move tags in Subversion I wish Subversion had a better way of moving tags. The only way that I know to move a tag is to remove the file from the tag and then copy it again. Revision tree browsers don't seem to handle that very well. This also requires keeping the directory structure under the trunk and tag in ...
TITLE: How do I move tags in Subversion QUESTION: I wish Subversion had a better way of moving tags. The only way that I know to move a tag is to remove the file from the tag and then copy it again. Revision tree browsers don't seem to handle that very well. This also requires keeping the directory structure under the...
[ "svn" ]
2
2
8,809
7
0
2008-09-15T12:49:56.810000
2008-09-15T12:58:39.987000
62,512
62,532
Three dimensional arrays of integers in C++
I would like to find out safe ways of implementing three dimensional arrays of integers in C++, using pointer arithmetic / dynamic memory allocation, or, alternatively using STL techniques such as vectors. Essentially I want my integer array dimensions to look like: [ x ][ y ][ z ] x and y are in the range 20-6000 z is...
Have a look at the Boost multi-dimensional array library. Here's an example (adapted from the Boost documentation): #include "boost/multi_array.hpp" int main() { // Create a 3D array that is 20 x 30 x 4 int x = 20; int y = 30; int z = 4; typedef boost::multi_array array_type; typedef array_type::index index; array_ty...
Three dimensional arrays of integers in C++ I would like to find out safe ways of implementing three dimensional arrays of integers in C++, using pointer arithmetic / dynamic memory allocation, or, alternatively using STL techniques such as vectors. Essentially I want my integer array dimensions to look like: [ x ][ y ...
TITLE: Three dimensional arrays of integers in C++ QUESTION: I would like to find out safe ways of implementing three dimensional arrays of integers in C++, using pointer arithmetic / dynamic memory allocation, or, alternatively using STL techniques such as vectors. Essentially I want my integer array dimensions to lo...
[ "c++", "arrays", "multidimensional-array" ]
7
11
34,198
7
0
2008-09-15T12:50:19.367000
2008-09-15T12:52:34.667000
62,529
99,671
Best Practice for Model Design in Ruby on Rails
The RoR tutorials posit one model per table for the ORM to work. My DB schema has some 70 tables divided conceptually into 5 groups of functionality (eg, any given table lives in one and only one functional group, and relations between tables of different groups are minimised.) So: should I design a model per conceptua...
I cover this in one of my large apps by just making sure that the tables/models are conceptually grouped by name (with almost 1:1 table-model relationship). Example: events event_types event_groups event_attendees etc... That way when I'm using TextMate or whatever, the model files are nicely grouped together by the al...
Best Practice for Model Design in Ruby on Rails The RoR tutorials posit one model per table for the ORM to work. My DB schema has some 70 tables divided conceptually into 5 groups of functionality (eg, any given table lives in one and only one functional group, and relations between tables of different groups are minim...
TITLE: Best Practice for Model Design in Ruby on Rails QUESTION: The RoR tutorials posit one model per table for the ORM to work. My DB schema has some 70 tables divided conceptually into 5 groups of functionality (eg, any given table lives in one and only one functional group, and relations between tables of differen...
[ "ruby-on-rails", "ruby", "activerecord" ]
8
9
5,025
7
0
2008-09-15T12:52:15.867000
2008-09-19T04:38:04.023000
62,539
62,577
What is the dependency inversion principle and why is it important?
What is the dependency inversion principle and why is it important?
Check this document out: The Dependency Inversion Principle. It basically says: High level modules should not depend upon low-level modules. Both should depend upon abstractions. Abstractions should never depend upon details. Details should depend upon abstractions. As to why it is important, in short: changes are risk...
What is the dependency inversion principle and why is it important? What is the dependency inversion principle and why is it important?
TITLE: What is the dependency inversion principle and why is it important? QUESTION: What is the dependency inversion principle and why is it important? ANSWER: Check this document out: The Dependency Inversion Principle. It basically says: High level modules should not depend upon low-level modules. Both should depe...
[ "oop", "solid-principles", "glossary", "principles", "dependency-inversion" ]
226
122
95,054
16
0
2008-09-15T12:53:20.030000
2008-09-15T12:57:45.667000
62,542
68,492
What is the best free test tracking software?
I'm not talking about bug tracking software (like Bugzilla or Jira). I'm looking for something that: Stores test specifications in text format Combines test specs into test coverage scenarios Keeps track of the progress through testing scenarios Links test specs with bug reports stored in Bugzilla Generates progress re...
TestLink is a pretty nice open source test tracking tool with the features you need, and is still under active development. Take a look at http://testlink.org/
What is the best free test tracking software? I'm not talking about bug tracking software (like Bugzilla or Jira). I'm looking for something that: Stores test specifications in text format Combines test specs into test coverage scenarios Keeps track of the progress through testing scenarios Links test specs with bug re...
TITLE: What is the best free test tracking software? QUESTION: I'm not talking about bug tracking software (like Bugzilla or Jira). I'm looking for something that: Stores test specifications in text format Combines test specs into test coverage scenarios Keeps track of the progress through testing scenarios Links test...
[ "testing" ]
22
12
18,107
6
0
2008-09-15T12:54:08.123000
2008-09-16T01:19:17.227000
62,570
62,642
How do I move a file (or folder) from one folder to another in TortoiseSVN?
I would like to move a file or folder from one place to another within the same repository without having to use Repo Browser to do it, and without creating two independent add/delete operations. Using Repo Browser works fine except that your code will be hanging in a broken state until you get any supporting changes c...
To move a file or set of files using Tortoise SVN, right-click-and-drag the target files to their destination and release the right mouse button. The popup menu will have a SVN move versioned files here option. Note that the destination folder must have already been added to the repository for the SVN move versioned fi...
How do I move a file (or folder) from one folder to another in TortoiseSVN? I would like to move a file or folder from one place to another within the same repository without having to use Repo Browser to do it, and without creating two independent add/delete operations. Using Repo Browser works fine except that your c...
TITLE: How do I move a file (or folder) from one folder to another in TortoiseSVN? QUESTION: I would like to move a file or folder from one place to another within the same repository without having to use Repo Browser to do it, and without creating two independent add/delete operations. Using Repo Browser works fine ...
[ "svn", "tortoisesvn" ]
252
453
158,070
11
0
2008-09-15T12:57:16.307000
2008-09-15T13:05:04.557000
62,588
63,006
Shared/Static variable in Global.asax isolated per request?
I have some ASP.NET web services which all share a common helper class they only need to instantiate one instance of per server. It's used for simple translation of data, but does spend some time during start-up loading things from the web.config file, etc. The helper class is 100% thread-safe. Think of it as a simple ...
It's not wise to use application state unless you absolutely require it, things are much simpler if you stick to using per-request objects. Any addition of state to the helper classes could cause all sorts of subtle errors. Use the HttpContext.Current items collection and intialise it per request. A VB module would do ...
Shared/Static variable in Global.asax isolated per request? I have some ASP.NET web services which all share a common helper class they only need to instantiate one instance of per server. It's used for simple translation of data, but does spend some time during start-up loading things from the web.config file, etc. Th...
TITLE: Shared/Static variable in Global.asax isolated per request? QUESTION: I have some ASP.NET web services which all share a common helper class they only need to instantiate one instance of per server. It's used for simple translation of data, but does spend some time during start-up loading things from the web.co...
[ "asp.net", "vb.net", "web-services" ]
3
0
3,453
3
0
2008-09-15T12:59:24.430000
2008-09-15T13:46:13.303000
62,599
62,817
Setting the namespace of a WinForms UserControl in VB.NET
How do you define your UserControls as being in a namespace below the project namespace, ie. [RootNameSpace].[SubSectionOfProgram].Controls? Edit due to camainc's answer: I also have a constraint that I have to have all the code in a single project. Edit to finalise question: As I suspected it isn't possible to do what...
I'm not sure if this is what you are asking, but this is how we do it. We namespace all of our projects in a consistent manner, user controls are no different. We also namespace using the project settings window, although you could do it through a combination of the project window and in code. Each solution gets a name...
Setting the namespace of a WinForms UserControl in VB.NET How do you define your UserControls as being in a namespace below the project namespace, ie. [RootNameSpace].[SubSectionOfProgram].Controls? Edit due to camainc's answer: I also have a constraint that I have to have all the code in a single project. Edit to fina...
TITLE: Setting the namespace of a WinForms UserControl in VB.NET QUESTION: How do you define your UserControls as being in a namespace below the project namespace, ie. [RootNameSpace].[SubSectionOfProgram].Controls? Edit due to camainc's answer: I also have a constraint that I have to have all the code in a single pro...
[ "vb.net", "winforms", "namespaces" ]
2
1
4,044
3
0
2008-09-15T13:00:22.087000
2008-09-15T13:23:16.947000
62,606
62,775
.Net 2+: why does if( 1 == null ) no longer throw a compiler exception?
I'm using int as an example, but this applies to any value type in.Net In.Net 1 the following would throw a compiler exception: int i = SomeFunctionThatReturnsInt(); if( i == null ) //compiler exception here Now (in.Net 2 or 3.5) that exception has gone. I know why this is: int? j = null; //nullable int if( i == j ) ...
I don't think this is a compiler problem per se; an integer value is never null, but the idea of equating them isn't invalid; it's a valid function that always returns false. And the compiler knows; the code bool oneIsNull = 1 == null; compiles, but gives a compiler warning: The result of the expression is always 'fals...
.Net 2+: why does if( 1 == null ) no longer throw a compiler exception? I'm using int as an example, but this applies to any value type in.Net In.Net 1 the following would throw a compiler exception: int i = SomeFunctionThatReturnsInt(); if( i == null ) //compiler exception here Now (in.Net 2 or 3.5) that exception ha...
TITLE: .Net 2+: why does if( 1 == null ) no longer throw a compiler exception? QUESTION: I'm using int as an example, but this applies to any value type in.Net In.Net 1 the following would throw a compiler exception: int i = SomeFunctionThatReturnsInt(); if( i == null ) //compiler exception here Now (in.Net 2 or 3.5)...
[ "c#", ".net-3.5", "compiler-construction", ".net-2.0" ]
5
3
2,015
6
0
2008-09-15T13:01:24.143000
2008-09-15T13:18:08.973000
62,618
62,762
What is the best way to merge mp3 files?
I've got many, many mp3 files that I would like to merge into a single file. I've used the command line method copy /b 1.mp3+2.mp3 3.mp3 but it's a pain when there's a lot of them and their namings are inconsistent. The time never seems to come out right either.
As Thomas Owens pointed out, simply concatenating the files will leave multiple ID3 headers scattered throughout the resulting concatenated file - so the time/bitrate info will be wildly wrong. You're going to need to use a tool which can combine the audio data for you. mp3wrap would be ideal for this - it's designed t...
What is the best way to merge mp3 files? I've got many, many mp3 files that I would like to merge into a single file. I've used the command line method copy /b 1.mp3+2.mp3 3.mp3 but it's a pain when there's a lot of them and their namings are inconsistent. The time never seems to come out right either.
TITLE: What is the best way to merge mp3 files? QUESTION: I've got many, many mp3 files that I would like to merge into a single file. I've used the command line method copy /b 1.mp3+2.mp3 3.mp3 but it's a pain when there's a lot of them and their namings are inconsistent. The time never seems to come out right either...
[ "audio", "mp3" ]
68
52
174,296
12
0
2008-09-15T13:02:39.353000
2008-09-15T13:16:27.447000
62,625
62,779
How do you know what to test when writing unit tests?
Using C#, I need a class called User that has a username, password, active flag, first name, last name, full name, etc. There should be methods to authenticate and save a user. Do I just write a test for the methods? And do I even need to worry about testing the properties since they are.Net's getter and setters?
Many great responses to this are also on my question: " Beginning TDD - Challenges? Solutions? Recommendations? " May I also recommend taking a look at my blog post (which was partly inspired by my question), I have got some good feedback on that. Namely: I Don’t Know Where to Start? Start afresh. Only think about writ...
How do you know what to test when writing unit tests? Using C#, I need a class called User that has a username, password, active flag, first name, last name, full name, etc. There should be methods to authenticate and save a user. Do I just write a test for the methods? And do I even need to worry about testing the pro...
TITLE: How do you know what to test when writing unit tests? QUESTION: Using C#, I need a class called User that has a username, password, active flag, first name, last name, full name, etc. There should be methods to authenticate and save a user. Do I just write a test for the methods? And do I even need to worry abo...
[ "c#", "unit-testing", "tdd" ]
128
133
86,774
36
0
2008-09-15T13:03:22.050000
2008-09-15T13:18:40.780000
62,650
62,745
Saving Java Object Graphs as XML file
What's the simplest-to-use techonlogy available to save an arbitrary Java object graph as an XML file (and to be able to rehydrate the objects later)?
The easiest way here is to serialize the object graph. Java 1.4 has built in support for serialization as XML. A solution I have used successfully is XStream ( http://x-stream.github.io/)- it's a small library that will easily allow you to serialize and deserialize to and from XML. The downside is you can only very lim...
Saving Java Object Graphs as XML file What's the simplest-to-use techonlogy available to save an arbitrary Java object graph as an XML file (and to be able to rehydrate the objects later)?
TITLE: Saving Java Object Graphs as XML file QUESTION: What's the simplest-to-use techonlogy available to save an arbitrary Java object graph as an XML file (and to be able to rehydrate the objects later)? ANSWER: The easiest way here is to serialize the object graph. Java 1.4 has built in support for serialization a...
[ "java", "xml" ]
15
8
5,831
15
0
2008-09-15T13:05:43.883000
2008-09-15T13:14:45.487000
62,654
65,151
How to define and use static variables in F# class
Is there a way to have a mutable static variable in F# class that is identical to a static variable in C# class?
You use static let bindings (note: while necessary some times, it's none too functional): type StaticMemberTest () = static let mutable test: string = "" member this.Test with get() = test <- "asdf" test
How to define and use static variables in F# class Is there a way to have a mutable static variable in F# class that is identical to a static variable in C# class?
TITLE: How to define and use static variables in F# class QUESTION: Is there a way to have a mutable static variable in F# class that is identical to a static variable in C# class? ANSWER: You use static let bindings (note: while necessary some times, it's none too functional): type StaticMemberTest () = static let ...
[ "f#", "functional-programming" ]
9
18
5,584
1
0
2008-09-15T13:06:18.703000
2008-09-15T17:56:56.290000
62,658
62,829
Getting PEAR to work on XAMPP (Apache/MySQL stack on Windows)
I'm trying to install Laconica, an open-source Microblogging application on my Windows development server using XAMPP as per the instructions provided. The website cannot find PEAR, and throws the below errors: Warning: require_once(PEAR.php) [function.require-once]: failed to open stream: No such file or directory in ...
You need to fix your include_path system variable to point to the correct location. To fix it edit the php.ini file. In that file you will find a line that says, " include_path =... ". (You can find out what the location of php.ini by running phpinfo() on a page.) Fix the part of the line that says, " \xampplite\php\pe...
Getting PEAR to work on XAMPP (Apache/MySQL stack on Windows) I'm trying to install Laconica, an open-source Microblogging application on my Windows development server using XAMPP as per the instructions provided. The website cannot find PEAR, and throws the below errors: Warning: require_once(PEAR.php) [function.requi...
TITLE: Getting PEAR to work on XAMPP (Apache/MySQL stack on Windows) QUESTION: I'm trying to install Laconica, an open-source Microblogging application on my Windows development server using XAMPP as per the instructions provided. The website cannot find PEAR, and throws the below errors: Warning: require_once(PEAR.ph...
[ "php", "pear", "laconica" ]
16
26
213,025
8
0
2008-09-15T13:06:38.983000
2008-09-15T13:23:59.753000
62,686
62,812
Performing validation on a databound object after the property has been updated
I have a basic form with controls that are databound to an object implementing the INotifyPropertyChanged interface. I would like to add some validation to a couple of properties but dont want to go through implementing IDataErrorInfo for the sake of validating a couple of properties. I have created the functions that ...
I'm not sure exactly what the problem is, are you saying that you can't get the property to set until the control loses focus? If so, you need to set the binding to update OnPropertyChanged instead of OnValidation. Binding to OnPropertyChanged means the binding is updated immediately, while OnValidation only updates th...
Performing validation on a databound object after the property has been updated I have a basic form with controls that are databound to an object implementing the INotifyPropertyChanged interface. I would like to add some validation to a couple of properties but dont want to go through implementing IDataErrorInfo for t...
TITLE: Performing validation on a databound object after the property has been updated QUESTION: I have a basic form with controls that are databound to an object implementing the INotifyPropertyChanged interface. I would like to add some validation to a couple of properties but dont want to go through implementing ID...
[ ".net", "vb.net", "validation", "data-binding" ]
2
1
1,408
2
0
2008-09-15T13:09:28.277000
2008-09-15T13:23:02.440000
62,689
63,041
bitwise indexing in C?
I'm trying to implement a data compression idea I've had, and since I'm imagining running it against a large corpus of test data, I had thought to code it in C (I mostly have experience in scripting languages like Ruby and Tcl.) Looking through the O'Reilly 'cow' books on C, I realize that I can't simply index the bits...
Following on from what Kyle has said, you can use a macro to do the hard work for you. It is possible. To set the nth bit, use OR: x |= (1 << 5); // sets the 6th-from right To clear a bit, use AND: x &= ~(1 << 5); // clears 6th-from-right To flip a bit, use XOR: x ^= (1 << 5); // flips 6th-from-right Or... #define GetB...
bitwise indexing in C? I'm trying to implement a data compression idea I've had, and since I'm imagining running it against a large corpus of test data, I had thought to code it in C (I mostly have experience in scripting languages like Ruby and Tcl.) Looking through the O'Reilly 'cow' books on C, I realize that I can'...
TITLE: bitwise indexing in C? QUESTION: I'm trying to implement a data compression idea I've had, and since I'm imagining running it against a large corpus of test data, I had thought to code it in C (I mostly have experience in scripting languages like Ruby and Tcl.) Looking through the O'Reilly 'cow' books on C, I r...
[ "c", "coding-style", "bit-manipulation" ]
8
12
12,211
9
0
2008-09-15T13:09:32.253000
2008-09-15T13:49:49.550000
62,702
62,894
Good text on order analysis
As a self-taught computer programmer, I'm often at a loss to estimate the O() value for a particular operation. Yeah, I know off the top of my head most of the important ones, like for the major sorts and searches, but I don't know how to calculate one when something new comes along, unless it's blindingly obvious. Is ...
If you really want to learn this topic, then you probably need a standard theory/algorithms textbook. I don't know of any website that can actually teach you complexity analysis ("complexity" or "time complexity" is how you call those O() values; you might also want to google for "analysis of algorithms" or "introducti...
Good text on order analysis As a self-taught computer programmer, I'm often at a loss to estimate the O() value for a particular operation. Yeah, I know off the top of my head most of the important ones, like for the major sorts and searches, but I don't know how to calculate one when something new comes along, unless ...
TITLE: Good text on order analysis QUESTION: As a self-taught computer programmer, I'm often at a loss to estimate the O() value for a particular operation. Yeah, I know off the top of my head most of the important ones, like for the major sorts and searches, but I don't know how to calculate one when something new co...
[ "computer-science" ]
4
2
457
5
0
2008-09-15T13:10:34.777000
2008-09-15T13:31:19.160000
62,716
62,844
SVN externals sub folder changes not showing in view log (tortoise svn)
SVN externals allow you to make an SVN folder appear as if it's at another location. A good use for this is having a common folder shared across all of your projects in SVN. I have a /trunk/common folder in SVN that I share via several different project. Example: Project1: /trunk/project1/depends Project2: /trunk/proje...
This is not possible with the current release of Subversion, other than explicitly calling svn log on the target of the externals directory You can try issueing a feature request at the Apache Subversion website
SVN externals sub folder changes not showing in view log (tortoise svn) SVN externals allow you to make an SVN folder appear as if it's at another location. A good use for this is having a common folder shared across all of your projects in SVN. I have a /trunk/common folder in SVN that I share via several different pr...
TITLE: SVN externals sub folder changes not showing in view log (tortoise svn) QUESTION: SVN externals allow you to make an SVN folder appear as if it's at another location. A good use for this is having a common folder shared across all of your projects in SVN. I have a /trunk/common folder in SVN that I share via se...
[ "svn", "tortoisesvn" ]
11
3
8,439
4
0
2008-09-15T13:12:39.657000
2008-09-15T13:25:55.803000
62,771
62,805
How do I check if a given string is a legal/valid file name under Windows?
I want to include a batch file rename functionality in my application. A user can type a destination filename pattern and (after replacing some wildcards in the pattern) I need to check if it's going to be a legal filename under Windows. I've tried to use regular expression like [a-zA-Z0-9_]+ but it doesn't include man...
You can get a list of invalid characters from Path.GetInvalidPathChars and GetInvalidFileNameChars. UPD: See Steve Cooper's suggestion on how to use these in a regular expression. UPD2: Note that according to the Remarks section in MSDN "The array returned from this method is not guaranteed to contain the complete set ...
How do I check if a given string is a legal/valid file name under Windows? I want to include a batch file rename functionality in my application. A user can type a destination filename pattern and (after replacing some wildcards in the pattern) I need to check if it's going to be a legal filename under Windows. I've tr...
TITLE: How do I check if a given string is a legal/valid file name under Windows? QUESTION: I want to include a batch file rename functionality in my application. A user can type a destination filename pattern and (after replacing some wildcards in the pattern) I need to check if it's going to be a legal filename unde...
[ "c#", "windows", "file", "filesystems" ]
181
101
195,708
27
0
2008-09-15T13:17:29.927000
2008-09-15T13:22:16.357000
62,776
63,470
How to implement the Edit -> Copy menu in c#/.net
How do I implement a Copy menu item in a Windows application written in C#/.NET 2.0? I want to let the user to mark some text in a control and then select the Copy menu item from an Edit menu in the menubar of the application and then do a Paste in for example Excel. What makes my head spin is how to first determine wh...
With the aid of some heavy pair programming a colleague of mine and I came up with this, feel free to refactor. The code is placed in the main form. The copyToolStripMenuItem_Click method handles the Click event on the Copy menu item in the Edit menu. /// /// Recursively traverse a tree of controls to find the control ...
How to implement the Edit -> Copy menu in c#/.net How do I implement a Copy menu item in a Windows application written in C#/.NET 2.0? I want to let the user to mark some text in a control and then select the Copy menu item from an Edit menu in the menubar of the application and then do a Paste in for example Excel. Wh...
TITLE: How to implement the Edit -> Copy menu in c#/.net QUESTION: How do I implement a Copy menu item in a Windows application written in C#/.NET 2.0? I want to let the user to mark some text in a control and then select the Copy menu item from an Edit menu in the menubar of the application and then do a Paste in for...
[ "c#", ".net", "winforms", "user-interface" ]
4
5
3,489
5
0
2008-09-15T13:18:22.077000
2008-09-15T14:36:59.983000
62,784
62,824
Should you design websites that require JavaScript in this day & age?
It's fall of 2008, and I still hear developers say that you should not design a site that requires JavaScript. I understand that you should develop sites that degrade gracefully when JS is not present/on. But at what point do you not include funcitonality that can only be powered by JS? I guess the question comes down ...
5% according to these statistics: http://www.w3schools.com/browsers/browsers_stats.asp
Should you design websites that require JavaScript in this day & age? It's fall of 2008, and I still hear developers say that you should not design a site that requires JavaScript. I understand that you should develop sites that degrade gracefully when JS is not present/on. But at what point do you not include funciton...
TITLE: Should you design websites that require JavaScript in this day & age? QUESTION: It's fall of 2008, and I still hear developers say that you should not design a site that requires JavaScript. I understand that you should develop sites that degrade gracefully when JS is not present/on. But at what point do you no...
[ "javascript" ]
15
1
8,274
30
0
2008-09-15T13:19:32.870000
2008-09-15T13:23:44.950000
62,798
62,911
Applying Aspect Oriented Programming
I've been using some basic AOP style solutions for cross-cutting concerns like security, logging, validation, etc. My solution has revolved around Castle Windsor and DynamicProxy because I can apply everything using a Boo based DSL and keep my code clean of Attributes. I was told at the weekend to have a look at PostSh...
I only looked at castle-windsor for a short time (yet) so I can't comment on that but I did use postsharp. Postsharp works by weaving at compile time. It ads a post-compile step to your build where it modifies your code. The code is compiled as if you just programmed the cross cutting concerns into you code. This is a ...
Applying Aspect Oriented Programming I've been using some basic AOP style solutions for cross-cutting concerns like security, logging, validation, etc. My solution has revolved around Castle Windsor and DynamicProxy because I can apply everything using a Boo based DSL and keep my code clean of Attributes. I was told at...
TITLE: Applying Aspect Oriented Programming QUESTION: I've been using some basic AOP style solutions for cross-cutting concerns like security, logging, validation, etc. My solution has revolved around Castle Windsor and DynamicProxy because I can apply everything using a Boo based DSL and keep my code clean of Attribu...
[ "c#", "castle-windsor", "aop", "castle-dynamicproxy" ]
13
10
2,920
2
0
2008-09-15T13:21:13.630000
2008-09-15T13:34:31.337000
62,804
63,219
How to Convert ISO 8601 Duration to TimeSpan in VB.Net?
Is there a standard library method that converts a string that has duration in the standard ISO 8601 Duration (also used in XSD for its duration type) format into the.NET TimeSpan object? For example, P0DT1H0M0S which represents a duration of one hour, is converted into New TimeSpan(0,1,0,0,0). A Reverse converter does...
This will convert from xs:duration to TimeSpan: System.Xml.XmlConvert.ToTimeSpan("P0DT1H0M0S") See http://msdn.microsoft.com/en-us/library/system.xml.xmlconvert.totimespan.aspx
How to Convert ISO 8601 Duration to TimeSpan in VB.Net? Is there a standard library method that converts a string that has duration in the standard ISO 8601 Duration (also used in XSD for its duration type) format into the.NET TimeSpan object? For example, P0DT1H0M0S which represents a duration of one hour, is converte...
TITLE: How to Convert ISO 8601 Duration to TimeSpan in VB.Net? QUESTION: Is there a standard library method that converts a string that has duration in the standard ISO 8601 Duration (also used in XSD for its duration type) format into the.NET TimeSpan object? For example, P0DT1H0M0S which represents a duration of one...
[ ".net", "xml", "timespan" ]
16
28
12,675
3
0
2008-09-15T13:22:13.300000
2008-09-15T14:09:38.677000
62,810
132,553
Exceptions not passed correctly thru RCF (using Boost.Serialization)
I use RCF with boost.serialization (why use RCF's copy when we already use the original?) It works OK, but when an exception is thrown in the server, it's not passed correctly to the client. Instead, I get an RCF::SerializationException quoting an archive_exception saying "class name too long". When I change the protoc...
Here's a patch given by Jarl at CodeProject: In RcfServer.cpp, before the line where RcfServer::handleSession() is defined (around line 792), insert the following code: void serialize(SerializationProtocolOut & out, const RemoteException & e) { serialize(out, std::auto_ptr (new RemoteException(e))); } And in Marshal.cp...
Exceptions not passed correctly thru RCF (using Boost.Serialization) I use RCF with boost.serialization (why use RCF's copy when we already use the original?) It works OK, but when an exception is thrown in the server, it's not passed correctly to the client. Instead, I get an RCF::SerializationException quoting an arc...
TITLE: Exceptions not passed correctly thru RCF (using Boost.Serialization) QUESTION: I use RCF with boost.serialization (why use RCF's copy when we already use the original?) It works OK, but when an exception is thrown in the server, it's not passed correctly to the client. Instead, I get an RCF::SerializationExcept...
[ "c++", "boost-serialization", "rcf" ]
2
2
727
2
0
2008-09-15T13:22:54.827000
2008-09-25T10:41:52.233000
62,816
62,895
What could be good ways to deploy ASP.Net Web Applications?
We currently deploy web applications by creating a database and running SQL scripts through query analyzer. Then we copy the output from "publish website" and set up that website in IIS. We have seen websetup in visual studio, but that part seems to be thinly documented. For example, we are not clear how to ask the use...
Avoid Visual Studio deployment, and automate as much as possible. Web Deployment Projects and NAnt can be your friends! Briefly, our deployment setup: We use RedGate SQL to script differences between dev and live database. An NAnt build file which calls MSBUILD to build the web deployment project (.wdproj), zips up the...
What could be good ways to deploy ASP.Net Web Applications? We currently deploy web applications by creating a database and running SQL scripts through query analyzer. Then we copy the output from "publish website" and set up that website in IIS. We have seen websetup in visual studio, but that part seems to be thinly ...
TITLE: What could be good ways to deploy ASP.Net Web Applications? QUESTION: We currently deploy web applications by creating a database and running SQL scripts through query analyzer. Then we copy the output from "publish website" and set up that website in IIS. We have seen websetup in visual studio, but that part s...
[ "asp.net", "sql-server", "deployment", "web-applications", "installation" ]
6
7
2,697
3
0
2008-09-15T13:23:11.783000
2008-09-15T13:31:52.730000
62,868
62,919
Get mac address for remote computer under NT4 in C
Is it possible to determine the MAC address of the originator of a remote connection under Windows NT 4? The remote PC opens a socket connection into my application and I can get the IP address. However I need to determine the MAC address from the information available from the socket such as the IP address of the remo...
Try GetIpNetTable. This function is documented as supported as of NT 4.0 SP4.
Get mac address for remote computer under NT4 in C Is it possible to determine the MAC address of the originator of a remote connection under Windows NT 4? The remote PC opens a socket connection into my application and I can get the IP address. However I need to determine the MAC address from the information available...
TITLE: Get mac address for remote computer under NT4 in C QUESTION: Is it possible to determine the MAC address of the originator of a remote connection under Windows NT 4? The remote PC opens a socket connection into my application and I can get the IP address. However I need to determine the MAC address from the inf...
[ "c", "mac-address", "nt4" ]
2
1
1,296
2
0
2008-09-15T13:27:37.623000
2008-09-15T13:35:42.347000
62,876
62,968
What's the best way to save and retrieve binary files with Oracle 10g?
I'm about to implement a feature in our application that allows the user to 'upload' a PDF or Microsoft PowerPoint document, which the application will then make available to other users in a viewer (so they don't get to 'download' it in the 'Save as..' sense). I already know how to save and retrieve arbitrary binary i...
Couple of options: You could put the BLOB column in its own tablespace, with its own storage characteristics; you could store the BLOBs in their own table, linked to the other table by an ID column. In either case as you suggested you could define the column as a BFILE which means the actual file is stored externally f...
What's the best way to save and retrieve binary files with Oracle 10g? I'm about to implement a feature in our application that allows the user to 'upload' a PDF or Microsoft PowerPoint document, which the application will then make available to other users in a viewer (so they don't get to 'download' it in the 'Save a...
TITLE: What's the best way to save and retrieve binary files with Oracle 10g? QUESTION: I'm about to implement a feature in our application that allows the user to 'upload' a PDF or Microsoft PowerPoint document, which the application will then make available to other users in a viewer (so they don't get to 'download'...
[ ".net", "oracle", "binaryfiles" ]
1
6
4,801
6
0
2008-09-15T13:28:54.377000
2008-09-15T13:42:06.293000
62,892
62,986
Using Actionscript 3 to connect to a database
I'm looking for advice on how to dynamically create content in flash based on a database. Initially I was thinking that we would export the database to an XML file and use the built in Actionscript XML parser to take care of that, however the size of the XML file may prove prohibitive. I have read about using an interm...
Unless you're running your Actionscript on the server side (I doubt that), connecting to a database directly wouldn't be very smart at all. To connect to a database from client side Actionscript you'd have to open your server to accept database connections from everyone, and you'd have to store access data in your swf ...
Using Actionscript 3 to connect to a database I'm looking for advice on how to dynamically create content in flash based on a database. Initially I was thinking that we would export the database to an XML file and use the built in Actionscript XML parser to take care of that, however the size of the XML file may prove ...
TITLE: Using Actionscript 3 to connect to a database QUESTION: I'm looking for advice on how to dynamically create content in flash based on a database. Initially I was thinking that we would export the database to an XML file and use the built in Actionscript XML parser to take care of that, however the size of the X...
[ "flash", "actionscript-3", "actionscript", "database-connection" ]
2
4
32,700
7
0
2008-09-15T13:31:05.430000
2008-09-15T13:44:18.067000
62,906
62,950
Predefined Dialog templates in VB.NET?
In VB.NET is there a library of template dialogs I can use? It's easy to create a custom dialog and inherit from that, but it seems like there would be some templates for that sort of thing. I just need something simple like Save/Cancel, Yes/No, etc. Edit: MessageBox is not quite enough, because I want to add drop-down...
Why not create your own template? I've done that with several types of forms, not just dialogs. It is a great way to give yourself a jump-start. Create your basic dialog, keeping it as generic as possible, then save it as a template. Here is an article that will help you: http://www.builderau.com.au/program/dotnet/soa/...
Predefined Dialog templates in VB.NET? In VB.NET is there a library of template dialogs I can use? It's easy to create a custom dialog and inherit from that, but it seems like there would be some templates for that sort of thing. I just need something simple like Save/Cancel, Yes/No, etc. Edit: MessageBox is not quite ...
TITLE: Predefined Dialog templates in VB.NET? QUESTION: In VB.NET is there a library of template dialogs I can use? It's easy to create a custom dialog and inherit from that, but it seems like there would be some templates for that sort of thing. I just need something simple like Save/Cancel, Yes/No, etc. Edit: Messag...
[ "vb.net", "templates", "dialog" ]
0
1
1,445
4
0
2008-09-15T13:33:35.283000
2008-09-15T13:40:15.907000
62,916
64,517
How do I get logout to work on RubyCAS-Server?
I have installed and setup RubyCAS-Server and RubyCAS-Client on my machine. Login works perfectly but when I try to logout I get this error message from the RubyCAS-Server: Camping Problem! CASServer::Controllers::Logout.GET ActiveRecord::StatementInvalid Mysql::Error: Unknown column 'username' in 'where clause': SEL...
Seems there's a bug in the 0.6 version of the gem (possibly coinciding with change made to finders in Rails 2.1) as detailed in this bug ticket. In the meantime, you could try installing from the source tree.
How do I get logout to work on RubyCAS-Server? I have installed and setup RubyCAS-Server and RubyCAS-Client on my machine. Login works perfectly but when I try to logout I get this error message from the RubyCAS-Server: Camping Problem! CASServer::Controllers::Logout.GET ActiveRecord::StatementInvalid Mysql::Error: U...
TITLE: How do I get logout to work on RubyCAS-Server? QUESTION: I have installed and setup RubyCAS-Server and RubyCAS-Client on my machine. Login works perfectly but when I try to logout I get this error message from the RubyCAS-Server: Camping Problem! CASServer::Controllers::Logout.GET ActiveRecord::StatementInval...
[ "ruby", "single-sign-on", "cas" ]
0
0
870
2
0
2008-09-15T13:35:31.350000
2008-09-15T16:38:36.277000
62,918
74,675
Using GCC from within VS 2005(8) IDE
Is there a way to utilise the GCC compiler whilst still being able to develop via the Visual Studio IDE? Our project is cross-platform, and I quite frequently get into trouble from my colleague because I'm checking in code that's not standards compliant (this can be attributed to the VS compiler!). I'd still like to be...
What I am about to suggest would still require a makefile, so I am partially repeating the advice from an earlier reply. Or, as was also mentioned earlier, maybe you already have a makefile, in which case you will have even fewer steps in order to accomplish what I am about to describe. Once you know your specific wind...
Using GCC from within VS 2005(8) IDE Is there a way to utilise the GCC compiler whilst still being able to develop via the Visual Studio IDE? Our project is cross-platform, and I quite frequently get into trouble from my colleague because I'm checking in code that's not standards compliant (this can be attributed to th...
TITLE: Using GCC from within VS 2005(8) IDE QUESTION: Is there a way to utilise the GCC compiler whilst still being able to develop via the Visual Studio IDE? Our project is cross-platform, and I quite frequently get into trouble from my colleague because I'm checking in code that's not standards compliant (this can b...
[ "c++", "visual-studio", "visual-c++", "gcc", "cross-platform" ]
10
5
3,995
7
0
2008-09-15T13:35:39.600000
2008-09-16T17:13:42.063000
62,921
62,980
Process vs Threads
How to decide whether to use threads or create separate process altogether in your application to achieve parallelism.
Threads are more light weight, and for the making several "workers" just to utilize all availabe CPUs or cores, you're better of with threads. When you need the workers to be better isolated and more robust, like with most servers, go with sockets. When one thread crashes badly, it usually takes down the entire process...
Process vs Threads How to decide whether to use threads or create separate process altogether in your application to achieve parallelism.
TITLE: Process vs Threads QUESTION: How to decide whether to use threads or create separate process altogether in your application to achieve parallelism. ANSWER: Threads are more light weight, and for the making several "workers" just to utilize all availabe CPUs or cores, you're better of with threads. When you nee...
[ "optimization", "operating-system" ]
24
15
11,239
6
0
2008-09-15T13:35:54.920000
2008-09-15T13:43:41.173000
62,936
62,972
What does the number in parentheses shown after Unix command names in manpages mean?
For example: man(1), find(3), updatedb(2)? What do the numbers in parentheses (Brit. "brackets") mean?
It's the section that the man page for the command is assigned to. These are split as General commands System calls C library functions Special files (usually devices, those found in /dev) and drivers File formats and conventions Games and screensavers Miscellanea System administration commands and daemons Original des...
What does the number in parentheses shown after Unix command names in manpages mean? For example: man(1), find(3), updatedb(2)? What do the numbers in parentheses (Brit. "brackets") mean?
TITLE: What does the number in parentheses shown after Unix command names in manpages mean? QUESTION: For example: man(1), find(3), updatedb(2)? What do the numbers in parentheses (Brit. "brackets") mean? ANSWER: It's the section that the man page for the command is assigned to. These are split as General commands Sy...
[ "linux", "unix", "command-line", "manpage" ]
666
631
59,770
7
0
2008-09-15T13:37:47.130000
2008-09-15T13:42:31.707000
62,946
63,781
Misra standard for embedded software
I have a requirement to make a large amount of code MISRA compliant. First question: Can somebody to give an estimation for passing well written code for embedded system based on experience. I understand that "well written" is poorly defined and vague so i ask for raw estimation. Second question: Any recommendation for...
I also highly recommend PC-Lint. If you happen to be compiling your code with Visual Studio I recommend a plug-in 'Visual Lint' from Riverblade. If you cannot compile the code in Visual Studio, you can still run PC-Lint from the command line to good effect. Some embedded system compilers provide MISRA compliance testin...
Misra standard for embedded software I have a requirement to make a large amount of code MISRA compliant. First question: Can somebody to give an estimation for passing well written code for embedded system based on experience. I understand that "well written" is poorly defined and vague so i ask for raw estimation. Se...
TITLE: Misra standard for embedded software QUESTION: I have a requirement to make a large amount of code MISRA compliant. First question: Can somebody to give an estimation for passing well written code for embedded system based on experience. I understand that "well written" is poorly defined and vague so i ask for ...
[ "c", "code-analysis", "embedded", "misra" ]
13
12
10,758
6
0
2008-09-15T13:39:28.373000
2008-09-15T15:11:25.610000
62,951
64,529
Implementing CollectionConstraints across NUnit versions
We've implemented a CollectionConstraint for Nunit in version 2.4.3 in C#. Some of our developers have already upgraded to version 2.4.7 though, and they get project creation errors when compiling. The error is doMatch: no suitable method found to override Any advice on how to get this constraint so it compiles version...
Unfortunately the constraint API changed in incompatible ways for custom constraints in 2.4.6. NUnit 2.4.5 and earlier used an IConstraint interface and in 2.4.6 it was changed to a Constraint abstract base class. There was an optional Constraint base class in 2.4.5 and earlier, but the class is not consistent between ...
Implementing CollectionConstraints across NUnit versions We've implemented a CollectionConstraint for Nunit in version 2.4.3 in C#. Some of our developers have already upgraded to version 2.4.7 though, and they get project creation errors when compiling. The error is doMatch: no suitable method found to override Any ad...
TITLE: Implementing CollectionConstraints across NUnit versions QUESTION: We've implemented a CollectionConstraint for Nunit in version 2.4.3 in C#. Some of our developers have already upgraded to version 2.4.7 though, and they get project creation errors when compiling. The error is doMatch: no suitable method found ...
[ "c#", "nunit" ]
0
2
146
1
0
2008-09-15T13:40:21.727000
2008-09-15T16:40:14.557000
62,963
67,999
How do you extend Linq to SQL?
Last year, Scott Guthrie stated “You can actually override the raw SQL that LINQ to SQL uses if you want absolute control over the SQL executed”, but I can’t find documentation describing an extensibility method. I would like to modify the following LINQ to SQL query: using (NorthwindContext northwind = new NorthwindCo...
The ability to change the underlying provider and thus modify the SQL did not make the final cut in LINQ to SQL.
How do you extend Linq to SQL? Last year, Scott Guthrie stated “You can actually override the raw SQL that LINQ to SQL uses if you want absolute control over the SQL executed”, but I can’t find documentation describing an extensibility method. I would like to modify the following LINQ to SQL query: using (NorthwindCont...
TITLE: How do you extend Linq to SQL? QUESTION: Last year, Scott Guthrie stated “You can actually override the raw SQL that LINQ to SQL uses if you want absolute control over the SQL executed”, but I can’t find documentation describing an extensibility method. I would like to modify the following LINQ to SQL query: us...
[ "linq", "linq-to-sql" ]
14
11
5,888
2
0
2008-09-15T13:41:40.257000
2008-09-15T23:42:05.320000
62,965
63,520
ASP.NET WebService Returns Gibberish Characters When Throwing Exceptions
I have a web service (ASMX) and in it, a web method that does some work and throws an exception if the input wasn't valid. [ScriptMethod] [WebMethod] public string MyWebMethod(string input) { string l_returnVal; if (!ValidInput(input)) { string l_errMsg = System.Web.HttpUtility.HtmlEncode(GetErrorMessage()); throw new...
Are you sure setting the "fileEncoding" is what you want, and not "responseEncoding"? Setting the fileEncoding determines how the web server will try to read physical.asmx/.aspx files from disk when it can't determine the encoding automatically. So, settings this to "utf-8" means you must save all your.asmx/.aspx files...
ASP.NET WebService Returns Gibberish Characters When Throwing Exceptions I have a web service (ASMX) and in it, a web method that does some work and throws an exception if the input wasn't valid. [ScriptMethod] [WebMethod] public string MyWebMethod(string input) { string l_returnVal; if (!ValidInput(input)) { string l...
TITLE: ASP.NET WebService Returns Gibberish Characters When Throwing Exceptions QUESTION: I have a web service (ASMX) and in it, a web method that does some work and throws an exception if the input wasn't valid. [ScriptMethod] [WebMethod] public string MyWebMethod(string input) { string l_returnVal; if (!ValidInput(...
[ "asp.net", "ajax", "web-services", "exception", "encoding" ]
1
1
3,454
1
0
2008-09-15T13:41:56.870000
2008-09-15T14:41:42.860000
62,977
70,751
How to write a C++ FireFox 3 plugin (not extension) on Windows?
Could someone write-up a step by step guide to developing a C++ based plugin for FireFox on Windows? The links and examples on http://www.mozilla.org/projects/plugins/ are all old and inaccurate - the "NEW" link was added to the page in 2004. The example could be anything, but I was thinking a plugin that lets JavaScri...
See also http://developer.mozilla.org/en/Plugins. And yes, NPAPI plugins should work in Google Chrome as well. [edit 2015: Chrome removes support for NPAPI soon http://blog.chromium.org/2014/11/the-final-countdown-for-npapi.html ]
How to write a C++ FireFox 3 plugin (not extension) on Windows? Could someone write-up a step by step guide to developing a C++ based plugin for FireFox on Windows? The links and examples on http://www.mozilla.org/projects/plugins/ are all old and inaccurate - the "NEW" link was added to the page in 2004. The example c...
TITLE: How to write a C++ FireFox 3 plugin (not extension) on Windows? QUESTION: Could someone write-up a step by step guide to developing a C++ based plugin for FireFox on Windows? The links and examples on http://www.mozilla.org/projects/plugins/ are all old and inaccurate - the "NEW" link was added to the page in 2...
[ "c++", "windows", "firefox", "plugins" ]
9
5
18,088
4
0
2008-09-15T13:43:15.590000
2008-09-16T09:36:00.543000
62,987
63,725
Best way of constructing dynamic sql queries in C#/.NET3.5?
A project I'm working on at the moment involves refactoring a C# Com Object which serves as a database access layer to some Sql 2005 databases. The author of the existent code has built all the sql queries manually using a string and many if-statements to construct the fairly complex sql statement (~10 joins, >10 sub s...
I used C# and Linq to do something similar to get log entries filtered on user input (see Conditional Linq Queries ): IQueryable matches = m_Locator.Logs; // Users filter if (usersFilter) matches = matches.Where(l => l.UserName == comboBoxUsers.Text); // Severity filter if (severityFilter) matches = matches.Where(l =...
Best way of constructing dynamic sql queries in C#/.NET3.5? A project I'm working on at the moment involves refactoring a C# Com Object which serves as a database access layer to some Sql 2005 databases. The author of the existent code has built all the sql queries manually using a string and many if-statements to cons...
TITLE: Best way of constructing dynamic sql queries in C#/.NET3.5? QUESTION: A project I'm working on at the moment involves refactoring a C# Com Object which serves as a database access layer to some Sql 2005 databases. The author of the existent code has built all the sql queries manually using a string and many if-...
[ "c#", "sql", "sql-server", "linq", ".net-3.5" ]
8
9
14,005
12
0
2008-09-15T13:44:19.173000
2008-09-15T15:05:20.477000
63,008
119,735
C# SQL Restore database to default data location
I'm writing a C# application which downloads a compressed database backup via FTP. The application then needs to extract the backup and restore it to the default database location. I will not know which version of SQL Server will be installed on the machine where the application runs. Therefore, I need to find the defa...
What I discovered is that Microsoft.SqlServer.Management.Smo.Server(ServerName).Settings.DefaultFile only returns non-null when there is no path explicitly defined. As soon as you specify a path which is not the default, then this function returns that path correctly. So, a simple workaround was to check whether this f...
C# SQL Restore database to default data location I'm writing a C# application which downloads a compressed database backup via FTP. The application then needs to extract the backup and restore it to the default database location. I will not know which version of SQL Server will be installed on the machine where the app...
TITLE: C# SQL Restore database to default data location QUESTION: I'm writing a C# application which downloads a compressed database backup via FTP. The application then needs to extract the backup and restore it to the default database location. I will not know which version of SQL Server will be installed on the mac...
[ "c#", "sql" ]
6
9
7,205
3
0
2008-09-15T13:46:42.680000
2008-09-23T08:02:50.667000
63,011
63,039
Endless loop in JavaScript that does not trigger warning by browser
I'm displaying a set of images as an overlay using Google Maps. Displaying these images should be in an endless loop but most most browsers detect this, and display a warning. Is there a way to make a endless loop in JavaScript so that it isn't stopped or warned against by the browser?
Try setInterval or setTimeout. Here is an example: (show = (o) => setTimeout(() => { console.log(o) show(++o) }, 1000))(1);.as-console-wrapper { max-height: 100%!important; top: 0; }
Endless loop in JavaScript that does not trigger warning by browser I'm displaying a set of images as an overlay using Google Maps. Displaying these images should be in an endless loop but most most browsers detect this, and display a warning. Is there a way to make a endless loop in JavaScript so that it isn't stopped...
TITLE: Endless loop in JavaScript that does not trigger warning by browser QUESTION: I'm displaying a set of images as an overlay using Google Maps. Displaying these images should be in an endless loop but most most browsers detect this, and display a warning. Is there a way to make a endless loop in JavaScript so tha...
[ "javascript", "loops" ]
1
8
5,591
8
0
2008-09-15T13:46:50.400000
2008-09-15T13:49:30.533000
63,043
472,236
WCF Datacontract free serialization (3.5 SP1)
Has anybody got this to actually work? Documentation is non existent on how to enable this feature and I get missing attribute exceptions despite having a 3.5 SP1 project.
I found that it doesn't work with internal/private types, but making my type public it worked fine. This means no anonymous types either:( Using reflector I found the method ClassDataContract.IsNonAttributedTypeValidForSerialization(Type) that seems to make the decision. It's the last line that seems to be the killer, ...
WCF Datacontract free serialization (3.5 SP1) Has anybody got this to actually work? Documentation is non existent on how to enable this feature and I get missing attribute exceptions despite having a 3.5 SP1 project.
TITLE: WCF Datacontract free serialization (3.5 SP1) QUESTION: Has anybody got this to actually work? Documentation is non existent on how to enable this feature and I get missing attribute exceptions despite having a 3.5 SP1 project. ANSWER: I found that it doesn't work with internal/private types, but making my typ...
[ ".net", "wcf", "serialization" ]
3
1
2,013
6
0
2008-09-15T13:49:51.127000
2009-01-23T08:07:12.893000
63,086
63,357
Is there a way around coding in Python without the tab, indent & whitespace criteria?
I want to start using Python for small projects but the fact that a misplaced tab or indent can throw a compile error is really getting on my nerves. Is there some type of setting to turn this off? I'm currently using NotePad++. Is there maybe an IDE that would take care of the tabs and indenting?
I'm currently using NotePad++. Is there maybe an IDE that would take care of the tabs and indenting? I liked pydev extensions of eclipse for that.
Is there a way around coding in Python without the tab, indent & whitespace criteria? I want to start using Python for small projects but the fact that a misplaced tab or indent can throw a compile error is really getting on my nerves. Is there some type of setting to turn this off? I'm currently using NotePad++. Is th...
TITLE: Is there a way around coding in Python without the tab, indent & whitespace criteria? QUESTION: I want to start using Python for small projects but the fact that a misplaced tab or indent can throw a compile error is really getting on my nerves. Is there some type of setting to turn this off? I'm currently usin...
[ "python" ]
12
4
19,858
23
0
2008-09-15T13:55:14.483000
2008-09-15T14:22:30.457000
63,090
63,566
Surrogate vs. natural/business keys
Here we go again, the old argument still arises... Would we better have a business key as a primary key, or would we rather have a surrogate id (i.e. an SQL Server identity) with a unique constraint on the business key field? Please, provide examples or proof to support your theory.
Both. Have your cake and eat it. Remember there is nothing special about a primary key, except that it is labelled as such. It is nothing more than a NOT NULL UNIQUE constraint, and a table can have more than one. If you use a surrogate key, you still want a business key to ensure uniqueness according to the business r...
Surrogate vs. natural/business keys Here we go again, the old argument still arises... Would we better have a business key as a primary key, or would we rather have a surrogate id (i.e. an SQL Server identity) with a unique constraint on the business key field? Please, provide examples or proof to support your theory.
TITLE: Surrogate vs. natural/business keys QUESTION: Here we go again, the old argument still arises... Would we better have a business key as a primary key, or would we rather have a surrogate id (i.e. an SQL Server identity) with a unique constraint on the business key field? Please, provide examples or proof to sup...
[ "database", "database-design", "primary-key", "key" ]
195
116
87,959
19
0
2008-09-15T13:55:44.687000
2008-09-15T14:48:15.650000
63,104
63,341
Smarter Vim recovery?
When a previous Vim session crashed, you are greeted with the "Swap file... already exists!" for each and every file that was open in the previous session. Can you make this Vim recovery prompt smarter? (Without switching off recovery!) Specifically, I'm thinking of: If the swapped version does not contain unsaved chan...
I have vim store my swap files in a single local directory, by having this in my.vimrc: set directory=~/.vim/swap,. Among other benefits, this makes the swap files easy to find all at once. Now when my laptop loses power or whatever and I start back up with a bunch of swap files laying around, I just run my cleanswap s...
Smarter Vim recovery? When a previous Vim session crashed, you are greeted with the "Swap file... already exists!" for each and every file that was open in the previous session. Can you make this Vim recovery prompt smarter? (Without switching off recovery!) Specifically, I'm thinking of: If the swapped version does no...
TITLE: Smarter Vim recovery? QUESTION: When a previous Vim session crashed, you are greeted with the "Swap file... already exists!" for each and every file that was open in the previous session. Can you make this Vim recovery prompt smarter? (Without switching off recovery!) Specifically, I'm thinking of: If the swapp...
[ "vim", "recovery" ]
52
38
16,648
7
0
2008-09-15T13:57:47.113000
2008-09-15T14:20:29.417000
63,130
63,228
Add Custom TextboxCell to a DataGridView control that contains a button to open the FileDialog
I would like to add a DataGridViewTextBoxCell cell to a DataGridViewCell control, but as well as being able to type in the text cell as normal it must also contain a '...' button that once clicks brings up the OpenFileDialog window to allow the user to select a file. Once selected, the text cell will be populated with ...
This MSDN article explains how to add a custom control to a DataGridView. You should be able to make a UserControl that has a textbox and button on it and embed that in the DataGridView.
Add Custom TextboxCell to a DataGridView control that contains a button to open the FileDialog I would like to add a DataGridViewTextBoxCell cell to a DataGridViewCell control, but as well as being able to type in the text cell as normal it must also contain a '...' button that once clicks brings up the OpenFileDialog ...
TITLE: Add Custom TextboxCell to a DataGridView control that contains a button to open the FileDialog QUESTION: I would like to add a DataGridViewTextBoxCell cell to a DataGridViewCell control, but as well as being able to type in the text cell as normal it must also contain a '...' button that once clicks brings up t...
[ ".net", ".net-2.0" ]
1
1
3,649
2
0
2008-09-15T14:00:49.960000
2008-09-15T14:10:27.333000
63,146
63,182
How to handle file uploads to a dedicated image server?
I got a webserver with a running application. There's a webpage with a form: some text data and a file upload field. Now, what I would like to have is it working like this: The file is sent to the dedicated server, diffrent then the one application is running on. The server should return some kind of path (or anything ...
POST to dedicated server, server stores image and calls back to web server through a web service or other to give it any info required.
How to handle file uploads to a dedicated image server? I got a webserver with a running application. There's a webpage with a form: some text data and a file upload field. Now, what I would like to have is it working like this: The file is sent to the dedicated server, diffrent then the one application is running on. ...
TITLE: How to handle file uploads to a dedicated image server? QUESTION: I got a webserver with a running application. There's a webpage with a form: some text data and a file upload field. Now, what I would like to have is it working like this: The file is sent to the dedicated server, diffrent then the one applicati...
[ "webserver", "file-upload" ]
2
0
1,321
2
0
2008-09-15T14:02:18.243000
2008-09-15T14:05:59.030000
63,147
63,485
User Interface Controls for Win32
I see many user interface control libraries for.NET, but where can I get similar stuff for win32 using simply C/C++? Things like prettier buttons, dials, listviews, graphs, etc. Seems every Win32 programmers' right of passage is to end up writing his own collection.:/ No MFC controls please. I only do pure C/C++. And w...
I've used Trolltech's Qt framework in the past and had great success with it: In addition, it's also cross-platform, so in theory you can target Win, Mac, & Linux (provided you don't do anything platform-specific in the rest of your code, of course;) ) Edit: I notice that you're targeting Windows Mobile; that definitel...
User Interface Controls for Win32 I see many user interface control libraries for.NET, but where can I get similar stuff for win32 using simply C/C++? Things like prettier buttons, dials, listviews, graphs, etc. Seems every Win32 programmers' right of passage is to end up writing his own collection.:/ No MFC controls p...
TITLE: User Interface Controls for Win32 QUESTION: I see many user interface control libraries for.NET, but where can I get similar stuff for win32 using simply C/C++? Things like prettier buttons, dials, listviews, graphs, etc. Seems every Win32 programmers' right of passage is to end up writing his own collection.:/...
[ "c++", "winapi", "user-interface" ]
8
4
3,213
7
0
2008-09-15T14:02:20.940000
2008-09-15T14:38:38.343000
63,150
63,258
What's the best way to build a string of delimited items in Java?
While working in a Java app, I recently needed to assemble a comma-delimited list of values to pass to another web service without knowing how many elements there would be in advance. The best I could come up with off the top of my head was something like this: public String appendWithDelimiter( String original, String...
Pre Java 8: Apache's commons lang is your friend here - it provides a join method very similar to the one you refer to in Ruby: StringUtils.join(java.lang.Iterable,char) Java 8: Java 8 provides joining out of the box via StringJoiner and String.join(). The snippets below show how you can use them: StringJoiner StringJo...
What's the best way to build a string of delimited items in Java? While working in a Java app, I recently needed to assemble a comma-delimited list of values to pass to another web service without knowing how many elements there would be in advance. The best I could come up with off the top of my head was something lik...
TITLE: What's the best way to build a string of delimited items in Java? QUESTION: While working in a Java app, I recently needed to assemble a comma-delimited list of values to pass to another web service without knowing how many elements there would be in advance. The best I could come up with off the top of my head...
[ "java", "string", "algorithm" ]
374
645
370,877
37
0
2008-09-15T14:02:43.687000
2008-09-15T14:13:34.720000
63,157
107,669
Hooking into the TCP Stack in C
It's not just a capture I'm looking to do here. I want to first capture the packet, then in real time, check the payload for specific data, remove it, inject a signature and reinject the packet into the stack to be sent on as before. I had a read of the ipfw divert sockets using IPFW and it looks very promising. What a...
I was going to echo other responses that have recommended iptables (depending on the complexity of both the patterns that you're trying to match and the packet modifications that you want to make) - until I took notice of the BSD tag on the question. As Stephen Pellicer has already mentioned, libpcap is a good option f...
Hooking into the TCP Stack in C It's not just a capture I'm looking to do here. I want to first capture the packet, then in real time, check the payload for specific data, remove it, inject a signature and reinject the packet into the stack to be sent on as before. I had a read of the ipfw divert sockets using IPFW and...
TITLE: Hooking into the TCP Stack in C QUESTION: It's not just a capture I'm looking to do here. I want to first capture the packet, then in real time, check the payload for specific data, remove it, inject a signature and reinject the packet into the stack to be sent on as before. I had a read of the ipfw divert sock...
[ "c", "tcp", "stack", "freebsd", "bsd" ]
4
0
2,625
4
0
2008-09-15T14:03:59.797000
2008-09-20T08:52:43.130000
63,181
64,394
Editing XML in Flex using e4x
In Flex, I have an xml document such as the following: var xml:XML = value1 value2 value3 At runtime, I want to create a TextInput control for each node under root, and have the values bound to the values in the XML. As far as I can tell I can't use BindingUtils to bind to e4x nodes at runtime (please tell me if I'm wr...
The closure only captures a reference to the variable, not its current value. Since local variables are Function-scoped (not block-scoped) each iteration through the loop creates a closure that captures a reference to the same variable. You could extract the TextInput creation code into a separate function, which would...
Editing XML in Flex using e4x In Flex, I have an xml document such as the following: var xml:XML = value1 value2 value3 At runtime, I want to create a TextInput control for each node under root, and have the values bound to the values in the XML. As far as I can tell I can't use BindingUtils to bind to e4x nodes at run...
TITLE: Editing XML in Flex using e4x QUESTION: In Flex, I have an xml document such as the following: var xml:XML = value1 value2 value3 At runtime, I want to create a TextInput control for each node under root, and have the values bound to the values in the XML. As far as I can tell I can't use BindingUtils to bind t...
[ "javascript", "apache-flex", "e4x" ]
1
2
3,673
2
0
2008-09-15T14:05:47.080000
2008-09-15T16:24:07.510000
63,206
63,227
Find all available JREs on Mac OS X from Java application installer
If Java application requires certain JRE version then how can I check its availability on Mac OS X during installation?
It should be as simple as looking at /System/Library/Frameworks/JavaVM.framework/Versions/ E.g. from my machine: manoa:~ stu$ ll /System/Library/Frameworks/JavaVM.framework/Versions/ total 56 774077 lrwxr-xr-x 1 root wheel 5 Jul 23 15:31 1.3 -> 1.3.1 167151 drwxr-xr-x 3 root wheel 102 Jan 14 2008 1.3.1 167793 lrwxr-xr-...
Find all available JREs on Mac OS X from Java application installer If Java application requires certain JRE version then how can I check its availability on Mac OS X during installation?
TITLE: Find all available JREs on Mac OS X from Java application installer QUESTION: If Java application requires certain JRE version then how can I check its availability on Mac OS X during installation? ANSWER: It should be as simple as looking at /System/Library/Frameworks/JavaVM.framework/Versions/ E.g. from my m...
[ "java", "macos", "installation" ]
4
1
880
2
0
2008-09-15T14:08:20.880000
2008-09-15T14:10:24.090000
63,232
64,077
How to make Flex RIA contents accessible to search engines like Google?
How would you make the contents of Flex RIA applications accessible to Google, so that Google can index the content and shows links to the right items in your Flex RIA. Consider a online shop, created in Flex, where the offered items shall be indexed by Google. Then a link on Google should open the corresponding produc...
Currently the best technique for making an RIA indexable by search engines is called progressive enhancement (or graceful degradation, depending on which way you see it). Basically you create a simple HTML version of the application using the same data as the application loads. This version should be dynamically genera...
How to make Flex RIA contents accessible to search engines like Google? How would you make the contents of Flex RIA applications accessible to Google, so that Google can index the content and shows links to the right items in your Flex RIA. Consider a online shop, created in Flex, where the offered items shall be index...
TITLE: How to make Flex RIA contents accessible to search engines like Google? QUESTION: How would you make the contents of Flex RIA applications accessible to Google, so that Google can index the content and shows links to the right items in your Flex RIA. Consider a online shop, created in Flex, where the offered it...
[ "apache-flex", "ria", "google-search", "googlebot" ]
3
5
1,483
2
0
2008-09-15T14:10:47.737000
2008-09-15T15:43:58.373000
63,257
63,280
Does generated code need to be human readable?
I'm working on a tool that will generate the source code for an interface and a couple classes implementing that interface. My output isn't particularly complicated, so it's not going to be hard to make the output conform to our normal code formatting standards. But this got me thinking: how human-readable does auto-ge...
I think it's just as important for generated code to be readable and follow normal coding styles. At some point, someone is either going to need to debug the code or otherwise see what is happening "behind the scenes".
Does generated code need to be human readable? I'm working on a tool that will generate the source code for an interface and a couple classes implementing that interface. My output isn't particularly complicated, so it's not going to be hard to make the output conform to our normal code formatting standards. But this g...
TITLE: Does generated code need to be human readable? QUESTION: I'm working on a tool that will generate the source code for an interface and a couple classes implementing that interface. My output isn't particularly complicated, so it's not going to be hard to make the output conform to our normal code formatting sta...
[ "language-agnostic", "code-generation", "readability" ]
7
17
1,421
22
0
2008-09-15T14:13:33.003000
2008-09-15T14:15:53.590000
63,291
63,772
Select columns with NULL values only
How do I select all the columns in a table that only contain NULL values for all the rows? I'm using MS SQL Server 2005. I'm trying to find out which columns are not used in the table so I can delete them.
Here is the sql 2005 or later version: Replace ADDR_Address with your tablename. declare @col varchar(255), @cmd varchar(max) DECLARE getinfo cursor for SELECT c.name FROM sys.tables t JOIN sys.columns c ON t.Object_ID = c.Object_ID WHERE t.Name = 'ADDR_Address' OPEN getinfo FETCH NEXT FROM getinfo into @col WHILE ...
Select columns with NULL values only How do I select all the columns in a table that only contain NULL values for all the rows? I'm using MS SQL Server 2005. I'm trying to find out which columns are not used in the table so I can delete them.
TITLE: Select columns with NULL values only QUESTION: How do I select all the columns in a table that only contain NULL values for all the rows? I'm using MS SQL Server 2005. I'm trying to find out which columns are not used in the table so I can delete them. ANSWER: Here is the sql 2005 or later version: Replace ADD...
[ "sql-server" ]
69
89
367,459
16
0
2008-09-15T14:16:41.390000
2008-09-15T15:10:20.293000
63,345
63,989
When did I last talk to my Domain Server?
How can my app get a valid "last time connected to domain" timestamp from Windows, even when the app is running offline? Background: I am writing an application that is run on multiple client machines throughout my company. All of these client machines are on one of the AD domains implemented by my company. This applic...
I don't believe this value is stored on the client machine. It's stored in Active Directory, and you can get a list of inactive machines using the Dsquery tool. The best option is to have your program do a simple test such as connection to a DC, and then store the timestamp of that action.
When did I last talk to my Domain Server? How can my app get a valid "last time connected to domain" timestamp from Windows, even when the app is running offline? Background: I am writing an application that is run on multiple client machines throughout my company. All of these client machines are on one of the AD doma...
TITLE: When did I last talk to my Domain Server? QUESTION: How can my app get a valid "last time connected to domain" timestamp from Windows, even when the app is running offline? Background: I am writing an application that is run on multiple client machines throughout my company. All of these client machines are on ...
[ "windows", "active-directory" ]
1
1
603
2
0
2008-09-15T14:21:07.650000
2008-09-15T15:33:29.863000
63,378
63,416
Screen + vim causes shift-enter to insert 'M' and a newline
When running a vim instance in gnu screen hitting shift enter in insert mode adds an 'M' and then a newline, rather than just a newline. Does anybody know what the problem might be, or where to look? Relevant system info: Ubuntu 8.04.1 Screen version 4.00.03 (FAU) 23-Oct-06 VIM - Vi IMproved 7.1 (2007 May 12, compiled ...
Missing info from your question: Where do you run screen and see this issue? Some terminal app (KTerminal, Gnome terminal, virtual console etc) or remote session (eg putty, ssh from another computer) do a “echo $TERM” and tell us its output do a “cat -v”, press Shift-Enter, then Enter, then Ctrl - D and then tell us wh...
Screen + vim causes shift-enter to insert 'M' and a newline When running a vim instance in gnu screen hitting shift enter in insert mode adds an 'M' and then a newline, rather than just a newline. Does anybody know what the problem might be, or where to look? Relevant system info: Ubuntu 8.04.1 Screen version 4.00.03 (...
TITLE: Screen + vim causes shift-enter to insert 'M' and a newline QUESTION: When running a vim instance in gnu screen hitting shift enter in insert mode adds an 'M' and then a newline, rather than just a newline. Does anybody know what the problem might be, or where to look? Relevant system info: Ubuntu 8.04.1 Screen...
[ "vim", "ide", "editor", "gnu-screen" ]
8
5
2,200
2
0
2008-09-15T14:24:36.817000
2008-09-15T14:30:26.053000
63,399
63,405
MySQL statement that returns a SQL statement?
I need to do a dump of a table on a remote server, but I can't access the server directly. The only access I have is through PHP scripts. Is there some way in which MySQL will return an INSERT INTO `table_name` (`field1`, `field2`) VALUES ('a', 'b'), ('c', 'd') statement, like what mysqldump will return? I don't have a...
1) can you run mysqldump from exec or passthru 2) take a look at this: http://www.php-mysql-tutorial.com/perform-mysql-backup-php.php
MySQL statement that returns a SQL statement? I need to do a dump of a table on a remote server, but I can't access the server directly. The only access I have is through PHP scripts. Is there some way in which MySQL will return an INSERT INTO `table_name` (`field1`, `field2`) VALUES ('a', 'b'), ('c', 'd') statement, l...
TITLE: MySQL statement that returns a SQL statement? QUESTION: I need to do a dump of a table on a remote server, but I can't access the server directly. The only access I have is through PHP scripts. Is there some way in which MySQL will return an INSERT INTO `table_name` (`field1`, `field2`) VALUES ('a', 'b'), ('c',...
[ "php", "mysql", "export" ]
6
5
633
6
0
2008-09-15T14:27:23.440000
2008-09-15T14:28:38.990000
63,408
63,458
iPhone app loading
When I load my iPhone app it always loads a black screen first then pops up the main window. This happens even with a simple empty app with a single window loaded. I've noticed that when loading, most apps zoom in on the main window (or scale it to fit the screen, however you want to think about it) and then load the c...
Add a Default.png to your project. This should be the image you want shown instead of the black launch screen.
iPhone app loading When I load my iPhone app it always loads a black screen first then pops up the main window. This happens even with a simple empty app with a single window loaded. I've noticed that when loading, most apps zoom in on the main window (or scale it to fit the screen, however you want to think about it) ...
TITLE: iPhone app loading QUESTION: When I load my iPhone app it always loads a black screen first then pops up the main window. This happens even with a simple empty app with a single window loaded. I've noticed that when loading, most apps zoom in on the main window (or scale it to fit the screen, however you want t...
[ "ios", "iphone" ]
14
19
5,830
4
0
2008-09-15T14:29:15.900000
2008-09-15T14:35:24.403000
63,421
63,511
Using Emacs as an IDE
Currently my workflow with Emacs when I am coding in C or C++ involves three windows. The largest on the right contains the file I am working with. The left is split into two, the bottom being a shell which I use to type in compile or make commands, and the top is often some sort of documentation or README file that I ...
You'll have to be specific as to what you mean by "the rest". Except for the object inspector (that I"m aware of), emacs does all the above quite easily: editor (obvious) compiler - just run M-x compile and enter your compile command. From there on, you can just M-x compile and use the default. Emacs will capture C/C++...
Using Emacs as an IDE Currently my workflow with Emacs when I am coding in C or C++ involves three windows. The largest on the right contains the file I am working with. The left is split into two, the bottom being a shell which I use to type in compile or make commands, and the top is often some sort of documentation ...
TITLE: Using Emacs as an IDE QUESTION: Currently my workflow with Emacs when I am coding in C or C++ involves three windows. The largest on the right contains the file I am working with. The left is split into two, the bottom being a shell which I use to type in compile or make commands, and the top is often some sort...
[ "emacs", "ide", "development-environment", "slime" ]
178
76
81,249
18
0
2008-09-15T14:31:22.603000
2008-09-15T14:41:01.380000
63,429
66,514
How do I display dynamic text at the mouse cursor via C++/MFC in a Win32 application
I would like to be able to display some dynamic text at the mouse cursor location in a win32 app, for instance to give an X,Y coordinate that would move with the cursor as though attached. I can do this during a mousemove event using a TextOut() call for the window at the mouse coordinates and invalidate a rectange aro...
You may want to consider a small transparent window that you move to follow the mouse. In particular, since Windows 2000, Layered windows seem to be the weapon of choice (confession: no personal experience there).
How do I display dynamic text at the mouse cursor via C++/MFC in a Win32 application I would like to be able to display some dynamic text at the mouse cursor location in a win32 app, for instance to give an X,Y coordinate that would move with the cursor as though attached. I can do this during a mousemove event using a...
TITLE: How do I display dynamic text at the mouse cursor via C++/MFC in a Win32 application QUESTION: I would like to be able to display some dynamic text at the mouse cursor location in a win32 app, for instance to give an X,Y coordinate that would move with the cursor as though attached. I can do this during a mouse...
[ "c++", "winapi", "mfc" ]
2
1
3,829
3
0
2008-09-15T14:31:57.377000
2008-09-15T20:17:32.613000
63,439
63,592
Programmatically show tooltip in winforms application
How can I programatically cause a control's tooltip to show in a Winforms app without needing the mouse to hover over the control? (P/Invoke is ok if necessary).
If you are using the Tooltip control on the form, you can do it like this: ToolTip1.Show("Text to display", Control) The MSDN documentation for the ToolTip control's "Show" method has all the different variations on this and how to use them.
Programmatically show tooltip in winforms application How can I programatically cause a control's tooltip to show in a Winforms app without needing the mouse to hover over the control? (P/Invoke is ok if necessary).
TITLE: Programmatically show tooltip in winforms application QUESTION: How can I programatically cause a control's tooltip to show in a Winforms app without needing the mouse to hover over the control? (P/Invoke is ok if necessary). ANSWER: If you are using the Tooltip control on the form, you can do it like this: To...
[ "winforms" ]
27
28
38,388
7
0
2008-09-15T14:32:56.560000
2008-09-15T14:51:27.530000
63,447
63,480
How do I perform an IF...THEN in an SQL SELECT?
How do I perform an IF...THEN in an SQL SELECT statement? For example: SELECT IF(Obsolete = 'N' OR InStock = 'Y'? 1: 0) AS Saleable, * FROM Product
The CASE statement is the closest to IF in SQL and is supported on all versions of SQL Server. SELECT CAST( CASE WHEN Obsolete = 'N' or InStock = 'Y' THEN 1 ELSE 0 END AS bit) as Saleable, * FROM Product You only need to use the CAST operator if you want the result as a Boolean value. If you are happy with an int, this...
How do I perform an IF...THEN in an SQL SELECT? How do I perform an IF...THEN in an SQL SELECT statement? For example: SELECT IF(Obsolete = 'N' OR InStock = 'Y'? 1: 0) AS Saleable, * FROM Product
TITLE: How do I perform an IF...THEN in an SQL SELECT? QUESTION: How do I perform an IF...THEN in an SQL SELECT statement? For example: SELECT IF(Obsolete = 'N' OR InStock = 'Y'? 1: 0) AS Saleable, * FROM Product ANSWER: The CASE statement is the closest to IF in SQL and is supported on all versions of SQL Server. SE...
[ "sql", "sql-server", "t-sql", "if-statement", "case" ]
1,791
2,041
4,606,449
30
0
2008-09-15T14:34:09.337000
2008-09-15T14:38:24.473000
63,463
63,654
Split out ints from string
Let's say I have a web page that currently accepts a single ID value via a url parameter: http://example.com/mypage.aspx?ID=1234 I want to change it to accept a list of ids, like this: http://example.com/mypage.aspx?IDs=1234,4321,6789 So it's available to my code as a string via context.Request.QueryString["IDs"]. What...
No offense to those who provided clear answers, but many people seem to be answering your question instead of addressing your problem. You want multiple IDs, so you think you could this this: http://example.com/mypage.aspx?IDs=1234,4321,6789 The problem is that this is a non-robust solution. In the future, if you want ...
Split out ints from string Let's say I have a web page that currently accepts a single ID value via a url parameter: http://example.com/mypage.aspx?ID=1234 I want to change it to accept a list of ids, like this: http://example.com/mypage.aspx?IDs=1234,4321,6789 So it's available to my code as a string via context.Reque...
TITLE: Split out ints from string QUESTION: Let's say I have a web page that currently accepts a single ID value via a url parameter: http://example.com/mypage.aspx?ID=1234 I want to change it to accept a list of ids, like this: http://example.com/mypage.aspx?IDs=1234,4321,6789 So it's available to my code as a string...
[ ".net", "string", ".net-2.0" ]
10
13
13,153
13
0
2008-09-15T14:35:57.427000
2008-09-15T14:57:42.587000
63,494
63,551
Does anyone use template metaprogramming in real life?
I discovered template metaprogramming more than 5 years ago and got a huge kick out of reading Modern C++ Design but I never found an opertunity to use it in real life. Have you ever used this technique in real code? Contributors to Boost need not apply;o)
I once used template metaprogramming in C++ to implement a technique called "symbolic perturbation" for dealing with degenerate input in geometric algorithms. By representing arithmetic expressions as nested templates (i.e. basically by writing out the parse trees by hand) I was able to hand off all the expression anal...
Does anyone use template metaprogramming in real life? I discovered template metaprogramming more than 5 years ago and got a huge kick out of reading Modern C++ Design but I never found an opertunity to use it in real life. Have you ever used this technique in real code? Contributors to Boost need not apply;o)
TITLE: Does anyone use template metaprogramming in real life? QUESTION: I discovered template metaprogramming more than 5 years ago and got a huge kick out of reading Modern C++ Design but I never found an opertunity to use it in real life. Have you ever used this technique in real code? Contributors to Boost need not...
[ "c++", "templates", "template-meta-programming" ]
34
29
15,720
15
0
2008-09-15T14:39:31.757000
2008-09-15T14:46:23.033000
63,509
69,545
Are there any JSF component libraries that generate semantic and cross-browser html markup?
I'm using RichFaces per a client requirement, but the markup it (and the stock JSF controls) generates is an awful mess of nested tables. Are there any control libraries out there that generate nicer markup? AJAX support is a huge plus!
There is ICEFaces which provides more semantic support than RichFaces.Also you can try Nitobi suite which also provides similar kinda solution.If you are not satisfied with any of these I suggest try to write your own part extending the Sun faces
Are there any JSF component libraries that generate semantic and cross-browser html markup? I'm using RichFaces per a client requirement, but the markup it (and the stock JSF controls) generates is an awful mess of nested tables. Are there any control libraries out there that generate nicer markup? AJAX support is a hu...
TITLE: Are there any JSF component libraries that generate semantic and cross-browser html markup? QUESTION: I'm using RichFaces per a client requirement, but the markup it (and the stock JSF controls) generates is an awful mess of nested tables. Are there any control libraries out there that generate nicer markup? AJ...
[ "jsf", "semantic-markup" ]
3
1
516
2
0
2008-09-15T14:40:55.653000
2008-09-16T05:11:37.353000
63,517
63,560
Intellisense in Visual Studio 2005 between C# and VB - can't navigate to definitions
I'm absolutely stunned by the fact that MS just couldn't get it right to navigate to the definition of a method, when you're combining C# and VB projects in one solution. If you're trying to navigate from VB to C#, it brings up the "Object Explorer", and if from C# to VB, it generates a metadata file. Honestly, what is...
This is general to both languages. F12 in VB.Net always takes you to the object browser F12 in C# always takes you to a meta-data definition This is a deliberate mechanism to try and match expected behaviour for upgrading users. The C# way gives you the right information, but the VB way is what users of VBA or VB6 will...
Intellisense in Visual Studio 2005 between C# and VB - can't navigate to definitions I'm absolutely stunned by the fact that MS just couldn't get it right to navigate to the definition of a method, when you're combining C# and VB projects in one solution. If you're trying to navigate from VB to C#, it brings up the "Ob...
TITLE: Intellisense in Visual Studio 2005 between C# and VB - can't navigate to definitions QUESTION: I'm absolutely stunned by the fact that MS just couldn't get it right to navigate to the definition of a method, when you're combining C# and VB projects in one solution. If you're trying to navigate from VB to C#, it...
[ "c#", "vb.net", "visual-studio", "intellisense" ]
2
2
1,463
3
0
2008-09-15T14:41:39.333000
2008-09-15T14:47:30.503000
63,556
63,628
c# properties with repeated code
I have a class with a bunch of properties that look like this: public string Name { get { return _name; } set { IsDirty = true; _name = value; } } It would be a lot easier if I could rely on C# 3.0 to generate the backing store for these, but is there any way to factor out the IsDirty=true; so that I can write my prope...
No. Not without writing considerably more (arcane?) code than the original version (You'd have to use reflection to check for the attribute on the property and what not.. did I mention it being 'slower').. This is the kind of duplication I can live with. MS has the same need for raising events when a property is change...
c# properties with repeated code I have a class with a bunch of properties that look like this: public string Name { get { return _name; } set { IsDirty = true; _name = value; } } It would be a lot easier if I could rely on C# 3.0 to generate the backing store for these, but is there any way to factor out the IsDirty=t...
TITLE: c# properties with repeated code QUESTION: I have a class with a bunch of properties that look like this: public string Name { get { return _name; } set { IsDirty = true; _name = value; } } It would be a lot easier if I could rely on C# 3.0 to generate the backing store for these, but is there any way to factor...
[ "c#", "properties", "attributes" ]
5
5
2,201
10
0
2008-09-15T14:46:56.917000
2008-09-15T14:55:11.483000
63,581
63,626
Unobtrusive Javascript: Removing links if Javascript is enabled
I'm using PopBox for magnifying thumbnails on my page. But I want my website to work even for users which turned javascript off. I tried to use the following HTML code: Now i need to disable the a-Tag using javascript, otherwise my PopBox won't work. How do I do that?
Just put the onclick on the a-tag: Make sure to return false either at the end of the function (here Pop ) or inline like in the above example. This prevents the user from being redirected to the link by the 's default behaviour.
Unobtrusive Javascript: Removing links if Javascript is enabled I'm using PopBox for magnifying thumbnails on my page. But I want my website to work even for users which turned javascript off. I tried to use the following HTML code: Now i need to disable the a-Tag using javascript, otherwise my PopBox won't work. How d...
TITLE: Unobtrusive Javascript: Removing links if Javascript is enabled QUESTION: I'm using PopBox for magnifying thumbnails on my page. But I want my website to work even for users which turned javascript off. I tried to use the following HTML code: Now i need to disable the a-Tag using javascript, otherwise my PopBox...
[ "javascript" ]
1
3
1,091
6
0
2008-09-15T14:50:34.303000
2008-09-15T14:55:05.277000
63,599
65,937
Including files case-sensitively on Windows from PHP
We have an issue using the PEAR libraries on Windows from PHP. Pear contains many classes, we are making use of a fair few, one of which is the Mail class found in Mail.php. We use PEAR on the path, rather than providing the full explicit path to individual PEAR files: require_once('Mail.php'); Rather than: require_onc...
having 2 files with the same name in the include path is not a good idea, rename your files so the files that you wrote have different names from third party libraries. anyway for your current situation I think by changing the order of paths in your include path, you can fix this. PHP searches for the files in the incl...
Including files case-sensitively on Windows from PHP We have an issue using the PEAR libraries on Windows from PHP. Pear contains many classes, we are making use of a fair few, one of which is the Mail class found in Mail.php. We use PEAR on the path, rather than providing the full explicit path to individual PEAR file...
TITLE: Including files case-sensitively on Windows from PHP QUESTION: We have an issue using the PEAR libraries on Windows from PHP. Pear contains many classes, we are making use of a fair few, one of which is the Mail class found in Mail.php. We use PEAR on the path, rather than providing the full explicit path to in...
[ "php", "windows", "apache", "pear" ]
0
1
608
4
0
2008-09-15T14:52:15.283000
2008-09-15T19:25:16.203000