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
55,594
55,597
CSS not being applied on non authenticated ASP.NET page
When developing (works fine live) the pages for our website don't pick up the correct CSS until the user has authenticated (logged on). So the Logon and Logoff forms look bad, but once inside the site, the CSS works again. I'm guessing it's some kind of authentication issue? Haven't really looked into it too much becau...
Check and make sure that the CSS file itself is not in an area that you are securing. You can manually exclude the file via the web.config if needed.
CSS not being applied on non authenticated ASP.NET page When developing (works fine live) the pages for our website don't pick up the correct CSS until the user has authenticated (logged on). So the Logon and Logoff forms look bad, but once inside the site, the CSS works again. I'm guessing it's some kind of authentica...
TITLE: CSS not being applied on non authenticated ASP.NET page QUESTION: When developing (works fine live) the pages for our website don't pick up the correct CSS until the user has authenticated (logged on). So the Logon and Logoff forms look bad, but once inside the site, the CSS works again. I'm guessing it's some ...
[ "asp.net", "css" ]
14
15
11,088
4
0
2008-09-11T01:01:53.720000
2008-09-11T01:03:35.853000
55,607
55,681
Best Technique for Multiple Eval Fields in Gridview ItemTemplate?
What is the best way to use multiple EVAL fields in a GridView ItemTemplate? Looking to have some control over formatting for appearance as well as setting up hyperlinks/javascript etc.
Even clearer, IMO, is: <%# String.Format("{0} - {1}", Eval("Name1"), Eval("Name2")) %>
Best Technique for Multiple Eval Fields in Gridview ItemTemplate? What is the best way to use multiple EVAL fields in a GridView ItemTemplate? Looking to have some control over formatting for appearance as well as setting up hyperlinks/javascript etc.
TITLE: Best Technique for Multiple Eval Fields in Gridview ItemTemplate? QUESTION: What is the best way to use multiple EVAL fields in a GridView ItemTemplate? Looking to have some control over formatting for appearance as well as setting up hyperlinks/javascript etc. ANSWER: Even clearer, IMO, is: <%# String.Format(...
[ "asp.net", "data-binding", "gridview", "eval" ]
34
64
60,116
4
0
2008-09-11T01:11:08.240000
2008-09-11T02:10:35.380000
55,611
55,637
JavaScript private methods
To make a JavaScript class with a public method I'd do something like: function Restaurant() {} Restaurant.prototype.buy_food = function(){ // something here } Restaurant.prototype.use_restroom = function(){ // something here } That way users of my class can: var restaurant = new Restaurant(); restaurant.buy_food(); ...
You can do it, but the downside is that it can't be part of the prototype: function Restaurant() { var myPrivateVar; var private_stuff = function() { // Only visible inside Restaurant() myPrivateVar = "I can set this here!"; } this.use_restroom = function() { // use_restroom is visible to all private_stuff(); } this...
JavaScript private methods To make a JavaScript class with a public method I'd do something like: function Restaurant() {} Restaurant.prototype.buy_food = function(){ // something here } Restaurant.prototype.use_restroom = function(){ // something here } That way users of my class can: var restaurant = new Restaurant...
TITLE: JavaScript private methods QUESTION: To make a JavaScript class with a public method I'd do something like: function Restaurant() {} Restaurant.prototype.buy_food = function(){ // something here } Restaurant.prototype.use_restroom = function(){ // something here } That way users of my class can: var restauran...
[ "javascript", "oop", "private-methods" ]
550
453
472,679
34
0
2008-09-11T01:12:39.030000
2008-09-11T01:26:52.583000
55,612
55,624
CSS to select/style first word
This one has me kind of stumped. I want to make the first word of all the paragraphs in my #content div at 14pt instead of the default for the paragraphs (12pt). Is there a way to do this in straight CSS or am I left wrapping the first word in a span to accomplish this?
What you are looking for is a pseudo-element that doesn't exist. There is:first-letter and:first-line, but no:first-word. You can of course do this with JavaScript. Here's some code I found that does this: http://www.dynamicsitesolutions.com/javascript/first-word-selector/
CSS to select/style first word This one has me kind of stumped. I want to make the first word of all the paragraphs in my #content div at 14pt instead of the default for the paragraphs (12pt). Is there a way to do this in straight CSS or am I left wrapping the first word in a span to accomplish this?
TITLE: CSS to select/style first word QUESTION: This one has me kind of stumped. I want to make the first word of all the paragraphs in my #content div at 14pt instead of the default for the paragraphs (12pt). Is there a way to do this in straight CSS or am I left wrapping the first word in a span to accomplish this? ...
[ "css" ]
100
107
232,413
14
0
2008-09-11T01:13:56.110000
2008-09-11T01:18:21.560000
55,633
55,653
Where is the console API for WebKit/Safari?
WebKit/Safari supports the console object, which is similar to what Firebug does. But what exactly is supported? There is a console documentation for Firebug, but where can I find the console documentation for Safari/WebKit?
Supported methods were originally: console.log() console.error() console.warn() console.info() Newer versions of WebKit also add the following methods making the WebKit console API almost identical to Firebug's console API: console.count() console.debug() console.profileEnd() console.trace() console.dir() console.dirxm...
Where is the console API for WebKit/Safari? WebKit/Safari supports the console object, which is similar to what Firebug does. But what exactly is supported? There is a console documentation for Firebug, but where can I find the console documentation for Safari/WebKit?
TITLE: Where is the console API for WebKit/Safari? QUESTION: WebKit/Safari supports the console object, which is similar to what Firebug does. But what exactly is supported? There is a console documentation for Firebug, but where can I find the console documentation for Safari/WebKit? ANSWER: Supported methods were o...
[ "javascript", "console", "safari" ]
64
66
27,920
7
0
2008-09-11T01:23:24.700000
2008-09-11T01:39:25.520000
55,639
55,664
How do you communicate between Windows Vista Session 0 and Desktop?
In prior versions of Windows before Vista you could have a Windows Service interact with the current logged in desktop user to easy display information on the screen from the service. In Windows Vista Session 0 was added for security to isolate the services from the desktop. What is an easy way to communicate between a...
You can use shared memory or named pipe to facilitate IPC as well. Conceptually this is similar to TCP/IP, but you don't have to worry about finding an unused port. You have to make sure that the named objects you create are prefixed with "Global\" to allow them to be accessed by all sessions as described here. AFAIK t...
How do you communicate between Windows Vista Session 0 and Desktop? In prior versions of Windows before Vista you could have a Windows Service interact with the current logged in desktop user to easy display information on the screen from the service. In Windows Vista Session 0 was added for security to isolate the ser...
TITLE: How do you communicate between Windows Vista Session 0 and Desktop? QUESTION: In prior versions of Windows before Vista you could have a Windows Service interact with the current logged in desktop user to easy display information on the screen from the service. In Windows Vista Session 0 was added for security ...
[ "windows-vista", "ipc" ]
7
4
3,011
3
0
2008-09-11T01:29:21.940000
2008-09-11T01:48:13.733000
55,641
55,650
Unicode Processing in C++
What is the best practice of Unicode processing in C++?
Use ICU for dealing with your data (or a similar library) In your own data store, make sure everything is stored in the same encoding Make sure you are always using your unicode library for mundane tasks like string length, capitalization status, etc. Never use standard library builtins like is_alpha unless that is the...
Unicode Processing in C++ What is the best practice of Unicode processing in C++?
TITLE: Unicode Processing in C++ QUESTION: What is the best practice of Unicode processing in C++? ANSWER: Use ICU for dealing with your data (or a similar library) In your own data store, make sure everything is stored in the same encoding Make sure you are always using your unicode library for mundane tasks like st...
[ "c++", "unicode" ]
109
81
46,197
9
0
2008-09-11T01:30:32.140000
2008-09-11T01:37:17.303000
55,643
55,647
How do I keep a mySQL database secure?
I'm going to be implementing a PHP/mySQL setup to store credit card information. It seems like AES_ENCRYPT/AES_DECRYPT is the way to go, but I'm still confused on one point: How do I keep the encryption key secure? Hardwiring it into my PHP scripts (which will live on the same server as the db) seems like a major secur...
You should think long and hard about whether you REALLY need to keep the CC#. If you don't have a great reason, DON'T! Every other week you hear about some company being compromised and CC#'s being stolen. All these companies made a fatal flaw - they kept too much information. Keep the CC# until the transaction clears....
How do I keep a mySQL database secure? I'm going to be implementing a PHP/mySQL setup to store credit card information. It seems like AES_ENCRYPT/AES_DECRYPT is the way to go, but I'm still confused on one point: How do I keep the encryption key secure? Hardwiring it into my PHP scripts (which will live on the same ser...
TITLE: How do I keep a mySQL database secure? QUESTION: I'm going to be implementing a PHP/mySQL setup to store credit card information. It seems like AES_ENCRYPT/AES_DECRYPT is the way to go, but I'm still confused on one point: How do I keep the encryption key secure? Hardwiring it into my PHP scripts (which will li...
[ "php", "mysql", "security", "aes" ]
10
16
11,181
5
0
2008-09-11T01:31:57.080000
2008-09-11T01:35:45.560000
55,669
55,682
SharePoint Permissions
I would like to create a folder that users who do not have privileges to view the rest of the site can see. This user group would be granted access to the site, but I only want them to be able to view one particular page. Is this possible to do without going to every single page and removing the new user group's access...
yeah, you should be able to create a new group and add the users to that list/subweb/whatever and just that. This is assuming that you didn't grant access to all users somewhere. If you did, then hopefully the default access is granted to a default user group (like sharepoint visitors) and you can alter that group to e...
SharePoint Permissions I would like to create a folder that users who do not have privileges to view the rest of the site can see. This user group would be granted access to the site, but I only want them to be able to view one particular page. Is this possible to do without going to every single page and removing the ...
TITLE: SharePoint Permissions QUESTION: I would like to create a folder that users who do not have privileges to view the rest of the site can see. This user group would be granted access to the site, but I only want them to be able to view one particular page. Is this possible to do without going to every single page...
[ "sharepoint", "permissions" ]
0
2
793
2
0
2008-09-11T02:01:04.280000
2008-09-11T02:11:15.490000
55,692
55,694
.NET namespaces
My background is primarily as a Java Developer, but lately I have been doing some work in.NET. So I have been trying to do some simple projects at home to get better at working with.NET. I have been able to transfer much of my Java experience into working with.NET (specifically C#), but the only thing that has really p...
I can't claim that it's a best practice, but I often see files organized in a directory hierarchy that mirrors the namespace. If it fits your mental model of the code better, then do so - I can't think of any harm. Just because the.NET model doesn't enforce relationships between namespaces, projects, and directory stru...
.NET namespaces My background is primarily as a Java Developer, but lately I have been doing some work in.NET. So I have been trying to do some simple projects at home to get better at working with.NET. I have been able to transfer much of my Java experience into working with.NET (specifically C#), but the only thing t...
TITLE: .NET namespaces QUESTION: My background is primarily as a Java Developer, but lately I have been doing some work in.NET. So I have been trying to do some simple projects at home to get better at working with.NET. I have been able to transfer much of my Java experience into working with.NET (specifically C#), bu...
[ ".net", "namespaces" ]
9
11
5,008
9
0
2008-09-11T02:26:45.327000
2008-09-11T02:29:49.687000
55,693
57,335
How do you use FogBugz with an Agile methodology?
"Evidence-based scheduling" in FogBugz is interesting, but how do I use it w/ an Agile methodology?
As eed3si9n said, if you are consistent in your estimates for EBS, FogBugz will take care of this for you. As to the more general, how does FogBugz fit with the Agile methodology, your best bet is to do sprints as mini-releases. Create a sprint and add the cases you want to achieve for that sprint to that release (or m...
How do you use FogBugz with an Agile methodology? "Evidence-based scheduling" in FogBugz is interesting, but how do I use it w/ an Agile methodology?
TITLE: How do you use FogBugz with an Agile methodology? QUESTION: "Evidence-based scheduling" in FogBugz is interesting, but how do I use it w/ an Agile methodology? ANSWER: As eed3si9n said, if you are consistent in your estimates for EBS, FogBugz will take care of this for you. As to the more general, how does Fog...
[ "agile", "fogbugz", "schedule" ]
19
12
6,649
4
0
2008-09-11T02:29:25.413000
2008-09-11T18:56:10.020000
55,709
55,788
Streaming large files in a java servlet
I am building a java server that needs to scale. One of the servlets will be serving images stored in Amazon S3. Recently under load, I ran out of memory in my VM and it was after I added the code to serve the images so I'm pretty sure that streaming larger servlet responses is causing my troubles. My question is: is t...
When possible, you should not store the entire contents of a file to be served in memory. Instead, aquire an InputStream for the data, and copy the data to the Servlet OutputStream in pieces. For example: ServletOutputStream out = response.getOutputStream(); InputStream in = [ code to get source input stream ]; String ...
Streaming large files in a java servlet I am building a java server that needs to scale. One of the servlets will be serving images stored in Amazon S3. Recently under load, I ran out of memory in my VM and it was after I added the code to serve the images so I'm pretty sure that streaming larger servlet responses is c...
TITLE: Streaming large files in a java servlet QUESTION: I am building a java server that needs to scale. One of the servlets will be serving images stored in Amazon S3. Recently under load, I ran out of memory in my VM and it was after I added the code to serve the images so I'm pretty sure that streaming larger serv...
[ "java", "java-io" ]
46
58
85,288
8
0
2008-09-11T02:40:12.563000
2008-09-11T03:53:45.523000
55,713
56,054
PHP: How do I check if all public methods of two classes return the same values?
In effect, if I have a class c and instances of $c1 and $c2 which might have different private variable amounts but all their public methods return the same values I would like to be able to check that $c1 == $c2? Does anyone know an easy way to do this?
You can also implement a equal($other) function like or use foreach to iterate over the public properties (this behaviour might be overwritten) of one object and compare them to the other object's properties. $value) { if (!isset($b->$name) || $b->$name!=$value ) { return false; } } return true; } (untested) or (more o...
PHP: How do I check if all public methods of two classes return the same values? In effect, if I have a class c and instances of $c1 and $c2 which might have different private variable amounts but all their public methods return the same values I would like to be able to check that $c1 == $c2? Does anyone know an easy ...
TITLE: PHP: How do I check if all public methods of two classes return the same values? QUESTION: In effect, if I have a class c and instances of $c1 and $c2 which might have different private variable amounts but all their public methods return the same values I would like to be able to check that $c1 == $c2? Does an...
[ "php", "oop" ]
2
2
1,038
5
0
2008-09-11T02:42:09.923000
2008-09-11T08:43:07.090000
55,720
55,737
Find out where your PHP code is slowing down (Performance Issue)
Here's my first question at SO. I have a internal application for my company which I've been recently ask to maintain. The applications is built in PHP and its fairly well coded (OO, DB Abstraction, Smarty) nothing WTF-ish. The problem is the applications is very slow. How do I go about finding out what's slowing the a...
I've used XDebug profiling recently in a similiar situation. It outputs a full profile report that can be read with many common profiling apps ( Can't give you a list though, I just used the one that came with slackware ).
Find out where your PHP code is slowing down (Performance Issue) Here's my first question at SO. I have a internal application for my company which I've been recently ask to maintain. The applications is built in PHP and its fairly well coded (OO, DB Abstraction, Smarty) nothing WTF-ish. The problem is the applications...
TITLE: Find out where your PHP code is slowing down (Performance Issue) QUESTION: Here's my first question at SO. I have a internal application for my company which I've been recently ask to maintain. The applications is built in PHP and its fairly well coded (OO, DB Abstraction, Smarty) nothing WTF-ish. The problem i...
[ "php", "mysql", "performance", "profiling" ]
31
40
31,922
12
0
2008-09-11T02:47:49.597000
2008-09-11T03:06:52.313000
55,729
55,738
How often should you use git-gc?
How often should you use git-gc? The manual page simply says: Users are encouraged to run this task on a regular basis within each repository to maintain good disk space utilization and good operating performance. Are there some commands to get some object counts to find out whether it's time to gc?
It depends mostly on how much the repository is used. With one user checking in once a day and a branch/merge/etc operation once a week you probably don't need to run it more than once a year. With several dozen developers working on several dozen projects each checking in 2-3 times a day, you might want to run it nigh...
How often should you use git-gc? How often should you use git-gc? The manual page simply says: Users are encouraged to run this task on a regular basis within each repository to maintain good disk space utilization and good operating performance. Are there some commands to get some object counts to find out whether it'...
TITLE: How often should you use git-gc? QUESTION: How often should you use git-gc? The manual page simply says: Users are encouraged to run this task on a regular basis within each repository to maintain good disk space utilization and good operating performance. Are there some commands to get some object counts to fi...
[ "git", "git-gc" ]
261
232
138,855
11
0
2008-09-11T02:59:13.830000
2008-09-11T03:10:24.350000
55,735
55,868
How Do I detect Text and Cursor position changes in Word using VSTO
I want to write a word addin that does some computations and updates some ui whenever the user types something or moves the current insertion point. From looking at the MSDN docs, I don't see any obvious way such as an TextTyped event on the document or application objects. Does anyone know if this is possible without ...
As you've probably discovered, Word has events, but they're for really coarse actions like a document open or a switch to another document. I'm guessing MS did this intentionally to prevent a crappy macro from slowing down typing. In short, there's no great way to do what you want. A Word MVP confirms that in this thre...
How Do I detect Text and Cursor position changes in Word using VSTO I want to write a word addin that does some computations and updates some ui whenever the user types something or moves the current insertion point. From looking at the MSDN docs, I don't see any obvious way such as an TextTyped event on the document o...
TITLE: How Do I detect Text and Cursor position changes in Word using VSTO QUESTION: I want to write a word addin that does some computations and updates some ui whenever the user types something or moves the current insertion point. From looking at the MSDN docs, I don't see any obvious way such as an TextTyped event...
[ "ms-word", "ms-office", "vsto" ]
1
1
3,689
2
0
2008-09-11T03:05:48.353000
2008-09-11T05:47:51.693000
55,753
55,885
Creating Custom Performance Counters in Visual C++
Does anybody know of a method for creating custom Performance Counters using ordinary unmanaged Visual C++? I know that it can be done easily using managed C++, but I need to do it using an unmanaged Windows service. I also know that you can retrieve performance counter data, but I need to create some custom counters a...
See here: http://msdn.microsoft.com/en-us/library/aa371925.aspx It is not really hard, but a bit tedious as the API involves extensive usage of self-referential, variable-length structures and has to employ some IPC mechanism to obtain the data from the monitored process.
Creating Custom Performance Counters in Visual C++ Does anybody know of a method for creating custom Performance Counters using ordinary unmanaged Visual C++? I know that it can be done easily using managed C++, but I need to do it using an unmanaged Windows service. I also know that you can retrieve performance counte...
TITLE: Creating Custom Performance Counters in Visual C++ QUESTION: Does anybody know of a method for creating custom Performance Counters using ordinary unmanaged Visual C++? I know that it can be done easily using managed C++, but I need to do it using an unmanaged Windows service. I also know that you can retrieve ...
[ "c++", "visual-c++", "performancecounter" ]
5
6
10,441
4
0
2008-09-11T03:25:26.403000
2008-09-11T06:09:49.550000
55,754
55,782
How to zero pad numbers in file names in Bash?
What is the best way, using Bash, to rename files in the form: (foo1, foo2,..., foo1300,..., fooN) With zero-padded file names: (foo00001, foo00002,..., foo01300,..., fooN)
In case N is not a priori fixed: for f in foo[0-9]*; do mv "$f" "$(printf 'foo%05d' "${f#foo}")" done
How to zero pad numbers in file names in Bash? What is the best way, using Bash, to rename files in the form: (foo1, foo2,..., foo1300,..., fooN) With zero-padded file names: (foo00001, foo00002,..., foo01300,..., fooN)
TITLE: How to zero pad numbers in file names in Bash? QUESTION: What is the best way, using Bash, to rename files in the form: (foo1, foo2,..., foo1300,..., fooN) With zero-padded file names: (foo00001, foo00002,..., foo01300,..., fooN) ANSWER: In case N is not a priori fixed: for f in foo[0-9]*; do mv "$f" "$(printf...
[ "bash", "rename" ]
66
44
42,708
10
0
2008-09-11T03:25:41.783000
2008-09-11T03:47:46.070000
55,755
55,760
ASP.NET - Performance Implications of a sql server database in the app_data folder
The default asp.net membership provider uses a.mdf sql server database file in the app_code database. How scalable is this in terms of calling a flat file database instead of running it in a standard sql environment? Is this recommended only for small/medium traffic sites?
It's a reasonable trade off for any site that can run on one server. It's fairly reasonable for small to medium traffic sites. When you grow to a point of a web farm, then you'll be better off with a separate server. Also, depending on how database dependent your application is, you may find better performance handing ...
ASP.NET - Performance Implications of a sql server database in the app_data folder The default asp.net membership provider uses a.mdf sql server database file in the app_code database. How scalable is this in terms of calling a flat file database instead of running it in a standard sql environment? Is this recommended ...
TITLE: ASP.NET - Performance Implications of a sql server database in the app_data folder QUESTION: The default asp.net membership provider uses a.mdf sql server database file in the app_code database. How scalable is this in terms of calling a flat file database instead of running it in a standard sql environment? Is...
[ "asp.net", "sql-server", "database" ]
2
3
542
2
0
2008-09-11T03:25:56.213000
2008-09-11T03:30:09.950000
55,757
55,767
PHP Multiform Validation and Redirection
I have buy.php with a form where you enter items, quantity, shipping data, etc. When you click the Submit button, it posts back to buy.php ($_SERVER['PHP_SELF']) and does some data validation. If there are fields missing or errors, they are highlighted. If everything is correct, I save the $_POST data in $_SESSION vari...
You could do a redirect to buy.php after saving to the session object, which then does a server redirect to check.php, it would mean when the user clicks back, they're going back to the GET request not the POST request
PHP Multiform Validation and Redirection I have buy.php with a form where you enter items, quantity, shipping data, etc. When you click the Submit button, it posts back to buy.php ($_SERVER['PHP_SELF']) and does some data validation. If there are fields missing or errors, they are highlighted. If everything is correct,...
TITLE: PHP Multiform Validation and Redirection QUESTION: I have buy.php with a form where you enter items, quantity, shipping data, etc. When you click the Submit button, it posts back to buy.php ($_SERVER['PHP_SELF']) and does some data validation. If there are fields missing or errors, they are highlighted. If ever...
[ "php", "validation", "post" ]
4
4
1,744
2
0
2008-09-11T03:27:07.007000
2008-09-11T03:35:47.033000
55,797
55,801
How can one reference a WCF service in a different Visual Studio solution?
A Visual Studio 2008 project in one solution needs to reference a WCF service in another VS 2008 solution on the same development machine. Does anybody have any suggestions on how best to accomplish this?
Host the service, and then use the URI of the hosted service in the other project to have VS create a proxy for you. Here's a step by step article on how to add a reference. And here's an article that teaches you how to host a service in VS (which is probably the simplest thing to do while developing). I'd recommend yo...
How can one reference a WCF service in a different Visual Studio solution? A Visual Studio 2008 project in one solution needs to reference a WCF service in another VS 2008 solution on the same development machine. Does anybody have any suggestions on how best to accomplish this?
TITLE: How can one reference a WCF service in a different Visual Studio solution? QUESTION: A Visual Studio 2008 project in one solution needs to reference a WCF service in another VS 2008 solution on the same development machine. Does anybody have any suggestions on how best to accomplish this? ANSWER: Host the serv...
[ "visual-studio-2008", "wcf" ]
2
1
1,797
2
0
2008-09-11T04:18:07.743000
2008-09-11T04:20:06.053000
55,823
56,082
What, if anything is typically done in a repository's structure to reflect deployed units?
This is a follow-up to the question: Should the folders in a solution match the namespace? The consensus on that question was a qualified "yes": that is, folders == namespaces, generally, but not slavishly (the way java requires). Indeed, that's how I set up projects. But setting up source control has made me hesitate ...
I usually don't really think about this and just do "what feels right" but usually I end up using names that fit the following strategy fairly well. I'll use the highest common namespace in the tree for the.dll name just like you seem to be doing; with lib and lib.data this is lib so the dll is called lib. With lib.eco...
What, if anything is typically done in a repository's structure to reflect deployed units? This is a follow-up to the question: Should the folders in a solution match the namespace? The consensus on that question was a qualified "yes": that is, folders == namespaces, generally, but not slavishly (the way java requires)...
TITLE: What, if anything is typically done in a repository's structure to reflect deployed units? QUESTION: This is a follow-up to the question: Should the folders in a solution match the namespace? The consensus on that question was a qualified "yes": that is, folders == namespaces, generally, but not slavishly (the ...
[ ".net", "dll", "version-control", "directory" ]
0
1
97
1
0
2008-09-11T04:52:07.303000
2008-09-11T08:59:10.453000
55,835
55,849
Is there a reliable way to prevent cheating in a web based contest where anonymous users can vote?
I'm working on a web-based contest which is supposed to allow anonymous users to vote, but we want to prevent them from voting more than once. IP based limits can be bypassed with anonymous proxies, users can clear cookies, etc. It's possible to use a Silverlight application, which would have access to isolated storage...
The short answer is: no. The longer answer is: but you can make it arbitrarily difficult. What I would do: Voting requires solving a captcha (to avoid as much as possible automated voting). To be even more effective I would recommend to have prepared multiple types of simple captchas (like "pick the photo with the cat"...
Is there a reliable way to prevent cheating in a web based contest where anonymous users can vote? I'm working on a web-based contest which is supposed to allow anonymous users to vote, but we want to prevent them from voting more than once. IP based limits can be bypassed with anonymous proxies, users can clear cookie...
TITLE: Is there a reliable way to prevent cheating in a web based contest where anonymous users can vote? QUESTION: I'm working on a web-based contest which is supposed to allow anonymous users to vote, but we want to prevent them from voting more than once. IP based limits can be bypassed with anonymous proxies, user...
[ "asp.net", "silverlight" ]
12
19
1,566
7
0
2008-09-11T05:12:42.230000
2008-09-11T05:28:14.890000
55,843
85,732
How can I test that my Linq IQueryable has executed
I am currently using Linq to NHibernate (although that is not an issue with regards to this question) to execute queries against my database and I want to be able to test whether the current IQueryable result instance has been executed or not. The debugger knows that my IQueryable has not been 'invoked' because it tell...
How about writing an IQueryable wrapper like this: class QueryableWrapper: IQueryable { private IQueryable _InnerQueryable; private bool _HasExecuted; public QueryableWrapper(IQueryable innerQueryable) { _InnerQueryable = innerQueryable; } public bool HasExecuted { get { return _HasExecuted; } } public IEnumerator G...
How can I test that my Linq IQueryable has executed I am currently using Linq to NHibernate (although that is not an issue with regards to this question) to execute queries against my database and I want to be able to test whether the current IQueryable result instance has been executed or not. The debugger knows that ...
TITLE: How can I test that my Linq IQueryable has executed QUESTION: I am currently using Linq to NHibernate (although that is not an issue with regards to this question) to execute queries against my database and I want to be able to test whether the current IQueryable result instance has been executed or not. The de...
[ "c#", "linq" ]
5
3
3,396
3
0
2008-09-11T05:18:43.167000
2008-09-17T17:41:36
55,845
55,850
Should data security be performed on the database side?
We're in the process of setting up a new framework and way of doing business for our new internal apps. Our current design dictates that all security logic should be handled by our database, and all information (and I mean all) will be going in and out of the database via stored procedures. The theory is, the data acce...
Don't do that. We recently had a VERY BAD experience when the "database guru" decided to go to another company. The maintenance of all the logic in the procedures are just horrible!! Yes, you're going to have some performance improvement, but that's not worth it. In fact, performance is not even a big concern in intern...
Should data security be performed on the database side? We're in the process of setting up a new framework and way of doing business for our new internal apps. Our current design dictates that all security logic should be handled by our database, and all information (and I mean all) will be going in and out of the data...
TITLE: Should data security be performed on the database side? QUESTION: We're in the process of setting up a new framework and way of doing business for our new internal apps. Our current design dictates that all security logic should be handled by our database, and all information (and I mean all) will be going in a...
[ "sql", "security", "stored-procedures" ]
6
8
411
8
0
2008-09-11T05:21:30.757000
2008-09-11T05:30:19.957000
55,855
56,164
TextBox.TextChanged & ICommandSource
I am following the M-V-VM pattern for my WPF UI. I would like to hook up a command to the TextChanged event of a TextBox to a command that is in my ViewModel class. The only way I can conceive of completing this task is to inherit from the TextBox control, and implement ICommandSource. I can then instruct the command t...
First off, you've surely considered two-way data binding to your viewmodel, with an UpdateSourceTrigger of PropertyChanged? That way the property setter of the property you bind to will be called every time the text is changed? If that's not enough, then I would tackle this problem using Attached Behaviours. On Julian ...
TextBox.TextChanged & ICommandSource I am following the M-V-VM pattern for my WPF UI. I would like to hook up a command to the TextChanged event of a TextBox to a command that is in my ViewModel class. The only way I can conceive of completing this task is to inherit from the TextBox control, and implement ICommandSour...
TITLE: TextBox.TextChanged & ICommandSource QUESTION: I am following the M-V-VM pattern for my WPF UI. I would like to hook up a command to the TextChanged event of a TextBox to a command that is in my ViewModel class. The only way I can conceive of completing this task is to inherit from the TextBox control, and impl...
[ "wpf", "mvvm", "command", "event-binding" ]
10
18
22,722
3
0
2008-09-11T05:36:17.557000
2008-09-11T09:51:56.537000
55,859
55,863
How can I catch all types of exceptions in one catch block?
In C++, I'm trying to catch all types of exceptions in one catch (like catch(Exception) in C#). How is it done? And what's more, how can one catch divide-by-zero exceptions?
catch (...) { // Handle exceptions not covered. } Important considerations: A better approach is to catch specific types of exception that you can actually recover from as opposed to all possible exceptions. catch(...) will also catch certain serious system level exceptions (varies depending on compiler) that you are n...
How can I catch all types of exceptions in one catch block? In C++, I'm trying to catch all types of exceptions in one catch (like catch(Exception) in C#). How is it done? And what's more, how can one catch divide-by-zero exceptions?
TITLE: How can I catch all types of exceptions in one catch block? QUESTION: In C++, I'm trying to catch all types of exceptions in one catch (like catch(Exception) in C#). How is it done? And what's more, how can one catch divide-by-zero exceptions? ANSWER: catch (...) { // Handle exceptions not covered. } Important...
[ "c++", "exception", "try-catch" ]
13
28
21,249
9
0
2008-09-11T05:41:15.640000
2008-09-11T05:43:38.647000
55,862
55,904
How to implement password protection for individual files?
I'm writing a little desktop app that should be able to encrypt a data file and protect it with a password (i.e. one must enter the correct password to decrypt). I want the encrypted data file to be self-contained and portable, so the authentication has to be embedded in the file (or so I assume). I have a strategy tha...
Key Generation I would recommend using a recognized algorithm such as PBKDF2 defined in PKCS #5 version 2.0 to generate a key from your password. It's similar to the algorithm you outline, but is capable of generating longer symmetric keys for use with AES. You should be able to find an open-source library that impleme...
How to implement password protection for individual files? I'm writing a little desktop app that should be able to encrypt a data file and protect it with a password (i.e. one must enter the correct password to decrypt). I want the encrypted data file to be self-contained and portable, so the authentication has to be e...
TITLE: How to implement password protection for individual files? QUESTION: I'm writing a little desktop app that should be able to encrypt a data file and protect it with a password (i.e. one must enter the correct password to decrypt). I want the encrypted data file to be self-contained and portable, so the authenti...
[ "encryption", "cryptography", "passwords" ]
21
24
9,069
5
0
2008-09-11T05:43:24.683000
2008-09-11T06:37:40.467000
55,869
55,887
Determine file type of an image
I'm downloading some images from a service that doesn't always include a content-type and doesn't provide an extension for the file I'm downloading (ugh, don't ask). What's the best way to determine the image format in.NET? The application that is reading these downloaded images needs to have a proper file extension or...
A probably easier approach would be to use Image.FromFile() and then use the RawFormat property, as it already knows about the magic bits in the headers for the most common formats, like this: Image i = Image.FromFile("c:\\foo"); if (System.Drawing.Imaging.ImageFormat.Jpeg.Equals(i.RawFormat)) MessageBox.Show("JPEG"); ...
Determine file type of an image I'm downloading some images from a service that doesn't always include a content-type and doesn't provide an extension for the file I'm downloading (ugh, don't ask). What's the best way to determine the image format in.NET? The application that is reading these downloaded images needs to...
TITLE: Determine file type of an image QUESTION: I'm downloading some images from a service that doesn't always include a content-type and doesn't provide an extension for the file I'm downloading (ugh, don't ask). What's the best way to determine the image format in.NET? The application that is reading these download...
[ ".net", "image", "content-type", "mime-types" ]
52
55
34,704
6
0
2008-09-11T05:50:52.700000
2008-09-11T06:11:18.593000
55,871
55,880
Track when user hits back button on the browser
Is it possible to detect when the user clicks on the browser's back button? I have an Ajax application and if I can detect when the user clicks on the back button I can display the appropriate data back Any solution using PHP, JavaScript is preferable. Hell a solution in any language is fine, just need something that I...
There are multiple ways of doing it, though some will only work in certain browsers. One that I know off the top of my head is to embed a tiny near-invisible iframe on the page. When the user hits the back button the iframe is navigated back which you can detect and then update your page. Here is another solution. You ...
Track when user hits back button on the browser Is it possible to detect when the user clicks on the browser's back button? I have an Ajax application and if I can detect when the user clicks on the back button I can display the appropriate data back Any solution using PHP, JavaScript is preferable. Hell a solution in ...
TITLE: Track when user hits back button on the browser QUESTION: Is it possible to detect when the user clicks on the browser's back button? I have an Ajax application and if I can detect when the user clicks on the back button I can display the appropriate data back Any solution using PHP, JavaScript is preferable. H...
[ "php", "javascript", "browser" ]
26
15
28,209
7
0
2008-09-11T05:52:56.610000
2008-09-11T06:01:42.720000
55,878
55,902
How do distributed transactions work (eg. MSDTC)?
I understand, in a fuzzy sort of way, how regular ACID transactions work. You perform some work on a database in such a way that the work is not confirmed until some kind of commit flag is set. The commit part is based on some underlying assumption (like a single disk block write is atomic). In the event of a catastrop...
About "step 4": The transaction manager coordinates with the resource managers to ensure that all succeed to do the requested work or none of the work if done, thus maintaining the ACID properties. This of course requires all participants to provide the proper interfaces and (error-free) implementations. The interface ...
How do distributed transactions work (eg. MSDTC)? I understand, in a fuzzy sort of way, how regular ACID transactions work. You perform some work on a database in such a way that the work is not confirmed until some kind of commit flag is set. The commit part is based on some underlying assumption (like a single disk b...
TITLE: How do distributed transactions work (eg. MSDTC)? QUESTION: I understand, in a fuzzy sort of way, how regular ACID transactions work. You perform some work on a database in such a way that the work is not confirmed until some kind of commit flag is set. The commit part is based on some underlying assumption (li...
[ "transactions", "acid", "mstdc" ]
14
4
4,528
1
0
2008-09-11T06:01:04.453000
2008-09-11T06:31:04.537000
55,899
55,914
How to see the actual Oracle SQL statement that is being executed
I'm using a custom-built inhouse application that generates a standard set of reports on a weekly basis. I have no access to the source code of the application, and everyone tells me there is no documentation available for the Oracle database schema. (Aargh!) I've been asked to define the specs for a variant of an exis...
On the data dictionary side there are a lot of tools you can use to such as Schema Spy To look at what queries are running look at views sys.v_$sql and sys.v_$sqltext. You will also need access to sys.all_users One thing to note that queries that use parameters will show up once with entries like and TABLETYPE=’:b16’ w...
How to see the actual Oracle SQL statement that is being executed I'm using a custom-built inhouse application that generates a standard set of reports on a weekly basis. I have no access to the source code of the application, and everyone tells me there is no documentation available for the Oracle database schema. (Aa...
TITLE: How to see the actual Oracle SQL statement that is being executed QUESTION: I'm using a custom-built inhouse application that generates a standard set of reports on a weekly basis. I have no access to the source code of the application, and everyone tells me there is no documentation available for the Oracle da...
[ "sql", "oracle" ]
28
24
113,025
6
0
2008-09-11T06:26:01.040000
2008-09-11T06:45:01.540000
55,901
55,910
Web service - current time zone for a city?
Is there a web service of some sort (or any other way) to pull a current time zone settings for a (US) city. For the parts of the country that don't follow the Daylight Saving Time and basically jump timezones when everyone else is switching summer/winter time... I don't fancy creating own database of the places that d...
earthtools.org provides a free web service to get the time zone from a city here: http://www.earthtools.org/webservices.htm#timezone You just pass in the long/lat values like this: (This is for New York) http://www.earthtools.org/timezone-1.1/40.71417/-74.00639 EDIT: It seems like earthtools has been shut down. A good ...
Web service - current time zone for a city? Is there a web service of some sort (or any other way) to pull a current time zone settings for a (US) city. For the parts of the country that don't follow the Daylight Saving Time and basically jump timezones when everyone else is switching summer/winter time... I don't fanc...
TITLE: Web service - current time zone for a city? QUESTION: Is there a web service of some sort (or any other way) to pull a current time zone settings for a (US) city. For the parts of the country that don't follow the Daylight Saving Time and basically jump timezones when everyone else is switching summer/winter ti...
[ "web-services", "timezone" ]
54
47
98,775
8
0
2008-09-11T06:30:04.667000
2008-09-11T06:43:53.320000
55,903
55,909
Eclipse alternative to VS .sln files
I've recently had to switch from Visual Studio to Eclipse CDT. It would seem that Eclipse "workspaces" are not quite like VS solution files. Eclipse workspaces use the.metadata folder for managing multiple projects, but there doesn't seem to be a simple distinction between user settings or IDE preferences and project/s...
Yes you are right eclipse does not manage projects in the same way VS does with solution files. However for putting a group of related projects into a VCS eclipse has the concept of a Team Project Set available in File->Export then under the Team folder there is Team Project Set.
Eclipse alternative to VS .sln files I've recently had to switch from Visual Studio to Eclipse CDT. It would seem that Eclipse "workspaces" are not quite like VS solution files. Eclipse workspaces use the.metadata folder for managing multiple projects, but there doesn't seem to be a simple distinction between user sett...
TITLE: Eclipse alternative to VS .sln files QUESTION: I've recently had to switch from Visual Studio to Eclipse CDT. It would seem that Eclipse "workspaces" are not quite like VS solution files. Eclipse workspaces use the.metadata folder for managing multiple projects, but there doesn't seem to be a simple distinction...
[ "eclipse" ]
13
4
6,560
3
0
2008-09-11T06:33:27.620000
2008-09-11T06:41:49.503000
55,932
212,372
Win32 CreatePatternBrush
MSDN displays the following for CreatePatternBrush: You can delete a pattern brush without affecting the associated bitmap by using the DeleteObject function. Therefore, you can then use this bitmap to create any number of pattern brushes. My question is the opposite. If the HBRUSH is long lived, can I delete the HBITM...
The HBRUSH and HBITMAP are entirely independent. The handles can be deleted entirely independent from each other, and, once created, no changes to either object will effect the other.
Win32 CreatePatternBrush MSDN displays the following for CreatePatternBrush: You can delete a pattern brush without affecting the associated bitmap by using the DeleteObject function. Therefore, you can then use this bitmap to create any number of pattern brushes. My question is the opposite. If the HBRUSH is long live...
TITLE: Win32 CreatePatternBrush QUESTION: MSDN displays the following for CreatePatternBrush: You can delete a pattern brush without affecting the associated bitmap by using the DeleteObject function. Therefore, you can then use this bitmap to create any number of pattern brushes. My question is the opposite. If the H...
[ "winapi", "gdi" ]
5
5
2,164
4
0
2008-09-11T07:13:24.280000
2008-10-17T14:27:04.970000
55,943
55,954
How to profile a silverlight application?
Is their any profilers that support Silverlight? I have tried ANTS (Version 3.1) without any success? Does version 4 support it? Any other products I can try? Updated since the release of Silverlight 4, it is now possible to do full profiling on SL applications... check out this article on the topic At PDC, I announced...
Install XPerf and xperfview as available here: http://msdn.microsoft.com/en-us/library/cc305218.aspx (1) Startup your sample (2) xperf -on base (3) wait for a bit (4) xperf –d myprofile.etl (5) when this is done, set your symbol path: set _NT_SYMBOL_PATH= srv C:\symbols http://msdl.microsoft.com/downloads/symbols (6) x...
How to profile a silverlight application? Is their any profilers that support Silverlight? I have tried ANTS (Version 3.1) without any success? Does version 4 support it? Any other products I can try? Updated since the release of Silverlight 4, it is now possible to do full profiling on SL applications... check out thi...
TITLE: How to profile a silverlight application? QUESTION: Is their any profilers that support Silverlight? I have tried ANTS (Version 3.1) without any success? Does version 4 support it? Any other products I can try? Updated since the release of Silverlight 4, it is now possible to do full profiling on SL application...
[ "silverlight", "profiling" ]
17
20
13,369
7
0
2008-09-11T07:29:00.903000
2008-09-11T07:35:43.370000
55,953
56,098
Can't make an SSL Connection
I'm using a device that's got GPRS media to connect to a PC running stunnel. On TCPIP connections, the number of sessions is limitless. However, when it comes to SSL connections, it could only go as far as 1062 successful sessions. I've tried it like 3 times but makes no difference. I've checked the OpenSSL codes and I...
Are you connecting via a phone provider - could that be the issue?
Can't make an SSL Connection I'm using a device that's got GPRS media to connect to a PC running stunnel. On TCPIP connections, the number of sessions is limitless. However, when it comes to SSL connections, it could only go as far as 1062 successful sessions. I've tried it like 3 times but makes no difference. I've ch...
TITLE: Can't make an SSL Connection QUESTION: I'm using a device that's got GPRS media to connect to a PC running stunnel. On TCPIP connections, the number of sessions is limitless. However, when it comes to SSL connections, it could only go as far as 1062 successful sessions. I've tried it like 3 times but makes no d...
[ "ssl", "connection", "limits" ]
0
0
538
2
0
2008-09-11T07:34:33.857000
2008-09-11T09:06:33.137000
55,956
56,133
mysql_insert_id alternative for postgresql
is there an alternative for mysql_insert_id() php function for PostgreSQL? Most of the frameworks are solving the problem partially by finding the current value of the sequence used in the ID. However, there are times that the primary key is not a serial column....
From the PostgreSQL point of view, in pseudo-code: * $insert_id = INSERT...RETURNING foo_id;-- only works for PostgreSQL >= 8.2. * INSERT...; $insert_id = SELECT lastval(); -- works for PostgreSQL >= 8.1 * $insert_id = SELECT nextval('foo_seq'); INSERT INTO table (foo...) values ($insert_id...) for older PostgreSQL (...
mysql_insert_id alternative for postgresql is there an alternative for mysql_insert_id() php function for PostgreSQL? Most of the frameworks are solving the problem partially by finding the current value of the sequence used in the ID. However, there are times that the primary key is not a serial column....
TITLE: mysql_insert_id alternative for postgresql QUESTION: is there an alternative for mysql_insert_id() php function for PostgreSQL? Most of the frameworks are solving the problem partially by finding the current value of the sequence used in the ID. However, there are times that the primary key is not a serial colu...
[ "php", "postgresql", "insert-id" ]
24
44
19,439
4
0
2008-09-11T07:37:00.107000
2008-09-11T09:32:42.247000
55,961
55,969
Exception Handling in .net web apps
I admit it: I don't bother with too much exception handling. I know I should do more but I can never wrap my head around where to start and where to stop. I'm not being lazy. Far from it. It's that I'm overwrought with exception handling ambivalence. It just seems that there is a seemingly infinite number of places in ...
Microsoft's Patterns & Practices team did a good job incorporating best practices of exception management into Enterprise Library Exception Handling Application Block Event if wouldn't use Enterprise Library, I highly recommend you to read their documentation. P&P team describes common scenarios and best practices for ...
Exception Handling in .net web apps I admit it: I don't bother with too much exception handling. I know I should do more but I can never wrap my head around where to start and where to stop. I'm not being lazy. Far from it. It's that I'm overwrought with exception handling ambivalence. It just seems that there is a see...
TITLE: Exception Handling in .net web apps QUESTION: I admit it: I don't bother with too much exception handling. I know I should do more but I can never wrap my head around where to start and where to stop. I'm not being lazy. Far from it. It's that I'm overwrought with exception handling ambivalence. It just seems t...
[ "asp.net", "exception" ]
9
11
1,508
6
0
2008-09-11T07:45:56.340000
2008-09-11T07:49:00.840000
55,963
60,855
Unsafe C# and pointers for 2D rendering, good or bad?
I am writing a C# control that wraps DirectX 9 and provides a simplified interface to perform 2D pixel level drawing..NET requires that I wrap this code in an unsafe code block and compile with the allow unsafe code option. I'm locking the entire surface which then returns a pointer to the locked area of memory. I can ...
Using unsafe pointers is the fastest way to do direct memory manipulation in C# (definitely faster than using the Marshal wrapper functions). Just out of curiosity, what sort of 2D drawing operations are you trying to perform? I ask because locking a DirectX surface to do pixel level manipulations will defeat most of t...
Unsafe C# and pointers for 2D rendering, good or bad? I am writing a C# control that wraps DirectX 9 and provides a simplified interface to perform 2D pixel level drawing..NET requires that I wrap this code in an unsafe code block and compile with the allow unsafe code option. I'm locking the entire surface which then ...
TITLE: Unsafe C# and pointers for 2D rendering, good or bad? QUESTION: I am writing a C# control that wraps DirectX 9 and provides a simplified interface to perform 2D pixel level drawing..NET requires that I wrap this code in an unsafe code block and compile with the allow unsafe code option. I'm locking the entire s...
[ "c#", "graphics", "pointers" ]
5
5
2,825
4
0
2008-09-11T07:47:22.343000
2008-09-13T20:41:18.503000
55,964
56,123
Make WiX installation set upgrade to the same folder
How can I make a major upgrade to an installation set (MSI) built with WiX install into the same folder as the original installation? The installation is correctly detected as an upgrade, but the directory selection screen is still shown and with the default value (not necessarily the current installation folder). Do I...
There's an example in the WiX tutorial: https://www.firegiant.com/wix/tutorial/getting-started/where-to-install/ Of course, you've got to set the registry key as part of the install too. Stick this inside a component that's part of the original install:
Make WiX installation set upgrade to the same folder How can I make a major upgrade to an installation set (MSI) built with WiX install into the same folder as the original installation? The installation is correctly detected as an upgrade, but the directory selection screen is still shown and with the default value (n...
TITLE: Make WiX installation set upgrade to the same folder QUESTION: How can I make a major upgrade to an installation set (MSI) built with WiX install into the same folder as the original installation? The installation is correctly detected as an upgrade, but the directory selection screen is still shown and with th...
[ "wix", "windows-installer" ]
31
34
10,677
3
0
2008-09-11T07:47:46.663000
2008-09-11T09:25:20.593000
55,968
55,973
Is there a MySQLAdmin or SQL Server Management Studio equivalent for SQLite databases on Windows?
I need some software to explore and modify some SQLite databases. Does anything similar to SQL Server Management Studio or MySQLAdmin exist for it?
As a Firefox plugin (aimed mainly at gears, but should work) As a (sucky) web based app And a big list of management tools
Is there a MySQLAdmin or SQL Server Management Studio equivalent for SQLite databases on Windows? I need some software to explore and modify some SQLite databases. Does anything similar to SQL Server Management Studio or MySQLAdmin exist for it?
TITLE: Is there a MySQLAdmin or SQL Server Management Studio equivalent for SQLite databases on Windows? QUESTION: I need some software to explore and modify some SQLite databases. Does anything similar to SQL Server Management Studio or MySQLAdmin exist for it? ANSWER: As a Firefox plugin (aimed mainly at gears, but...
[ "sql", "windows", "sqlite" ]
6
10
2,230
3
0
2008-09-11T07:48:53.867000
2008-09-11T07:52:32.610000
55,984
56,024
What is the difference between const and readonly in C#?
What is the difference between const and readonly in C#? When would you use one over the other?
Apart from the apparent difference of having to declare the value at the time of a definition for a const VS readonly values can be computed dynamically but need to be assigned before the constructor exits. After that it is frozen. const 's are implicitly static. You use a ClassName.ConstantName notation to access them...
What is the difference between const and readonly in C#? What is the difference between const and readonly in C#? When would you use one over the other?
TITLE: What is the difference between const and readonly in C#? QUESTION: What is the difference between const and readonly in C#? When would you use one over the other? ANSWER: Apart from the apparent difference of having to declare the value at the time of a definition for a const VS readonly values can be computed...
[ "c#", ".net", "constants", "readonly" ]
1,699
1,553
514,533
30
0
2008-09-11T08:02:19.297000
2008-09-11T08:24:41.770000
56,011
56,190
Single quotes vs. double quotes in Python
According to the documentation, they're pretty much interchangeable. Is there a stylistic reason to use one over the other?
I like to use double quotes around strings that are used for interpolation or that are natural language messages, and single quotes for small symbol-like strings, but will break the rules if the strings contain quotes, or if I forget. I use triple double quotes for docstrings and raw string literals for regular express...
Single quotes vs. double quotes in Python According to the documentation, they're pretty much interchangeable. Is there a stylistic reason to use one over the other?
TITLE: Single quotes vs. double quotes in Python QUESTION: According to the documentation, they're pretty much interchangeable. Is there a stylistic reason to use one over the other? ANSWER: I like to use double quotes around strings that are used for interpolation or that are natural language messages, and single qu...
[ "python", "coding-style" ]
718
525
814,734
19
0
2008-09-11T08:18:55.293000
2008-09-11T10:06:49.557000
56,013
56,017
Cross platform .Net?
If you were to write an GUI application that runs locally and calls a webservice, to be cross platform, can you do it with.Net, what tools would you recommend? I was considering Java as it would be relatively easy to pick up due to its C# similarity and then I could use the JVM.
You should get familiar with the Mono project and MonoDevelop; the express purpose of those projects is to allow building and running.NET code on a variety of platforms, including Windows, Linux, and Mac OSX. Since the Mono is a re-implementation of.NET, it always lags a little behind Microsoft.NET, but they've got goo...
Cross platform .Net? If you were to write an GUI application that runs locally and calls a webservice, to be cross platform, can you do it with.Net, what tools would you recommend? I was considering Java as it would be relatively easy to pick up due to its C# similarity and then I could use the JVM.
TITLE: Cross platform .Net? QUESTION: If you were to write an GUI application that runs locally and calls a webservice, to be cross platform, can you do it with.Net, what tools would you recommend? I was considering Java as it would be relatively easy to pick up due to its C# similarity and then I could use the JVM. ...
[ ".net", "cross-platform" ]
7
10
3,985
9
0
2008-09-11T08:20:29.110000
2008-09-11T08:21:49.140000
56,022
56,043
Prevent file casing problems in Subversion
We encountered a problem with using Subversion on Windows. A developer committed a file foo.Data.sql and later another developer committed a file called foo.data.sql. Naturally, this caused a problem on Windows clients (all clients are Windows in our environments) because files are case sensitive in Subversion but not ...
There is definitely a hook script that checks case sensitivity - Sourceforge have it as one of their options. A quick google turns up: http://www.subversionary.org/howto/using-check-case-insensitive-py-on-windows and http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/case-insensitive.py The issue wil...
Prevent file casing problems in Subversion We encountered a problem with using Subversion on Windows. A developer committed a file foo.Data.sql and later another developer committed a file called foo.data.sql. Naturally, this caused a problem on Windows clients (all clients are Windows in our environments) because file...
TITLE: Prevent file casing problems in Subversion QUESTION: We encountered a problem with using Subversion on Windows. A developer committed a file foo.Data.sql and later another developer committed a file called foo.data.sql. Naturally, this caused a problem on Windows clients (all clients are Windows in our environm...
[ "svn", "tortoisesvn" ]
4
4
2,008
3
0
2008-09-11T08:23:02.287000
2008-09-11T08:38:12.017000
56,037
56,519
how to represent an empty field in yaml
I am working with fixtures on rails and I want one of the fixture fields to be blank. Example: two: name: test path: - I want this blank but not to act as a group heading. test: 4 But, I do not know how to leave path: blank without it acting as a group title. Does anybody know how to do that?
YAML files are based on indentation. Once you actually have correct indentation it will read everything at the same level as siblings. two: name: test path: test: 4
how to represent an empty field in yaml I am working with fixtures on rails and I want one of the fixture fields to be blank. Example: two: name: test path: - I want this blank but not to act as a group heading. test: 4 But, I do not know how to leave path: blank without it acting as a group title. Does anybody know ho...
TITLE: how to represent an empty field in yaml QUESTION: I am working with fixtures on rails and I want one of the fixture fields to be blank. Example: two: name: test path: - I want this blank but not to act as a group heading. test: 4 But, I do not know how to leave path: blank without it acting as a group title. Do...
[ "ruby-on-rails", "yaml" ]
8
7
7,654
2
0
2008-09-11T08:32:21.830000
2008-09-11T13:26:18.113000
56,045
56,626
Stuts2 Tiles Tomcat suspected of changing UTF-8 to?
I'm having some internationalisation woes: My UTF-8 string fields are being rendered in the browser as???? after being returned from the database. After retrieval from the database using Hibernate, the String fields are presented correctly on inspection using the eclipse debugger. However Struts2/Tiles is rendering the...
You could try something like this. It's taken from sun's page on Character Sets and Encodings. I think this has to be the very first line in your jsp. <%@ page contentType="text/html; charset=UTF-8" %>
Stuts2 Tiles Tomcat suspected of changing UTF-8 to? I'm having some internationalisation woes: My UTF-8 string fields are being rendered in the browser as???? after being returned from the database. After retrieval from the database using Hibernate, the String fields are presented correctly on inspection using the ecli...
TITLE: Stuts2 Tiles Tomcat suspected of changing UTF-8 to? QUESTION: I'm having some internationalisation woes: My UTF-8 string fields are being rendered in the browser as???? after being returned from the database. After retrieval from the database using Hibernate, the String fields are presented correctly on inspect...
[ "java", "utf-8", "internationalization", "struts2", "tiles" ]
1
0
600
4
0
2008-09-11T08:39:22.403000
2008-09-11T14:05:28.127000
56,046
56,080
Stop system entering 'standby'
How can i stop the host machine entering standby mode while my application is running? Is there any win32 api call to do this?
There are two APIs, depending on what version of Windows. XP,2000, 2003: http://msdn.microsoft.com/en-us/library/aa373247(VS.85).aspx Respond to PBT_APMQUERYSUSPEND. Vista, 2008: http://msdn.microsoft.com/en-us/library/aa373208(VS.85).aspx There could be many valid reasons to prevent the computer from going to sleep. F...
Stop system entering 'standby' How can i stop the host machine entering standby mode while my application is running? Is there any win32 api call to do this?
TITLE: Stop system entering 'standby' QUESTION: How can i stop the host machine entering standby mode while my application is running? Is there any win32 api call to do this? ANSWER: There are two APIs, depending on what version of Windows. XP,2000, 2003: http://msdn.microsoft.com/en-us/library/aa373247(VS.85).aspx R...
[ "c++", "winapi", "standards", "standby" ]
4
6
3,520
2
0
2008-09-11T08:40:03.027000
2008-09-11T08:57:51.143000
56,052
56,061
Best way to insert timestamp in Vim?
EditPad Lite has a nice feature ( CTRL - E, CTRL - I ) which inserts a time stamp e.g. "2008-09-11 10:34:53" into your code. What is the best way to get this functionality in Vim? (I am using Vim 6.1 on a Linux server via SSH. In the current situation a number of us share a login so I don't want to create abbreviations...
http://kenno.wordpress.com/2006/08/03/vim-tip-insert-time-stamp/ Tried it out, it works on my mac::r! date produces: Thu Sep 11 10:47:30 CEST 2008 This::r! date "+\%Y-\%m-\%d \%H:\%M:\%S" produces: 2008-09-11 10:50:56
Best way to insert timestamp in Vim? EditPad Lite has a nice feature ( CTRL - E, CTRL - I ) which inserts a time stamp e.g. "2008-09-11 10:34:53" into your code. What is the best way to get this functionality in Vim? (I am using Vim 6.1 on a Linux server via SSH. In the current situation a number of us share a login so...
TITLE: Best way to insert timestamp in Vim? QUESTION: EditPad Lite has a nice feature ( CTRL - E, CTRL - I ) which inserts a time stamp e.g. "2008-09-11 10:34:53" into your code. What is the best way to get this functionality in Vim? (I am using Vim 6.1 on a Linux server via SSH. In the current situation a number of u...
[ "vim", "vi" ]
104
102
45,314
11
0
2008-09-11T08:41:56.547000
2008-09-11T08:45:50.843000
56,070
56,163
DELETE Statement hangs on SQL Server for no apparent reason
Edit: Solved, there was a trigger with a loop on the table (read my own answer further below). We have a simple delete statement that looks like this: DELETE FROM tablename WHERE pk = 12345 This just hangs, no timeout, no nothing. We've looked at the execution plan, and it consists of many lookups on related tables to ...
One piece of information missing is the number of indices on the table you are deleting the data from. As SQL Server uses the Primary Key as a pointer in every index, any change to the primary index requires updating every index. Though, unless we are talking a high number, this shouldn't be an issue. I am guessing, fr...
DELETE Statement hangs on SQL Server for no apparent reason Edit: Solved, there was a trigger with a loop on the table (read my own answer further below). We have a simple delete statement that looks like this: DELETE FROM tablename WHERE pk = 12345 This just hangs, no timeout, no nothing. We've looked at the execution...
TITLE: DELETE Statement hangs on SQL Server for no apparent reason QUESTION: Edit: Solved, there was a trigger with a loop on the table (read my own answer further below). We have a simple delete statement that looks like this: DELETE FROM tablename WHERE pk = 12345 This just hangs, no timeout, no nothing. We've looke...
[ "sql", "sql-server", "sql-server-2005" ]
11
6
17,548
3
0
2008-09-11T08:51:39.550000
2008-09-11T09:51:37.397000
56,078
56,100
Merging two Collection<T>
I got a Function that returns a Collection, and that calls itself recursively to eventually return one big Collection. Now, i just wonder what the best approach to merge the lists? Collection.CopyTo() only copies to string[], and using a foreach() loop feels like being inefficient. However, since I also want to filter ...
If you're using List<> you can use.AddRange to add one list to the other list. Or you can use yield return to combine lists on the fly like this: public IEnumerable Combine(IEnumerable col1, IEnumerable col2) { foreach(string item in col1) yield return item; foreach(string item in col2) yield return item; }
Merging two Collection<T> I got a Function that returns a Collection, and that calls itself recursively to eventually return one big Collection. Now, i just wonder what the best approach to merge the lists? Collection.CopyTo() only copies to string[], and using a foreach() loop feels like being inefficient. However, si...
TITLE: Merging two Collection<T> QUESTION: I got a Function that returns a Collection, and that calls itself recursively to eventually return one big Collection. Now, i just wonder what the best approach to merge the lists? Collection.CopyTo() only copies to string[], and using a foreach() loop feels like being ineffi...
[ "c#", "collections" ]
9
18
14,487
5
0
2008-09-11T08:57:17.853000
2008-09-11T09:06:44.990000
56,087
57,802
Does ruby have real multithreading?
I know about the "cooperative" threading of ruby using green threads. How can I create real "OS-level" threads in my application in order to make use of multiple cpu cores for processing?
Updated with Jörg's Sept 2011 comment You seem to be confusing two very different things here: the Ruby Programming Language and the specific threading model of one specific implementation of the Ruby Programming Language. There are currently around 11 different implementations of the Ruby Programming Language, with ve...
Does ruby have real multithreading? I know about the "cooperative" threading of ruby using green threads. How can I create real "OS-level" threads in my application in order to make use of multiple cpu cores for processing?
TITLE: Does ruby have real multithreading? QUESTION: I know about the "cooperative" threading of ruby using green threads. How can I create real "OS-level" threads in my application in order to make use of multiple cpu cores for processing? ANSWER: Updated with Jörg's Sept 2011 comment You seem to be confusing two ve...
[ "ruby", "multithreading", "concurrency" ]
304
620
80,710
9
0
2008-09-11T09:01:36.003000
2008-09-11T22:25:12.903000
56,091
56,111
Pointers to C++ class methods
Whilst refactoring some legacy C++ code I found that I could potentially remove some code duplication by somehow defining a variable that could point to any class method that shared the same signature. After a little digging, I found that I could do something like the following: class MyClass { protected: bool CaseMeth...
What you have there is a pointer-to-member-function. It will solve your problem. I am surprised that your "TestSwitch" function compiles, as the calling syntax is slightly different to what you might expect. It should be: bool res = (this->*CaseMethod)( 999, "hello world" ); However, you might find a combination of boo...
Pointers to C++ class methods Whilst refactoring some legacy C++ code I found that I could potentially remove some code duplication by somehow defining a variable that could point to any class method that shared the same signature. After a little digging, I found that I could do something like the following: class MyCl...
TITLE: Pointers to C++ class methods QUESTION: Whilst refactoring some legacy C++ code I found that I could potentially remove some code duplication by somehow defining a variable that could point to any class method that shared the same signature. After a little digging, I found that I could do something like the fol...
[ "c++" ]
3
8
1,084
7
0
2008-09-11T09:03:13.737000
2008-09-11T09:18:24.153000
56,096
56,214
Removing web.config from subversion (ASP.NET Project)
I have a project which is source controlled using Subversion and VisualSVN. Since the version of web.config is different on the server and the developers' computers I want the file to remain on the computers but to be ignored by Subversion. I added it to the svn:ignore but it still remains (and still has a red exclamat...
you'll have to do both the remove and ignore operation first make a backup of your local file (like @ibz said) then remove the web.config from the repository. then copy back the web.config to the same folder finally use svn:ignore so that subversion does not try to add it again to the repository since i use tortoisesvn...
Removing web.config from subversion (ASP.NET Project) I have a project which is source controlled using Subversion and VisualSVN. Since the version of web.config is different on the server and the developers' computers I want the file to remain on the computers but to be ignored by Subversion. I added it to the svn:ign...
TITLE: Removing web.config from subversion (ASP.NET Project) QUESTION: I have a project which is source controlled using Subversion and VisualSVN. Since the version of web.config is different on the server and the developers' computers I want the file to remain on the computers but to be ignored by Subversion. I added...
[ "asp.net", "svn", "web-config" ]
4
6
2,690
4
0
2008-09-11T09:06:06.520000
2008-09-11T10:27:02.943000
56,112
57,760
WCF, ASP.NET Membership Provider and Authentication Service
I have written a Silverlight 2 application communicating with a WCF service (BasicHttpBinding). The site hosting the Silverlight content is protected using a ASP.NET Membership Provider. I can access the current user using HttpContext.Current.User.Identity.Name from my WCF service, and I have turned on AspNetCompatibil...
I finally found a way to make this work. For authentication I'm using the " WCF Authentication Service ". When authenticating the service will try to set an authentication cookie. I need to get this cookie out of the response, and add it to any other request made to other web services on the same machine. The code to d...
WCF, ASP.NET Membership Provider and Authentication Service I have written a Silverlight 2 application communicating with a WCF service (BasicHttpBinding). The site hosting the Silverlight content is protected using a ASP.NET Membership Provider. I can access the current user using HttpContext.Current.User.Identity.Nam...
TITLE: WCF, ASP.NET Membership Provider and Authentication Service QUESTION: I have written a Silverlight 2 application communicating with a WCF service (BasicHttpBinding). The site hosting the Silverlight content is protected using a ASP.NET Membership Provider. I can access the current user using HttpContext.Current...
[ ".net", "wcf", "web-services" ]
13
5
22,038
6
0
2008-09-11T09:18:49.503000
2008-09-11T21:59:47.800000
56,118
57,362
Triangle Trigonometry (ActionScript 3)
I am trying to write a formula in ActionScript 3 that will give me var "z" (please see image below) in degrees, which I will then convert to radians. I will already know the value of vars "x" and "y". Using trigonometry, how can I calculate the length of the hypotenuse and therefore the variable angle of var z? A solut...
What you need is this: var h:Number = Math.sqrt(x*x + y*y); var z:Number = Math.atan2(y, x); That should give you the angle in radians, you might need to swap x/y and possibly add or remove 90 degrees but it should do the trick! (Note that you don't even need h to get z when you're using atan2) I use multiplication ins...
Triangle Trigonometry (ActionScript 3) I am trying to write a formula in ActionScript 3 that will give me var "z" (please see image below) in degrees, which I will then convert to radians. I will already know the value of vars "x" and "y". Using trigonometry, how can I calculate the length of the hypotenuse and therefo...
TITLE: Triangle Trigonometry (ActionScript 3) QUESTION: I am trying to write a formula in ActionScript 3 that will give me var "z" (please see image below) in degrees, which I will then convert to radians. I will already know the value of vars "x" and "y". Using trigonometry, how can I calculate the length of the hypo...
[ "actionscript-3", "trigonometry", "hypotenuse" ]
7
6
8,939
4
0
2008-09-11T09:22:45.187000
2008-09-11T19:08:16.997000
56,121
56,135
IPC Mechanisms in C# - Usage and Best Practices
I have used IPC in Win32 code a while ago - critical sections, events, and semaphores. How is the scene in the.NET environment? Are there any tutorial explaining all available options and when to use and why?
Most recent Microsoft's stuff in IPC is Windows Communication Foundation. Actually there is nothing new in the lower level (tcp, upd, named pipes etc) But WCF simplifies IPC development greatly. Useful resource: Interprocess Communication with WCF on Dr. Dobb's portal WCF Communication Options in the.NET Framework 3.5 ...
IPC Mechanisms in C# - Usage and Best Practices I have used IPC in Win32 code a while ago - critical sections, events, and semaphores. How is the scene in the.NET environment? Are there any tutorial explaining all available options and when to use and why?
TITLE: IPC Mechanisms in C# - Usage and Best Practices QUESTION: I have used IPC in Win32 code a while ago - critical sections, events, and semaphores. How is the scene in the.NET environment? Are there any tutorial explaining all available options and when to use and why? ANSWER: Most recent Microsoft's stuff in IPC...
[ "c#", ".net", "ipc" ]
56
31
84,988
6
0
2008-09-11T09:24:22.873000
2008-09-11T09:34:50.150000
56,124
56,198
Can I run a 64-bit VMware image on a 32-bit machine?
Can I run a 64-bit VMware image on a 32-bit machine? I've googled this, but there doesn't seem to be a conclusive answer. I know that it would have to be completely emulated and would run like a dog - but slow performance isn't necessarily an issue as I'm just interested in testing some of my background services code o...
The easiest way to check your workstation is to download the VMware Processor Check for 64-Bit Compatibility tool from the VMware website. You can't run a 64-bit VM session on a 32-bit processor. However, you can run a 64-bit VM session if you have a 64-bit processor but have installed a 32-bit host OS and your process...
Can I run a 64-bit VMware image on a 32-bit machine? Can I run a 64-bit VMware image on a 32-bit machine? I've googled this, but there doesn't seem to be a conclusive answer. I know that it would have to be completely emulated and would run like a dog - but slow performance isn't necessarily an issue as I'm just intere...
TITLE: Can I run a 64-bit VMware image on a 32-bit machine? QUESTION: Can I run a 64-bit VMware image on a 32-bit machine? I've googled this, but there doesn't seem to be a conclusive answer. I know that it would have to be completely emulated and would run like a dog - but slow performance isn't necessarily an issue ...
[ "64-bit", "vmware", "virtualization", "virtual-machine" ]
90
124
218,623
10
0
2008-09-11T09:26:25.240000
2008-09-11T10:10:18.677000
56,145
87,399
MFC IE embedded web browser wackiness
I have this modeless MFC dialog which embeds an Internet Explorer web browser control. The control is derived straight from CWnd with ActiveX wrappers generated by Visual Studio, and I map it to the CDialog using only a DDX_Control(pDX, IDC_EXPLORER, m_explorer);. I have 2 problems. Problem #1: Being modeless, I start ...
problem 1) try myBrowser.navigate("about:blank") before destroying the window.
MFC IE embedded web browser wackiness I have this modeless MFC dialog which embeds an Internet Explorer web browser control. The control is derived straight from CWnd with ActiveX wrappers generated by Visual Studio, and I map it to the CDialog using only a DDX_Control(pDX, IDC_EXPLORER, m_explorer);. I have 2 problems...
TITLE: MFC IE embedded web browser wackiness QUESTION: I have this modeless MFC dialog which embeds an Internet Explorer web browser control. The control is derived straight from CWnd with ActiveX wrappers generated by Visual Studio, and I map it to the CDialog using only a DDX_Control(pDX, IDC_EXPLORER, m_explorer);....
[ "c++", "internet-explorer", "mfc", "dialog" ]
5
3
3,063
1
0
2008-09-11T09:41:53.720000
2008-09-17T20:38:17.133000
56,149
56,212
Storing file permissions in Subversion repository
How do you store file permissions in a repository? A few files need to be read-only to stop a third party program from trashing it but after checking out of the repository they are set to read-write. I looked on google and found a blog post from 2005 that states that Subversion doesn't store file-permissions. There are...
One possible solution would be to write a script that you check in with the rest of your code and which is run as the first step of your build process. This script runs through your copy of the codebase and sets read permissions on certain files. Ideally the script would read the list of files from a simple input file....
Storing file permissions in Subversion repository How do you store file permissions in a repository? A few files need to be read-only to stop a third party program from trashing it but after checking out of the repository they are set to read-write. I looked on google and found a blog post from 2005 that states that Su...
TITLE: Storing file permissions in Subversion repository QUESTION: How do you store file permissions in a repository? A few files need to be read-only to stop a third party program from trashing it but after checking out of the repository they are set to read-write. I looked on google and found a blog post from 2005 t...
[ "windows", "svn", "file-permissions" ]
41
11
37,134
12
0
2008-09-11T09:45:37.613000
2008-09-11T10:23:29.503000
56,224
56,299
Creating objects driven by the database to populate a Treeview - very slow
I have an application that reads a table from a database. I issue an SQL query to get a result set, based on a unique string value I glean from the results, I use a case/switch statement to generate certain objects (they inherit TreeNode BTW). These created objects get shunted into a Dictionary object to be used later....
To add to @ Brad, only populate the tree as needed. That means hooking into the expand event of the tree nodes. This is similar to how Windows Explorer functions when dealing with network shares. There should be 1 TreeNode object per actual tree node in the tree - don't try to reuse the things. You may either associate...
Creating objects driven by the database to populate a Treeview - very slow I have an application that reads a table from a database. I issue an SQL query to get a result set, based on a unique string value I glean from the results, I use a case/switch statement to generate certain objects (they inherit TreeNode BTW). T...
TITLE: Creating objects driven by the database to populate a Treeview - very slow QUESTION: I have an application that reads a table from a database. I issue an SQL query to get a result set, based on a unique string value I glean from the results, I use a case/switch statement to generate certain objects (they inheri...
[ "c#", "dictionary", "object", "clone", "icloneable" ]
2
1
1,062
3
0
2008-09-11T10:33:54.173000
2008-09-11T11:25:28.933000
56,227
56,240
How do you determine the latest SVN revision number rooted in a directory?
I would like to start tagging my deployed binaries with the latest SVN revision number. However, because SVN is file-based and not directory/project-based, I need to scan through all the directory's and subdirectory's files in order to determine the highest revision number. Using svn info on the root doesn't work (it j...
One way. When you check out the code, look at the last line of svn output: $ svn up...stuff... Updated to revision 66593. A more direct way: $ svn info Path:. URL: https://svn.example.com/svn/myproject/trunk Repository Root: https://svn.example.com/svn/ Repository UUID: d2a7a951-c712-0410-832a-9abccabd3052 Revision: 66...
How do you determine the latest SVN revision number rooted in a directory? I would like to start tagging my deployed binaries with the latest SVN revision number. However, because SVN is file-based and not directory/project-based, I need to scan through all the directory's and subdirectory's files in order to determine...
TITLE: How do you determine the latest SVN revision number rooted in a directory? QUESTION: I would like to start tagging my deployed binaries with the latest SVN revision number. However, because SVN is file-based and not directory/project-based, I need to scan through all the directory's and subdirectory's files in ...
[ "svn", "build-automation" ]
36
25
47,971
10
0
2008-09-11T10:35:02.767000
2008-09-11T10:43:00.050000
56,229
56,470
XML writing tools for Python
I'm currently trying ElementTree and it looks fine, it escapes HTML entities and so on and so forth. Am I missing something truly wonderful I haven't heard of? This is similar to what I'm actually doing: import xml.etree.ElementTree as ET root = ET.Element('html') head = ET.SubElement(root,'head') script = ET.SubElemen...
I assume that you're actually creating an XML DOM tree, because you want to validate that what goes into this file is valid XML, since otherwise you'd just write a static string to a file. If validating your output is indeed your goal, then I'd suggest from xml.dom.minidom import parseString doc = parseString(""" And ...
XML writing tools for Python I'm currently trying ElementTree and it looks fine, it escapes HTML entities and so on and so forth. Am I missing something truly wonderful I haven't heard of? This is similar to what I'm actually doing: import xml.etree.ElementTree as ET root = ET.Element('html') head = ET.SubElement(root,...
TITLE: XML writing tools for Python QUESTION: I'm currently trying ElementTree and it looks fine, it escapes HTML entities and so on and so forth. Am I missing something truly wonderful I haven't heard of? This is similar to what I'm actually doing: import xml.etree.ElementTree as ET root = ET.Element('html') head = E...
[ "python", "xml", "xhtml" ]
35
10
39,057
8
0
2008-09-11T10:35:37.163000
2008-09-11T12:53:06.977000
56,249
56,286
WCF service configuration file question regarding <baseAddresses>
From what I've seen the tag is ignored when hosting a WCF service in IIS. I understand that when self-hosting this is required but is this harmful or even used when operating under IIS? ex. From what I've seen you can take a config file describing a service from one machine and use that on a completely different machin...
As you have guessed, the baseAddresses element is completely ignored when hosting in IIS. The service's base address is determined by the web site & virtual directory into which your wcf service is placed. Even when self-hosting, baseAddresses is not required. It is merely a convenience that avoids you having to enter ...
WCF service configuration file question regarding <baseAddresses> From what I've seen the tag is ignored when hosting a WCF service in IIS. I understand that when self-hosting this is required but is this harmful or even used when operating under IIS? ex. From what I've seen you can take a config file describing a serv...
TITLE: WCF service configuration file question regarding <baseAddresses> QUESTION: From what I've seen the tag is ignored when hosting a WCF service in IIS. I understand that when self-hosting this is required but is this harmful or even used when operating under IIS? ex. From what I've seen you can take a config file...
[ "wcf", "configuration", "configuration-files" ]
19
35
26,959
3
0
2008-09-11T10:49:46.677000
2008-09-11T11:21:15.870000
56,256
56,301
Converting a .rptproj from VS2005 to VS2008
I've got my brand new VS2008 and decided to convert my main solution from VS2005. One of the projects is a SQL2005 reporting services project. Now that I've converted I cannot load it in VS2008. Is there anyway around this? My problem is that my solution is a hybrid and has websites libraries and reports in there. Sepa...
Visual Studio 2008 does not support the 2005 business intelligence projects, so if you have not done so already don't uninstall 2005 Business Intelligence! You can continue to maintain those projects independently in VS2005. SQL Server 2008 Business Intelligence will integrate with VS2008 so you will require that and a...
Converting a .rptproj from VS2005 to VS2008 I've got my brand new VS2008 and decided to convert my main solution from VS2005. One of the projects is a SQL2005 reporting services project. Now that I've converted I cannot load it in VS2008. Is there anyway around this? My problem is that my solution is a hybrid and has w...
TITLE: Converting a .rptproj from VS2005 to VS2008 QUESTION: I've got my brand new VS2008 and decided to convert my main solution from VS2005. One of the projects is a SQL2005 reporting services project. Now that I've converted I cannot load it in VS2008. Is there anyway around this? My problem is that my solution is ...
[ "visual-studio-2008", "reporting-services" ]
6
1
4,426
2
0
2008-09-11T10:53:15.813000
2008-09-11T11:27:17.743000
56,266
56,366
Using Silverlight for an entire website?
We need to build an administration portal website to support our client/server application. Since we're a.Net shop the obvious traditional way would be to do that in ASP.Net. But Silverlight 2 will be coming out of beta a good while before our release date. Should we consider building the whole website in silverlight i...
Depends on your goals. If administration portal is part of application and will only be used from computers where your application is installed, there are plenty of advantages of going fully Silverlight - or even WPF. But if you can see a scenario where it will be used either from random PC or by random person, fully f...
Using Silverlight for an entire website? We need to build an administration portal website to support our client/server application. Since we're a.Net shop the obvious traditional way would be to do that in ASP.Net. But Silverlight 2 will be coming out of beta a good while before our release date. Should we consider bu...
TITLE: Using Silverlight for an entire website? QUESTION: We need to build an administration portal website to support our client/server application. Since we're a.Net shop the obvious traditional way would be to do that in ASP.Net. But Silverlight 2 will be coming out of beta a good while before our release date. Sho...
[ "asp.net", "silverlight", "architecture" ]
10
9
9,523
12
0
2008-09-11T10:59:08.590000
2008-09-11T12:01:41.827000
56,271
57,040
Context.User losing Roles after being assigned in Global.asax.Application_AuthenticateRequest
I am using Forms authentication in my asp.net (3.5) application. I am also using roles to define what user can access which subdirectories of the app. Thus, the pertinent sections of my web.config file look like this: Based on what I have read, this should ensure that the only users able to access the Admin directory w...
Here was the problem and solution: Earlier in development I had gone to the Website menu and clicked on Asp.net configuration. This resulted in the following line being added to the web.config: From that point on, the app was assuming that I was doing roles through the Asp.net site manager, and not through FormsAuthent...
Context.User losing Roles after being assigned in Global.asax.Application_AuthenticateRequest I am using Forms authentication in my asp.net (3.5) application. I am also using roles to define what user can access which subdirectories of the app. Thus, the pertinent sections of my web.config file look like this: Based on...
TITLE: Context.User losing Roles after being assigned in Global.asax.Application_AuthenticateRequest QUESTION: I am using Forms authentication in my asp.net (3.5) application. I am also using roles to define what user can access which subdirectories of the app. Thus, the pertinent sections of my web.config file look l...
[ "c#", ".net", "asp.net", "forms-authentication", "roles" ]
3
5
6,153
2
0
2008-09-11T11:06:31.973000
2008-09-11T16:23:11.433000
56,279
56,281
Export ASPX to HTML
We're building a CMS. The site will be built and managed by the users in aspx pages, but we would like to create a static site of HTML's. The way we're doing it now is with code I found here that overloads the Render method in the Aspx Page and writes the HTML string to a file. This works fine for a single page, but th...
Calling the Render method is still pretty simple. Just create an instance of your page, create a stub WebContext along with the WebRequest object, and call the Render method of the page. You are then free to do whatever you want with the results. Alternatively, write a little curl or wget script to download and store w...
Export ASPX to HTML We're building a CMS. The site will be built and managed by the users in aspx pages, but we would like to create a static site of HTML's. The way we're doing it now is with code I found here that overloads the Render method in the Aspx Page and writes the HTML string to a file. This works fine for a...
TITLE: Export ASPX to HTML QUESTION: We're building a CMS. The site will be built and managed by the users in aspx pages, but we would like to create a static site of HTML's. The way we're doing it now is with code I found here that overloads the Render method in the Aspx Page and writes the HTML string to a file. Thi...
[ "asp.net", "html", "screen-scraping" ]
5
2
7,522
5
0
2008-09-11T11:15:54.213000
2008-09-11T11:18:53.783000
56,296
56,320
Can you view an aggregate changeset in git? If so, how?
In Subversion you can specify a range of versions to get an aggregate view of a series of commits. Is this possible in git? If so, how?
You can pass ranges of revisions using the.. (and...) operator. git diff 6d0918...HEAD instead of giving (abbreviated) SHA hashes, you can also denote revisions relative to branches and tags: git diff HEAD~4 # shows the diff from the last four commits to the current one Have a look at the chapter "Specifying Revisions"...
Can you view an aggregate changeset in git? If so, how? In Subversion you can specify a range of versions to get an aggregate view of a series of commits. Is this possible in git? If so, how?
TITLE: Can you view an aggregate changeset in git? If so, how? QUESTION: In Subversion you can specify a range of versions to get an aggregate view of a series of commits. Is this possible in git? If so, how? ANSWER: You can pass ranges of revisions using the.. (and...) operator. git diff 6d0918...HEAD instead of giv...
[ "git", "diff" ]
8
9
1,118
1
0
2008-09-11T11:24:53.660000
2008-09-11T11:37:09.717000
56,313
56,338
ReSharper Code Cleanup/Reformat Code feature vs Versioning Control Systems
ReSharper Code cleanup feature (with " reorder members " and " reformat code " enabled) is really great. You define a layout template using XML, then a simple key combination reorganizes your whole source file (or folder/project/solution) according to the rules you set in the template. Anyway, do you think that could b...
Yes, it will definitely cause problems. In addition to creating conflicts that have to be manually resolved, when you check in a file that has been reformatted, the VCS will note almost every line as having been changed. This will make it hard for you or a teammate to look back at the history and see what changed when....
ReSharper Code Cleanup/Reformat Code feature vs Versioning Control Systems ReSharper Code cleanup feature (with " reorder members " and " reformat code " enabled) is really great. You define a layout template using XML, then a simple key combination reorganizes your whole source file (or folder/project/solution) accord...
TITLE: ReSharper Code Cleanup/Reformat Code feature vs Versioning Control Systems QUESTION: ReSharper Code cleanup feature (with " reorder members " and " reformat code " enabled) is really great. You define a layout template using XML, then a simple key combination reorganizes your whole source file (or folder/projec...
[ "c#", "version-control", "resharper" ]
8
16
5,628
9
0
2008-09-11T11:32:16.513000
2008-09-11T11:44:21.603000
56,315
73,127
D Programming Language in the real world?
Is anyone out there using D for real world applications? If so, what are you using it for? I can't seem to find anything big on the web written in D. Despite the lack of known big users, D seems like a very promissing language to me, and according to TIOBE, it's fairly popular.
I'm using D for my research work in the area of computer graphics. I and others have had papers published in our fields based on work done using D. I think it's definitely ready for use on small to medium sized research projects where performance matters. It's a nice fit for research work because often you're starting ...
D Programming Language in the real world? Is anyone out there using D for real world applications? If so, what are you using it for? I can't seem to find anything big on the web written in D. Despite the lack of known big users, D seems like a very promissing language to me, and according to TIOBE, it's fairly popular.
TITLE: D Programming Language in the real world? QUESTION: Is anyone out there using D for real world applications? If so, what are you using it for? I can't seem to find anything big on the web written in D. Despite the lack of known big users, D seems like a very promissing language to me, and according to TIOBE, it...
[ "d" ]
140
77
47,221
20
0
2008-09-11T11:33:05.887000
2008-09-16T14:46:45.333000
56,324
56,335
Reset screen point to the top of screen in Windows & Linux console
I have a little routine that's run under Linux and Windows written in C and displays output on the console. I'm not linking in any form of curses or anything like that. Currently I clear the screen using #ifdef __WIN32 system( "cls" ); #else system( "clear" ); #endif Then I have a bunch of printf statements to update t...
Looks like I may have found a windows specific way of doing it SetConsoleCursorPosition Ansi escape sequence \033[0;0H for Linux - just printf that to the console.
Reset screen point to the top of screen in Windows & Linux console I have a little routine that's run under Linux and Windows written in C and displays output on the console. I'm not linking in any form of curses or anything like that. Currently I clear the screen using #ifdef __WIN32 system( "cls" ); #else system( "cl...
TITLE: Reset screen point to the top of screen in Windows & Linux console QUESTION: I have a little routine that's run under Linux and Windows written in C and displays output on the console. I'm not linking in any form of curses or anything like that. Currently I clear the screen using #ifdef __WIN32 system( "cls" );...
[ "c", "console" ]
2
0
1,550
4
0
2008-09-11T11:39:15.030000
2008-09-11T11:43:21.650000
56,325
56,331
Team System get-latest-version on checkout
We used to use SourceSafe, and one thing I liked about it was that when you checked out a file, it automatically got you its latest version. Now we work with Team System 2005, and it doesn't work that way - you have to "get latest version" before you start working on a file that you've checked out. Is there a way to co...
There's a Visual Studio Add-in for this that someone wrote: http://blogs.microsoft.co.il/blogs/srlteam/archive/2007/03/24/TFS-GetLatest-version-on-check_2D00_out-Add_2D00_In.aspx
Team System get-latest-version on checkout We used to use SourceSafe, and one thing I liked about it was that when you checked out a file, it automatically got you its latest version. Now we work with Team System 2005, and it doesn't work that way - you have to "get latest version" before you start working on a file th...
TITLE: Team System get-latest-version on checkout QUESTION: We used to use SourceSafe, and one thing I liked about it was that when you checked out a file, it automatically got you its latest version. Now we work with Team System 2005, and it doesn't work that way - you have to "get latest version" before you start wo...
[ "tfs" ]
5
2
418
3
0
2008-09-11T11:39:15.780000
2008-09-11T11:42:08.457000
56,334
56,336
How do I perform a simple one-statement SQL search across tables?
Suppose that two tables exist: users and groups. How does one provide "simple search" in which a user enters text and results contain both users and groups whose names contain the text? The result of the search must distinguish between the two types.
The trick is to combine a UNION with a literal string to determine the type of 'object' returned. In most (?) cases, UNION ALL will be more efficient, and should be used unless duplicates are required in the sub-queries. The following pattern should suffice: SELECT "group" type, name FROM groups WHERE name LIKE "%$text...
How do I perform a simple one-statement SQL search across tables? Suppose that two tables exist: users and groups. How does one provide "simple search" in which a user enters text and results contain both users and groups whose names contain the text? The result of the search must distinguish between the two types.
TITLE: How do I perform a simple one-statement SQL search across tables? QUESTION: Suppose that two tables exist: users and groups. How does one provide "simple search" in which a user enters text and results contain both users and groups whose names contain the text? The result of the search must distinguish between ...
[ "sql", "search" ]
2
3
1,232
4
0
2008-09-11T11:43:11.853000
2008-09-11T11:43:24.227000
56,340
154,326
Can I set a data breakpoint in runtime in System C (or in Plain Vanilla C++)?
I have a class in system-C with some data members as such: long double x[8]; I'm initializing it in the construction like this: for (i = 0; i < 8; ++i) { x[i] = 0; } But the first time I use it in my code I have garbage there. Because of the way the system is built I can't connect a debugger easily. Are there any metho...
You could try starting a second thread which spins, looking for changes in the variable: #include void *ThreadProc(void *arg) { volatile long double *x = (volatile long double *)arg; while(1) { for(int i = 0; i < 8; i++) { if(x[i]!= 0) { __asm__ __volatile__ ("int 3"); // breakpoint (x86) } } return 0; // Never reache...
Can I set a data breakpoint in runtime in System C (or in Plain Vanilla C++)? I have a class in system-C with some data members as such: long double x[8]; I'm initializing it in the construction like this: for (i = 0; i < 8; ++i) { x[i] = 0; } But the first time I use it in my code I have garbage there. Because of the ...
TITLE: Can I set a data breakpoint in runtime in System C (or in Plain Vanilla C++)? QUESTION: I have a class in system-C with some data members as such: long double x[8]; I'm initializing it in the construction like this: for (i = 0; i < 8; ++i) { x[i] = 0; } But the first time I use it in my code I have garbage ther...
[ "c++", "linux", "debugging" ]
0
0
1,213
3
0
2008-09-11T11:45:27.230000
2008-09-30T18:27:21.453000
56,342
56,387
What's the best way of parsing strings?
We've got a scenario that requires us to parse lots of e-mail (plain text), each e-mail 'type' is the result of a script being run against various platforms. Some are tab delimited, some are space delimited, some we simply don't know yet. We'll need to support more 'formats' in the future too. Do we go for a solution u...
The three solutions you stated each cover very different needs. Manual parsing (simple text search) is the most flexible and the most adaptable, however, it very quickly becomes a real pain in the ass as the parsing required is more complicated. Regex are a middle ground, and probably your best bet here. They are power...
What's the best way of parsing strings? We've got a scenario that requires us to parse lots of e-mail (plain text), each e-mail 'type' is the result of a script being run against various platforms. Some are tab delimited, some are space delimited, some we simply don't know yet. We'll need to support more 'formats' in t...
TITLE: What's the best way of parsing strings? QUESTION: We've got a scenario that requires us to parse lots of e-mail (plain text), each e-mail 'type' is the result of a script being run against various platforms. Some are tab delimited, some are space delimited, some we simply don't know yet. We'll need to support m...
[ "c#", "email", "parsing", "projects-and-solutions" ]
6
4
1,450
10
0
2008-09-11T11:47:03.903000
2008-09-11T12:14:38.970000
56,347
56,370
Iterators in C++ (stl) vs Java, is there a conceptual difference?
I'm returning to c++ after being away for a bit and trying to dust off the old melon. In Java Iterator is an interface to a container having methods: hasNext(), next() and remove(). The presence of hasNext() means it has the concept of a limit for the container being traversed. //with an Iterator Iterator iter = trees....
Yes, there is a large conceptual difference. C++ utilizes different "classes" of iterators. Some are used for random access (unlike Java), some are used for forward access (like java). While even others are used for writing data (for use with, say, transform ). See the iterators concept in the C++ Documentation: Input ...
Iterators in C++ (stl) vs Java, is there a conceptual difference? I'm returning to c++ after being away for a bit and trying to dust off the old melon. In Java Iterator is an interface to a container having methods: hasNext(), next() and remove(). The presence of hasNext() means it has the concept of a limit for the co...
TITLE: Iterators in C++ (stl) vs Java, is there a conceptual difference? QUESTION: I'm returning to c++ after being away for a bit and trying to dust off the old melon. In Java Iterator is an interface to a container having methods: hasNext(), next() and remove(). The presence of hasNext() means it has the concept of ...
[ "java", "c++", "iterator", "iteration" ]
34
21
13,934
9
0
2008-09-11T11:50:24.490000
2008-09-11T12:05:12.083000
56,357
56,360
Precompilation and startup times on ASP.Net
I am developping a (relatively small) website in ASP.Net 2.0. I am also using nAnt to perform some easy tweaking on my project before delivering executables. In its current state, the website is "precompiled" using aspnet_compiler.exe -nologo -v ${Appname} -u ${target} I have noticed that after the IIS pool is restarte...
Make sure that: You are using a Web Application project rather than a Web Site project, this will result in a precompiled binary for your code behind You have turned off debug code generation in the web.config file - I guess if this is different to when you used aspnet_compiler the code may be recompiled If you've trie...
Precompilation and startup times on ASP.Net I am developping a (relatively small) website in ASP.Net 2.0. I am also using nAnt to perform some easy tweaking on my project before delivering executables. In its current state, the website is "precompiled" using aspnet_compiler.exe -nologo -v ${Appname} -u ${target} I have...
TITLE: Precompilation and startup times on ASP.Net QUESTION: I am developping a (relatively small) website in ASP.Net 2.0. I am also using nAnt to perform some easy tweaking on my project before delivering executables. In its current state, the website is "precompiled" using aspnet_compiler.exe -nologo -v ${Appname} -...
[ "c#", "asp.net", "compilation", "startup", "aspnet-compiler" ]
6
4
2,644
6
0
2008-09-11T11:53:53.233000
2008-09-11T11:56:57.767000
56,362
62,964
Directory layout for pure Ruby project
I'm starting to learn ruby. I'm also a day-to-day C++ dev. For C++ projects I usually go with following dir structure / -/bin <- built binaries -/build <- build time temporary object (eg..obj, cmake intermediates) -/doc <- manuals and/or Doxygen docs -/src --/module-1 --/module-2 -- non module specific sources, like ma...
Bundler includes the necessary infrastructure to generate a gem: $ bundle gem --coc --mit --test=minitest --exe spider Creating gem 'spider'... MIT License enabled in config Code of conduct enabled in config create spider/Gemfile create spider/lib/spider.rb create spider/lib/spider/version.rb create spider/spider.gemsp...
Directory layout for pure Ruby project I'm starting to learn ruby. I'm also a day-to-day C++ dev. For C++ projects I usually go with following dir structure / -/bin <- built binaries -/build <- build time temporary object (eg..obj, cmake intermediates) -/doc <- manuals and/or Doxygen docs -/src --/module-1 --/module-2 ...
TITLE: Directory layout for pure Ruby project QUESTION: I'm starting to learn ruby. I'm also a day-to-day C++ dev. For C++ projects I usually go with following dir structure / -/bin <- built binaries -/build <- build time temporary object (eg..obj, cmake intermediates) -/doc <- manuals and/or Doxygen docs -/src --/mod...
[ "ruby", "code-formatting" ]
23
13
11,124
7
0
2008-09-11T11:58:06
2008-09-15T13:41:54.313000
56,375
56,380
Are non-generic collections in .NET obsolete?
Put differently: Is there a good reason to choose a loosely-typed collection over a type-safe one (HashTable vs. Dictionary)? Are they still there only for compatibility? As far as I understand, generic collections not only are type-safe, but their performance is better. Here's a comprehensive article on the topic: An ...
The non-generic collections are so obsolete that they've been removed from the CoreCLR used in Silverlight and Live Mesh.
Are non-generic collections in .NET obsolete? Put differently: Is there a good reason to choose a loosely-typed collection over a type-safe one (HashTable vs. Dictionary)? Are they still there only for compatibility? As far as I understand, generic collections not only are type-safe, but their performance is better. He...
TITLE: Are non-generic collections in .NET obsolete? QUESTION: Put differently: Is there a good reason to choose a loosely-typed collection over a type-safe one (HashTable vs. Dictionary)? Are they still there only for compatibility? As far as I understand, generic collections not only are type-safe, but their perform...
[ ".net", "generics", "collections" ]
26
22
8,032
9
0
2008-09-11T12:05:59.850000
2008-09-11T12:09:30.513000
56,391
56,418
Automatically checking for a new version of my application
Trying to honor a feature request from our customers, I'd like that my application, when Internet is available, check on our website if a new version is available. The problem is that I have no idea about what have to be done on the server side. I can imagine that my application (developped in C++ using Qt) has to send...
I would absolutely recommend to just do a plain HTTP request to your website. Everything else is bound to fail. I'd make a HTTP GET request to a certain page on your site containing the version of the local application. like http://www.example.com/update?version=1.2.4 Then you can return what ever you want, probably al...
Automatically checking for a new version of my application Trying to honor a feature request from our customers, I'd like that my application, when Internet is available, check on our website if a new version is available. The problem is that I have no idea about what have to be done on the server side. I can imagine t...
TITLE: Automatically checking for a new version of my application QUESTION: Trying to honor a feature request from our customers, I'd like that my application, when Internet is available, check on our website if a new version is available. The problem is that I have no idea about what have to be done on the server sid...
[ "c++", "qt" ]
24
38
11,355
12
0
2008-09-11T12:17:50.820000
2008-09-11T12:29:19.823000
56,402
73,257
Aligning text in SVG
I am trying to make SVG XML documents with a mixture of lines and brief text snippets (two or three words typically). The major problem I'm having is getting the text aligning with line segments. For horizontal alignment I can use text-anchor with left, middle or right. I can't find a equivalent for vertical alignment;...
It turns out that you don't need explicit text paths. Firefox 3 has only partial support of the vertical alignment tags ( see this thread ). It also seems that dominant-baseline only works when applied as a style whereas text-anchor can be part of the style or a tag attribute. Vertical Horizontal Bit of Both This works...
Aligning text in SVG I am trying to make SVG XML documents with a mixture of lines and brief text snippets (two or three words typically). The major problem I'm having is getting the text aligning with line segments. For horizontal alignment I can use text-anchor with left, middle or right. I can't find a equivalent fo...
TITLE: Aligning text in SVG QUESTION: I am trying to make SVG XML documents with a mixture of lines and brief text snippets (two or three words typically). The major problem I'm having is getting the text aligning with line segments. For horizontal alignment I can use text-anchor with left, middle or right. I can't fi...
[ "xml", "svg" ]
71
61
61,587
2
0
2008-09-11T12:24:24.157000
2008-09-16T14:57:13.937000
56,411
56,447
How to test randomness (case in point - Shuffling)
First off, this question is ripped out from this question. I did it because I think this part is bigger than a sub-part of a longer question. If it offends, please pardon me. Assume that you have a algorithm that generates randomness. Now how do you test it? Or to be more direct - Assume you have an algorithm that shuf...
Statistics. The de facto standard for testing RNGs is the Diehard suite (originally available at http://stat.fsu.edu/pub/diehard ). Alternatively, the Ent program provides tests that are simpler to interpret but less comprehensive. As for shuffling algorithms, use a well-known algorithm such as Fisher-Yates (a.k.a "Knu...
How to test randomness (case in point - Shuffling) First off, this question is ripped out from this question. I did it because I think this part is bigger than a sub-part of a longer question. If it offends, please pardon me. Assume that you have a algorithm that generates randomness. Now how do you test it? Or to be m...
TITLE: How to test randomness (case in point - Shuffling) QUESTION: First off, this question is ripped out from this question. I did it because I think this part is bigger than a sub-part of a longer question. If it offends, please pardon me. Assume that you have a algorithm that generates randomness. Now how do you t...
[ "math", "theory", "random", "puzzle" ]
47
30
15,634
11
0
2008-09-11T12:27:22.293000
2008-09-11T12:45:04.717000
56,417
106,464
Anyone used Dabo for a medium-big project?
We're at the beginning of a new ERP-ish client-server application, developed as a Python rich client. We're currently evaluating Dabo as our main framework and it looks quite nice and easy to use, but I was wondering, has anyone used it for medium-to-big sized projects? Thanks for your time!
I'm one of the authors of the Dabo framework. One of our users pointed out to me the extremely negative answer you received, and so I thought I had better chime in and clear up some of the incorrect assumptions in the first reply. Dabo is indeed well-known in the Python community. I have presented it at 3 of the last 4...
Anyone used Dabo for a medium-big project? We're at the beginning of a new ERP-ish client-server application, developed as a Python rich client. We're currently evaluating Dabo as our main framework and it looks quite nice and easy to use, but I was wondering, has anyone used it for medium-to-big sized projects? Thanks...
TITLE: Anyone used Dabo for a medium-big project? QUESTION: We're at the beginning of a new ERP-ish client-server application, developed as a Python rich client. We're currently evaluating Dabo as our main framework and it looks quite nice and easy to use, but I was wondering, has anyone used it for medium-to-big size...
[ "python", "erp", "dabo" ]
21
25
4,099
2
0
2008-09-11T12:29:09.013000
2008-09-19T23:55:08.023000
56,424
80,707
What can cause a reduction in frame rate when upgrading a graphics card?
We have a two-screen DirectX application that previously ran at a consistent 60 FPS (the monitors' sync rate) using a NVIDIA 8400GS (256MB). However, when we swapped out the card for one with 512 MB of RAM the frame rate struggles to get above 40 FPS. (It only gets this high because we're using triple-buffering.) The t...
Are the cards exactly the same (both GeForce 8400GS), and only the memory size differ? Quite often with different memory sizes come slightly different clock rates (i.e. your card with more memory might use slower memory!). So the first thing to check would be GPU core & memory clock rates, using something like GPU-Z.
What can cause a reduction in frame rate when upgrading a graphics card? We have a two-screen DirectX application that previously ran at a consistent 60 FPS (the monitors' sync rate) using a NVIDIA 8400GS (256MB). However, when we swapped out the card for one with 512 MB of RAM the frame rate struggles to get above 40 ...
TITLE: What can cause a reduction in frame rate when upgrading a graphics card? QUESTION: We have a two-screen DirectX application that previously ran at a consistent 60 FPS (the monitors' sync rate) using a NVIDIA 8400GS (256MB). However, when we swapped out the card for one with 512 MB of RAM the frame rate struggle...
[ "c++", "hardware", "directx" ]
3
2
387
2
0
2008-09-11T12:31:09.790000
2008-09-17T07:10:25.970000
56,427
56,451
Are there any resources for becoming a Cygwin "power user"?
I've got it configured, but I want more from it...maybe Cygwin isn't the right tool, but I like how it provides a *nix-like environment within Windows.
I've found Cygwin to be very useful in the past. FWIW, lately however I've shied away from it in favor of the following: XAMPP Unixutils I like these tools even better.
Are there any resources for becoming a Cygwin "power user"? I've got it configured, but I want more from it...maybe Cygwin isn't the right tool, but I like how it provides a *nix-like environment within Windows.
TITLE: Are there any resources for becoming a Cygwin "power user"? QUESTION: I've got it configured, but I want more from it...maybe Cygwin isn't the right tool, but I like how it provides a *nix-like environment within Windows. ANSWER: I've found Cygwin to be very useful in the past. FWIW, lately however I've shied ...
[ "windows", "unix", "cygwin" ]
11
5
1,277
3
0
2008-09-11T12:32:47.197000
2008-09-11T12:46:57.317000
56,443
56,483
Create drop down list options from enum in a DataGridView
I currently have a class and I'm trying to create an easy GUI to create a collection of this class. Most of the attributes of this class are strings. However, one of the attributes I want the user to be able to set is an Enum. Therefore, I would like the user interface, to have a dropdownlist for this enum, to restrict...
I do not know if that would work with a DataGridView column but it works with ComboBoxes: comboBox1.DataSource = Enum.GetValues(typeof(MyEnum)); and: MyEnum value = (MyEnum)comboBox1.SelectedValue; UPDATE: It works with DataGridView columns too, just remember to set the value type. DataGridViewComboBoxColumn col = new ...
Create drop down list options from enum in a DataGridView I currently have a class and I'm trying to create an easy GUI to create a collection of this class. Most of the attributes of this class are strings. However, one of the attributes I want the user to be able to set is an Enum. Therefore, I would like the user in...
TITLE: Create drop down list options from enum in a DataGridView QUESTION: I currently have a class and I'm trying to create an easy GUI to create a collection of this class. Most of the attributes of this class are strings. However, one of the attributes I want the user to be able to set is an Enum. Therefore, I woul...
[ "c#", ".net", "winforms", "user-interface", ".net-2.0" ]
19
44
33,666
2
0
2008-09-11T12:42:55.767000
2008-09-11T13:04:26.260000
56,472
61,947
Sending messages to objects while debugging Objective-C in gdb, without symbols
I'm trying to send messages to Objective-C objects in gdb. (gdb) p $esi $2 = (void *) 0x1268160 (gdb) po $esi (gdb) po [$esi count] Target does not respond to this message selector. I can't send any message to it. Am I missing something? Do I really need the symbols, or something else?
If you must override gdb and send a message to an object when it will not let you, you can use performSelector: (gdb) print (int)[receivedData count] Target does not respond to this message selector. (gdb) print (int)[receivedData performSelector:@selector(count) ] 2008-09-15 00:46:35.854 Executable[1008:20b] *** -[NS...
Sending messages to objects while debugging Objective-C in gdb, without symbols I'm trying to send messages to Objective-C objects in gdb. (gdb) p $esi $2 = (void *) 0x1268160 (gdb) po $esi (gdb) po [$esi count] Target does not respond to this message selector. I can't send any message to it. Am I missing something? Do...
TITLE: Sending messages to objects while debugging Objective-C in gdb, without symbols QUESTION: I'm trying to send messages to Objective-C objects in gdb. (gdb) p $esi $2 = (void *) 0x1268160 (gdb) po $esi (gdb) po [$esi count] Target does not respond to this message selector. I can't send any message to it. Am I mis...
[ "objective-c", "debugging", "macos", "gdb", "reversing" ]
11
10
3,635
3
0
2008-09-11T12:53:42.573000
2008-09-15T06:54:05.183000
56,478
56,493
How to interact with Windows Media Player in C#
I am looking for a way to interact with a standalone full version of Windows Media Player. Mostly I need to know the Path of the currently played track. The iTunes SDK makes this really easy but unfortunately there really isn't any way to do it with Windows Media Player, at least not in.Net(C#) without any heavy use of...
I had this https://social.msdn.microsoft.com/Forums/vstudio/en-US/dbd43d7e-f3a6-4087-be06-df17e76b635d/windows-media-player-remoting-in-c?forum=clr in my bookmarks but have NOT tested it in anyway. Just a pointer in the right direction. It's nothing official and will require a bit of digging, but you should get a fairl...
How to interact with Windows Media Player in C# I am looking for a way to interact with a standalone full version of Windows Media Player. Mostly I need to know the Path of the currently played track. The iTunes SDK makes this really easy but unfortunately there really isn't any way to do it with Windows Media Player, ...
TITLE: How to interact with Windows Media Player in C# QUESTION: I am looking for a way to interact with a standalone full version of Windows Media Player. Mostly I need to know the Path of the currently played track. The iTunes SDK makes this really easy but unfortunately there really isn't any way to do it with Wind...
[ "c#", "windows", "media", "wmp" ]
9
4
67,414
4
0
2008-09-11T13:02:32.367000
2008-09-11T13:08:26.377000
56,479
56,489
Will .NET MVC give me the HTML/CSS/JS separation I need?
I'm working with my ASP.NET development team to try and create "better" (i.e. cleaner) HTML when rendering pages. At the moment,.NET has a nasty tendency to do things like dump JavaScript into the page, making it a mandatory requirement on form controls and not allowing forms to work when JS isn't available. In some in...
The ASP.NET MVC Framework would give you a much more familiar separation. Because there is no viewstate, etc in the MVC Framework you won't have to worry about JavaScript being dumped into your pages. The only JavaScript calls you see will be ones that you manually add. You can, for the most part, separate HTML / CSS /...
Will .NET MVC give me the HTML/CSS/JS separation I need? I'm working with my ASP.NET development team to try and create "better" (i.e. cleaner) HTML when rendering pages. At the moment,.NET has a nasty tendency to do things like dump JavaScript into the page, making it a mandatory requirement on form controls and not a...
TITLE: Will .NET MVC give me the HTML/CSS/JS separation I need? QUESTION: I'm working with my ASP.NET development team to try and create "better" (i.e. cleaner) HTML when rendering pages. At the moment,.NET has a nasty tendency to do things like dump JavaScript into the page, making it a mandatory requirement on form ...
[ "javascript", "html", "css", "asp.net-mvc" ]
8
5
1,069
4
0
2008-09-11T13:02:52.507000
2008-09-11T13:07:47.003000
56,500
56,514
Can't access variable in C++ DLL from a C app
I'm stuck on a fix to a legacy Visual C++ 6 app. In the C++ DLL source I have put extern "C" _declspec(dllexport) char* MyNewVariable = 0; which results in MyNewVariable showing up (nicely undecorated) in the export table (as shown by dumpbin /exports blah.dll). However, I can't figure out how to declare the variable s...
you must link against the lib generated after compiling the DLL. In the linker options of the project, you must add the.lib file. And yes, you should also declare the variable as: extern "C" { declspec(dllimport) char MyNewVariable; }
Can't access variable in C++ DLL from a C app I'm stuck on a fix to a legacy Visual C++ 6 app. In the C++ DLL source I have put extern "C" _declspec(dllexport) char* MyNewVariable = 0; which results in MyNewVariable showing up (nicely undecorated) in the export table (as shown by dumpbin /exports blah.dll). However, I ...
TITLE: Can't access variable in C++ DLL from a C app QUESTION: I'm stuck on a fix to a legacy Visual C++ 6 app. In the C++ DLL source I have put extern "C" _declspec(dllexport) char* MyNewVariable = 0; which results in MyNewVariable showing up (nicely undecorated) in the export table (as shown by dumpbin /exports blah...
[ "c++", "c", "interop", "name-decoration" ]
8
5
6,905
7
0
2008-09-11T13:15:18.810000
2008-09-11T13:22:07.170000
56,518
56,539
Is there any difference between type? and Nullable<type>?
In C# are the nullable primitive types (i.e. bool? ) just aliases for their corresponding Nullable type or is there a difference between the two?
If you look at the IL using Ildasm, you'll find that they both compile down to Nullable.
Is there any difference between type? and Nullable<type>? In C# are the nullable primitive types (i.e. bool? ) just aliases for their corresponding Nullable type or is there a difference between the two?
TITLE: Is there any difference between type? and Nullable<type>? QUESTION: In C# are the nullable primitive types (i.e. bool? ) just aliases for their corresponding Nullable type or is there a difference between the two? ANSWER: If you look at the IL using Ildasm, you'll find that they both compile down to Nullable.
[ "c#", ".net", "nullable" ]
52
67
41,856
9
0
2008-09-11T13:25:20.563000
2008-09-11T13:36:33.017000
56,521
56,533
Windows Forms Designer upset by a control with a nullable property
I have a "numeric textbox" in C#.NET which is nothing more than a derivation of Textbox, with some added logic to prevent the user entering anything non-numeric. As part of this, I have added a Value property of type double? (or Nullable ). It's nullable to support the case where the user doesn't enter anything. The co...
Or, if you don't want the designer adding any code at all... add this to the Property. [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
Windows Forms Designer upset by a control with a nullable property I have a "numeric textbox" in C#.NET which is nothing more than a derivation of Textbox, with some added logic to prevent the user entering anything non-numeric. As part of this, I have added a Value property of type double? (or Nullable ). It's nullabl...
TITLE: Windows Forms Designer upset by a control with a nullable property QUESTION: I have a "numeric textbox" in C#.NET which is nothing more than a derivation of Textbox, with some added logic to prevent the user entering anything non-numeric. As part of this, I have added a Value property of type double? (or Nullab...
[ "c#", "winforms", "nullable" ]
2
3
1,145
3
0
2008-09-11T13:26:47.860000
2008-09-11T13:34:28.577000
56,543
56,552
Recovering from a slightly out of date subversion repository backup
A problem I ran into a while back I never found a good solution for... Say you have a working copy checked out from subversion at revision 7500, and the disk holding the current repository dies. You've got a backup of the repository at, say, revision 7450. It's easy to restore the repository backup, but any attempt to ...
You could check out a rev.7450 copy somewhere, then export your 7500 copy (to remove the.svn folders). Drag the exported copy (which is the latest copy) over the 7450 copy. All the new files should simply overwrite the older ones, leaving the.svn folders the same. Subversion will assume you just made a bunch of changes...
Recovering from a slightly out of date subversion repository backup A problem I ran into a while back I never found a good solution for... Say you have a working copy checked out from subversion at revision 7500, and the disk holding the current repository dies. You've got a backup of the repository at, say, revision 7...
TITLE: Recovering from a slightly out of date subversion repository backup QUESTION: A problem I ran into a while back I never found a good solution for... Say you have a working copy checked out from subversion at revision 7500, and the disk holding the current repository dies. You've got a backup of the repository a...
[ "svn", "version-control", "backup", "system-administration" ]
7
6
967
4
0
2008-09-11T13:38:17.287000
2008-09-11T13:41:59.777000
56,546
56,578
activerecord as model, is this a good idea?
Recently thanks to rails' popularity, many people start using activerecord as model. however, before I heard of rails (my peer group was not a fan of open source stuff, we were taught in a.NET school...) and while I was doing my final year project, i found this definition for a model The model represents enterprise dat...
Martin Fowler described this pattern in Patterns of Enterprise Application Architecture together with two other patterns or architectures. These patterns are good for different situations and different amounts of complexity. If you want to so only simple stuff you can use Transaction Script. This is an architecture you...
activerecord as model, is this a good idea? Recently thanks to rails' popularity, many people start using activerecord as model. however, before I heard of rails (my peer group was not a fan of open source stuff, we were taught in a.NET school...) and while I was doing my final year project, i found this definition for...
TITLE: activerecord as model, is this a good idea? QUESTION: Recently thanks to rails' popularity, many people start using activerecord as model. however, before I heard of rails (my peer group was not a fan of open source stuff, we were taught in a.NET school...) and while I was doing my final year project, i found t...
[ "php", "model-view-controller", "activerecord" ]
7
8
2,269
3
0
2008-09-11T13:40:04.880000
2008-09-11T13:50:52.810000
56,547
56,612
How do you perform a CROSS JOIN with LINQ to SQL?
How do you perform a CROSS JOIN with LINQ to SQL?
A cross-join is simply the Cartesian product of two sets. There's no explicit join operator for it. var combo = from p in people from c in cars select new { p.Name, c.Make, c.Model, c.Colour };
How do you perform a CROSS JOIN with LINQ to SQL? How do you perform a CROSS JOIN with LINQ to SQL?
TITLE: How do you perform a CROSS JOIN with LINQ to SQL? QUESTION: How do you perform a CROSS JOIN with LINQ to SQL? ANSWER: A cross-join is simply the Cartesian product of two sets. There's no explicit join operator for it. var combo = from p in people from c in cars select new { p.Name, c.Make, c.Model, c.Colour };
[ "c#", "linq", "linq-to-sql", "cross-join" ]
137
178
68,447
5
0
2008-09-11T13:40:19.203000
2008-09-11T14:00:40.963000
56,553
56,952
Using an external "windows"-keyboard under Mac OS X
I use a MacBook, but I've got a usual keyboard attached to it. The problem is that the keys don't exactly map 1-to-1. One thing is the APPLE and ALT keys. They map to WIN and ALT, but they are usually physically inverted, so if you want to use them with the same layout you have to invert them in the OS. The Function ke...
In OS X 10.5 they allow you to have different keyboard setups for different keyboards. This works most of the time. I've had issues with very old keyboards that are plugged in via a PS2 to USB but otherwise it works fine.
Using an external "windows"-keyboard under Mac OS X I use a MacBook, but I've got a usual keyboard attached to it. The problem is that the keys don't exactly map 1-to-1. One thing is the APPLE and ALT keys. They map to WIN and ALT, but they are usually physically inverted, so if you want to use them with the same layou...
TITLE: Using an external "windows"-keyboard under Mac OS X QUESTION: I use a MacBook, but I've got a usual keyboard attached to it. The problem is that the keys don't exactly map 1-to-1. One thing is the APPLE and ALT keys. They map to WIN and ALT, but they are usually physically inverted, so if you want to use them w...
[ "macos", "keyboard", "ergonomics" ]
31
26
48,728
4
0
2008-09-11T13:42:34.237000
2008-09-11T15:48:28.083000
56,554
56,671
What is the proper regular expression for an unescaped backslash before a character?
Let's say I want to represent \q (or any other particular "backslash-escaped character"). That is, I want to match \q but not \\q, since the latter is a backslash-escaped backslash followed by a q. Yet \\\q would match, since it's a backslash-escaped backslash followed by a backslash-escaped q. (Well, it would match th...
Updated: My new and improved Perl regex, supporting more than 3 backslashes: /(? \\\\)* # an even number of backslashes \\q # Followed by a \q /x; or if your regex library doesn't support extended syntax. /(? \\\\)*\\q/ Output of my test program: q does not match \q does match \\q does not match \\\q does match \\\\q d...
What is the proper regular expression for an unescaped backslash before a character? Let's say I want to represent \q (or any other particular "backslash-escaped character"). That is, I want to match \q but not \\q, since the latter is a backslash-escaped backslash followed by a q. Yet \\\q would match, since it's a ba...
TITLE: What is the proper regular expression for an unescaped backslash before a character? QUESTION: Let's say I want to represent \q (or any other particular "backslash-escaped character"). That is, I want to match \q but not \\q, since the latter is a backslash-escaped backslash followed by a q. Yet \\\q would matc...
[ "regex" ]
11
19
14,286
4
0
2008-09-11T13:42:35.157000
2008-09-11T14:25:06.177000
56,561
56,694
What is the best way to convert between char* and System::String in C++/CLI
What is the approved way to convert from char* to System::string and back in C++/CLI? I found a few references to marshal_to<> templated functions on Google, but it appears that this feature never made the cut for Visual Studio 2005 (and isn't in Visual Studio 2008 either, AFAIK). I have also seen some code on Stan Lip...
There's a good overview here (this marshaling support added for VS2008): http://www.codeproject.com/KB/mcpp/OrcasMarshalAs.aspx
What is the best way to convert between char* and System::String in C++/CLI What is the approved way to convert from char* to System::string and back in C++/CLI? I found a few references to marshal_to<> templated functions on Google, but it appears that this feature never made the cut for Visual Studio 2005 (and isn't ...
TITLE: What is the best way to convert between char* and System::String in C++/CLI QUESTION: What is the approved way to convert from char* to System::string and back in C++/CLI? I found a few references to marshal_to<> templated functions on Google, but it appears that this feature never made the cut for Visual Studi...
[ ".net", "string", "c++-cli" ]
50
18
72,661
5
0
2008-09-11T13:45:30.827000
2008-09-11T14:34:28.433000