PostId
int64
4
11.8M
PostCreationDate
stringlengths
19
19
OwnerUserId
int64
1
1.57M
OwnerCreationDate
stringlengths
10
19
ReputationAtPostCreation
int64
-55
461k
OwnerUndeletedAnswerCountAtPostTime
int64
0
21.5k
Title
stringlengths
3
250
BodyMarkdown
stringlengths
5
30k
Tag1
stringlengths
1
25
Tag2
stringlengths
1
25
Tag3
stringlengths
1
25
Tag4
stringlengths
1
25
Tag5
stringlengths
1
25
PostClosedDate
stringlengths
19
19
OpenStatus
stringclasses
5 values
unified_texts
stringlengths
32
30.1k
OpenStatus_id
int64
0
4
55,755
09/11/2008 03:25:56
203,653
09/05/2008 01:43:38
3
0
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? Thanks.
asp.net
null
null
null
null
null
open
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? Thanks.
0
55,757
09/11/2008 03:27:07
2,542
08/22/2008 18:22:34
1
0
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 variables, then do a header('Location: check.php'), where I display the data so the buyer can check the info one last time before actually buying. Now, if I'm in check.php and hit the Back button to buy.php so I can change stuff, the browser asks if I want to resend the POST data. I'm trying to avoid that. Anyone have any good advice or good practices for PHP Multiform validation? Also, if I had n pages for the user to fill, buy.php, buy2.php ... buyn.php before check.php would the same ideas still hold? Thanks for the help!
php
validation
post
null
null
null
open
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 variables, then do a header('Location: check.php'), where I display the data so the buyer can check the info one last time before actually buying. Now, if I'm in check.php and hit the Back button to buy.php so I can change stuff, the browser asks if I want to resend the POST data. I'm trying to avoid that. Anyone have any good advice or good practices for PHP Multiform validation? Also, if I had n pages for the user to fill, buy.php, buy2.php ... buyn.php before check.php would the same ideas still hold? Thanks for the help!
0
55,768
09/11/2008 03:36:45
131
08/02/2008 08:58:50
146
5
How do I find a user's IP address with PHP?
I would like to find a user's IP address when he/she enters my page. How do I programmatically do that?
php
ipaddress
null
null
null
null
open
How do I find a user's IP address with PHP? === I would like to find a user's IP address when he/she enters my page. How do I programmatically do that?
0
55,804
09/11/2008 04:25:41
1,196
08/13/2008 12:33:04
3,230
225
Visual studio automation: Enumerate opened windows upon solution loading.
How to enumerate opened code windows (i.e. those windows where you edit documents) upon solution loading using macros? As you probably know, MSVS remembers opened documents, i.e. when you load solution, IDE will load previously opened files. What I want to do is to perform some actions with those windows upon solution loading. I tried to access these windows in SolutionEvents_Opened handler. But have no luck - it seems that mentioned windows are not available at the moment SolutionEvents_Opened invoked. DTE.Documents is empty and DTE.Windows.Items doesn't contain them. I need some code like: Private Sub SolutionEvents_Opened() Handles SolutionEvents.Opened Dim window As Window = DTE.Documents.Item(?).Windows // one of the opened windows ... End Sub
visual-studio
vba
scripting
automation
null
null
open
Visual studio automation: Enumerate opened windows upon solution loading. === How to enumerate opened code windows (i.e. those windows where you edit documents) upon solution loading using macros? As you probably know, MSVS remembers opened documents, i.e. when you load solution, IDE will load previously opened files. What I want to do is to perform some actions with those windows upon solution loading. I tried to access these windows in SolutionEvents_Opened handler. But have no luck - it seems that mentioned windows are not available at the moment SolutionEvents_Opened invoked. DTE.Documents is empty and DTE.Windows.Items doesn't contain them. I need some code like: Private Sub SolutionEvents_Opened() Handles SolutionEvents.Opened Dim window As Window = DTE.Documents.Item(?).Windows // one of the opened windows ... End Sub
0
55,823
09/11/2008 04:52:07
4,525
09/04/2008 15:36:18
632
24
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?](http://stackoverflow.com/questions/4664/should-the-folders-in-a-solution-match-the-namespace#4672) 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 about my current folder structure. As with the .NET Framework, the namespaces in my project do not always match the deployed units one-to-one. Say you have <pre> lib -> lib.dll lib.data -> lib.dll lib.ecom -> lib.ecom.dll lib.ecom.paypal -> lib.ecom.paypal.dll </pre> In other words, child namespaces may or may not ship with the parent. So are the namespaces that deploy together grouped in any way? By the way, I don't use VS or NAnt &#8212; just good old fashioned build batches.
.net
version-control
folders
null
null
null
open
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?](http://stackoverflow.com/questions/4664/should-the-folders-in-a-solution-match-the-namespace#4672) 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 about my current folder structure. As with the .NET Framework, the namespaces in my project do not always match the deployed units one-to-one. Say you have <pre> lib -> lib.dll lib.data -> lib.dll lib.ecom -> lib.ecom.dll lib.ecom.paypal -> lib.ecom.paypal.dll </pre> In other words, child namespaces may or may not ship with the parent. So are the namespaces that deploy together grouped in any way? By the way, I don't use VS or NAnt &#8212; just good old fashioned build batches.
0
55,835
09/11/2008 05:12:42
5
07/31/2008 14:22:31
3,131
106
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, but users can still clear that. I don't think it's possible to do this without some joker voting himself up with a bot or something. Got an idea?
asp.net
silverlight
null
null
null
null
open
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, but users can still clear that. I don't think it's possible to do this without some joker voting himself up with a bot or something. Got an idea?
0
55,843
09/11/2008 05:18:43
4,884
09/06/2008 10:28:40
33
3
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 tells me that expanding the Results property will *'enumerate'* it. Is there a way for me to programattically identify that as well. I hope that makes sense :)
c#
linq
null
null
null
null
open
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 tells me that expanding the Results property will *'enumerate'* it. Is there a way for me to programattically identify that as well. I hope that makes sense :)
0
55,845
09/11/2008 05:21:30
5,203
09/08/2008 13:10:19
1
0
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 database guru seems to think 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 access layer requests info from a stored procedure and passes over authentication to the database. The database determines the users role/permissions and decides whether or not to perform the task (whether that be retrieving data or making an update). I guess this means less database transactions. One call to the database. If the security was in our data access layer, this would require 1 database call to determine if the user had proper permissions, and then 1 separate database call to perform the action. I, for one, find the Sql Management studio completely lacking as an IDE. My main concern is we will end up having to maintain some nasty amount of business logic in our stored procedures for some very minimal performance gains. Right now, we're using LINQ for our ORM. It seems light and fast, but best of all, its really easy to rapidly develop in. Is the maintenance cost worth the performance gain? Are we fooling ourselves into thinking there will even be a noticeable performance gain? Or are we just making a nightmare for ourselves? Our environment: - Internal, non-mission critical business apps - C#/ASP.NET 3.5 - Windows 2003 - MS SQL Server 2005 - 35 Medium sized web apps with approx 500 users
stored-procedures
security
sql
null
null
null
open
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 database guru seems to think 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 access layer requests info from a stored procedure and passes over authentication to the database. The database determines the users role/permissions and decides whether or not to perform the task (whether that be retrieving data or making an update). I guess this means less database transactions. One call to the database. If the security was in our data access layer, this would require 1 database call to determine if the user had proper permissions, and then 1 separate database call to perform the action. I, for one, find the Sql Management studio completely lacking as an IDE. My main concern is we will end up having to maintain some nasty amount of business logic in our stored procedures for some very minimal performance gains. Right now, we're using LINQ for our ORM. It seems light and fast, but best of all, its really easy to rapidly develop in. Is the maintenance cost worth the performance gain? Are we fooling ourselves into thinking there will even be a noticeable performance gain? Or are we just making a nightmare for ourselves? Our environment: - Internal, non-mission critical business apps - C#/ASP.NET 3.5 - Windows 2003 - MS SQL Server 2005 - 35 Medium sized web apps with approx 500 users
0
55,855
09/11/2008 05:36:17
708
08/08/2008 06:10:02
564
18
TextBox.TextChanged & ICommandSource
I am following the [M-V-VM][1] 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 to be fired from the TextChanged event. This seems to be too much work for something which appears to be so simple. Is there an easier way (than subclassing the TextBox and implementing ICommandSource) to hook up the TextChanged event to my ViewModel class? [1]: http://blogs.msdn.com/johngossman/archive/2005/10/08/478683.aspx
wpf
null
null
null
null
null
open
TextBox.TextChanged & ICommandSource === I am following the [M-V-VM][1] 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 to be fired from the TextChanged event. This seems to be too much work for something which appears to be so simple. Is there an easier way (than subclassing the TextBox and implementing ICommandSource) to hook up the TextChanged event to my ViewModel class? [1]: http://blogs.msdn.com/johngossman/archive/2005/10/08/478683.aspx
0
55,859
09/11/2008 05:41:15
195
08/03/2008 11:02:15
141
10
catching all types of exceptions in C++ in one catch block
in c++, Iam trying to catch all types of exceptions in one catch (like catch(Exception) in C#). how is it done ? and more, how can one catch devide-by-zero exceptions ?
c++
null
null
null
null
null
open
catching all types of exceptions in C++ in one catch block === in c++, Iam trying to catch all types of exceptions in one catch (like catch(Exception) in C#). how is it done ? and more, how can one catch devide-by-zero exceptions ?
0
55,860
09/11/2008 05:42:44
1,790
08/18/2008 15:07:02
2,023
101
Why can't I delete this cookie?!
Okay, here is the 411 - I have the following event handler in my Global.asax.cs file: private void Global_PostRequestHandlerExecute(object sender, EventArgs e) { if (/* logic that determines that this is an ajax call */) { // we want to set a cookie Response.Cookies.Add(new HttpCookie("MyCookie", "true")); } } That handler will run during Ajax requests (as a result of the Ajax framework I am using), as well as at other times - the condition of the if statement filters out non-Ajax events, and works just fine (it isn't relevant here, so I didn't include it for brevity's sake). It suffices us to say that this works just fine - the cookie is set, I am able to read it on the client, and all is well up to that point. Now for the part that drives me nuts. Here is the JavaScript function I am using to delete the cookie: function deleteCookie(name) { var cookieDate = new Date(); cookieDate.setTime(cookieDate.getTime() - 1); document.cookie = (name + "=; expires=" + cookieDate.toGMTString()); } So, of course, at some point after the cookie is set, I delete it like so: deleteCookie("MyCookie"); Only, that doesn't do the job; the cookie still exists. So, anyone know why?
c#
asp.net
javascript
ajax
cookies
null
open
Why can't I delete this cookie?! === Okay, here is the 411 - I have the following event handler in my Global.asax.cs file: private void Global_PostRequestHandlerExecute(object sender, EventArgs e) { if (/* logic that determines that this is an ajax call */) { // we want to set a cookie Response.Cookies.Add(new HttpCookie("MyCookie", "true")); } } That handler will run during Ajax requests (as a result of the Ajax framework I am using), as well as at other times - the condition of the if statement filters out non-Ajax events, and works just fine (it isn't relevant here, so I didn't include it for brevity's sake). It suffices us to say that this works just fine - the cookie is set, I am able to read it on the client, and all is well up to that point. Now for the part that drives me nuts. Here is the JavaScript function I am using to delete the cookie: function deleteCookie(name) { var cookieDate = new Date(); cookieDate.setTime(cookieDate.getTime() - 1); document.cookie = (name + "=; expires=" + cookieDate.toGMTString()); } So, of course, at some point after the cookie is set, I delete it like so: deleteCookie("MyCookie"); Only, that doesn't do the job; the cookie still exists. So, anyone know why?
0
55,862
09/11/2008 05:43:24
4,154
09/02/2008 05:43:32
46
4
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 that appears workable and seems logical based on what I know (which is probably just enough to be dangerous), but I have no idea if it's actually a good design or not. So tell me: is this crazy? Is there a better/best way to do it? * Step 1: User enters plain-text password, e.g. "MyDifficultPassword" * Step 2: App hashes the user-password and uses that value as the symmetric key to encrypt/decrypt the data file. e.g. "MyDifficultPassword" --> "HashedUserPwdAndKey". * Step 3: App hashes the hashed value from step 2 and saves the new value in the data file header (i.e. the unencrypted part of the data file) and uses that value to validate the user's password. e.g. "HashedUserPwdAndKey" --> "HashedValueForAuthentication" Basically I'm extrapolating from the common way to implement web-site passwords (when you're not using OpenID, that is), which is to store the (salted) hash of the user's password in your DB and never save the actual password. But since I use the hashed user password for the symmetric encryption key, I can't use the same value for authentication. So I hash it again, basically treating it just like another password, and save the doubly-hashed value in the data file. That way, I can take the file to another PC and decrypt it by simply entering my password. So is this design reasonably secure, or hopelessly naive, or somewhere in between? Thanks!
encryption
cryptography
password
null
null
null
open
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 that appears workable and seems logical based on what I know (which is probably just enough to be dangerous), but I have no idea if it's actually a good design or not. So tell me: is this crazy? Is there a better/best way to do it? * Step 1: User enters plain-text password, e.g. "MyDifficultPassword" * Step 2: App hashes the user-password and uses that value as the symmetric key to encrypt/decrypt the data file. e.g. "MyDifficultPassword" --> "HashedUserPwdAndKey". * Step 3: App hashes the hashed value from step 2 and saves the new value in the data file header (i.e. the unencrypted part of the data file) and uses that value to validate the user's password. e.g. "HashedUserPwdAndKey" --> "HashedValueForAuthentication" Basically I'm extrapolating from the common way to implement web-site passwords (when you're not using OpenID, that is), which is to store the (salted) hash of the user's password in your DB and never save the actual password. But since I use the hashed user password for the symmetric encryption key, I can't use the same value for authentication. So I hash it again, basically treating it just like another password, and save the doubly-hashed value in the data file. That way, I can take the file to another PC and decrypt it by simply entering my password. So is this design reasonably secure, or hopelessly naive, or somewhere in between? Thanks!
0
55,869
09/11/2008 05:50:52
5,277
09/08/2008 20:39:51
51
5
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 all hell breaks loose.
.net
image
extension
mime-types
content-type
null
open
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 all hell breaks loose.
0
55,871
09/11/2008 05:52:56
3,983
09/01/2008 07:09:13
26
5
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 can translate to PHP/JavaScript
javascript
php
browser
null
null
null
open
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 can translate to PHP/JavaScript
0
55,878
09/11/2008 06:01:04
2,581
08/23/2008 04:37:51
71
8
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 catastrophic error, you can just clear out the uncommitted data in the recovery phase. How do distributed transactions work? In some of the MS documentation I have read that you can somehow perform a transaction across databases and filesystems (among other things). This technology could be (and probably is) used for installers, where you want the program to be fully installed or fully absent. You simply begin a transaction at the start of the installer. Next you could connect to the registry and filesystem, making the changes that define the installation. When the job is done, simply commit, or rollback if the installation fails for some reason. The registry and filesystem are automatically cleaned for you by this magical distributed transaction coordinator. How is it possible that two disparate systems can be transacted upon in this fashion? It seems to me that it is always possible to leave the system in an inconsistent state, where the filesystem has committed its changes and the registry has not. I think in MSDTC it is even possible to perform a transaction across the network. I have read [http://blogs.msdn.com/florinlazar/archive/2004/03/04/84199.aspx][1], but it feels like only the beginning of the explanation, and that step 4 should be expanded considerably. [1]: http://blogs.msdn.com/florinlazar/archive/2004/03/04/84199.aspx
transactions
acid
mstdc
null
null
null
open
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 catastrophic error, you can just clear out the uncommitted data in the recovery phase. How do distributed transactions work? In some of the MS documentation I have read that you can somehow perform a transaction across databases and filesystems (among other things). This technology could be (and probably is) used for installers, where you want the program to be fully installed or fully absent. You simply begin a transaction at the start of the installer. Next you could connect to the registry and filesystem, making the changes that define the installation. When the job is done, simply commit, or rollback if the installation fails for some reason. The registry and filesystem are automatically cleaned for you by this magical distributed transaction coordinator. How is it possible that two disparate systems can be transacted upon in this fashion? It seems to me that it is always possible to leave the system in an inconsistent state, where the filesystem has committed its changes and the registry has not. I think in MSDTC it is even possible to perform a transaction across the network. I have read [http://blogs.msdn.com/florinlazar/archive/2004/03/04/84199.aspx][1], but it feels like only the beginning of the explanation, and that step 4 should be expanded considerably. [1]: http://blogs.msdn.com/florinlazar/archive/2004/03/04/84199.aspx
0
55,899
09/11/2008 06:26:01
480
08/06/2008 08:40:05
51
6
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 existing report (e.g., apply additional filters to constrain the data set, and modify the layout slightly). This sounds simple enough in principle, but is difficult without any existing documentation. It's my understanding that the logs can't help me because the report only queries the database; it does not actually insert, delete, or update database values, so there is nothing to log (is this correct?). So my question is this: is there a tool or utility (Oracle or otherwise) that I can use to see the actual SQL statement that is being executed while the report generation job is still running? I figure, if I can see what tables are actually being accessed to produce the existing report, I'll have a very good starting point for exploring the schema and determining the correct SQL to use for my own report.
sql
oracle
null
null
null
null
open
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 existing report (e.g., apply additional filters to constrain the data set, and modify the layout slightly). This sounds simple enough in principle, but is difficult without any existing documentation. It's my understanding that the logs can't help me because the report only queries the database; it does not actually insert, delete, or update database values, so there is nothing to log (is this correct?). So my question is this: is there a tool or utility (Oracle or otherwise) that I can use to see the actual SQL statement that is being executed while the report generation job is still running? I figure, if I can see what tables are actually being accessed to produce the existing report, I'll have a very good starting point for exploring the schema and determining the correct SQL to use for my own report.
0
55,901
09/11/2008 06:30:04
4,808
09/05/2008 17:41:47
74
5
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 don't follow DST. Is there a way to pull this data on demand? Thank you!
web-services
timezone
null
null
null
null
open
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 don't follow DST. Is there a way to pull this data on demand? Thank you!
0
55,903
09/11/2008 06:33:27
3,293
08/27/2008 17:50:56
1
0
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/solution settings. What I want is a way to group a collection of related (and dependent) projects together and have that data live in source control without all the other user specific stuff that developers don't need to share. You know, like a .sln file in Visual Studio. Does Eclipse just not work this way? (And if not, then why not?)
eclipse
null
null
null
null
null
open
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/solution settings. What I want is a way to group a collection of related (and dependent) projects together and have that data live in source control without all the other user specific stuff that developers don't need to share. You know, like a .sln file in Visual Studio. Does Eclipse just not work this way? (And if not, then why not?)
0
55,922
09/11/2008 07:03:17
2,095
08/20/2008 11:01:19
262
17
How to keep concentrated and focused while waiting for your compiler?
When I'm working on software, I find that as soon as I have to wait more than around 6 seconds for the compiler or for the program to start (or simply for Visual Studio to process some really complicated command like, say, Space Bar), I tend to fire up the email client, or go read stuff on the Internet, or post questions on StackOverflow. Do you know the problem? How do you keep focused? Is there some maintenance task that can be done in the meantime that does not get in the way of your concentration? (My build is finished, I can go back to working now) Carl
productivity
focus
flow
concentration
null
null
open
How to keep concentrated and focused while waiting for your compiler? === When I'm working on software, I find that as soon as I have to wait more than around 6 seconds for the compiler or for the program to start (or simply for Visual Studio to process some really complicated command like, say, Space Bar), I tend to fire up the email client, or go read stuff on the Internet, or post questions on StackOverflow. Do you know the problem? How do you keep focused? Is there some maintenance task that can be done in the meantime that does not get in the way of your concentration? (My build is finished, I can go back to working now) Carl
0
55,932
09/11/2008 07:13:24
4,910
09/06/2008 14:49:31
51
5
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 HBITMAP right after I create the brush? IE: does the HBRUSH store its own copy of the HBITMAP? In this case, I'd like the HBRUSH to have object scope while the HBITMAP would have method scope (the method that creates the HBRUSH).
winapi
gdi
null
null
null
null
open
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 HBITMAP right after I create the brush? IE: does the HBRUSH store its own copy of the HBITMAP? In this case, I'd like the HBRUSH to have object scope while the HBITMAP would have method scope (the method that creates the HBRUSH).
0
55,943
09/11/2008 07:29:00
5,147
09/08/2008 07:23:50
21
5
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?
profiling
silverllight
null
null
null
null
open
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?
0
55,953
09/11/2008 07:34:33
5,741
09/11/2008 07:34:33
1
0
SSL Connection Limit
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 couldn't seem to find any code block that limits SSL connection to 1062. On SSL's point of view, is there anything that limits the number of connections?
ssl
connection
limit
null
null
null
open
SSL Connection Limit === 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 couldn't seem to find any code block that limits SSL connection to 1062. On SSL's point of view, is there anything that limits the number of connections?
0
55,956
09/11/2008 07:37:00
5,742
09/11/2008 07:37:00
1
0
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....
php
insert-id
postgresql
null
null
null
open
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....
0
55,961
09/11/2008 07:45:56
3,742
08/30/2008 14:08:11
133
18
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 even the smallest app where exception handling can be applied and it can begin to feel like overkill. I've gotten by with careful testing, validating, and silent prayer but this is a bad programming accident waiting to happen. So, what are your exception handling best practices? In particular, where are the most obvious/critical places where exception handling should be applied and where are places where it should be considered? Sorry for the vague the question but I really want to close the book on this once and for all.
.net
exception-handling
null
null
null
null
open
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 even the smallest app where exception handling can be applied and it can begin to feel like overkill. I've gotten by with careful testing, validating, and silent prayer but this is a bad programming accident waiting to happen. So, what are your exception handling best practices? In particular, where are the most obvious/critical places where exception handling should be applied and where are places where it should be considered? Sorry for the vague the question but I really want to close the book on this once and for all.
0
55,963
09/11/2008 07:47:22
5,023
09/07/2008 12:27:27
180
14
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 then write pixel data directly using "simple" pointer arithmetic. I have performance tested this and found a substantial speed improvement over other "safe" methods I know of. Is this the fastest way to manipulate individual pixels in a C# .NET application? Is there a better, safer way? If there was an equally fast approach that does not require pointer manipulation it would be my preference to use that. (I know this is 2008 and we should all be using directx 3d, opengl etc, however this control is to be used exclusively for 2d pixel rendering and simply does not require 3d rendering.)
c#
graphics
pointers
null
null
null
open
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 then write pixel data directly using "simple" pointer arithmetic. I have performance tested this and found a substantial speed improvement over other "safe" methods I know of. Is this the fastest way to manipulate individual pixels in a C# .NET application? Is there a better, safer way? If there was an equally fast approach that does not require pointer manipulation it would be my preference to use that. (I know this is 2008 and we should all be using directx 3d, opengl etc, however this control is to be used exclusively for 2d pixel rendering and simply does not require 3d rendering.)
0
55,964
09/11/2008 07:47:46
4,683
09/05/2008 07:14:50
1
0
Make wix installation set upgrade to 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 have to do manual work like saving the installation folder in a registry key upon first installing and then read this key upon upgrade? If so, is there any example? Or is there some easier way to achieve this in MSI / Wix? As reference I paste in my current Wix file below: <?xml version="1.0" encoding="utf-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi"> <Product Id="a2298d1d-ba60-4c4d-92e3-a77413f54a53" Name="MyCompany Integration Framework 1.0.0" Language="1033" Version="1.0.0" Manufacturer="MyCompany" UpgradeCode="9071eacc-9b5a-48e3-bb90-8064d2b2c45d"> <!-- Package information --> <Package Keywords="Installer" Id="e85e6190-1cd4-49f5-8924-9da5fcb8aee8" Description="Installs MyCompany Integration Framework 1.0.0" Comments="Installs MyCompany Integration Framework 1.0.0" InstallerVersion="100" Compressed="yes" /> <Upgrade Id='9071eacc-9b5a-48e3-bb90-8064d2b2c45d'> <UpgradeVersion Property="PATCHFOUND" OnlyDetect="no" Minimum="0.0.1" IncludeMinimum="yes" Maximum="1.0.0" IncludeMaximum="yes"/> </Upgrade> <!-- Useless but necessary... --> <Media Id="1" Cabinet="MyCompany.cab" EmbedCab="yes" /> <!-- Precondition: .Net 2 must be installed --> <Condition Message='This setup requires the .NET Framework 2 or higher.'> <![CDATA[MsiNetAssemblySupport >= "2.0.50727"]]> </Condition> <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="MyCompany" Name="MyCompany"> <Directory Id="INSTALLDIR" Name="Integrat" LongName="MyCompany Integration Framework"> <Component Id="MyCompanyDllComponent" Guid="4f362043-03a0-472d-a84f-896522ce7d2b" DiskId="1"> <File Id="MyCompanyIntegrationDll" Name="IbIntegr.dll" src="..\Build\MyCompany.Integration.dll" Vital="yes" LongName="MyCompany.Integration.dll" /> <File Id="MyCompanyServiceModelDll" Name="IbSerMod.dll" src="..\Build\MyCompany.ServiceModel.dll" Vital="yes" LongName="MyCompany.ServiceModel.dll" /> </Component> <!-- More components --> </Directory> </Directory> </Directory> <Feature Id="MyCompanyProductFeature" Title='MyCompany Integration Framework' Description='The complete package' Display='expand' Level="1" InstallDefault='local' ConfigurableDirectory="INSTALLDIR"> <ComponentRef Id="MyCompanyDllComponent" /> </Feature> <!-- Task scheduler application. It has to be used as a property --> <Property Id="finaltaskexe" Value="MyCompany.Integration.Host.exe" /> <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" /> <InstallExecuteSequence> <!-- command must be executed: MyCompany.Integration.Host.exe /INITIALCONFIG parameters.xml --> <Custom Action='PropertyAssign' After='InstallFinalize'>NOT Installed AND NOT PATCHFOUND</Custom> <Custom Action='LaunchFile' After='InstallFinalize'>NOT Installed AND NOT PATCHFOUND</Custom> <RemoveExistingProducts Before='CostInitialize' /> </InstallExecuteSequence> <!-- execute comand --> <CustomAction Id='PropertyAssign' Property='PathProperty' Value='[INSTALLDIR][finaltaskexe]' /> <CustomAction Id='LaunchFile' Property='PathProperty' ExeCommand='/INITIALCONFIG "[INSTALLDIR]parameters.xml"' Return='asyncNoWait' /> <!-- User interface information --> <UIRef Id="WixUI_InstallDir" /> <UIRef Id="WixUI_ErrorProgressText" /> </Product> </Wix>
msi
windows-installer
wix
null
null
null
open
Make wix installation set upgrade to 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 have to do manual work like saving the installation folder in a registry key upon first installing and then read this key upon upgrade? If so, is there any example? Or is there some easier way to achieve this in MSI / Wix? As reference I paste in my current Wix file below: <?xml version="1.0" encoding="utf-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi"> <Product Id="a2298d1d-ba60-4c4d-92e3-a77413f54a53" Name="MyCompany Integration Framework 1.0.0" Language="1033" Version="1.0.0" Manufacturer="MyCompany" UpgradeCode="9071eacc-9b5a-48e3-bb90-8064d2b2c45d"> <!-- Package information --> <Package Keywords="Installer" Id="e85e6190-1cd4-49f5-8924-9da5fcb8aee8" Description="Installs MyCompany Integration Framework 1.0.0" Comments="Installs MyCompany Integration Framework 1.0.0" InstallerVersion="100" Compressed="yes" /> <Upgrade Id='9071eacc-9b5a-48e3-bb90-8064d2b2c45d'> <UpgradeVersion Property="PATCHFOUND" OnlyDetect="no" Minimum="0.0.1" IncludeMinimum="yes" Maximum="1.0.0" IncludeMaximum="yes"/> </Upgrade> <!-- Useless but necessary... --> <Media Id="1" Cabinet="MyCompany.cab" EmbedCab="yes" /> <!-- Precondition: .Net 2 must be installed --> <Condition Message='This setup requires the .NET Framework 2 or higher.'> <![CDATA[MsiNetAssemblySupport >= "2.0.50727"]]> </Condition> <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="MyCompany" Name="MyCompany"> <Directory Id="INSTALLDIR" Name="Integrat" LongName="MyCompany Integration Framework"> <Component Id="MyCompanyDllComponent" Guid="4f362043-03a0-472d-a84f-896522ce7d2b" DiskId="1"> <File Id="MyCompanyIntegrationDll" Name="IbIntegr.dll" src="..\Build\MyCompany.Integration.dll" Vital="yes" LongName="MyCompany.Integration.dll" /> <File Id="MyCompanyServiceModelDll" Name="IbSerMod.dll" src="..\Build\MyCompany.ServiceModel.dll" Vital="yes" LongName="MyCompany.ServiceModel.dll" /> </Component> <!-- More components --> </Directory> </Directory> </Directory> <Feature Id="MyCompanyProductFeature" Title='MyCompany Integration Framework' Description='The complete package' Display='expand' Level="1" InstallDefault='local' ConfigurableDirectory="INSTALLDIR"> <ComponentRef Id="MyCompanyDllComponent" /> </Feature> <!-- Task scheduler application. It has to be used as a property --> <Property Id="finaltaskexe" Value="MyCompany.Integration.Host.exe" /> <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" /> <InstallExecuteSequence> <!-- command must be executed: MyCompany.Integration.Host.exe /INITIALCONFIG parameters.xml --> <Custom Action='PropertyAssign' After='InstallFinalize'>NOT Installed AND NOT PATCHFOUND</Custom> <Custom Action='LaunchFile' After='InstallFinalize'>NOT Installed AND NOT PATCHFOUND</Custom> <RemoveExistingProducts Before='CostInitialize' /> </InstallExecuteSequence> <!-- execute comand --> <CustomAction Id='PropertyAssign' Property='PathProperty' Value='[INSTALLDIR][finaltaskexe]' /> <CustomAction Id='LaunchFile' Property='PathProperty' ExeCommand='/INITIALCONFIG "[INSTALLDIR]parameters.xml"' Return='asyncNoWait' /> <!-- User interface information --> <UIRef Id="WixUI_InstallDir" /> <UIRef Id="WixUI_ErrorProgressText" /> </Product> </Wix>
0
55,968
09/11/2008 07:48:53
327
08/04/2008 17:08:49
682
47
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?
windows
sql
sqlite
null
null
null
open
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?
0
55,978
09/11/2008 07:58:38
5,175
09/08/2008 10:47:07
13
1
Test an object for NOT being a type (C#)
I know how to test an object to see if it is of a type, using the IS keyword e.g. if (foo is bar) { //do something here } but how do you test for it not being "bar"?, I can't seem to find a keyword that works with IS to test for a negative result. BTW - I have a horrible feeling this is soooo obvious, so apologies in advance...
c#
object
testing
syntax
null
null
open
Test an object for NOT being a type (C#) === I know how to test an object to see if it is of a type, using the IS keyword e.g. if (foo is bar) { //do something here } but how do you test for it not being "bar"?, I can't seem to find a keyword that works with IS to test for a negative result. BTW - I have a horrible feeling this is soooo obvious, so apologies in advance...
0
55,984
09/11/2008 08:02:19
4,883
09/06/2008 10:24:59
630
5
What is the difference between const and readonly?
What is the difference between const and readonly and do you use one over the other?
c#
null
null
null
null
null
open
What is the difference between const and readonly? === What is the difference between const and readonly and do you use one over the other?
0
55,986
09/11/2008 08:03:34
4,021
09/01/2008 12:23:44
213
13
Coping with unavailable systems at our work place
What do you do when your source control / bug database / network / email system is temporarily unavailable? This is to guage how productive we can be under such a situation?
productivity
self-improvement
null
null
null
null
open
Coping with unavailable systems at our work place === What do you do when your source control / bug database / network / email system is temporarily unavailable? This is to guage how productive we can be under such a situation?
0
55,992
09/11/2008 08:07:34
3,713
08/30/2008 09:06:27
151
19
Learn How To Become a Better Writer
**HAI GAIS! WHATZUP?!** You know how it goes, every other day you'll find someone whether it be at an internet forum or on a spec doc whose literary efforts can be described as abysmal. They try to write something intelligently but often come off as a complete jerk. They could be a kick-ass coder but fail to write any comment of coherent line of thought. They try to make a valid point but instead offend several nationalities on the effort. It is a curse, I tell you! Sometimes it is better if they stayed away from text. But they can't stay away as we are all dependent on written communication. The future of Internet depends on it! So to help these poor souls, does anyone know of any good reference on how to become a better writer without actually becoming a writer? **KTHXBYE!**
communication
null
null
null
null
07/16/2012 20:28:03
off topic
Learn How To Become a Better Writer === **HAI GAIS! WHATZUP?!** You know how it goes, every other day you'll find someone whether it be at an internet forum or on a spec doc whose literary efforts can be described as abysmal. They try to write something intelligently but often come off as a complete jerk. They could be a kick-ass coder but fail to write any comment of coherent line of thought. They try to make a valid point but instead offend several nationalities on the effort. It is a curse, I tell you! Sometimes it is better if they stayed away from text. But they can't stay away as we are all dependent on written communication. The future of Internet depends on it! So to help these poor souls, does anyone know of any good reference on how to become a better writer without actually becoming a writer? **KTHXBYE!**
2
56,005
09/11/2008 08:15:50
4,227
09/02/2008 13:08:22
67
4
.NET serialization class design problem
We have a rather large object graph that needs to be serialized and deserialized in a lot of different ways (modes). In some modes we want certain properties to be deserialized and in some we don't. The problem is now how we implement these modes. **Apporach A (use deseriliazation constructor and ISerializable.GetObjectData):** If we let each object of the graph serialize itself using a deserialization constructor we get a lot switches for all the different modes of deserialization. The advantage of this approach however is that all the deserialization logic is at one location and if we add new properties we just need to modify the ISerializable.GetObjectData and the deserialization constructor. Another advantage is that the object might take internal states into account that might be exposed publically. The most important disadvantage is that we dataobject itself needs to know about all possible serialization modes. If we need a new mode we need to modify the dataobjects. **Apporach B (Deserialization Factory Classes/Methods ):** Another approach would be to have some sort Deserialization Factory Classes/Methods one for each mode that does the serialization and deserialization externally (e.g. GraphSerializer.SerializeObjectTypeX(ObjectTypeX objectToSerialze). The advantage here is that whenever we want a new mode we just add a new Factory Class/Method and our Dataobject do not get cluttered with all the serialization modes that get introduced. The main disadvantage here is that I would have to write the same serialization code over and over for all the different modes. If two modes differ just in one or two properties but I would have to implement the complete logic for the whole graph again. When I add a new property to a dataobject I need to update all the factory classes. So I wonder if there is a better approach to this IMHO general problem. Or even a best practise in .NET?
class-design
serialization
.net
null
null
null
open
.NET serialization class design problem === We have a rather large object graph that needs to be serialized and deserialized in a lot of different ways (modes). In some modes we want certain properties to be deserialized and in some we don't. The problem is now how we implement these modes. **Apporach A (use deseriliazation constructor and ISerializable.GetObjectData):** If we let each object of the graph serialize itself using a deserialization constructor we get a lot switches for all the different modes of deserialization. The advantage of this approach however is that all the deserialization logic is at one location and if we add new properties we just need to modify the ISerializable.GetObjectData and the deserialization constructor. Another advantage is that the object might take internal states into account that might be exposed publically. The most important disadvantage is that we dataobject itself needs to know about all possible serialization modes. If we need a new mode we need to modify the dataobjects. **Apporach B (Deserialization Factory Classes/Methods ):** Another approach would be to have some sort Deserialization Factory Classes/Methods one for each mode that does the serialization and deserialization externally (e.g. GraphSerializer.SerializeObjectTypeX(ObjectTypeX objectToSerialze). The advantage here is that whenever we want a new mode we just add a new Factory Class/Method and our Dataobject do not get cluttered with all the serialization modes that get introduced. The main disadvantage here is that I would have to write the same serialization code over and over for all the different modes. If two modes differ just in one or two properties but I would have to implement the complete logic for the whole graph again. When I add a new property to a dataobject I need to update all the factory classes. So I wonder if there is a better approach to this IMHO general problem. Or even a best practise in .NET?
0
56,011
09/11/2008 08:18:55
4,883
09/06/2008 10:24:59
640
5
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?
python
coding-style
null
null
null
null
open
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?
0
56,013
09/11/2008 08:20:29
230
08/03/2008 19:32:46
574
36
Cross platform .Net?
If you where to write an application 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.
cross-platform
.net
null
null
null
null
open
Cross platform .Net? === If you where to write an application 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.
0
56,022
09/11/2008 08:23:02
2,822
08/25/2008 11:42:23
352
17
Prevent file casing problems in Subversion
We encountered a problem with using Subversion on Windows. A developer committed a file <code>foo.Data.sql</code> and later another developer committed a file called <code>foo.data.sql</code>. Naturally, this caused a problem on Windows clients (all clients are Windows in our environments) because files are case sensitive in Subversion but not in Windows. We managed to resolve this problem by deleting one of the files directly in the repository, but I still have two questions: 1. How is it possible for a developer to do this using a Windows client? Does he have an invalid working copy, or is there a bug in the client (TortoiseSVN)? 2. How can we prevent changes like these from entering the repository (i.e. has anyone written a hook script that performs a sanity check for file casing issues)?
svn
tortoisesvn
null
null
null
null
open
Prevent file casing problems in Subversion === We encountered a problem with using Subversion on Windows. A developer committed a file <code>foo.Data.sql</code> and later another developer committed a file called <code>foo.data.sql</code>. Naturally, this caused a problem on Windows clients (all clients are Windows in our environments) because files are case sensitive in Subversion but not in Windows. We managed to resolve this problem by deleting one of the files directly in the repository, but I still have two questions: 1. How is it possible for a developer to do this using a Windows client? Does he have an invalid working copy, or is there a bug in the client (TortoiseSVN)? 2. How can we prevent changes like these from entering the repository (i.e. has anyone written a hook script that performs a sanity check for file casing issues)?
0
56,028
09/11/2008 08:28:37
3,146
08/27/2008 00:25:15
846
43
What is your recommended monitor resolution?
I just got a new monitor to replace one of the ones I have at work. I went from this*: 1: 1600x1280 2: 1400x768 to this**: 1: 1768x1340 2: 1600x1280 (was formerly 1) This was a pretty big jump up for me, although in my office I seem to be a bit unusual in that I seem to be the only one who still has two CRT monitors on my desk (two pretty freaking huge ones at that). The thing about the CRTs is that currently none of the LCDs we have can do this high a resolution so I think it's pretty sweet. What kind of resolution is recommended these days for serious development work? \* & **: these numbers are approximate
monitor
resolution
null
null
null
null
open
What is your recommended monitor resolution? === I just got a new monitor to replace one of the ones I have at work. I went from this*: 1: 1600x1280 2: 1400x768 to this**: 1: 1768x1340 2: 1600x1280 (was formerly 1) This was a pretty big jump up for me, although in my office I seem to be a bit unusual in that I seem to be the only one who still has two CRT monitors on my desk (two pretty freaking huge ones at that). The thing about the CRTs is that currently none of the LCDs we have can do this high a resolution so I think it's pretty sweet. What kind of resolution is recommended these days for serious development work? \* & **: these numbers are approximate
0
56,037
09/11/2008 08:32:21
5,004
09/07/2008 10:03:29
72
2
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?
ruby-on-rails
yaml
null
null
null
null
open
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?
0
56,045
09/11/2008 08:39:22
3,966
09/01/2008 03:51:27
3
1
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 these strings as ???? in the HTML sent to the browser. The charset directive is present in the HTML header: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> Perhaps I need to add something to my struts2 or tiles configurations?
java
internationalization
struts2
tiles
utf-8
null
open
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 these strings as ???? in the HTML sent to the browser. The charset directive is present in the HTML header: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> Perhaps I need to add something to my struts2 or tiles configurations?
0
56,046
09/11/2008 08:40:03
123
08/02/2008 08:01:26
1,541
76
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?
c++
winapi
standards
null
null
null
open
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?
0
56,052
09/11/2008 08:41:56
4,639
09/04/2008 23:07:22
109
1
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 in the home directory if there is another built-in way to get a timestamp.)
vim
vi
null
null
null
null
open
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 in the home directory if there is another built-in way to get a timestamp.)
0
56,070
09/11/2008 08:51:39
267
08/04/2008 10:11:06
3,415
172
DELETE Statement hangs on SQL Server for no apparent reason
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 ensure no foreign keys would trip up the delete, but we've verified that none of those other tables have any rows referring to that particular row. There is no other user connected to the database at this time. We've run DBCC CHECKDB against it, and it reports 0 errors. What else should we look at?
sql-server-2005
sql
delete
hang
null
null
open
DELETE Statement hangs on SQL Server for no apparent reason === 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 ensure no foreign keys would trip up the delete, but we've verified that none of those other tables have any rows referring to that particular row. There is no other user connected to the database at this time. We've run DBCC CHECKDB against it, and it reports 0 errors. What else should we look at?
0
56,078
09/11/2008 08:57:17
91
08/01/2008 17:55:22
6,599
259
Merging 2 Collection<T>
I got a Function that returns a Collection&lt;string&gt;, and that calls itself recursively to eventually return one big Collection&lt;string&gt; 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 out duplicates, I feel like i'll end up with a foreach that calls Contains() on the Collection. I wonder, is there a more efficient way to have a recursive function that returns a list of strings without duplicates? I don't have to use a Collection, it can be pretty much any suitable data type. Only exclusion, I'm bound to Visual Studio 2005 and .net 3.0, so no LINQ.
c#
null
null
null
null
null
open
Merging 2 Collection<T> === I got a Function that returns a Collection&lt;string&gt;, and that calls itself recursively to eventually return one big Collection&lt;string&gt; 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 out duplicates, I feel like i'll end up with a foreach that calls Contains() on the Collection. I wonder, is there a more efficient way to have a recursive function that returns a list of strings without duplicates? I don't have to use a Collection, it can be pretty much any suitable data type. Only exclusion, I'm bound to Visual Studio 2005 and .net 3.0, so no LINQ.
0
56,087
09/11/2008 09:01:36
3,205
08/27/2008 13:06:13
458
29
Does ruby have real multithreading?
I know about the "cooperative" threading of ruby using <a href="http://en.wikipedia.org/wiki/Green_threads">green threads</a>. How can I create real "OS-level" threads in my application in order to make use of multiple cpu cores for processing?
ruby
multithreading
null
null
null
null
open
Does ruby have real multithreading? === I know about the "cooperative" threading of ruby using <a href="http://en.wikipedia.org/wiki/Green_threads">green threads</a>. How can I create real "OS-level" threads in my application in order to make use of multiple cpu cores for processing?
0
56,090
09/11/2008 09:02:49
1,612
08/17/2008 14:52:15
409
31
Subversion merge history visualisation
Are there any utilities out there which can draw pictures of the merge history of a subversion repo - we always commit merges with a (fairly) consistent log message, and it would be handy to be able to automatically extract this info into a single picture that shows what branches occurred when, and what the state of merges is. I'm just interested in an informational tool, not something to help with actually performing merges.
svn
merge
visualization
null
null
null
open
Subversion merge history visualisation === Are there any utilities out there which can draw pictures of the merge history of a subversion repo - we always commit merges with a (fairly) consistent log message, and it would be handy to be able to automatically extract this info into a single picture that shows what branches occurred when, and what the state of merges is. I'm just interested in an informational tool, not something to help with actually performing merges.
0
56,091
09/11/2008 09:03:13
2,958
08/26/2008 08:58:45
33
4
Pointers to C++ class mthods
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 CaseMethod1( int abc, const std::string& str ) { cout << "case 1:" << str; return true; } bool CaseMethod2( int abc, const std::string& str ) { cout << "case 2:" << str; return true; } bool CaseMethod3( int abc, const std::string& str ) { cout << "case 3:" << str; return true; } public: bool TestSwitch( int num ) { bool ( MyClass::*CaseMethod )( int, const std::string& ); switch ( num ) { case 1: CaseMethod = &MyClass::CaseMethod1; break; case 2: CaseMethod = &MyClass::CaseMethod2; break; case 3: CaseMethod = &MyClass::CaseMethod3; break; } ... bool res = CaseMethod( 999, "hello world" ); ... reurn res; } }; My question is - **is this the correct way to go about this?** Should I consider anything that *Boost* has to offer?
c++
null
null
null
null
null
open
Pointers to C++ class mthods === 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 CaseMethod1( int abc, const std::string& str ) { cout << "case 1:" << str; return true; } bool CaseMethod2( int abc, const std::string& str ) { cout << "case 2:" << str; return true; } bool CaseMethod3( int abc, const std::string& str ) { cout << "case 3:" << str; return true; } public: bool TestSwitch( int num ) { bool ( MyClass::*CaseMethod )( int, const std::string& ); switch ( num ) { case 1: CaseMethod = &MyClass::CaseMethod1; break; case 2: CaseMethod = &MyClass::CaseMethod2; break; case 3: CaseMethod = &MyClass::CaseMethod3; break; } ... bool res = CaseMethod( 999, "hello world" ); ... reurn res; } }; My question is - **is this the correct way to go about this?** Should I consider anything that *Boost* has to offer?
0
56,096
09/11/2008 09:06:06
5,754
09/11/2008 09:06:06
1
0
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 exclamation mark too since we are not committing it). How can I remove it from Subversion safely without it being deleted from the files system Thanks, Adin
subversion
visualsvn
web-config
null
null
null
open
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 exclamation mark too since we are not committing it). How can I remove it from Subversion safely without it being deleted from the files system Thanks, Adin
0
56,107
09/11/2008 09:16:40
327
08/04/2008 17:08:49
684
48
What is the best way to parse html in C#?
I'm looking for a library/method to parse an html file with more html specific features than generic xml parsing libraries.
c#
.net
html
parsing
null
11/15/2011 17:09:39
not constructive
What is the best way to parse html in C#? === I'm looking for a library/method to parse an html file with more html specific features than generic xml parsing libraries.
4
56,112
09/11/2008 09:18:49
1,199,387
08/06/2008 23:58:10
397
24
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 AspNetCompatibilityRequirementsMode. I now want to write a Windows application using the exact same web service. To handle authentication I have enabled the [Authentication service][1], and can call "login" to authenticate my user... Okey, all good... But how the heck do I get that authentication cookie set on my other service client?! Both services are hosted on the same domain - MyDataService.svc <- the one dealing with my data - AuthenticationService.svc <- the one the windows app has to call to authenticate. I don't want to create a new service for the windows client, or use another binding... [1]: http://msdn.microsoft.com/en-us/library/bb386582.aspx
wcf
web-service
.net
null
null
null
open
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 AspNetCompatibilityRequirementsMode. I now want to write a Windows application using the exact same web service. To handle authentication I have enabled the [Authentication service][1], and can call "login" to authenticate my user... Okey, all good... But how the heck do I get that authentication cookie set on my other service client?! Both services are hosted on the same domain - MyDataService.svc <- the one dealing with my data - AuthenticationService.svc <- the one the windows app has to call to authenticate. I don't want to create a new service for the windows client, or use another binding... [1]: http://msdn.microsoft.com/en-us/library/bb386582.aspx
0
56,118
09/11/2008 09:22:45
192
08/03/2008 10:15:38
290
28
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 solution in either AS3 or psuedocode would be very helpful. Thanks. ![alt text][1] [1]: http://x01.co.uk/triangle.jpg
actionscript-3
trigonometry
hypotenuse
null
null
null
open
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 solution in either AS3 or psuedocode would be very helpful. Thanks. ![alt text][1] [1]: http://x01.co.uk/triangle.jpg
0
56,121
09/11/2008 09:24:22
123
08/02/2008 08:01:26
1,548
78
IPC Mechanisms in C# - Usage and Best Practices..
I have used IPC in win32 code a while ago. [Critical sections, events & semaphores] How is the scene in .NET enviroment? Are there any tutorial explaining all available options and when to use and why?
c#
.net
ipc
null
null
null
open
IPC Mechanisms in C# - Usage and Best Practices.. === I have used IPC in win32 code a while ago. [Critical sections, events & semaphores] How is the scene in .NET enviroment? Are there any tutorial explaining all available options and when to use and why?
0
56,124
09/11/2008 09:26:25
1,078
08/12/2008 10:39:00
347
17
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 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 on 64-bit platforms.
vmware
64-bit
null
null
null
null
open
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 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 on 64-bit platforms.
0
56,145
09/11/2008 09:41:53
5,760
09/11/2008 09:41:53
1
0
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:<br/> Being modeless, I start and stop the dialog at my own pleasure using new/Create(), then DestroyWindow()/delete(in PostNcDestroy). Trouble begins when the IE control starts loading a Flash video (regular YouTube stuff): when one closes, thus destroying the dialog, the video still loads! Right until fully cached. The Flash ActiveX thread still lingers and continues to run even when the parent dialog has passed PostNcDestroy and all memory was freed. What to do? How do you trully 'kill' that child web control and all its threads? Problem #2:<br/> The web browser control covers the whole area of the dialog. I cannot intercept any OnMouseMove() - in the parent dialog or in the web browser mapping class! What gives? Thanks!
c++
mfc
internet-explorer
dialog
null
null
open
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:<br/> Being modeless, I start and stop the dialog at my own pleasure using new/Create(), then DestroyWindow()/delete(in PostNcDestroy). Trouble begins when the IE control starts loading a Flash video (regular YouTube stuff): when one closes, thus destroying the dialog, the video still loads! Right until fully cached. The Flash ActiveX thread still lingers and continues to run even when the parent dialog has passed PostNcDestroy and all memory was freed. What to do? How do you trully 'kill' that child web control and all its threads? Problem #2:<br/> The web browser control covers the whole area of the dialog. I cannot intercept any OnMouseMove() - in the parent dialog or in the web browser mapping class! What gives? Thanks!
0
56,149
09/11/2008 09:45:37
342
08/04/2008 19:59:52
784
78
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][1] that states that Subversion doesn't store file-permissions. There are patches and hook-scripts listed (only one url still exists). Three years later does Subversion still not store file permissions and are hooks the only way to go about this? (I've never done hooks and rather use something that is native to Subversion.) [1]: http://mamchenkov.net/wordpress/2005/04/27/subversion-and-file-permissions/
windows
svn
file-permissions
null
null
null
open
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][1] that states that Subversion doesn't store file-permissions. There are patches and hook-scripts listed (only one url still exists). Three years later does Subversion still not store file permissions and are hooks the only way to go about this? (I've never done hooks and rather use something that is native to Subversion.) [1]: http://mamchenkov.net/wordpress/2005/04/27/subversion-and-file-permissions/
0
56,168
09/11/2008 09:53:28
1,163
08/13/2008 07:44:23
43
4
Test Cases AND assertion statements
The code in [this question][1] made me think assert(value>0); //Precondition if (value>0) { //Doit } I never write the if-statement. Asserting is enough/all you *can* do. "Crash early, crash often" [CodeComplete][2] states: - The assert-statement makes the application Correct - The if-test makes the application Robust I don't think you've made an application more robust by correcting invalid input values, or skipping code: assert(value >= 0 ); //Precondition assert(value <= 90); //Precondition if(value < 0) //Just in case value = 0; if (value > 90) //Just in case value = 90; //Doit These corrections are based on assumptions you made about the outside world. Only the caller knows what "a valid input value" is for your function, and he must check its validity before he calls your function. To paraphrase [CodeComplete][2]: "Real-world programs *become* too messy when we *don't* rely solely on assertions." Question: Am I wrong, stuborn, stupid, too non-defensive... Thanks in advance! Jan [1]: http://stackoverflow.com/questions/17181/test-cases-vs-assertion-statement [2]: http://www.amazon.com/Code-Complete-Practical-Handbook-Construction/dp/0735619670
defensive-programming
null
null
null
null
null
open
Test Cases AND assertion statements === The code in [this question][1] made me think assert(value>0); //Precondition if (value>0) { //Doit } I never write the if-statement. Asserting is enough/all you *can* do. "Crash early, crash often" [CodeComplete][2] states: - The assert-statement makes the application Correct - The if-test makes the application Robust I don't think you've made an application more robust by correcting invalid input values, or skipping code: assert(value >= 0 ); //Precondition assert(value <= 90); //Precondition if(value < 0) //Just in case value = 0; if (value > 90) //Just in case value = 90; //Doit These corrections are based on assumptions you made about the outside world. Only the caller knows what "a valid input value" is for your function, and he must check its validity before he calls your function. To paraphrase [CodeComplete][2]: "Real-world programs *become* too messy when we *don't* rely solely on assertions." Question: Am I wrong, stuborn, stupid, too non-defensive... Thanks in advance! Jan [1]: http://stackoverflow.com/questions/17181/test-cases-vs-assertion-statement [2]: http://www.amazon.com/Code-Complete-Practical-Handbook-Construction/dp/0735619670
0
56,195
09/11/2008 10:09:19
5,383
09/09/2008 11:58:30
6
0
How to obtain Vista Edition programmatically?
How to obtain Vista Edition programmatically, that is Home Basic, Home Premium, Business or Ultimate ?
windows-vista
edition
null
null
null
null
open
How to obtain Vista Edition programmatically? === How to obtain Vista Edition programmatically, that is Home Basic, Home Premium, Business or Ultimate ?
0
56,208
09/11/2008 10:19:44
82
08/01/2008 16:28:35
149
3
WMI - Using InvokeMethod(..) on a ManagementObject representing a singleton ManagementClass
I've having trouble directly accessing the **Win32_OperatingSystem** management class that is exposed via WMI. It is a singleton class, and I'm pretty certain "Win32_OperatingSystem=@" is the correct path syntax to get the instance of a singleton. The call to InvokeMethod produces the exception listed at the bottom of the question, as does accessing the ClassPath property (commented line). What am I doing wrong? [I'm aware that I can use ManagementObjectSearcher/ObjectQuery to return a collection of Win32_OperatingSystem (which would contain only one), but since I know it is a singleton, I want to access it directly.] ---------- ManagementScope cimv2 = InitScope(string.Format(@"\\{0}\root\cimv2", this.Name)); ManagementObject os = new ManagementObject( cimv2, new ManagementPath("Win32_OperatingSystem=@"), new ObjectGetOptions()); //ManagementPath p = os.ClassPath; os.InvokeMethod("Reboot", null); ---------- System.Management.ManagementException was caught Message="Invalid object path " Source="System.Management" StackTrace: at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode) at System.Management.ManagementObject.Initialize(Boolean getObject) at System.Management.ManagementBaseObject.get_wbemObject() at System.Management.ManagementObject.get_ClassPath() at System.Management.ManagementObject.GetMethodParameters(String methodName, ManagementBaseObject& inParameters, IWbemClassObjectFreeThreaded& inParametersClass, IWbemClassObjectFreeThreaded& outParametersClass) at System.Management.ManagementObject.InvokeMethod(String methodName, Object[] args)
c#
wmi
null
null
null
null
open
WMI - Using InvokeMethod(..) on a ManagementObject representing a singleton ManagementClass === I've having trouble directly accessing the **Win32_OperatingSystem** management class that is exposed via WMI. It is a singleton class, and I'm pretty certain "Win32_OperatingSystem=@" is the correct path syntax to get the instance of a singleton. The call to InvokeMethod produces the exception listed at the bottom of the question, as does accessing the ClassPath property (commented line). What am I doing wrong? [I'm aware that I can use ManagementObjectSearcher/ObjectQuery to return a collection of Win32_OperatingSystem (which would contain only one), but since I know it is a singleton, I want to access it directly.] ---------- ManagementScope cimv2 = InitScope(string.Format(@"\\{0}\root\cimv2", this.Name)); ManagementObject os = new ManagementObject( cimv2, new ManagementPath("Win32_OperatingSystem=@"), new ObjectGetOptions()); //ManagementPath p = os.ClassPath; os.InvokeMethod("Reboot", null); ---------- System.Management.ManagementException was caught Message="Invalid object path " Source="System.Management" StackTrace: at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode) at System.Management.ManagementObject.Initialize(Boolean getObject) at System.Management.ManagementBaseObject.get_wbemObject() at System.Management.ManagementObject.get_ClassPath() at System.Management.ManagementObject.GetMethodParameters(String methodName, ManagementBaseObject& inParameters, IWbemClassObjectFreeThreaded& inParametersClass, IWbemClassObjectFreeThreaded& outParametersClass) at System.Management.ManagementObject.InvokeMethod(String methodName, Object[] args)
0
56,224
09/11/2008 10:33:54
5,175
09/08/2008 10:47:07
18
2
Creating objects driven by the database to populate a Treeview - very slow (C#)
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. Whilst generating these objects I use some of the values from the result set to populate values in the object via the setters. I query the Dictionary to return a particular object type and use it to populate a treeview. However it is not possible to populate 2 objects of the same type in a treeview from the Dictionary object (you get a runtime error - which escapes me at the moment, something to with referencing the same object). So what I have to do is use a memberwiseClone and implement IClonable to get around this. Am I doing this right? Is there a better way - because I think this is causing my program to be real slow at this point. At the very least I think its a bit clunky - any advice from people who know more than me - greatly appreciated.
c#
iclonable
dictionary
object
clone
null
open
Creating objects driven by the database to populate a Treeview - very slow (C#) === 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. Whilst generating these objects I use some of the values from the result set to populate values in the object via the setters. I query the Dictionary to return a particular object type and use it to populate a treeview. However it is not possible to populate 2 objects of the same type in a treeview from the Dictionary object (you get a runtime error - which escapes me at the moment, something to with referencing the same object). So what I have to do is use a memberwiseClone and implement IClonable to get around this. Am I doing this right? Is there a better way - because I think this is causing my program to be real slow at this point. At the very least I think its a bit clunky - any advice from people who know more than me - greatly appreciated.
0
56,227
09/11/2008 10:35:02
338
08/04/2008 18:34:44
1,372
75
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. I was wondering if there is a shortcut using the `svn` command to do this. Otherwise, can anyone suggest a simple script that is network-efficient (I would prefer if it didn't hit the remote server at all)? I also understand that one alternative approach is to keep a *version file* with the `svn:keywords`. This works (I've used it on other projects), but I get tired of dealing with making sure the file is dirty and the inevitable merge conflicts.
subversion
build-automation
null
null
null
null
open
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. I was wondering if there is a shortcut using the `svn` command to do this. Otherwise, can anyone suggest a simple script that is network-efficient (I would prefer if it didn't hit the remote server at all)? I also understand that one alternative approach is to keep a *version file* with the `svn:keywords`. This works (I've used it on other projects), but I get tired of dealing with making sure the file is dirty and the inevitable merge conflicts.
0
56,229
09/11/2008 10:35:37
5,190
09/08/2008 12:03:43
930
52
Best xml writing tool for Python
I'm currently trying ElementTree and it looks fine, it escapes HTML entities and so on and so forth. I'm just wondering if I'm 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.SubElement(head,'script') script.set('type','text/javascript') script.text = "var a = 'I love &aacute; letters'" body = ET.SubElement(root,'body') h1 = ET.SubElement(body,'h1') h1.text = "And I like the fact that 3 > 1" tree = ET.ElementTree(root) tree.write('foo.xhtml') # more foo.xhtml <html><head><script type="text/javascript">var a = 'I love &amp;aacute; letters'</script></head><body><h1>And I like the fact that 3 &gt; 1</h1> </body></html>
python
xml
xhtml
null
null
null
open
Best xml writing tool for Python === I'm currently trying ElementTree and it looks fine, it escapes HTML entities and so on and so forth. I'm just wondering if I'm 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.SubElement(head,'script') script.set('type','text/javascript') script.text = "var a = 'I love &aacute; letters'" body = ET.SubElement(root,'body') h1 = ET.SubElement(body,'h1') h1.text = "And I like the fact that 3 > 1" tree = ET.ElementTree(root) tree.write('foo.xhtml') # more foo.xhtml <html><head><script type="text/javascript">var a = 'I love &amp;aacute; letters'</script></head><body><h1>And I like the fact that 3 &gt; 1</h1> </body></html>
0
56,249
09/11/2008 10:49:46
5,772
09/11/2008 10:49:46
1
0
WCF service configuration file question regarding <baseAddresses>
From what I've seen the <baseAddresses> 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. <system.serviceModel> <service blah blah blah> <host> <baseAddresses> <add baseAddress="http://localhost/blah" /> </baseAddresses> </host> </service> </system.serviceModel> From what I've seen you can take a config file describing a service from one machine and use that on a completely different machine and it works fine. It looks as if IIS completely ignores this section. Thanks, kyle
wcf
configuration
configurationfiles
null
null
null
open
WCF service configuration file question regarding <baseAddresses> === From what I've seen the <baseAddresses> 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. <system.serviceModel> <service blah blah blah> <host> <baseAddresses> <add baseAddress="http://localhost/blah" /> </baseAddresses> </host> </service> </system.serviceModel> From what I've seen you can take a config file describing a service from one machine and use that on a completely different machine and it works fine. It looks as if IIS completely ignores this section. Thanks, kyle
0
56,256
09/11/2008 10:53:15
1,116
08/12/2008 13:25:41
762
42
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?
vs2008
reporting-services
null
null
null
null
open
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?
0
56,266
09/11/2008 10:59:08
1,727
08/18/2008 10:58:44
76
8
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 instead, with a supporting WCF backend? The main function of the portal will be: users, groups and permissions configuration; user profile settings configuration; file upload and download for files needed to support the application. I think the main reason for taking this approach would be that we have good experience with WPF and WCF, but little experience in ASP.Net. Either way we would have to learn ASP.Net or Silverlight, and learning Silverlight seems a more natural extension of our current skills. Are there any big no-nos from the experience of StackOverflowers?
asp.net
architecture
silverlight
null
null
null
open
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 instead, with a supporting WCF backend? The main function of the portal will be: users, groups and permissions configuration; user profile settings configuration; file upload and download for files needed to support the application. I think the main reason for taking this approach would be that we have good experience with WPF and WCF, but little experience in ASP.Net. Either way we would have to learn ASP.Net or Silverlight, and learning Silverlight seems a more natural extension of our current skills. Are there any big no-nos from the experience of StackOverflowers?
0
56,271
09/11/2008 11:06:31
51
08/01/2008 13:31:13
2,021
86
Context.User losing Roles between Application_AuthenticateRequest in Global.asax and Page_Load in WebForm
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: <system.web> <authentication mode="Forms"> <forms loginUrl="Default.aspx" path="/" protection="All" timeout="360" name="MyAppName" cookieless="UseCookies" /> </authentication> <authorization > <allow users="*"/> </authorization> </system.web> <location path="Admin"> <system.web> <authorization> <allow roles="Admin"/> <deny users="*"/> </authorization> </system.web> </location> Based on what I have read, this should ensure that the only users able to access the Admin directory will be users who have been Authenticated and assigned the Admin role. User authentication, saving the authentication ticket, and other related issues all work fine. If I remove the <location /> tags from the web.config file, everything works fine. The problem comes when I try to enforce that only users with the Admin role should be able to access the Admin directory. Based on this <a href="http://support.microsoft.com/kb/311495">MS KB article</a> along with other webpages giving the same information, I have added the following code to my Global.asax file: protected void Application_AuthenticateRequest(Object sender, EventArgs e) { if (HttpContext.Current.User != null) { if (Request.IsAuthenticated == true) { // Debug#1 FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(Context.Request.Cookies[FormsAuthentication.FormsCookieName].Value); // In this case, ticket.UserData = "Admin" string[] roles = new string[1] { ticket.UserData }; FormsIdentity id = new FormsIdentity(ticket); Context.User = new System.Security.Principal.GenericPrincipal(id, roles); // Debug#2 } } } However, when I try to log in, I am unable to access the Admin folder (get redirected to login page). Trying to debug the issue, if I step through a request, if I execute Context.User.IsInRole("Admin") at the line marked Debug#1 above, it returns a false. If I execute the same statement at line Debug#2, it equals true. So at least as far as Global.asax is concerned, the Role is being assigned properly. However, when I execute the same statement on the first line of Page_Load of the requested page, it returns false. So somewhere in between Application_AuthenticateRequest in Global.asax and Page_Load in WebForm, the role information is being lost (note: in Page_Load, the proper Authentication ticket is still assigned to Context.User.Id - only the role is being lost). What am I doing wrong, and how can I get it to work properly? Thanks!
c#
.net
asp.net
forms-authentication
roles
null
open
Context.User losing Roles between Application_AuthenticateRequest in Global.asax and Page_Load in WebForm === 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: <system.web> <authentication mode="Forms"> <forms loginUrl="Default.aspx" path="/" protection="All" timeout="360" name="MyAppName" cookieless="UseCookies" /> </authentication> <authorization > <allow users="*"/> </authorization> </system.web> <location path="Admin"> <system.web> <authorization> <allow roles="Admin"/> <deny users="*"/> </authorization> </system.web> </location> Based on what I have read, this should ensure that the only users able to access the Admin directory will be users who have been Authenticated and assigned the Admin role. User authentication, saving the authentication ticket, and other related issues all work fine. If I remove the <location /> tags from the web.config file, everything works fine. The problem comes when I try to enforce that only users with the Admin role should be able to access the Admin directory. Based on this <a href="http://support.microsoft.com/kb/311495">MS KB article</a> along with other webpages giving the same information, I have added the following code to my Global.asax file: protected void Application_AuthenticateRequest(Object sender, EventArgs e) { if (HttpContext.Current.User != null) { if (Request.IsAuthenticated == true) { // Debug#1 FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(Context.Request.Cookies[FormsAuthentication.FormsCookieName].Value); // In this case, ticket.UserData = "Admin" string[] roles = new string[1] { ticket.UserData }; FormsIdentity id = new FormsIdentity(ticket); Context.User = new System.Security.Principal.GenericPrincipal(id, roles); // Debug#2 } } } However, when I try to log in, I am unable to access the Admin folder (get redirected to login page). Trying to debug the issue, if I step through a request, if I execute Context.User.IsInRole("Admin") at the line marked Debug#1 above, it returns a false. If I execute the same statement at line Debug#2, it equals true. So at least as far as Global.asax is concerned, the Role is being assigned properly. However, when I execute the same statement on the first line of Page_Load of the requested page, it returns false. So somewhere in between Application_AuthenticateRequest in Global.asax and Page_Load in WebForm, the role information is being lost (note: in Page_Load, the proper Authentication ticket is still assigned to Context.User.Id - only the role is being lost). What am I doing wrong, and how can I get it to work properly? Thanks!
0
56,279
09/11/2008 11:15:54
278
08/04/2008 11:28:54
46
5
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][1] 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 the thing with our CMS is that we want to automatically create a few HTML pages for a site right from the start, even before the creator has edited anything in the system. Does anyone know of any way to do this? [1]: http://forums.asp.net/p/931180/1092188.aspx#1092188
asp.net
html
null
null
null
null
open
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][1] 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 the thing with our CMS is that we want to automatically create a few HTML pages for a site right from the start, even before the creator has edited anything in the system. Does anyone know of any way to do this? [1]: http://forums.asp.net/p/931180/1092188.aspx#1092188
0
56,296
09/11/2008 11:24:53
4,061
09/01/2008 15:48:37
53
1
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?
git
subversion
null
null
null
null
open
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?
0
56,313
09/11/2008 11:32:16
4,687
09/05/2008 08:04:23
1
1
ReSharper Code Cleanup/Reformat Code feature vs Versioning Control Systems
ReSharper Code cleanup feature (with "[reorder members](http://www.jetbrains.com/resharper/features/code_formatting.html#Reordering_Type_Members_C#_only)" and "[reformat code](http://www.jetbrains.com/resharper/features/code_formatting.html#Code_Style_Configuration_and_Sharing)" 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 be a problem regarding VCS like subversion, cvs, git, etc. ? Is there a chance that it causes many undesired conflicts ? Thank you.
c#
version-control
resharper
null
null
null
open
ReSharper Code Cleanup/Reformat Code feature vs Versioning Control Systems === ReSharper Code cleanup feature (with "[reorder members](http://www.jetbrains.com/resharper/features/code_formatting.html#Reordering_Type_Members_C#_only)" and "[reformat code](http://www.jetbrains.com/resharper/features/code_formatting.html#Code_Style_Configuration_and_Sharing)" 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 be a problem regarding VCS like subversion, cvs, git, etc. ? Is there a chance that it causes many undesired conflicts ? Thank you.
0
56,315
09/11/2008 11:33:05
2,018
08/19/2008 20:14:45
1,022
88
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.
d
real-world
null
null
null
null
open
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.
0
56,324
09/11/2008 11:39:15
5,330
09/09/2008 07:44:06
187
5
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 the status. What I'd like just reset the screenpointer to 0,0 so I can then just overlay my printfs. I'd rather avoid compiling in any more extensions especially since I'm coding for 2 different OS'.
c
console
null
null
null
null
open
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 the status. What I'd like just reset the screenpointer to 0,0 so I can then just overlay my printfs. I'd rather avoid compiling in any more extensions especially since I'm coding for 2 different OS'.
0
56,325
09/11/2008 11:39:15
278
08/04/2008 11:28:54
51
5
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 configure Team System (2005) to automatically get the latest version when checking out a file?
visual-studio-team-system
null
null
null
null
null
open
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 configure Team System (2005) to automatically get the latest version when checking out a file?
0
56,334
09/11/2008 11:43:11
5,058
09/07/2008 16:00:39
254
14
How do I perform a simple one-statement SQL search across tables?
Say I have two tables: users and groups, each of which has a name. I wish to provide a 'simple search', in which the user enters text and results contain both users and groups whose names contain the text. The results must distinguish between the two types.
sql
search
null
null
null
null
open
How do I perform a simple one-statement SQL search across tables? === Say I have two tables: users and groups, each of which has a name. I wish to provide a 'simple search', in which the user enters text and results contain both users and groups whose names contain the text. The results must distinguish between the two types.
0
56,340
09/11/2008 11:45:27
1,084
08/12/2008 11:01:49
560
46
Can I set a data breakpoint in runtime in System 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 = 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 methods to set a data breakpoint in the code so that it tells me where in the code the variables were actually changed, but without hooking up a debugger?
debugging
linux
null
null
null
null
open
Can I set a data breakpoint in runtime in System 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 = 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 methods to set a data breakpoint in the code so that it tells me where in the code the variables were actually changed, but without hooking up a debugger?
0
56,342
09/11/2008 11:47:03
5,791
09/11/2008 11:41:05
1
0
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 using: - Regex - Simply string searching (using string.IndexOf etc) - Lex/ Yacc - Other The overall solution will be developed in C# 2.0 (hopefully 3.5)
c#
parsing
projects-and-solutions
e-mail
null
null
open
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 using: - Regex - Simply string searching (using string.IndexOf etc) - Lex/ Yacc - Other The overall solution will be developed in C# 2.0 (hopefully 3.5)
0
56,347
09/11/2008 11:50:24
445,087
09/02/2008 17:25:48
371
8
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<String> iter = trees.iterator(); while (iter.hasNext()) { System.out.println(iter.next()); } In the C++ standard template library, iterators seem to represent a datatype or class the supports the operator++ and operator== but has **no concept of a limit** built in so comparison is required before advancing to the next item. The limit has to checked by the user comparing two iterators in the normal case the second iterator is the container end. vector<int> vec; vector<int>::iterator iter; // Add some elements to vector v.push_back(1); v.push_back(4); v.push_back(8); for(iter= v.begin(); iter != v.end(); iter++) { cout << *i << " "; //Should output 1 4 8 } The interesting part here is that in C++ a pointer is an iterator to an array. The STL took what was existing and build convention around it. It there any further subtlety to this that I am missing?
java
c++
iteration
iterator
null
null
open
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<String> iter = trees.iterator(); while (iter.hasNext()) { System.out.println(iter.next()); } In the C++ standard template library, iterators seem to represent a datatype or class the supports the operator++ and operator== but has **no concept of a limit** built in so comparison is required before advancing to the next item. The limit has to checked by the user comparing two iterators in the normal case the second iterator is the container end. vector<int> vec; vector<int>::iterator iter; // Add some elements to vector v.push_back(1); v.push_back(4); v.push_back(8); for(iter= v.begin(); iter != v.end(); iter++) { cout << *i << " "; //Should output 1 4 8 } The interesting part here is that in C++ a pointer is an iterator to an array. The STL took what was existing and build convention around it. It there any further subtlety to this that I am missing?
0
56,357
09/11/2008 11:53:53
5,789
09/11/2008 11:33:18
1
1
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 restarted (after a idle shutdown or a recycle), the application takes up to 20 seconds before it is back online (and Application_start is reached). I don't have the same issue when I am debugging directly within Visual Studio (it takes 2 seconds to start) so I am wondering if the aspnet_compiler is really such a good idea. I couldn't find much on MSDN. How do you compile your websites for production?
c#
asp.net
startup
compilation
aspnet-compiler
null
open
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 restarted (after a idle shutdown or a recycle), the application takes up to 20 seconds before it is back online (and Application_start is reached). I don't have the same issue when I am debugging directly within Visual Studio (it takes 2 seconds to start) so I am wondering if the aspnet_compiler is really such a good idea. I couldn't find much on MSDN. How do you compile your websites for production?
0
56,362
09/11/2008 11:58:06
5,731
09/11/2008 06:21:01
1
4
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 main.cpp - IDE project files (.sln), etc. What dir layout for Ruby (non-Rails, non-Merb) would you suggest to keep it clean, simple and maintainable?
ruby
layout
sourcecode
null
null
null
open
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 main.cpp - IDE project files (.sln), etc. What dir layout for Ruby (non-Rails, non-Merb) would you suggest to keep it clean, simple and maintainable?
0
56,375
09/11/2008 12:05:59
1,670
08/17/2008 21:56:17
47
2
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.
.net
collections
null
null
null
null
open
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.
0
56,388
09/11/2008 12:14:50
2,974
08/26/2008 09:39:16
740
59
When is it NIH vs. being a sensible investment of time?
So I'm sitting here playing catch up listening to [Stack Overflow Podcast #20][1] and Joel is talking about the Excel guys at MS who wrote their own compiler to improve the performance of code that worked with pointers and it got me wondering when is it NIH versus being a sensible investment of time? Given the situation back then that the current compiler performance was abysmal, I can see that selling this particular case to management was *fairly* simple given that you had a specific area of optimisation that you wanted to add. But nowadays, can you imagine trying to go to management and saying you wanted time to rewrite gcc? So how do people determine if an idea is worthwhile pursuing versus a "tilting at windmills" pursuit dripping in NIH syndrome? I'm asking because we need to get some time allocated to improve some aspects of our operational platform. I'm interested in how to go "with cap in hand" to ask The Man for some time to be allocated to make improvements that most people know will definitely pay off in the future. [1]: http://blog.stackoverflow.com/2008/09/podcast-20/
nih
improvement
null
null
null
null
open
When is it NIH vs. being a sensible investment of time? === So I'm sitting here playing catch up listening to [Stack Overflow Podcast #20][1] and Joel is talking about the Excel guys at MS who wrote their own compiler to improve the performance of code that worked with pointers and it got me wondering when is it NIH versus being a sensible investment of time? Given the situation back then that the current compiler performance was abysmal, I can see that selling this particular case to management was *fairly* simple given that you had a specific area of optimisation that you wanted to add. But nowadays, can you imagine trying to go to management and saying you wanted time to rewrite gcc? So how do people determine if an idea is worthwhile pursuing versus a "tilting at windmills" pursuit dripping in NIH syndrome? I'm asking because we need to get some time allocated to improve some aspects of our operational platform. I'm interested in how to go "with cap in hand" to ask The Man for some time to be allocated to make improvements that most people know will definitely pay off in the future. [1]: http://blog.stackoverflow.com/2008/09/podcast-20/
0
56,391
09/11/2008 12:17:50
2,796
08/25/2008 07:37:57
111
9
Autmatically 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 done on the server side. I can imagine that my application (developped in C++ using Qt) has to send a request (HTTP ?) to the server, but what is going to respond to this request ? In order to go through firewalls, I guess I'll have to use port 80 ? Is this correct ? Or, for such a feature, do I have to ask our network admin to open a specific port number through which I'll communicate ?
c++
qt
null
null
null
null
open
Autmatically 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 done on the server side. I can imagine that my application (developped in C++ using Qt) has to send a request (HTTP ?) to the server, but what is going to respond to this request ? In order to go through firewalls, I guess I'll have to use port 80 ? Is this correct ? Or, for such a feature, do I have to ask our network admin to open a specific port number through which I'll communicate ?
0
56,402
09/11/2008 12:24:24
5,764
09/11/2008 10:15:46
1
0
Aligning text in SVG
I am trying to 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; `alignment-baseline` does seem to do it, so at present I'm using `dy="0.5ex"` as a kludge for centre alignment. Is there a proper manner for aligning with the vertical centre or top of the text?
xml
svg
null
null
null
null
open
Aligning text in SVG === I am trying to 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; `alignment-baseline` does seem to do it, so at present I'm using `dy="0.5ex"` as a kludge for centre alignment. Is there a proper manner for aligning with the vertical centre or top of the text?
0
56,411
09/11/2008 12:27:22
4,165
09/02/2008 08:35:08
511
20
How to test randomness (case in point - Shuffling)
First off, this question is ripped out from [this][1] 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 shuffles a deck of cards, how do you test that it's a perfectly random algorithm? To add some theory to the problem - A deck of cards can be shuffled in 52! (52 factorial) different ways. Take a deck of cards, shuffle it by hand and write down the order of all cards. What is the probability that you would have gotten exactly that shuffle? Answer: 1 / 52!. What is the chance that you, after shuffling, will get A, K, Q, J ... of each suit in a sequence? Answer 1 / 52! So, just shuffling once and looking at the result will give you absolutely no information about your shuffling algorithms randomness. Twice and you have more information, Three even more... How would you black box test a shuffling algorithm for randomness? [1]: http://stackoverflow.com/questions/56215/interesting-interview-questions#56291
math
theory
puzzle
rng
null
null
open
How to test randomness (case in point - Shuffling) === First off, this question is ripped out from [this][1] 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 shuffles a deck of cards, how do you test that it's a perfectly random algorithm? To add some theory to the problem - A deck of cards can be shuffled in 52! (52 factorial) different ways. Take a deck of cards, shuffle it by hand and write down the order of all cards. What is the probability that you would have gotten exactly that shuffle? Answer: 1 / 52!. What is the chance that you, after shuffling, will get A, K, Q, J ... of each suit in a sequence? Answer 1 / 52! So, just shuffling once and looking at the result will give you absolutely no information about your shuffling algorithms randomness. Twice and you have more information, Three even more... How would you black box test a shuffling algorithm for randomness? [1]: http://stackoverflow.com/questions/56215/interesting-interview-questions#56291
0
56,417
09/11/2008 12:29:09
3,497
08/28/2008 19:06:00
19
6
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!
python
dabo
null
null
null
null
open
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!
0
56,424
09/11/2008 12:31:09
887
08/10/2008 07:50:30
305
15
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 two cards are from the same manufacturer (PNY). All other things are equal, this is a Windows XP Embedded application and we started from a fresh image for each card. The driver version number is 169.21. The application is all 2D. I.E. just a bunch of textured quads and a whole lot of pre-rendered graphics (hence the need to upgrade the card's memory). We also have compressed animations which the CPU decodes on the fly - this involves a texture lock. The locks take forever but I've also tried having a separate system memory texture for the CPU to update and then updating the rendered texture using the device's UpdateTexture method. No overall difference in performance. Although I've read through every FAQ I can find on the internet about DirectX performance, this is still the first time I've worked on a DirectX project so any arcane bits of knowledge you have would be useful. :) One other thing whilst I'm on the subject; when calling Present on the swap chains it seems DirectX waits for the present to complete regardless of the fact that I'm using D3DPRESENT_DONOTWAIT in both present parameters (PresentationInterval) and the flags of the call itself. Because this is a two-screen application this is a problem as the two monitors do not appear to be genlocked, I'm working around it by running the Present calls through a threadpool. What could the underlying cause of this be? Thanks.
c++
hardware
directx
null
null
null
open
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 two cards are from the same manufacturer (PNY). All other things are equal, this is a Windows XP Embedded application and we started from a fresh image for each card. The driver version number is 169.21. The application is all 2D. I.E. just a bunch of textured quads and a whole lot of pre-rendered graphics (hence the need to upgrade the card's memory). We also have compressed animations which the CPU decodes on the fly - this involves a texture lock. The locks take forever but I've also tried having a separate system memory texture for the CPU to update and then updating the rendered texture using the device's UpdateTexture method. No overall difference in performance. Although I've read through every FAQ I can find on the internet about DirectX performance, this is still the first time I've worked on a DirectX project so any arcane bits of knowledge you have would be useful. :) One other thing whilst I'm on the subject; when calling Present on the swap chains it seems DirectX waits for the present to complete regardless of the fact that I'm using D3DPRESENT_DONOTWAIT in both present parameters (PresentationInterval) and the flags of the call itself. Because this is a two-screen application this is a problem as the two monitors do not appear to be genlocked, I'm working around it by running the Present calls through a threadpool. What could the underlying cause of this be? Thanks.
0
56,427
09/11/2008 12:32:47
572
08/06/2008 20:56:54
3,598
274
Is 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.
cygwin
windows
nix
null
null
null
open
Is 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.
0
56,443
09/11/2008 12:42:55
4,660
09/05/2008 02:23:19
111
4
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 the user from entering a value that is not valid. Currently, I am taking the initial list of objects, adding them to a DataTable and setting the DataSource of my DataGridView to the table. Works nicely, even creates a checkbox column for the one Boolean property. But, I don't know how to make the column for the enum into a dropdownlist. I am using C# and .NET 2.0. Also, I have tried assigning the DataSource of the DataGridView to the list of my objects, but when I do this, it doesn't help with the enum and I'm unable to create new rows in the DataGridView, but I am definitely not bound to using a DataTable as my DataSource, it was simply the option I have semi-working.
c#
.net
gui
.net-2.0
winforms
null
open
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 the user from entering a value that is not valid. Currently, I am taking the initial list of objects, adding them to a DataTable and setting the DataSource of my DataGridView to the table. Works nicely, even creates a checkbox column for the one Boolean property. But, I don't know how to make the column for the enum into a dropdownlist. I am using C# and .NET 2.0. Also, I have tried assigning the DataSource of the DataGridView to the list of my objects, but when I do this, it doesn't help with the enum and I'm unable to create new rows in the DataGridView, but I am definitely not bound to using a DataTable as my DataSource, it was simply the option I have semi-working.
0
56,446
09/11/2008 12:44:49
1,111
08/12/2008 12:40:23
180
20
.Net arrays with lower bound > 0
Although perhaps a bizare thing to want to do, I need to create an Array in .Net with a lower bound > 0. This at first seems to be possible, using: Array.CreateInstance(typeof(Object), New Integer[] {2}, New Integer[] {9}) Produces the desired results (an array of objects with a lower bound set to 9). However the created array instance can no longer be passed to other methods expecting `Object[]` giving me an error saying that: `System.Object[*]` can not be cast into a `System.Object[]`. What is this difference in array types and how can I overcome this?
.net
arrays
null
null
null
null
open
.Net arrays with lower bound > 0 === Although perhaps a bizare thing to want to do, I need to create an Array in .Net with a lower bound > 0. This at first seems to be possible, using: Array.CreateInstance(typeof(Object), New Integer[] {2}, New Integer[] {9}) Produces the desired results (an array of objects with a lower bound set to 9). However the created array instance can no longer be passed to other methods expecting `Object[]` giving me an error saying that: `System.Object[*]` can not be cast into a `System.Object[]`. What is this difference in array types and how can I overcome this?
0
56,472
09/11/2008 12:53:42
5,577
09/10/2008 14:19:27
9
1
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 <NSArray: 0x1359c0> (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? Thanks in advance!
osx
debugging
gdb
objective-c
reversing
null
open
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 <NSArray: 0x1359c0> (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? Thanks in advance!
0
56,478
09/11/2008 13:02:32
5,798
09/11/2008 12:13:01
1
0
Howto 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 pinvoke, which I am not really comfortable with. Thanks
c#
media
wmp
windows
null
null
open
Howto 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 pinvoke, which I am not really comfortable with. Thanks
0
56,479
09/11/2008 13:02:52
3,212
08/27/2008 13:16:46
48
0
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 instances, we're struggling to overcome this without having to add a notable chunk to development time estimates. I've worked with MVC before - via Struts in Java - and found that in that instance, I was able to keep HTML pages exactly as I'd wanted them to be. *(This viewpoint is based on the "best case" static HTML I typically developed beforehand, then handed over to the Java programmers to fill in the holes.)* This worked out really well and we were able to produce some of the "best" web pages from a CMS that I've seen. Could .NET MVC give me the separation I need, or would it be a false economy to put aside valuable development time to test this? If .NET MVC isn't going to give me this fine-grained control over separation, any recommendations for .NET coding practices, libraries, etc. which might would be really helpful.
.net
javascript
html
css
mvc
null
open
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 instances, we're struggling to overcome this without having to add a notable chunk to development time estimates. I've worked with MVC before - via Struts in Java - and found that in that instance, I was able to keep HTML pages exactly as I'd wanted them to be. *(This viewpoint is based on the "best case" static HTML I typically developed beforehand, then handed over to the Java programmers to fill in the holes.)* This worked out really well and we were able to produce some of the "best" web pages from a CMS that I've seen. Could .NET MVC give me the separation I need, or would it be a false economy to put aside valuable development time to test this? If .NET MVC isn't going to give me this fine-grained control over separation, any recommendations for .NET coding practices, libraries, etc. which might would be really helpful.
0
56,500
09/11/2008 13:15:18
5,816
09/11/2008 13:15:18
1
0
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 so that I can access it in a C source file. I have tried various things, including _declspec(dllimport) char* MyNewVariable; but that just gives me a linker error: unresolved external symbol "__declspec(dllimport) char * MyNewVariable" (__imp_?MyNewVariable@@3PADA) How do I write the declaration so that the C++ DLL variable is accessible from the C app?
c
c++
interop
null
null
null
open
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 so that I can access it in a C source file. I have tried various things, including _declspec(dllimport) char* MyNewVariable; but that just gives me a linker error: unresolved external symbol "__declspec(dllimport) char * MyNewVariable" (__imp_?MyNewVariable@@3PADA) How do I write the declaration so that the C++ DLL variable is accessible from the C app?
0
56,505
09/11/2008 13:17:26
4,928
09/06/2008 18:16:34
33
1
Is there a C++ users group in the Northeast (of the United States)?
I noticed recently that there is a [Northwest C++ Users Group][1]. Is there anything similar in the Northeast? [1]: http://nwcpp.org/
c++
usersgroup
null
null
null
null
open
Is there a C++ users group in the Northeast (of the United States)? === I noticed recently that there is a [Northwest C++ Users Group][1]. Is there anything similar in the Northeast? [1]: http://nwcpp.org/
0
56,518
09/11/2008 13:25:20
93
08/01/2008 18:23:58
360
12
C#: Is there any difference between bool? and Nullable<bool> ?
In C# are the nullable primitive types (i.e. `bool?`) just aliases for their corresponding `Nullable<T>` type or is there a difference between the two?
c#
nullable
null
null
null
null
open
C#: Is there any difference between bool? and Nullable<bool> ? === In C# are the nullable primitive types (i.e. `bool?`) just aliases for their corresponding `Nullable<T>` type or is there a difference between the two?
0
56,543
09/11/2008 13:38:17
797
08/09/2008 02:14:04
2,281
89
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 use the working copy against it gives an error saying that revision 7500 doesn't exist in the repository. What is the best way to check in one gigantic revision to bring the content of the repository up to match the content of the working copy and get he working copy back to a functional state? (Ideally I'd like something easier than having to check out a brand new working copy and then copying over all the files manually - I think at the time the working copies were used to configuration manage servers, so it was a real pain to have to check out clean working copies)
svn
version-control
sysadmin
null
null
null
open
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 use the working copy against it gives an error saying that revision 7500 doesn't exist in the repository. What is the best way to check in one gigantic revision to bring the content of the repository up to match the content of the working copy and get he working copy back to a functional state? (Ideally I'd like something easier than having to check out a brand new working copy and then copying over all the files manually - I think at the time the working copies were used to configuration manage servers, so it was a real pain to have to check out clean working copies)
0
56,546
09/11/2008 13:40:04
5,742
09/11/2008 07:37:00
8
1
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 data and the business rules that govern access to and updates of this data. Often the model serves as a software approximation to a real-world process, so simple real-world modeling techniques apply when defining the model. it doesn't say the model should represent one table as what activerecord does. And normally within a transaction, one may have to query a few unrelated tables and then manipulate data from different tables... so if activerecord is used as model, then either one would have to cram all the logic code into the controller (which is kinda popular in some php frameworks) that makes it difficult to test or hack the activerecord model so that it performs database operation on not only the table it maps to, but also other related tables as well... so, what is so great about abusing (IMHO) activerecord as the model in a MVC architectural pattern?
php
mvc
activerecord
null
null
null
open
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 data and the business rules that govern access to and updates of this data. Often the model serves as a software approximation to a real-world process, so simple real-world modeling techniques apply when defining the model. it doesn't say the model should represent one table as what activerecord does. And normally within a transaction, one may have to query a few unrelated tables and then manipulate data from different tables... so if activerecord is used as model, then either one would have to cram all the logic code into the controller (which is kinda popular in some php frameworks) that makes it difficult to test or hack the activerecord model so that it performs database operation on not only the table it maps to, but also other related tables as well... so, what is so great about abusing (IMHO) activerecord as the model in a MVC architectural pattern?
0
56,547
09/11/2008 13:40:19
5,556
09/10/2008 14:01:15
1
3
How do you perform a CROSS JOIN with LINQ to SQL?
How do you perform a CROSS JOIN with LINQ to SQL?
c#
linq
linq-to-sql
crossjoin
null
null
open
How do you perform a CROSS JOIN with LINQ to SQL? === How do you perform a CROSS JOIN with LINQ to SQL?
0
56,553
09/11/2008 13:42:34
3,785
08/30/2008 19:40:07
21
5
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 keys work differently too. Fx on the external = Fn + Fx on the MacBook keyboard. And then there are all the insert, delete, keys. So, the question is, how do you come around this? Now I remap all the things I want at the System Preferences panel, but when I unplug the external keyboard it's all messed up. Is there a way to remap keys only for the external one? Some model of keyboard can store it's own mappings without needing the OS? Am I the only one who is bothered by this? (I would like to avoid buying an external mac keyboard, because I wanted to try one of the ergonomic models, and as far as I know, there are no mac ergonomic models)
osx
keyboard
ergonomics
null
null
null
open
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 keys work differently too. Fx on the external = Fn + Fx on the MacBook keyboard. And then there are all the insert, delete, keys. So, the question is, how do you come around this? Now I remap all the things I want at the System Preferences panel, but when I unplug the external keyboard it's all messed up. Is there a way to remap keys only for the external one? Some model of keyboard can store it's own mappings without needing the OS? Am I the only one who is bothered by this? (I would like to avoid buying an external mac keyboard, because I wanted to try one of the ergonomic models, and as far as I know, there are no mac ergonomic models)
0
56,554
09/11/2008 13:42:35
1,190
08/13/2008 12:15:38
1,338
101
What is the proper regular expression for an unescaped backslash before a character?
You could always consider compiling your Ruby to JVM byte-code (via [JRuby][1]) or .NET byte-code (via [IronRuby][2]) to distribute to people who have those virtual machines and don't want to install a Ruby runtime. You might want to check out [Shoes][3] for building desktop applications in Ruby. Rails really is tuned for building websites. [1]: http://jruby.codehaus.org/ [2]: http://www.ironruby.net/ [3]: http://code.whytheluckystiff.net/shoes/
regex
null
null
null
null
null
open
What is the proper regular expression for an unescaped backslash before a character? === You could always consider compiling your Ruby to JVM byte-code (via [JRuby][1]) or .NET byte-code (via [IronRuby][2]) to distribute to people who have those virtual machines and don't want to install a Ruby runtime. You might want to check out [Shoes][3] for building desktop applications in Ruby. Rails really is tuned for building websites. [1]: http://jruby.codehaus.org/ [2]: http://www.ironruby.net/ [3]: http://code.whytheluckystiff.net/shoes/
0
56,555
09/11/2008 13:43:14
123
08/02/2008 08:01:26
1,580
86
What are your essential phone-screen questions?
I loved the [article from Steve Yegge][1] where he explains to get the most out of phone interviews 1) Coding. The candidate has to write some simple code, with correct syntax, in C, C++, or Java. 2) OO design. The candidate has to define basic OO concepts, and come up with classes to model a simple problem. 3) Scripting and regexes. The candidate has to describe how to find the phone numbers in 50,000 HTML pages. 4) Data structures. The candidate has to demonstrate basic knowledge of the most common data structures. 5) Bits and bytes. The candidate has to answer simple questions about bits, bytes, and binary numbers. What are your essential phone screen questions when you are interviewing over phone? [1]: http://steve.yegge.googlepages.com/five-essential-phone-screen-questions
interview-questions
null
null
null
null
04/28/2012 16:03:36
not constructive
What are your essential phone-screen questions? === I loved the [article from Steve Yegge][1] where he explains to get the most out of phone interviews 1) Coding. The candidate has to write some simple code, with correct syntax, in C, C++, or Java. 2) OO design. The candidate has to define basic OO concepts, and come up with classes to model a simple problem. 3) Scripting and regexes. The candidate has to describe how to find the phone numbers in 50,000 HTML pages. 4) Data structures. The candidate has to demonstrate basic knowledge of the most common data structures. 5) Bits and bytes. The candidate has to answer simple questions about bits, bytes, and binary numbers. What are your essential phone screen questions when you are interviewing over phone? [1]: http://steve.yegge.googlepages.com/five-essential-phone-screen-questions
4
56,561
09/11/2008 13:45:30
3,114
08/26/2008 18:05:52
594
45
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 Lippman's blog][1], but it's from 2004. I have also seen Marshal::StringToHGlobalAnsi(). Is there a method that is considered "best practice"? [1]: http://blogs.msdn.com/slippman/archive/2004/06/02/147090.aspx
.net
c++
string
c++-cli
null
null
open
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 Lippman's blog][1], but it's from 2004. I have also seen Marshal::StringToHGlobalAnsi(). Is there a method that is considered "best practice"? [1]: http://blogs.msdn.com/slippman/archive/2004/06/02/147090.aspx
0
56,568
09/11/2008 13:48:27
5,742
09/11/2008 07:37:00
8
1
performing datetime related operations in PHP
how do you actually perform datetime operations such as adding date, finding difference, find out how many days excluding weekends in an interval? i personally started to pass some of these operations to my postgresql dbms as typically i would only need to issue one sql statement to obtain an answer, however, to do it in PHP way I would have to write a lot more code that means more chances for errors to occur... is there any libraries in PHP that does datetime operation in a way that doesn't require a lot of code... that beats sql in a situation where I need to find out how many days in between 2 dates without counting the weekend that is solved by making this query http://pastebin.com/f489c9da6 ??
php
sql
postgresql
datetime-operation
null
null
open
performing datetime related operations in PHP === how do you actually perform datetime operations such as adding date, finding difference, find out how many days excluding weekends in an interval? i personally started to pass some of these operations to my postgresql dbms as typically i would only need to issue one sql statement to obtain an answer, however, to do it in PHP way I would have to write a lot more code that means more chances for errors to occur... is there any libraries in PHP that does datetime operation in a way that doesn't require a lot of code... that beats sql in a situation where I need to find out how many days in between 2 dates without counting the weekend that is solved by making this query http://pastebin.com/f489c9da6 ??
0
56,574
09/11/2008 13:50:00
797
08/09/2008 02:14:04
2,296
89
Don't repeat yourself vs Internationalisation
A while back I was reading the W3C article on '[Re-using Strings in Scripted Content][1]', which contains some useful advice on internationalisation, but which strikes me as at odds iwth the DRY (Don't Repeat Yourself) principle of eliminating repetitive code. To take their example, we might have some code like this... print "The printer is "; if (printer.working) { print "on.\n"; } else { print "off.\n"; } print "The stapler is "; if (stapler.working) { print "on.\n"; } else { print "off.\n"; } My instinct would be to eliminate the repetition roughly as follows... report-state(printer, "printer"); report-state(stapler, "stapler"); function report-state(name, object) { print "The "+name+" is "; if (object.working) { print "on\n"; } else { print "off\n"; } } ...but doing so would cause a difficulty in the code if we needed to localise it to Spanish because the word for 'on' is apparently different in those two cases. So, I guess my question is, how have other developers approached balancing the DRY principle with internationalisation of their code? Part of me wants to argue that internationalisation is one of those extreme programming “[you arent gonna need it][2]” situations. On the flip side however, refactoring with the DRY principle in mind is supposed to balance this by making it easy to implement functionality as it’s required, not harder as it does here. [1]: http://www.w3.org/International/articles/text-reuse/ [2]: http://www.extremeprogramming.org/rules/early.html
internationalization
null
null
null
null
null
open
Don't repeat yourself vs Internationalisation === A while back I was reading the W3C article on '[Re-using Strings in Scripted Content][1]', which contains some useful advice on internationalisation, but which strikes me as at odds iwth the DRY (Don't Repeat Yourself) principle of eliminating repetitive code. To take their example, we might have some code like this... print "The printer is "; if (printer.working) { print "on.\n"; } else { print "off.\n"; } print "The stapler is "; if (stapler.working) { print "on.\n"; } else { print "off.\n"; } My instinct would be to eliminate the repetition roughly as follows... report-state(printer, "printer"); report-state(stapler, "stapler"); function report-state(name, object) { print "The "+name+" is "; if (object.working) { print "on\n"; } else { print "off\n"; } } ...but doing so would cause a difficulty in the code if we needed to localise it to Spanish because the word for 'on' is apparently different in those two cases. So, I guess my question is, how have other developers approached balancing the DRY principle with internationalisation of their code? Part of me wants to argue that internationalisation is one of those extreme programming “[you arent gonna need it][2]” situations. On the flip side however, refactoring with the DRY principle in mind is supposed to balance this by making it easy to implement functionality as it’s required, not harder as it does here. [1]: http://www.w3.org/International/articles/text-reuse/ [2]: http://www.extremeprogramming.org/rules/early.html
0