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,010
09/10/2008 18:50:47
4,061
09/01/2008 15:48:37
48
1
What's a clean/simple way to ensure the security of a page?
Supposing you have a form that collects and submits sensitive information and you want to ensure it is never accessed via insecure (non-HTTPS) means, how might you best go about enforcing that policy?
https
ssl
security
form
null
null
open
What's a clean/simple way to ensure the security of a page? === Supposing you have a form that collects and submits sensitive information and you want to ensure it is never accessed via insecure (non-HTTPS) means, how might you best go about enforcing that policy?
0
55,013
09/10/2008 18:51:52
83
08/01/2008 16:31:56
1,196
82
Should I always use the AndAlso and OrElse operators?
Is there ever a circumstance in which I would not want to use the [AndAlso][1] operator rather than the [And][2] operator? …or in which I would not want to use the [OrElse][3] operator rather than the [Or][4] operator? [1]: http://msdn.microsoft.com/en-us/library/cb8x3kfz.aspx [2]: http://msdn.microsoft.com/en-us/library/sdbcfyzh.aspx [3]: http://msdn.microsoft.com/en-us/library/ea1sssb2.aspx [4]: http://msdn.microsoft.com/en-us/library/06s37a7f.aspx
vb
vb.net
.net
null
null
null
open
Should I always use the AndAlso and OrElse operators? === Is there ever a circumstance in which I would not want to use the [AndAlso][1] operator rather than the [And][2] operator? …or in which I would not want to use the [OrElse][3] operator rather than the [Or][4] operator? [1]: http://msdn.microsoft.com/en-us/library/cb8x3kfz.aspx [2]: http://msdn.microsoft.com/en-us/library/sdbcfyzh.aspx [3]: http://msdn.microsoft.com/en-us/library/ea1sssb2.aspx [4]: http://msdn.microsoft.com/en-us/library/06s37a7f.aspx
0
55,035
09/10/2008 18:57:41
1,154
08/12/2008 23:39:07
401
41
Application to Stress Test in a Windows .NET Application
I am developing a Windows .NET application (WinForms) and I need to simulate a stress test of the database and the application ( more than 100 conections). **What tools do you recommend?**
.net
stresstesting
null
null
null
null
open
Application to Stress Test in a Windows .NET Application === I am developing a Windows .NET application (WinForms) and I need to simulate a stress test of the database and the application ( more than 100 conections). **What tools do you recommend?**
0
55,039
09/10/2008 18:59:56
1,436
08/15/2008 15:43:19
439
22
Rehsarper 4.0 - Renaming a class does not rename the file
I probably set something on accident in the options, but I can't find it. Any ideas?
visual-studio
resharper
null
null
null
null
open
Rehsarper 4.0 - Renaming a class does not rename the file === I probably set something on accident in the options, but I can't find it. Any ideas?
0
55,042
09/10/2008 19:00:40
337
08/04/2008 18:11:42
140
6
How to program simple chat bot AI?
I want to build a bot that asks someone a few simple questions and branches based on the answer. I realize parsing meaning from the human responses will be challenging, but how do you setup the program to deal with the "state" of the conversation? EDIT: It will be a one-to-one conversation between a human and the bot.
language-agnostic
ai
bots
null
null
null
open
How to program simple chat bot AI? === I want to build a bot that asks someone a few simple questions and branches based on the answer. I realize parsing meaning from the human responses will be challenging, but how do you setup the program to deal with the "state" of the conversation? EDIT: It will be a one-to-one conversation between a human and the bot.
0
55,054
09/10/2008 19:07:08
5,170
09/08/2008 10:27:38
1
0
What’s the best way to capitalise the first letter of each word in a string in SQL Server.
What’s the best way to capitalise the first letter of each word in a string in SQL Server.
sql
sql-server
string
null
null
null
open
What’s the best way to capitalise the first letter of each word in a string in SQL Server. === What’s the best way to capitalise the first letter of each word in a string in SQL Server.
0
55,056
09/10/2008 19:09:14
5,616
09/10/2008 14:55:47
11
2
What's the best Django search app?
I'm building a Django project that needs search functionality, and until there's a `django.contrib.search`, I have to choose a search app. So, which is the best? By "best" I mean... - easy to install / set up - has a Django- or at least Python-friendly API - can perform reasonably complex searches Here are some apps I've heard of, please suggest others if you know of any: - [djangosearch][1] - [django-sphinx][2] I'd also like to avoid using a third-party search engine (like Google SiteSearch), because some of the data I'd like to index is for site members only and should not be public. [1]: http://code.google.com/p/djangosearch/ [2]: http://code.google.com/p/django-sphinx/
python
django
search
search-engine
null
05/13/2012 19:02:21
not constructive
What's the best Django search app? === I'm building a Django project that needs search functionality, and until there's a `django.contrib.search`, I have to choose a search app. So, which is the best? By "best" I mean... - easy to install / set up - has a Django- or at least Python-friendly API - can perform reasonably complex searches Here are some apps I've heard of, please suggest others if you know of any: - [djangosearch][1] - [django-sphinx][2] I'd also like to avoid using a third-party search engine (like Google SiteSearch), because some of the data I'd like to index is for site members only and should not be public. [1]: http://code.google.com/p/djangosearch/ [2]: http://code.google.com/p/django-sphinx/
4
55,060
09/10/2008 19:09:47
5,261
09/08/2008 18:44:40
58
11
Php function argument error suppression
I'm pretty sure the answer to this question is no, but in case there's some PHP guru I've written a convenience function that checks to see if a variable has a non-empty value if so return that value otherwise use the other variable: function defaultValue($value, $default) { return $value ? $value : $default; } but when i pass in a variable that doesn't exist such as an non existent array key i'll get a warning: $bob = array(); defaultValue($bob['cool'], 'beans'); *Notice: Undefined index: cool in file.php on line 7* I know i can suppress the error by doing this: defaultValue(@$bob['cool'], 'beans'); but is there anything I can do in to the function that won't throw an error if it get's passed an invalid argument. Much like the function empty(). I know i'm only try to save a character's worth of work, but I'm trying to learn as well.
php
error-handling
error-suppression
null
null
null
open
Php function argument error suppression === I'm pretty sure the answer to this question is no, but in case there's some PHP guru I've written a convenience function that checks to see if a variable has a non-empty value if so return that value otherwise use the other variable: function defaultValue($value, $default) { return $value ? $value : $default; } but when i pass in a variable that doesn't exist such as an non existent array key i'll get a warning: $bob = array(); defaultValue($bob['cool'], 'beans'); *Notice: Undefined index: cool in file.php on line 7* I know i can suppress the error by doing this: defaultValue(@$bob['cool'], 'beans'); but is there anything I can do in to the function that won't throw an error if it get's passed an invalid argument. Much like the function empty(). I know i'm only try to save a character's worth of work, but I'm trying to learn as well.
0
55,061
09/10/2008 19:10:04
5,056
09/07/2008 15:43:17
440
44
How to jump to a class definition in CodeRush
Just downloaded the CodeRush trial version and I can't easily find the one feature that I really wanted. I would like to be able to start typing a class name and to jump to its definition, sort of like the quick navigator but I want it to search in closed files within my solution as well as open ones. I know R# has that ability, I assume CodeRush does too.
keyboard-shortcuts
coderush
null
null
null
null
open
How to jump to a class definition in CodeRush === Just downloaded the CodeRush trial version and I can't easily find the one feature that I really wanted. I would like to be able to start typing a class name and to jump to its definition, sort of like the quick navigator but I want it to search in closed files within my solution as well as open ones. I know R# has that ability, I assume CodeRush does too.
0
55,083
09/10/2008 19:19:52
3,797
08/30/2008 21:52:47
11
2
Opening a PDF in WPF Application
Any ideas how to open a PDF file in a WPF Windows Application?
wpf
null
null
null
null
null
open
Opening a PDF in WPF Application === Any ideas how to open a PDF file in a WPF Windows Application?
0
55,093
09/10/2008 19:27:04
4,790
09/05/2008 16:00:28
18
7
How to deal with arrays (declared on the stack) in C++?
I have a class to parse a matrix that keeps the result in an array member: class Parser { ... double matrix_[4][4]; }; The user of this class needs to call an API function (as in, a function I have no control over, so I can't just change its interface to make things work more easily) that looks like this: void api_func(const double matrix[4][4]); The only way I have come up with for the caller to pass the array result to the function is by making the member public: void myfunc() { Parser parser; ... api_func(parser.matrix_); } Is this the only way to do things? I'm astounded by how inflexible multidimensional arrays declared like this are. I thought <code>matrix_</code> would essentially be the same as a <code>double**</code> and I could cast (safely) between the two. As it turns out, I can't even find an _unsafe_ way to cast between the things. Say I add an accessor to the <code>Parser</code> class: void* Parser::getMatrix() { return (void*)matrix_; } This will compile, but I can't use it, because there doesn't seem to be a way to cast back to the weirdo array type: // A smorgasbord of syntax errors... api_func((double[][])parser.getMatrix()); api_func((double[4][4])parser.getMatrix()); api_func((double**)parser.getMatrix()); // cast works but it's to the wrong type The error is: > error C2440: 'type cast' : cannot convert from 'void *' to 'const double [4][4]' ...with an intriguing addendum: > There are no conversions to array types, although there are conversions to references or pointers to arrays I can't determine how to cast to a reference or pointer to array either, albeit that it probably won't help me here. To be sure, at this point the matter is purely academic, as the <code>void*</code> casts are hardly cleaner than a single class member left public!
c++
arrays
null
null
null
null
open
How to deal with arrays (declared on the stack) in C++? === I have a class to parse a matrix that keeps the result in an array member: class Parser { ... double matrix_[4][4]; }; The user of this class needs to call an API function (as in, a function I have no control over, so I can't just change its interface to make things work more easily) that looks like this: void api_func(const double matrix[4][4]); The only way I have come up with for the caller to pass the array result to the function is by making the member public: void myfunc() { Parser parser; ... api_func(parser.matrix_); } Is this the only way to do things? I'm astounded by how inflexible multidimensional arrays declared like this are. I thought <code>matrix_</code> would essentially be the same as a <code>double**</code> and I could cast (safely) between the two. As it turns out, I can't even find an _unsafe_ way to cast between the things. Say I add an accessor to the <code>Parser</code> class: void* Parser::getMatrix() { return (void*)matrix_; } This will compile, but I can't use it, because there doesn't seem to be a way to cast back to the weirdo array type: // A smorgasbord of syntax errors... api_func((double[][])parser.getMatrix()); api_func((double[4][4])parser.getMatrix()); api_func((double**)parser.getMatrix()); // cast works but it's to the wrong type The error is: > error C2440: 'type cast' : cannot convert from 'void *' to 'const double [4][4]' ...with an intriguing addendum: > There are no conversions to array types, although there are conversions to references or pointers to arrays I can't determine how to cast to a reference or pointer to array either, albeit that it probably won't help me here. To be sure, at this point the matter is purely academic, as the <code>void*</code> casts are hardly cleaner than a single class member left public!
0
55,096
09/10/2008 19:29:02
5,484
09/09/2008 22:57:40
1
1
Is there a good WPF pivot control?
Does anyone have any experience with a good wpf pivot table control?
wpf
controls
null
null
null
null
open
Is there a good WPF pivot control? === Does anyone have any experience with a good wpf pivot table control?
0
55,099
09/10/2008 19:32:35
3,043
08/26/2008 13:24:14
1,716
173
Find checkout history for SVN working folder
We have an intranet site backed by SVN, such that the site is a checkout out copy of the repository (working folder). Something on the site has been causing problems today, and I want to know how to find out what was checked out to that working folder in the last 48 hours.
svn
null
null
null
null
null
open
Find checkout history for SVN working folder === We have an intranet site backed by SVN, such that the site is a checkout out copy of the repository (working folder). Something on the site has been causing problems today, and I want to know how to find out what was checked out to that working folder in the last 48 hours.
0
55,101
09/10/2008 19:33:28
3,047
08/26/2008 13:36:37
40
6
Using Linq, how can I pass a var back from a method?
I have a Linq query that I want to call from multiple places: var myData = from a in db.MyTable where a.MyValue == "A" select new { a.Key, a.MyValue }; How can I create a method, put this code in it, and then call it? public ??? GetSomeData() { // my Linq query }
c#
linq
null
null
null
null
open
Using Linq, how can I pass a var back from a method? === I have a Linq query that I want to call from multiple places: var myData = from a in db.MyTable where a.MyValue == "A" select new { a.Key, a.MyValue }; How can I create a method, put this code in it, and then call it? public ??? GetSomeData() { // my Linq query }
0
55,113
09/10/2008 19:36:39
1,463
08/15/2008 17:26:44
458
34
How do I convert a .docx to html using asp.net?
Word 2007 saves its documents in .docx format which is really a zip file with a bunch of stuff in it including an xml file with the document. I want to be able to take a .docx file and drop it into a folder in my asp.net web app and have the code open the .docx file and render the (xml part of the) document as a web page. I've been searching the web for more information on this but so far haven't found much. My questions are: 1. Would you (a) use XSLT to transform the XML to HTML, or (b) use xml manipulation libraries in .net (such as XDocument and XElement in 3.5) to convert to HTML or (c) other? 2. Do you know of any open source libraries/projects that have done this that I could use as a starting point? Thanks!
asp.net
xml
xslt
null
null
null
open
How do I convert a .docx to html using asp.net? === Word 2007 saves its documents in .docx format which is really a zip file with a bunch of stuff in it including an xml file with the document. I want to be able to take a .docx file and drop it into a folder in my asp.net web app and have the code open the .docx file and render the (xml part of the) document as a web page. I've been searching the web for more information on this but so far haven't found much. My questions are: 1. Would you (a) use XSLT to transform the XML to HTML, or (b) use xml manipulation libraries in .net (such as XDocument and XElement in 3.5) to convert to HTML or (c) other? 2. Do you know of any open source libraries/projects that have done this that I could use as a starting point? Thanks!
0
55,114
09/10/2008 19:36:47
1,116,922
08/04/2008 16:48:14
1
0
Where does RegexBuddy store its working data between uses?
Ok, so I'm an idiot. So I was working on a regex that took way to long to craft. After perfecting it, I upgraded my work machine with a blazing fast hard drive and realized that I never saved the regex anywhere and simply used RegexBuddy's autosave to store it. Dumb dumb dumb. I sent a copy of the regex to a coworker but now he can't find it (or the record of our communication). My best hope of finding the regex is to find it in RegexBuddy on the old hard drive. RegexBuddy automatically saves whatever you were working on each time you close it. I've done some preliminary searches to try to determine where it actually saves that working data but I'm having no success. This question is the result of my dumb behavior but I thought it was a good chance to finally ask a question here.
regexbuddy
null
null
null
null
null
open
Where does RegexBuddy store its working data between uses? === Ok, so I'm an idiot. So I was working on a regex that took way to long to craft. After perfecting it, I upgraded my work machine with a blazing fast hard drive and realized that I never saved the regex anywhere and simply used RegexBuddy's autosave to store it. Dumb dumb dumb. I sent a copy of the regex to a coworker but now he can't find it (or the record of our communication). My best hope of finding the regex is to find it in RegexBuddy on the old hard drive. RegexBuddy automatically saves whatever you were working on each time you close it. I've done some preliminary searches to try to determine where it actually saves that working data but I'm having no success. This question is the result of my dumb behavior but I thought it was a good chance to finally ask a question here.
0
55,129
09/10/2008 19:47:26
572
08/06/2008 20:56:54
3,498
275
Can USB devices directly access hardware?
Here's why I'm wondering. I recently bought an external TV tuner for my laptop, which has a feature that when it's being jostled, the hard drive stops spinning. However, even when I move my laptop, the video from the TV tuner (which handles all of the video processing, according to the book on it) doesn't stutter. I'm wondering if this TV tuner is accessing the video card and display systems directly instead of writing to the HDD and then displaying that. This brings me to my question. What things can/can't an external device do?
hardware
external-application
null
null
null
null
open
Can USB devices directly access hardware? === Here's why I'm wondering. I recently bought an external TV tuner for my laptop, which has a feature that when it's being jostled, the hard drive stops spinning. However, even when I move my laptop, the video from the TV tuner (which handles all of the video processing, according to the book on it) doesn't stutter. I'm wondering if this TV tuner is accessing the video card and display systems directly instead of writing to the HDD and then displaying that. This brings me to my question. What things can/can't an external device do?
0
55,130
09/10/2008 19:48:00
1,983
08/19/2008 17:03:37
23
2
NullReferenceException on instanciated object ??
This is a segment of code from an app I've inherited, a user got a Yellow screen of death "Object reference not set to an instance of an object" on the *bool l_Success* ... line. Now I'm 95% sure the faulty argument is *ref l_Monitor* which is very weird considering the object is instanciated a few lines before. Anyone have a clue why it would happen, note that I have seen the same issue pop up in other places in the code. IDMS.Monitor l_Monitor = new IDMS.Monitor(); l_Monitor.LogFile.Product_ID = "SE_WEB_APP"; if (m_PermType_RadioButtonList.SelectedIndex == -1) { l_Monitor.LogFile.Log( Nortel.IS.IDMS.LogFile.MessageTypes.ERROR, "No permission type selected" ); return; } bool l_Success = SE.UI.Utilities.GetPermissionList( ref l_Monitor, ref m_CPermissions_ListBox, (int)this.ViewState["m_Account_Share_ID"], (m_PermFolders_DropDownList.Enabled) ? m_PermFolders_DropDownList.SelectedItem.Value : "-1", (SE.Types.PermissionType)m_PermType_RadioButtonList.SelectedIndex, (SE.Types.PermissionResource)m_PermResource_RadioButtonList.SelectedIndex );
c#
asp.net
yellow-screen-of-death
null
null
null
open
NullReferenceException on instanciated object ?? === This is a segment of code from an app I've inherited, a user got a Yellow screen of death "Object reference not set to an instance of an object" on the *bool l_Success* ... line. Now I'm 95% sure the faulty argument is *ref l_Monitor* which is very weird considering the object is instanciated a few lines before. Anyone have a clue why it would happen, note that I have seen the same issue pop up in other places in the code. IDMS.Monitor l_Monitor = new IDMS.Monitor(); l_Monitor.LogFile.Product_ID = "SE_WEB_APP"; if (m_PermType_RadioButtonList.SelectedIndex == -1) { l_Monitor.LogFile.Log( Nortel.IS.IDMS.LogFile.MessageTypes.ERROR, "No permission type selected" ); return; } bool l_Success = SE.UI.Utilities.GetPermissionList( ref l_Monitor, ref m_CPermissions_ListBox, (int)this.ViewState["m_Account_Share_ID"], (m_PermFolders_DropDownList.Enabled) ? m_PermFolders_DropDownList.SelectedItem.Value : "-1", (SE.Types.PermissionType)m_PermType_RadioButtonList.SelectedIndex, (SE.Types.PermissionResource)m_PermResource_RadioButtonList.SelectedIndex );
0
55,139
09/10/2008 19:49:58
3,208
08/27/2008 13:12:45
115
7
What is your favorite IDE for Perl Development
What is your favorite IDE for Perl Development and why?
ide
perl
null
null
null
10/24/2011 14:35:53
not constructive
What is your favorite IDE for Perl Development === What is your favorite IDE for Perl Development and why?
4
55,140
09/10/2008 19:51:03
123
08/02/2008 08:01:26
1,521
75
Database engines Comparison - Windows Mobile..
What are the different database options on Windows Mobile available? I have used CEDB and EDB for linear dataset needs. I have heard of SQL server 2005 Mobile edition. But what are the advantages over others (if there is any)
windows-mobile
pocketpc
sql-server-mobile
null
null
null
open
Database engines Comparison - Windows Mobile.. === What are the different database options on Windows Mobile available? I have used CEDB and EDB for linear dataset needs. I have heard of SQL server 2005 Mobile edition. But what are the advantages over others (if there is any)
0
55,147
09/10/2008 19:52:21
1,484
08/15/2008 20:40:42
18
5
Embed a File Chooser in a UserControl / Form
I've inherited a desktop application which has a custom .NET file chooser that is embedded in a control, but it has some issues. I'd like to replace it with a non-custom File Chooser (like the OpenFileDialog). However, for a variety of reasons it needs to be embedded in the parent control not a popup dialog. Is there a control I'm missing, or does MS only provide the popup dialog out of the box?
.net
c#
null
null
null
null
open
Embed a File Chooser in a UserControl / Form === I've inherited a desktop application which has a custom .NET file chooser that is embedded in a control, but it has some issues. I'd like to replace it with a non-custom File Chooser (like the OpenFileDialog). However, for a variety of reasons it needs to be embedded in the parent control not a popup dialog. Is there a control I'm missing, or does MS only provide the popup dialog out of the box?
0
55,179
09/10/2008 20:05:02
3,268
08/12/2008 03:24:22
123
6
Why all the Linq To Entities Hate?
I've noticed that there seems to be quite a bit of hostility towards Linq To Entities particularly from the Alt.Net folks. I understand the resistance to more "drag and drop" programming, but from my understanding, Linq To Entities doesn't require it. We're currently using Linq to SQL, and we are using the DBML document to define it (once you get more than a dozen or so tables, the designer is pretty useless.) So why wouldn't the same approach work for Linq To Entities?
linq-to-entities
null
null
null
null
null
open
Why all the Linq To Entities Hate? === I've noticed that there seems to be quite a bit of hostility towards Linq To Entities particularly from the Alt.Net folks. I understand the resistance to more "drag and drop" programming, but from my understanding, Linq To Entities doesn't require it. We're currently using Linq to SQL, and we are using the DBML document to define it (once you get more than a dozen or so tables, the designer is pretty useless.) So why wouldn't the same approach work for Linq To Entities?
0
55,180
09/10/2008 20:05:25
4,872
09/06/2008 09:14:55
153
3
In Python, how can you easily retrieve sorted items from a dictionary?
Dictionaries unlike lists are not ordered (and do not have the 'sort' attribute). Therefore, you can not rely on getting the items in the same order when first added. What is the easiest way to loop through a dictionary containing strings as the key value and retrieving them in ascending order? For example, you had this: d = {'b' : 'this is b', 'a': 'this is a' , 'c' : 'this is c'} I want to print associated values in the following sequence: this is a this is b this is c
python
list
sorting
dictionary
null
null
open
In Python, how can you easily retrieve sorted items from a dictionary? === Dictionaries unlike lists are not ordered (and do not have the 'sort' attribute). Therefore, you can not rely on getting the items in the same order when first added. What is the easiest way to loop through a dictionary containing strings as the key value and retrieving them in ascending order? For example, you had this: d = {'b' : 'this is b', 'a': 'this is a' , 'c' : 'this is c'} I want to print associated values in the following sequence: this is a this is b this is c
0
55,203
09/10/2008 20:14:01
1,463
08/15/2008 17:26:44
465
34
How do I inserting text into textbox after popping up another window to request information?
I have an asp.net web page written in C#. Using some javascript I popup another .aspx page which has a few controls that are filled in and from which I create a small snippet of text. When the user clicks OK on that dialog box I want to insert that piece of text into a textbox on the page that initial "popped up" the dialog/popup page. I'm guessing that this will involve javascript which is not a strong point of mine. How do I do this?
javascript
c#
asp.net
null
null
null
open
How do I inserting text into textbox after popping up another window to request information? === I have an asp.net web page written in C#. Using some javascript I popup another .aspx page which has a few controls that are filled in and from which I create a small snippet of text. When the user clicks OK on that dialog box I want to insert that piece of text into a textbox on the page that initial "popped up" the dialog/popup page. I'm guessing that this will involve javascript which is not a strong point of mine. How do I do this?
0
55,206
09/10/2008 20:14:07
5,472
09/09/2008 21:19:29
1
3
What is the operator precedence order in VB6?
In particular, for the logical operators
vb6
null
null
null
null
null
open
What is the operator precedence order in VB6? === In particular, for the logical operators
0
55,210
09/10/2008 20:15:17
123
08/02/2008 08:01:26
1,536
75
Algorithm to generate anagrams..
What would be the best strategy to generate anagrams. > An anagram is a type of word play, the result of rearranging the letters > of a word or phrase to produce a new word or phrase, using all the original > letters exactly once; > ex. > > - **Eleven plus two** is anagram of ***Twelve plus one*** > - **A decimal point** is anagram of ***I'm a dot in place*** > - **Astronomers** is anagram of ***Moon starers*** At first it looks straightforwardly simple, just to jumble the letters and generate all possible combinations. But what would be the efficient approach to generate only the words in dictionary. I came across this page, [Solving anagrams in Ruby][1]. But what are your ideas? [1]: http://lojic.com/blog/2007/10/22/solving-anagrams-in-ruby/
language-agnostic
algorithm
puzzle
problem-solving
null
null
open
Algorithm to generate anagrams.. === What would be the best strategy to generate anagrams. > An anagram is a type of word play, the result of rearranging the letters > of a word or phrase to produce a new word or phrase, using all the original > letters exactly once; > ex. > > - **Eleven plus two** is anagram of ***Twelve plus one*** > - **A decimal point** is anagram of ***I'm a dot in place*** > - **Astronomers** is anagram of ***Moon starers*** At first it looks straightforwardly simple, just to jumble the letters and generate all possible combinations. But what would be the efficient approach to generate only the words in dictionary. I came across this page, [Solving anagrams in Ruby][1]. But what are your ideas? [1]: http://lojic.com/blog/2007/10/22/solving-anagrams-in-ruby/
0
55,218
09/10/2008 20:17:03
5,441
09/09/2008 15:34:34
1
6
Unique password generation
I looking for a way, specifically in PHP that I will be guaranteed to always get a unique password. I have done the following: strtolower(substr(crypt(time()), 0, 7)); But I have found that once in a while I end up with a duplicate password (rarely, but often enough). I have also thought of doing: strtolower(substr(crypt(uniqid(rand(), true)), 0, 7)); But according to the PHP website, uniqid() could, if uniqid() is called twice in the same microsecond, it could generate the same password. I'm thinking that the addition of rand() that it rarely would, but still possible. After the lines mentioned above I am also remove characters such as L and o so it's less confusing for the user. This maybe part of the cause for the duplicates, but still necessary. One option I have a thought of is creating a website that will generate the password, storing it in a database, ensuring it's completely unique. Any other thoughts? Are there any websites out there that already do this that have some kind of API or just return the password. I found [http://userident.com][1] but I'm not sure if the passwords will be completely unique. This needs to run in the background without any user input. [1]: http://userident.com
php
passwords
web-development
web-services
null
null
open
Unique password generation === I looking for a way, specifically in PHP that I will be guaranteed to always get a unique password. I have done the following: strtolower(substr(crypt(time()), 0, 7)); But I have found that once in a while I end up with a duplicate password (rarely, but often enough). I have also thought of doing: strtolower(substr(crypt(uniqid(rand(), true)), 0, 7)); But according to the PHP website, uniqid() could, if uniqid() is called twice in the same microsecond, it could generate the same password. I'm thinking that the addition of rand() that it rarely would, but still possible. After the lines mentioned above I am also remove characters such as L and o so it's less confusing for the user. This maybe part of the cause for the duplicates, but still necessary. One option I have a thought of is creating a website that will generate the password, storing it in a database, ensuring it's completely unique. Any other thoughts? Are there any websites out there that already do this that have some kind of API or just return the password. I found [http://userident.com][1] but I'm not sure if the passwords will be completely unique. This needs to run in the background without any user input. [1]: http://userident.com
0
55,223
09/10/2008 20:20:46
3,654
08/29/2008 17:52:22
243
13
How do I implement a HTML cache for a PHP site?
What is the best way of implementing a cache for a PHP site? Obviously, there are some things that shouldn't be cached (for example search queries), but I want to find a good solution that will make sure that I avoid the 'digg effect'. I know there is WP-Cache for WordPress, but I'm writing a custom solution that isn't built on WP. Thanks.
php
html
caching
null
null
null
open
How do I implement a HTML cache for a PHP site? === What is the best way of implementing a cache for a PHP site? Obviously, there are some things that shouldn't be cached (for example search queries), but I want to find a good solution that will make sure that I avoid the 'digg effect'. I know there is WP-Cache for WordPress, but I'm writing a custom solution that isn't built on WP. Thanks.
0
55,256
09/10/2008 20:34:45
2,171
08/20/2008 18:04:57
97
2
Files on Windows and Contiguous Sectors
Is there a way to guarantee that a file on Windows (using the NTFS file system) will use contiguous sectors on the hard disk? In other words, the first chunk of the file will be stored in a certain sector, the second chunk of the file will be stored in the next sector, and so on. I should add that I want to be able to create this file programmatically, so I'd rather not just ask the user to defrag their harddrive after creating this file. Thanks, Terry
windows
filesystems
null
null
null
null
open
Files on Windows and Contiguous Sectors === Is there a way to guarantee that a file on Windows (using the NTFS file system) will use contiguous sectors on the hard disk? In other words, the first chunk of the file will be stored in a certain sector, the second chunk of the file will be stored in the next sector, and so on. I should add that I want to be able to create this file programmatically, so I'd rather not just ask the user to defrag their harddrive after creating this file. Thanks, Terry
0
55,270
09/10/2008 20:39:20
1,965
08/19/2008 15:51:08
3,878
229
Refresh all update panels on the page?
I have some code that modifies a value that several controls in other update panels are bound to. When this event handler fires, I'd like it to force the other update panels to refresh as well, so they can rebind. Is this possible?
asp.net
ajax
c#
null
null
null
open
Refresh all update panels on the page? === I have some code that modifies a value that several controls in other update panels are bound to. When this event handler fires, I'd like it to force the other update panels to refresh as well, so they can rebind. Is this possible?
0
55,273
09/10/2008 20:40:27
3,683
08/29/2008 21:24:01
152
20
What are the advantages of VistaDB
I have seen the references to VistaDB over the years and with tools like SQLite, Firebird, MS SQL et. al. I have never had a reason to consider it. What are the benefits of paying for VistaDB vs using another technology? Things I have thought of: 1. Compact Framework Support. SQLite+MSSQL support the CF. 2. Need migration path to a 'more robust' system. Firebird+MSSQL. 3. Need more advanced features such as triggers. Firebird+MSSQL
sql-server
database
sqlite
firebird
vistadb
null
open
What are the advantages of VistaDB === I have seen the references to VistaDB over the years and with tools like SQLite, Firebird, MS SQL et. al. I have never had a reason to consider it. What are the benefits of paying for VistaDB vs using another technology? Things I have thought of: 1. Compact Framework Support. SQLite+MSSQL support the CF. 2. Need migration path to a 'more robust' system. Firebird+MSSQL. 3. Need more advanced features such as triggers. Firebird+MSSQL
0
55,279
09/10/2008 20:41:48
5,454
09/09/2008 18:07:51
1
0
Kill a specific PHP script running on FastCGI / IIS?
I'm a PHP developer, but honestly my knowledge of server management is somewhat lacking. I fired off a script today that took a regrettably long time to run, and because it had an embedded call to `ignore_user_abort()`, pressing "stop" in the browser was obviously futile. There was a time limit of 15 minutes enforced in the FastCGI settings, but this was still incessantly long since I really had to just wait it out before I could continue with anything else. Is there some way to manage/kill whatever PHP scripts are being executed by FastCGI at any given moment? Thanks in advance.
php
iis
fastcgi
null
null
null
open
Kill a specific PHP script running on FastCGI / IIS? === I'm a PHP developer, but honestly my knowledge of server management is somewhat lacking. I fired off a script today that took a regrettably long time to run, and because it had an embedded call to `ignore_user_abort()`, pressing "stop" in the browser was obviously futile. There was a time limit of 15 minutes enforced in the FastCGI settings, but this was still incessantly long since I really had to just wait it out before I could continue with anything else. Is there some way to manage/kill whatever PHP scripts are being executed by FastCGI at any given moment? Thanks in advance.
0
55,296
09/10/2008 20:49:52
2,385
08/22/2008 00:18:38
31
8
How exactly do you configure httpOnly Cookies in ASP Classic?
I'm looking to implement httpOnly in my legacy ASP classic sites. Anyone knows how to do it?
security
httponly
aspclassic
null
null
null
open
How exactly do you configure httpOnly Cookies in ASP Classic? === I'm looking to implement httpOnly in my legacy ASP classic sites. Anyone knows how to do it?
0
55,297
09/10/2008 20:50:32
925
08/10/2008 16:16:15
76
17
asp consuming a web service, what do do with recordset object ?
Currently I run an classic (old) ASP webpage with recordset object used directly in bad old spagethi code fasion. I'm thinking of implementing a data layer in asp.net as web serivce to improve manageability. This is also a first step towards upgrading the website to asp.net. The site itself remains ASP for the moment... Can anybody recommend a good way of replacing the recordset object type with a web service compatible type (like an array or something)? What do I replace below with?: set objRS = oConn.execute(SQL) while not objRS.eof ... name = Cstr(objRS(1)) ... wend and also mutliple recordsets can be replaced with? I'm talking : set objRS = objRs.nextRecordset Anybody went through this?
asp.net
asp
upgrading
web-services
null
null
open
asp consuming a web service, what do do with recordset object ? === Currently I run an classic (old) ASP webpage with recordset object used directly in bad old spagethi code fasion. I'm thinking of implementing a data layer in asp.net as web serivce to improve manageability. This is also a first step towards upgrading the website to asp.net. The site itself remains ASP for the moment... Can anybody recommend a good way of replacing the recordset object type with a web service compatible type (like an array or something)? What do I replace below with?: set objRS = oConn.execute(SQL) while not objRS.eof ... name = Cstr(objRS(1)) ... wend and also mutliple recordsets can be replaced with? I'm talking : set objRS = objRs.nextRecordset Anybody went through this?
0
55,313
09/10/2008 21:00:07
5,266
09/08/2008 19:40:56
31
8
Automatic code quality tool for Ruby?
One thing I really miss about Java is the tool support. FindBugs, Checkstyle and PMD made for a holy trinity of code quality metrics and automatic bug checking. Is there anything that will check for simple bugs and / or style violations of Ruby code? Bonus points if I can adapt it for frameworks such as Rails so that Rails idioms are adhered to.
ruby
ruby-on-rails
software-tools
code-analysis
null
null
open
Automatic code quality tool for Ruby? === One thing I really miss about Java is the tool support. FindBugs, Checkstyle and PMD made for a holy trinity of code quality metrics and automatic bug checking. Is there anything that will check for simple bugs and / or style violations of Ruby code? Bonus points if I can adapt it for frameworks such as Rails so that Rails idioms are adhered to.
0
55,317
09/10/2008 21:02:52
44,972
09/02/2008 10:00:56
3
0
OpenGl And Flickering
When objects from a CallList intersect the near plane I get a flicker..., what can I do? Im using OpenGL and SDL. Yes it is double buffered.
opengl
null
null
null
null
null
open
OpenGl And Flickering === When objects from a CallList intersect the near plane I get a flicker..., what can I do? Im using OpenGL and SDL. Yes it is double buffered.
0
55,322
09/10/2008 21:05:06
123
08/02/2008 08:01:26
1,536
75
JVM choices on Windows Mobile..
What are the JVM implementations available on Windows Mobile? [Esmertec JBed][1] is the one on my WinMo phone. Wondering how many other JVM vendors are in this zone. Are there any comparison or benchmarking data available? [1]: http://www.esmertec.com/40.html
windows-mobile
jvm
null
null
null
null
open
JVM choices on Windows Mobile.. === What are the JVM implementations available on Windows Mobile? [Esmertec JBed][1] is the one on my WinMo phone. Wondering how many other JVM vendors are in this zone. Are there any comparison or benchmarking data available? [1]: http://www.esmertec.com/40.html
0
55,323
09/10/2008 21:06:06
4,591
09/04/2008 18:57:54
136
16
ASP.Net Web Application Build Output - How do I include all deployment files
When I build my ASP.net web application I get a .dll file with the code for the website in it (which is great) but the website also needs all the .aspx files and friends, and these need to be placed in the correct directory structure. How can I get this all in one directory as the result of each build? Trying to pick the right files out of the source directory is a pain. The end result should be xcopy deployable.
asp.net
build-process
deployment
null
null
null
open
ASP.Net Web Application Build Output - How do I include all deployment files === When I build my ASP.net web application I get a .dll file with the code for the website in it (which is great) but the website also needs all the .aspx files and friends, and these need to be placed in the correct directory structure. How can I get this all in one directory as the result of each build? Trying to pick the right files out of the source directory is a pain. The end result should be xcopy deployable.
0
55,330
09/10/2008 21:08:52
750
08/08/2008 14:24:17
291
11
How do I maintain position of a DragPanelExtender across postbacks?
I already found this article: http://www.dotnetcurry.com/ShowArticle.aspx?ID=181&AspxAutoDetectCookieSupport=1 But I've got a different situation. I am embedding some hiddenFields inside of the master page and trying to store the position of the dragPanel in those. I am using javascript to store the position of the dragPanel and then when the user clicks on a link, the new page is loaded, but the dragPanel is reset into the starting position. Is there any easy way to do this?
asp.net
ajax
null
null
null
null
open
How do I maintain position of a DragPanelExtender across postbacks? === I already found this article: http://www.dotnetcurry.com/ShowArticle.aspx?ID=181&AspxAutoDetectCookieSupport=1 But I've got a different situation. I am embedding some hiddenFields inside of the master page and trying to store the position of the dragPanel in those. I am using javascript to store the position of the dragPanel and then when the user clicks on a link, the new page is loaded, but the dragPanel is reset into the starting position. Is there any easy way to do this?
0
55,340
09/10/2008 21:15:12
3,897
08/31/2008 18:44:05
226
13
Bespoke SQL Server 'encoding' sproc - is there a neater way of doing this?
I'm just wondering if there's a better way of doing this in SQL Server 2005. Effectively, I'm taking an originator_id (a number between 0 and 99) and a 'next_element' (it's really just a sequential counter between 1 and 999,999). We are trying to create a 6-character 'code' from them. The originator_id is multiplied up by a million, and then the counter added in, giving us a number between 0 and 99,999,999. Then we convert this into a 'base 32' string - a fake base 32, where we're really just using 0-9 and A-Z but with a few of the more confusing alphanums removed for clarity (I, O, S, Z). To do this, we just divide the number up by powers of 32, at each stage using the result we get for each power as an index for a character from our array of selected character. <pre> Thus, an originator ID of 61 and NextCodeElement of 9 gives a code of '1T5JA9' (61 * 1,000,000) + 9 = 61,000,009 61,000,009 div (5^32 = 33,554,432) = 1 = '1' 27,445,577 div (4^32 = 1,048,576) = 26 = 'T' 182,601 div (3^32 = 32,768) = 5 = '5' 18,761 div (2^32 = 1,024) = 18 = 'J' 329 div (1^32 = 32) = 10 = 'A' 9 div (0^32 = 1) = 9 = '9' so my code is 1T5JA9 </pre> Previously I've had this algorithm working (in Delphi) but now I really need to be able to recreate it in SQL Server 2005. Obviously I don't quite have the same functions to hand that I have in Delphi, but this is my take on the routine. It works, and I can generate codes (or reconstruct codes back into their components) just fine. But it looks a bit long-winded, and I'm not sure that the trick of selecting the result of a division into an int (ie casting it, really) is necessarily 'right' - is there a better SQLS approach to this kind of thing? <pre> CREATE procedure dummy_RP_CREATE_CODE @NextCodeElement int, @OriginatorID int, @code varchar(6) output as begin declare @raw_num int; declare @bcelems char(32); declare @chr int; select @bcelems='0123456789ABCDEFGHJKLMNPQRTUVWXY'; select @code=''; -- add in the originator_id, scaled into place select @raw_num = (@OriginatorID * 1000000) + @NextCodeElement; -- now to convert this to a 6-char code -- 5^32 select @chr = @raw_num / 33554432; select @raw_num = @raw_num - (@chr * 33554432); select @code = @code + SUBSTRING(@bcelems, 1 + @chr, 1); -- 4^32 select @chr = @raw_num / 1048576; select @raw_num = @raw_num - (@chr * 1048576); select @code = @code + SUBSTRING(@bcelems, 1 + @chr, 1); -- 3^32 select @chr = @raw_num / 32768; select @raw_num = @raw_num - (@chr * 32768); select @code = @code + SUBSTRING(@bcelems, 1 + @chr, 1); -- 2^32 select @chr = @raw_num / 1024; select @raw_num = @raw_num - (@chr * 1024); select @code = @code + SUBSTRING(@bcelems, 1 + @chr, 1); -- 1^32 select @chr = @raw_num / 32; select @raw_num = @raw_num - (@chr * 32); select @code = @code + SUBSTRING(@bcelems, 1 + @chr, 1); -- 0^32 select @code = @code + SUBSTRING(@bcelems, 1 + @raw_num, 1); -- that's it! end; </pre> I'm not desperately concerned about optimisation unless this method is actually an order of magnitude (or so) worse than any alternative. The code only ever gets executed in small bursts, maybe generating 20 or 30 codes every 10 minutes or so. Because of the large range of numbers I don't want to pre-calculate the codes into a huge table (only small pockets of the overall code range will be used in any given installation). However, I'm sure there's probably a tidier way of achieving the same result - particularly those divisions and subtractions. Any constructive criticism, observations or suggestions would be most welcome.
mssql
tsql
null
null
null
null
open
Bespoke SQL Server 'encoding' sproc - is there a neater way of doing this? === I'm just wondering if there's a better way of doing this in SQL Server 2005. Effectively, I'm taking an originator_id (a number between 0 and 99) and a 'next_element' (it's really just a sequential counter between 1 and 999,999). We are trying to create a 6-character 'code' from them. The originator_id is multiplied up by a million, and then the counter added in, giving us a number between 0 and 99,999,999. Then we convert this into a 'base 32' string - a fake base 32, where we're really just using 0-9 and A-Z but with a few of the more confusing alphanums removed for clarity (I, O, S, Z). To do this, we just divide the number up by powers of 32, at each stage using the result we get for each power as an index for a character from our array of selected character. <pre> Thus, an originator ID of 61 and NextCodeElement of 9 gives a code of '1T5JA9' (61 * 1,000,000) + 9 = 61,000,009 61,000,009 div (5^32 = 33,554,432) = 1 = '1' 27,445,577 div (4^32 = 1,048,576) = 26 = 'T' 182,601 div (3^32 = 32,768) = 5 = '5' 18,761 div (2^32 = 1,024) = 18 = 'J' 329 div (1^32 = 32) = 10 = 'A' 9 div (0^32 = 1) = 9 = '9' so my code is 1T5JA9 </pre> Previously I've had this algorithm working (in Delphi) but now I really need to be able to recreate it in SQL Server 2005. Obviously I don't quite have the same functions to hand that I have in Delphi, but this is my take on the routine. It works, and I can generate codes (or reconstruct codes back into their components) just fine. But it looks a bit long-winded, and I'm not sure that the trick of selecting the result of a division into an int (ie casting it, really) is necessarily 'right' - is there a better SQLS approach to this kind of thing? <pre> CREATE procedure dummy_RP_CREATE_CODE @NextCodeElement int, @OriginatorID int, @code varchar(6) output as begin declare @raw_num int; declare @bcelems char(32); declare @chr int; select @bcelems='0123456789ABCDEFGHJKLMNPQRTUVWXY'; select @code=''; -- add in the originator_id, scaled into place select @raw_num = (@OriginatorID * 1000000) + @NextCodeElement; -- now to convert this to a 6-char code -- 5^32 select @chr = @raw_num / 33554432; select @raw_num = @raw_num - (@chr * 33554432); select @code = @code + SUBSTRING(@bcelems, 1 + @chr, 1); -- 4^32 select @chr = @raw_num / 1048576; select @raw_num = @raw_num - (@chr * 1048576); select @code = @code + SUBSTRING(@bcelems, 1 + @chr, 1); -- 3^32 select @chr = @raw_num / 32768; select @raw_num = @raw_num - (@chr * 32768); select @code = @code + SUBSTRING(@bcelems, 1 + @chr, 1); -- 2^32 select @chr = @raw_num / 1024; select @raw_num = @raw_num - (@chr * 1024); select @code = @code + SUBSTRING(@bcelems, 1 + @chr, 1); -- 1^32 select @chr = @raw_num / 32; select @raw_num = @raw_num - (@chr * 32); select @code = @code + SUBSTRING(@bcelems, 1 + @chr, 1); -- 0^32 select @code = @code + SUBSTRING(@bcelems, 1 + @raw_num, 1); -- that's it! end; </pre> I'm not desperately concerned about optimisation unless this method is actually an order of magnitude (or so) worse than any alternative. The code only ever gets executed in small bursts, maybe generating 20 or 30 codes every 10 minutes or so. Because of the large range of numbers I don't want to pre-calculate the codes into a huge table (only small pockets of the overall code range will be used in any given installation). However, I'm sure there's probably a tidier way of achieving the same result - particularly those divisions and subtractions. Any constructive criticism, observations or suggestions would be most welcome.
0
55,342
09/10/2008 21:16:10
685
08/07/2008 19:18:05
182
14
How can I kill all sessions connecting to my oracle database?
I need an sqlplus script to quickly kill off all external sessions connecting to my oracle database without the supervision of and administrator. [After much searching and experimenting, I have an answer for this that I will post shortly]
oracle
sqlplus
null
null
null
null
open
How can I kill all sessions connecting to my oracle database? === I need an sqlplus script to quickly kill off all external sessions connecting to my oracle database without the supervision of and administrator. [After much searching and experimenting, I have an answer for this that I will post shortly]
0
55,350
09/10/2008 21:19:39
1,322
08/14/2008 14:11:10
166
8
"Background" task in palm OS
I'm trying to create a Palm OS app to check a web site every X minutes or hours, and provide a notification when a piece of data is available. I know that this kind of thing can be done on the new Palm's - for example, my Centro can have email or web sites download when the application isn't on top - but I don't know how to do it. Can anyone point me in the right direction?
palm-os
null
null
null
null
null
open
"Background" task in palm OS === I'm trying to create a Palm OS app to check a web site every X minutes or hours, and provide a notification when a piece of data is available. I know that this kind of thing can be done on the new Palm's - for example, my Centro can have email or web sites download when the application isn't on top - but I don't know how to do it. Can anyone point me in the right direction?
0
55,360
09/10/2008 21:28:13
4,230
09/02/2008 13:21:04
1
1
__doPostBack is not working in firefox
The __doPostBack is not working in firefox 3 (have not checked 2). Everything is working great in IE 6&7 and it even works in Chrome?? It's a simple asp:LinkButton with an OnClick event <asp:LinkButton ID="DeleteAllPicturesLinkButton" Enabled="False" OnClientClick="javascript:return confirm('Are you sure you want to delete all pictures? \n This action cannot be undone.');" OnClick="DeletePictureLinkButton_Click" CommandName="DeleteAll" CssClass="button" runat="server"> The javascript confirm is firing so I know the javascript is working, it's specirically the __doPostBack event. There is a lot more going on on the page, just didn't know if it's work it to post the entire page. Any ideas?
c#
asp.net
null
null
null
null
open
__doPostBack is not working in firefox === The __doPostBack is not working in firefox 3 (have not checked 2). Everything is working great in IE 6&7 and it even works in Chrome?? It's a simple asp:LinkButton with an OnClick event <asp:LinkButton ID="DeleteAllPicturesLinkButton" Enabled="False" OnClientClick="javascript:return confirm('Are you sure you want to delete all pictures? \n This action cannot be undone.');" OnClick="DeletePictureLinkButton_Click" CommandName="DeleteAll" CssClass="button" runat="server"> The javascript confirm is firing so I know the javascript is working, it's specirically the __doPostBack event. There is a lot more going on on the page, just didn't know if it's work it to post the entire page. Any ideas?
0
55,363
09/10/2008 21:31:50
3,742
08/30/2008 14:08:11
123
18
Best tools for creating website wireframes
When creating a wireframe for a website, I always start with a [Visio wireframe stencil from Garrett Dimon][1]. The stencil is amazing but it has been a few years since it has been updated and I'm looking for something new and exciting. What wireframing tool(s) do you use, if any? [1]: http://v1.garrettdimon.com/resources/templates-stencils-for-visio-omnigraffle
wireframe
null
null
null
null
09/20/2011 19:29:38
not constructive
Best tools for creating website wireframes === When creating a wireframe for a website, I always start with a [Visio wireframe stencil from Garrett Dimon][1]. The stencil is amazing but it has been a few years since it has been updated and I'm looking for something new and exciting. What wireframing tool(s) do you use, if any? [1]: http://v1.garrettdimon.com/resources/templates-stencils-for-visio-omnigraffle
4
55,365
09/10/2008 21:32:47
4,872
09/06/2008 09:14:55
194
3
How can I get Emacs' key bindings in Python's IDLE?
I use Emacs primarily for coding Python but sometimes I use IDLE. Is there a way to change the key bindings easily in IDLE to match Emacs?
python
ide
emacs
keyboard
null
null
open
How can I get Emacs' key bindings in Python's IDLE? === I use Emacs primarily for coding Python but sometimes I use IDLE. Is there a way to change the key bindings easily in IDLE to match Emacs?
0
55,369
09/10/2008 21:33:48
1,432
08/15/2008 15:33:54
963
59
Reading VC++ CArchive Binary Format (or Java reading (CObArray))
Is there any clear documentation on the binary formats used to serialize the various MFC data structures? I've been able to view some of my own classes in a hex editor and use Java's ByteBuffer class to read them in (with automatic endianness conversions, etc). However, I am currently running into issues while trying to bring over the CObArray data, as there seems to be a rather large header that is opaque to me, and it is unclear how it is persisting object type information. Is there a set of online documentation that would be helpful for this? Or some sample Java code from someone that has dealt with this in the past?
java
mfc
serialization
vc++
carchive
null
open
Reading VC++ CArchive Binary Format (or Java reading (CObArray)) === Is there any clear documentation on the binary formats used to serialize the various MFC data structures? I've been able to view some of my own classes in a hex editor and use Java's ByteBuffer class to read them in (with automatic endianness conversions, etc). However, I am currently running into issues while trying to bring over the CObArray data, as there seems to be a rather large header that is opaque to me, and it is unclear how it is persisting object type information. Is there a set of online documentation that would be helpful for this? Or some sample Java code from someone that has dealt with this in the past?
0
55,375
09/10/2008 21:39:21
5,296
09/08/2008 22:13:27
13
6
add values to enum
I know this rather goes against the idea of enums, but is it possible to extend enums in C#/Java? I mean "extend" in both the sense of adding new values to an enum, but also in the OO sense of inheriting from an existing enum. I assume it's not possible in Java, as it only got them fairly recently (Java 5?). C# seems more forgiving of people that want to do crazy things, though, so I thought it might be possible some way. Presumably it could be hacked up via reflection (not that you'd every actually use that method)? I'm not necessarily interested in implementing any given method, it just provoked my curiosity when it occurred to me :-)
c#
.net
java
null
null
null
open
add values to enum === I know this rather goes against the idea of enums, but is it possible to extend enums in C#/Java? I mean "extend" in both the sense of adding new values to an enum, but also in the OO sense of inheriting from an existing enum. I assume it's not possible in Java, as it only got them fairly recently (Java 5?). C# seems more forgiving of people that want to do crazy things, though, so I thought it might be possible some way. Presumably it could be hacked up via reflection (not that you'd every actually use that method)? I'm not necessarily interested in implementing any given method, it just provoked my curiosity when it occurred to me :-)
0
55,391
09/10/2008 21:49:53
5,675
09/10/2008 21:40:18
1
0
Python regular expression for HTML parsing
I want to grab the value of a hidden input field in HTML. <input type="hidden" name="fooId" value="12-3456789-1111111111" /> I want to write a regular expression in Python that will return the value of fooId, given that I know the line in the HTML follows the format <input type="hidden" name="fooId" value="**[id is here]**" /> Can someone provide an example in Python to parse the HTML for the value?
python
regex
null
null
null
null
open
Python regular expression for HTML parsing === I want to grab the value of a hidden input field in HTML. <input type="hidden" name="fooId" value="12-3456789-1111111111" /> I want to write a regular expression in Python that will return the value of fooId, given that I know the line in the HTML follows the format <input type="hidden" name="fooId" value="**[id is here]**" /> Can someone provide an example in Python to parse the HTML for the value?
0
55,403
09/10/2008 21:59:23
3,305
08/27/2008 18:56:35
552
30
Have you successfully used a GPGPU?
I am interested to know whether anyone has written an application that takes advantage of a [GPGPU][1] by using, for example, [nVidia CUDA][2]. If so, what issues did you find and what performance gains did you achieve compared with a standard CPU? [1]: http://en.wikipedia.org/wiki/GPGPU [2]: http://www.nvidia.com/object/cuda_get.html
c
gpgpu
hpc
null
null
null
open
Have you successfully used a GPGPU? === I am interested to know whether anyone has written an application that takes advantage of a [GPGPU][1] by using, for example, [nVidia CUDA][2]. If so, what issues did you find and what performance gains did you achieve compared with a standard CPU? [1]: http://en.wikipedia.org/wiki/GPGPU [2]: http://www.nvidia.com/object/cuda_get.html
0
55,411
09/10/2008 22:06:40
5,678
09/10/2008 21:56:59
1
0
Path.GetTempFileName -- Directory name is invalid
Running into a problem where on certain servers we get an error that the directory name is invalid when using Path.GetTempFileName. Further investigation shows that it is trying to write a file to c:\Documents and Setting\computername\aspnet\local settings\temp. This folder exists so I'm assuming this must be a permissions issue with respect to the asp.net account. I've been told by some that Path.GetTempFileName should be pointing to C:\Windows\Microsoft.NET\Framework\v2.0.50727\temporaryasp.net files. I've also been told that this problem may be due to the order in which IIS and .NET where installed on the server. I've done the typical 'aspnet_regiis -i' and checked security on the folders etc. At this point I'm stuck. Can anyone shed some light on this?
c#
asp.net
null
null
null
null
open
Path.GetTempFileName -- Directory name is invalid === Running into a problem where on certain servers we get an error that the directory name is invalid when using Path.GetTempFileName. Further investigation shows that it is trying to write a file to c:\Documents and Setting\computername\aspnet\local settings\temp. This folder exists so I'm assuming this must be a permissions issue with respect to the asp.net account. I've been told by some that Path.GetTempFileName should be pointing to C:\Windows\Microsoft.NET\Framework\v2.0.50727\temporaryasp.net files. I've also been told that this problem may be due to the order in which IIS and .NET where installed on the server. I've done the typical 'aspnet_regiis -i' and checked security on the folders etc. At this point I'm stuck. Can anyone shed some light on this?
0
55,414
09/10/2008 22:11:24
5,677
09/10/2008 21:56:30
1
1
ASP.NET MVC versus the Zeitgeist
ASP.NET MVC seems to be making a pretty big entrance. Can anyone summarise how its MVC implementation stacks up against popular MVC frameworks for other languages? (I'm thinking specifically of Rails and Zend Framework, though there are obviously lots.) Observations on learning curve, common terminology, ease of use and feelgood factor welcome. (For the sake of a little background, I've been avoiding using ASP.NET for some time because I really hate the webforms approach, but Jeff's prolific praise on the podcast has almost convinced me to give it a go.)
asp.net-mvc
mvc
zend-framework
null
null
null
open
ASP.NET MVC versus the Zeitgeist === ASP.NET MVC seems to be making a pretty big entrance. Can anyone summarise how its MVC implementation stacks up against popular MVC frameworks for other languages? (I'm thinking specifically of Rails and Zend Framework, though there are obviously lots.) Observations on learning curve, common terminology, ease of use and feelgood factor welcome. (For the sake of a little background, I've been avoiding using ASP.NET for some time because I really hate the webforms approach, but Jeff's prolific praise on the podcast has almost convinced me to give it a go.)
0
55,421
09/10/2008 22:15:23
3,305
08/27/2008 18:56:35
557
30
Do you actively manage technical debt?
Do you actively manage [technical debt][1] debt on your software development projects and if so, how do you do it? [1]: http://forums.construx.com/blogs/stevemcc/archive/2007/11/01/technical-debt-2.aspx
project-management
technical-debt
null
null
null
null
open
Do you actively manage technical debt? === Do you actively manage [technical debt][1] debt on your software development projects and if so, how do you do it? [1]: http://forums.construx.com/blogs/stevemcc/archive/2007/11/01/technical-debt-2.aspx
0
55,432
09/10/2008 22:25:52
1,368
08/14/2008 18:57:47
199
11
Writing specifications for a project, traditional route
What are the general, traditional steps/stages to software development, or more specifically, specification writing? I know of concepts like waterfall method, gathering specifications, use cases, etc. But I want a more formal explanation to it all.
project-management
specifications
null
null
null
null
open
Writing specifications for a project, traditional route === What are the general, traditional steps/stages to software development, or more specifically, specification writing? I know of concepts like waterfall method, gathering specifications, use cases, etc. But I want a more formal explanation to it all.
0
55,434
09/10/2008 22:27:51
337
08/04/2008 18:11:42
160
6
How to parse relative time?
This question is the other side of the question asking, "[How do I calculate relative time?][1]". Given some human input for a relative time, how can you parse it? By default you would offset from DateTime.Now(), but could optionally offset from another DateTime. (Prefer answers in C#) Example input: - "in 20 minutes" - "5 hours ago" - "3h 2m" - "next week" [1]: http://stackoverflow.com/questions/11/how-do-i-calculate-relative-time
time
parsing
language-agnostic
null
null
null
open
How to parse relative time? === This question is the other side of the question asking, "[How do I calculate relative time?][1]". Given some human input for a relative time, how can you parse it? By default you would offset from DateTime.Now(), but could optionally offset from another DateTime. (Prefer answers in C#) Example input: - "in 20 minutes" - "5 hours ago" - "3h 2m" - "next week" [1]: http://stackoverflow.com/questions/11/how-do-i-calculate-relative-time
0
55,437
09/10/2008 22:30:38
1,175
08/13/2008 10:21:54
1,583
119
Using Microsoft's Application Blocks
I haven't done a lot of .NET programming, but I have examined a few of the application blocks published by Microsoft's Patterns and Practices group. I was wondering how these are typically used: - Linked directly into applications - Source added into applications and built with them, perhaps with some customizations - Sample code used as reference while writing application-specific code I'm sure all three of these usages are common, but what are the most typical usage patterns? Are there a few particular application blocks that are used by "everyone?" Note: This question is related to, but not the same as http://beta.stackoverflow.com/questions/53065/enterprise-library-application-blocks-or-home-grown-framework.
design-patterns
application-blocks
.net
null
null
null
open
Using Microsoft's Application Blocks === I haven't done a lot of .NET programming, but I have examined a few of the application blocks published by Microsoft's Patterns and Practices group. I was wondering how these are typically used: - Linked directly into applications - Source added into applications and built with them, perhaps with some customizations - Sample code used as reference while writing application-specific code I'm sure all three of these usages are common, but what are the most typical usage patterns? Are there a few particular application blocks that are used by "everyone?" Note: This question is related to, but not the same as http://beta.stackoverflow.com/questions/53065/enterprise-library-application-blocks-or-home-grown-framework.
0
55,440
09/10/2008 22:35:06
108,465
08/08/2008 06:06:33
58
7
Checking Inheritence with templates in C++
I have a class which is a wrapper class(serves as a common interface) around another class implementing the functionality required. So my code looks like this. template<typename ImplemenationClass> class WrapperClass { // the code goes here } Now, how do I make sure that ImplementationClass can be derived from a set of classes only, similar to java's generics <? extends BaseClass> syntax?
java
c++
templates
null
null
null
open
Checking Inheritence with templates in C++ === I have a class which is a wrapper class(serves as a common interface) around another class implementing the functionality required. So my code looks like this. template<typename ImplemenationClass> class WrapperClass { // the code goes here } Now, how do I make sure that ImplementationClass can be derived from a set of classes only, similar to java's generics <? extends BaseClass> syntax?
0
55,448
09/10/2008 22:45:20
4,341
09/02/2008 23:04:11
1
3
What’s the best approach when migrating legacy projects across versions of visual studio?
I’ve been thinking about the number of projects we have inhouse that are still being developed using visual studio 6 and how best to migrate them forward onto visual studio 2008. The projects range in flavours of C/C++ and VB. Is it better to let VS2k8 convert the workspaces into solutions, fix any compile errors and be on your merry way? Or, is it better to start with a clean solution and migrate code across project by project discarding dead code along the way?
visual-studio
migration
null
null
null
null
open
What’s the best approach when migrating legacy projects across versions of visual studio? === I’ve been thinking about the number of projects we have inhouse that are still being developed using visual studio 6 and how best to migrate them forward onto visual studio 2008. The projects range in flavours of C/C++ and VB. Is it better to let VS2k8 convert the workspaces into solutions, fix any compile errors and be on your merry way? Or, is it better to start with a clean solution and migrate code across project by project discarding dead code along the way?
0
55,449
09/10/2008 22:45:31
4,872
09/06/2008 09:14:55
199
3
Can you "ignore" a file in Perforce?
I sometimes use the feature 'Reconcile Offline Work...' found in Perforce's P4V IDE to sync up any files that I have been working on while disconnected from the P4 depot. It launches another window that performs a 'Folder Diff'. I have files I never want to check in to source control (like ones found in bin folder such as DLLs, code generated output, etc.) Is there a way to filter those files/folders out from appearing as "new" that might be added. They tend to clutter up the list of files that I am actually interesting in. Does P4 have the equivalent of Subversion's 'ignore file' feature?
svn
version-control
perforce
null
null
null
open
Can you "ignore" a file in Perforce? === I sometimes use the feature 'Reconcile Offline Work...' found in Perforce's P4V IDE to sync up any files that I have been working on while disconnected from the P4 depot. It launches another window that performs a 'Folder Diff'. I have files I never want to check in to source control (like ones found in bin folder such as DLLs, code generated output, etc.) Is there a way to filter those files/folders out from appearing as "new" that might be added. They tend to clutter up the list of files that I am actually interesting in. Does P4 have the equivalent of Subversion's 'ignore file' feature?
0
55,451
09/10/2008 22:47:35
4,341
09/02/2008 23:04:11
1
3
Which C# project type would you use to redeveloped a MFC C++ activex control?
Looking at the C# project templates in VS2k8 and the offerings are WPF User Control Library, WPF Custom Control Library and Windows Forms Control Library. Which of these would you use if you wanted to move a legacy active control written in c++ into the world of C# and .NET?
c#
c++
visual-studio
code-migration
null
null
open
Which C# project type would you use to redeveloped a MFC C++ activex control? === Looking at the C# project templates in VS2k8 and the offerings are WPF User Control Library, WPF Custom Control Library and Windows Forms Control Library. Which of these would you use if you wanted to move a legacy active control written in c++ into the world of C# and .NET?
0
55,460
09/10/2008 22:57:22
1,463
08/15/2008 17:26:44
482
35
What is the possible mimetype hierachy of an email message?
I'm working with a snippet of code that recursively calls itself and tries to pull out a mime type part of "text/html" from an email (if it exists) for further processing. The "text/html" could exist inside other content such as "multipart/alternative" so I'm trying to find out if there is a defined hierarchy for email mime types. Anybody know if there is and what it is? i.e. what types can parent other types?
email
mime-types
null
null
null
null
open
What is the possible mimetype hierachy of an email message? === I'm working with a snippet of code that recursively calls itself and tries to pull out a mime type part of "text/html" from an email (if it exists) for further processing. The "text/html" could exist inside other content such as "multipart/alternative" so I'm trying to find out if there is a defined hierarchy for email mime types. Anybody know if there is and what it is? i.e. what types can parent other types?
0
55,463
09/10/2008 23:02:40
5,196
09/08/2008 12:39:19
36
2
One big SQL Select statement or several small ones (Performance)?
I'm building a PHP page with data sent from MySQL. Is it better to have 1 SELECT query with 4 table joins, or 4 small SELECT queries. Which is faster and what is the pro/con of each method? PS. I only need one row from each tables.
mysql
php
performance
null
null
null
open
One big SQL Select statement or several small ones (Performance)? === I'm building a PHP page with data sent from MySQL. Is it better to have 1 SELECT query with 4 table joins, or 4 small SELECT queries. Which is faster and what is the pro/con of each method? PS. I only need one row from each tables.
0
55,482
09/10/2008 23:16:32
4,115
09/01/2008 20:54:03
56
1
Uninstall Command Fails Only in Release Mode
I am able to successfully uninstall a third-party application via the command line and via a custom Inno Setup installer. Command line Execution: MSIEXEC.exe /x {14D74337-01C2-4F8F-B44B-67FC613E5B1F} /qn Inno Setup Command: [Run] Filename: msiexec.exe; Flags: runhidden waituntilterminated; Parameters: "/x {{14D74337-01C2-4F8F-B44B-67FC613E5B1F} /qn"; StatusMsg: "Uninstalling Service..."; I am also able to uninstall the application programmatically when executing the following C# code in debug mode. C# Code: string fileName = "MSIEXEC.exe"; string arguments = "/x {14D74337-01C2-4F8F-B44B-67FC613E5B1F} /qn"; ProcessStartInfo psi = new ProcessStartInfo(fileName, arguments) { CreateNoWindow = true, UseShellExecute = false, RedirectStandardOutput = true }; Process process = Process.Start(psi); string errorMsg = process.StandardOutput.ReadToEnd(); process.WaitForExit(); The same C# code, however, produces the following failure output when run as a compiled, deployed Windows Service: "This action is only valid for products that are currently installed." Additional Comments: - The Windows Service which is issuing the uninstall command is running on the same machine as the code being tested in Debug Mode. The Windows Service is running/logged on as the Local system account. - I have consulted my application logs and I have validated that the executed command arguments are thhe same in both debug and release mode. - I have consulted the Event Viewer but it doesn't offer any clues. Thoughts? Any help would be greatly appreciated. Thanks.
c#
installer
null
null
null
null
open
Uninstall Command Fails Only in Release Mode === I am able to successfully uninstall a third-party application via the command line and via a custom Inno Setup installer. Command line Execution: MSIEXEC.exe /x {14D74337-01C2-4F8F-B44B-67FC613E5B1F} /qn Inno Setup Command: [Run] Filename: msiexec.exe; Flags: runhidden waituntilterminated; Parameters: "/x {{14D74337-01C2-4F8F-B44B-67FC613E5B1F} /qn"; StatusMsg: "Uninstalling Service..."; I am also able to uninstall the application programmatically when executing the following C# code in debug mode. C# Code: string fileName = "MSIEXEC.exe"; string arguments = "/x {14D74337-01C2-4F8F-B44B-67FC613E5B1F} /qn"; ProcessStartInfo psi = new ProcessStartInfo(fileName, arguments) { CreateNoWindow = true, UseShellExecute = false, RedirectStandardOutput = true }; Process process = Process.Start(psi); string errorMsg = process.StandardOutput.ReadToEnd(); process.WaitForExit(); The same C# code, however, produces the following failure output when run as a compiled, deployed Windows Service: "This action is only valid for products that are currently installed." Additional Comments: - The Windows Service which is issuing the uninstall command is running on the same machine as the code being tested in Debug Mode. The Windows Service is running/logged on as the Local system account. - I have consulted my application logs and I have validated that the executed command arguments are thhe same in both debug and release mode. - I have consulted the Event Viewer but it doesn't offer any clues. Thoughts? Any help would be greatly appreciated. Thanks.
0
55,487
09/10/2008 23:27:17
2,789
08/25/2008 05:54:19
170
29
Find the settings JNDI is using for error reporting.
I've got a J2SE application that I am maintaining uses JNDI. (It uses JNDI to find it's J2EE application server.) It has pretty poor error reporting of failure to find the JNDI server. I've been looking around fora way to display which server the InitialContext is trying to talk to. Has anyone got a neat way to do this ?
java
jndi
null
null
null
null
open
Find the settings JNDI is using for error reporting. === I've got a J2SE application that I am maintaining uses JNDI. (It uses JNDI to find it's J2EE application server.) It has pretty poor error reporting of failure to find the JNDI server. I've been looking around fora way to display which server the InitialContext is trying to talk to. Has anyone got a neat way to do this ?
0
55,502
09/10/2008 23:43:35
5,296
09/08/2008 22:13:27
18
6
Return collection as read-only
I have an object in a multi-threaded environment that maintains a collection of information, e.g.: public IList<string> Data { get { return data; } } I currently have `return data;` wrapped by a `ReaderWriterLockSlim` to protect the collection from sharing violations. However, to be doubly sure, I'd like to return the collection as read-only, so that the calling code is unable to make changes to the collection, only view what's already there. Is this at all possible?
c#
.net
multithreading
collections
concurrency
null
open
Return collection as read-only === I have an object in a multi-threaded environment that maintains a collection of information, e.g.: public IList<string> Data { get { return data; } } I currently have `return data;` wrapped by a `ReaderWriterLockSlim` to protect the collection from sharing violations. However, to be doubly sure, I'd like to return the collection as read-only, so that the calling code is unable to make changes to the collection, only view what's already there. Is this at all possible?
0
55,503
09/10/2008 23:44:04
4,888
09/06/2008 11:28:10
1
5
How do I logout of multiple asp.net applications?
I have a main asp.net app, which is written in asp.net 1.1. Runnning underneath the application are several 2.0 apps. To completely logout a user can I just logout of the 1.1 app with FormsAuthentication.SignOut or is it more complicated than that?
asp.net
authentication
asp.net-1.1
null
null
null
open
How do I logout of multiple asp.net applications? === I have a main asp.net app, which is written in asp.net 1.1. Runnning underneath the application are several 2.0 apps. To completely logout a user can I just logout of the 1.1 app with FormsAuthentication.SignOut or is it more complicated than that?
0
55,506
09/10/2008 23:45:27
2,527
08/22/2008 16:35:28
469
22
How do I conditionally create a stored procedure in SQL Server?
As part of my integration strategy, I have a few SQL scripts that run in order to update the database. The first thing all of these scripts do is check to see if they need to run, e.g.: if @version <> @expects begin declare @error varchar(100); set @error = 'Invalid version. Your version is ' + convert(varchar, @version) + '. This script expects version ' + convert(varchar, @expects) + '.'; raiserror(@error, 10, 1); end else begin ...sql statements here... end Works great! Except if I need to add a stored procedure. The "create proc" command must be the only command in a batch of sql commands. Putting a "create proc" in my IF statement causes this error: 'CREATE/ALTER PROCEDURE' must be the first statement in a query batch. Ouch! How do I put the CREATE PROC command in my script, and have it only execute if it needs to? **ANSWER:** Wrap it in an EXEC()! Like so: if @version <> @expects begin ...snip... end else begin exec('CREATE PROC MyProc AS SELECT ''Victory!'''); end Works like a charm!
stored-procedures
sql-server
null
null
null
null
open
How do I conditionally create a stored procedure in SQL Server? === As part of my integration strategy, I have a few SQL scripts that run in order to update the database. The first thing all of these scripts do is check to see if they need to run, e.g.: if @version <> @expects begin declare @error varchar(100); set @error = 'Invalid version. Your version is ' + convert(varchar, @version) + '. This script expects version ' + convert(varchar, @expects) + '.'; raiserror(@error, 10, 1); end else begin ...sql statements here... end Works great! Except if I need to add a stored procedure. The "create proc" command must be the only command in a batch of sql commands. Putting a "create proc" in my IF statement causes this error: 'CREATE/ALTER PROCEDURE' must be the first statement in a query batch. Ouch! How do I put the CREATE PROC command in my script, and have it only execute if it needs to? **ANSWER:** Wrap it in an EXEC()! Like so: if @version <> @expects begin ...snip... end else begin exec('CREATE PROC MyProc AS SELECT ''Victory!'''); end Works like a charm!
0
55,510
09/10/2008 23:49:09
4,790
09/05/2008 16:00:28
63
8
When do function-level static variables get allocated/initialized?
I'm quite confident that globally declared variables get allocated (and initialized, if applicable) at program start time. int globalgarbage; unsigned int anumber = 42; But what about static ones defined within a function? void doSomething() { static bool globalish = true; // ... } When is the space for <code>globalish</code> allocated? I'm guessing when the program starts. But does it get initialized then too? Or is it initialized when <code>doSomething()</code> is first called?
c++
c
variables
null
null
null
open
When do function-level static variables get allocated/initialized? === I'm quite confident that globally declared variables get allocated (and initialized, if applicable) at program start time. int globalgarbage; unsigned int anumber = 42; But what about static ones defined within a function? void doSomething() { static bool globalish = true; // ... } When is the space for <code>globalish</code> allocated? I'm guessing when the program starts. But does it get initialized then too? Or is it initialized when <code>doSomething()</code> is first called?
0
55,517
09/10/2008 23:56:00
5,302
09/08/2008 22:49:47
46
8
Very slow compile times on Visual Studio
We are getting very slow compile times, which can take upwards of 20+ minutes on dual core 2GHz, 2G Ram machines. A lot of this is due to the size of our solution which has grown to 70+ projects, as well as VSS which is a bottle neck in itself when you have a lot of files. (swapping out VSS is not an option unfortuanetly, so I don't want this to descend into a VSS bash) We are looking at combing projects (not nice, as we like the separation of concerns, but is a good opportunity to refactor away some dead wood). We are also looking at having multiple solutions to achieve greater separation of concerns and quicker compile times for each element of the application. This I can see will become a dll hell as we try to keep things in synch. I am interested to know how other teams have dealt with this scaling issue, what do you do when your code base reaches a critical mass that you are wasting half the day watching the status bar deliver compile messages
visual-studio
suggestions
compilation
null
null
null
open
Very slow compile times on Visual Studio === We are getting very slow compile times, which can take upwards of 20+ minutes on dual core 2GHz, 2G Ram machines. A lot of this is due to the size of our solution which has grown to 70+ projects, as well as VSS which is a bottle neck in itself when you have a lot of files. (swapping out VSS is not an option unfortuanetly, so I don't want this to descend into a VSS bash) We are looking at combing projects (not nice, as we like the separation of concerns, but is a good opportunity to refactor away some dead wood). We are also looking at having multiple solutions to achieve greater separation of concerns and quicker compile times for each element of the application. This I can see will become a dll hell as we try to keep things in synch. I am interested to know how other teams have dealt with this scaling issue, what do you do when your code base reaches a critical mass that you are wasting half the day watching the status bar deliver compile messages
0
55,531
09/11/2008 00:05:58
811
08/09/2008 03:53:10
1,658
68
How do I calculate the "cost" of a crash?
### Background: Some time ago, I build a system for recording and categorizing application crashes for one of our internal programs. At the time, I used a combination of frequency and aggregated lost time (the time between the program launch and the crash) for prioritizing types of crashes. It worked reasonably well. Now, The Powers That Be want solid numbers on the *cost* of each type of crash being worked on. Or at least, numbers that *look* solid. I suppose I could use the aggregate lost time, multiplied by some plausible figure, but it seems dodgy. ###Question: Are there any established methods of calculating the real-world cost of application crashes? Or failing that, published studies speculating on such costs?
planning
crash
statistics
crashrpt
cost
null
open
How do I calculate the "cost" of a crash? === ### Background: Some time ago, I build a system for recording and categorizing application crashes for one of our internal programs. At the time, I used a combination of frequency and aggregated lost time (the time between the program launch and the crash) for prioritizing types of crashes. It worked reasonably well. Now, The Powers That Be want solid numbers on the *cost* of each type of crash being worked on. Or at least, numbers that *look* solid. I suppose I could use the aggregate lost time, multiplied by some plausible figure, but it seems dodgy. ###Question: Are there any established methods of calculating the real-world cost of application crashes? Or failing that, published studies speculating on such costs?
0
55,532
09/11/2008 00:06:58
4,790
09/05/2008 16:00:28
75
8
Casting between multi- and single-dimentional arrays
This came up from [this answer to a previous question of mine](http://stackoverflow.com/questions/55093/how-to-deal-with-arrays-declared-on-the-stack-in-c#55183). Is it guaranteed for the compiler to treat array[4][4] the same as array[16]? For instance, would either of the below calls to <code>api_func()</code> be safe? void api_func(const double matrix[4][4]); // ... { typedef double Matrix[4][4]; double* array1 = new double[16]; double array2[16]; // ... api_func(reinterpret_cast<Matrix&>(array1)); api_func(reinterpret_cast<Matrix&>(array2)); }
c++
arrays
null
null
null
null
open
Casting between multi- and single-dimentional arrays === This came up from [this answer to a previous question of mine](http://stackoverflow.com/questions/55093/how-to-deal-with-arrays-declared-on-the-stack-in-c#55183). Is it guaranteed for the compiler to treat array[4][4] the same as array[16]? For instance, would either of the below calls to <code>api_func()</code> be safe? void api_func(const double matrix[4][4]); // ... { typedef double Matrix[4][4]; double* array1 = new double[16]; double array2[16]; // ... api_func(reinterpret_cast<Matrix&>(array1)); api_func(reinterpret_cast<Matrix&>(array2)); }
0
55,556
09/11/2008 00:27:50
5,552
09/10/2008 13:38:06
11
1
Password generation, best practice
I need to generate some passwords, I want to avoid characters that can be confused for each other. Is there a definitive list of characters I should avoid? my current list is il10o8B3Evu![]{} Are there any other pairs of characters that are easy to confuse? for special characters I was going to limit myself to those under the number keys, though I know that this differs depending on your keyboards nationality! As a rider question, I would like my passwords to be 'wordlike'do you have a favoured algorithm for that? Thanks :)
passwords
security
userexperience
null
null
null
open
Password generation, best practice === I need to generate some passwords, I want to avoid characters that can be confused for each other. Is there a definitive list of characters I should avoid? my current list is il10o8B3Evu![]{} Are there any other pairs of characters that are easy to confuse? for special characters I was going to limit myself to those under the number keys, though I know that this differs depending on your keyboards nationality! As a rider question, I would like my passwords to be 'wordlike'do you have a favoured algorithm for that? Thanks :)
0
55,572
09/11/2008 00:48:10
5,433
09/09/2008 15:02:32
60
7
live asp.net web.config settings
I've only recently started working with asp.net and c#. Is there a standard practice set of web.config settings for a live final website? There seem to be a ton of options available and I'm looking to streamline performance, close possible security holes and other unecessary options.
asp.net
optimal
web-config
null
null
null
open
live asp.net web.config settings === I've only recently started working with asp.net and c#. Is there a standard practice set of web.config settings for a live final website? There seem to be a ton of options available and I'm looking to streamline performance, close possible security holes and other unecessary options.
0
55,574
09/11/2008 00:50:59
2,066
08/20/2008 03:59:13
306
24
Learning Ruby on Rails
As it stands now I'm a Java and C# developer, but the more and more I look at Ruby on Rails, the more I really want to learn it. What have you found to be the best route to learn RoR? Would it be easier to develop on Windows, or should I just run a virtual machine with linux? Is there an ide that can match the robustness of Visual Studio? Any programs to develop that give a good overhead of what to do? Any good books? Seriously, any tips/tricks/rants would be awesome.
ruby
ruby-on-rails
ide
books
null
null
open
Learning Ruby on Rails === As it stands now I'm a Java and C# developer, but the more and more I look at Ruby on Rails, the more I really want to learn it. What have you found to be the best route to learn RoR? Would it be easier to develop on Windows, or should I just run a virtual machine with linux? Is there an ide that can match the robustness of Visual Studio? Any programs to develop that give a good overhead of what to do? Any good books? Seriously, any tips/tricks/rants would be awesome.
0
55,576
09/11/2008 00:52:25
2,527
08/22/2008 16:35:28
515
24
ASP.Net: If I have the Session ID, Can I get the Session object?
This question is related to [this one](http://stackoverflow.com/questions/43324/can-i-put-an-aspnet-session-id-in-a-hidden-form-field), though I think I was a little too long-winded there to really get a good answer. I'll keep this brief. I'm working on a web handler (ashx) that accepts a form post from an aspx page. When the handler receives this form post, in order to do what it needs to do, it needs to know the user who is logged in (User.Identity.Name), but I can't rely on cookies being sent by the browser. I know I can get the Session.SessionID and place it in a hidden form field, but once my handler receives the form post, how can I use that SessionID to figure out the logged-in user's identity? I'm using the StateServer mode for session state.
asp.net
session
null
null
null
null
open
ASP.Net: If I have the Session ID, Can I get the Session object? === This question is related to [this one](http://stackoverflow.com/questions/43324/can-i-put-an-aspnet-session-id-in-a-hidden-form-field), though I think I was a little too long-winded there to really get a good answer. I'll keep this brief. I'm working on a web handler (ashx) that accepts a form post from an aspx page. When the handler receives this form post, in order to do what it needs to do, it needs to know the user who is logged in (User.Identity.Name), but I can't rely on cookies being sent by the browser. I know I can get the Session.SessionID and place it in a hidden form field, but once my handler receives the form post, how can I use that SessionID to figure out the logged-in user's identity? I'm using the StateServer mode for session state.
0
55,577
09/11/2008 00:53:06
5,168
09/08/2008 10:15:00
304
8
How can I test my web pages in Microsoft Internet Explorer on a Mac?
I want to test the web pages I create in all the modern versions of Internet Explorer (6, 7 and 8 beta) but I work mainly on a Mac and often don't have direct access to a PC.
testing
osx
internet-explorer
null
null
null
open
How can I test my web pages in Microsoft Internet Explorer on a Mac? === I want to test the web pages I create in all the modern versions of Internet Explorer (6, 7 and 8 beta) but I work mainly on a Mac and often don't have direct access to a PC.
0
55,594
09/11/2008 01:01:53
1,075
08/12/2008 10:13:30
1,297
77
CSS not being applied on non authenticated ASP.NET page
When developing (works fine live) the pages for our website don't pick up the correct CSS until the user has authenticated (logged on). So the Logon and Logoff forms look bad, but once inside the site, the CSS works again. I'm guessing it's some kind of authentication issue? Haven't really looked into it too much because it's only when working on dev so not a huge issue, but would be nice to know how to fix it.
asp.net
css
null
null
null
null
open
CSS not being applied on non authenticated ASP.NET page === When developing (works fine live) the pages for our website don't pick up the correct CSS until the user has authenticated (logged on). So the Logon and Logoff forms look bad, but once inside the site, the CSS works again. I'm guessing it's some kind of authentication issue? Haven't really looked into it too much because it's only when working on dev so not a huge issue, but would be nice to know how to fix it.
0
55,607
09/11/2008 01:11:08
242
08/03/2008 22:55:19
495
30
Multiple Eval Fields in Gridview ItemTemplate
I just learned a new trick and thought I'd share it (and try to find an *even better* way). I wanted to display two data-bound fields in a single ASP.NET Gridview ItemTemplate. I also wanted to have some control over the formatting. I had previously used this (bad, I know): <%# Eval("Name1", "{0} - ")%> <%#Eval("Name2")%> Result = 'John - Smith' But just discovered that I can also put TWO (or more) Evals in the same data-bound group: <%#Eval("Name1") & " - " & Eval("Name2")%> Result = 'John - Smith' Or <%# "First Name - " & Eval("Name1") & ", Last Name - " & Eval("Name2")%> Result = 'First Name - John, Last Name - Smith' This technique gives me *much* more control over the formatting without having to resort to putting string handling in the RowDataBound event of the GridView. But I know from experience that there is *ALWAYS* a better way to do something so.... **What techniques/tricks do _you use_ when binding and formatting data in a GridView/DataList/Repeater?**
asp.net
data-binding
gridview
eval
null
null
open
Multiple Eval Fields in Gridview ItemTemplate === I just learned a new trick and thought I'd share it (and try to find an *even better* way). I wanted to display two data-bound fields in a single ASP.NET Gridview ItemTemplate. I also wanted to have some control over the formatting. I had previously used this (bad, I know): <%# Eval("Name1", "{0} - ")%> <%#Eval("Name2")%> Result = 'John - Smith' But just discovered that I can also put TWO (or more) Evals in the same data-bound group: <%#Eval("Name1") & " - " & Eval("Name2")%> Result = 'John - Smith' Or <%# "First Name - " & Eval("Name1") & ", Last Name - " & Eval("Name2")%> Result = 'First Name - John, Last Name - Smith' This technique gives me *much* more control over the formatting without having to resort to putting string handling in the RowDataBound event of the GridView. But I know from experience that there is *ALWAYS* a better way to do something so.... **What techniques/tricks do _you use_ when binding and formatting data in a GridView/DataList/Repeater?**
0
55,611
09/11/2008 01:12:39
3,284
08/27/2008 17:03:53
1
0
JavaScript private methods
To make a JavaScript class with a public method I'd do something like: function Restaurant() { } Restaurant.prototype.buy_food = function() { // something here } Restaurant.prototype.use_restroom = function() { // something here } That way users of my class can: var restaurant = new Restaurant(); restaurant.buy_food(); restaurant.use_restroom(); How do I create a private method that my public buy_food and use_restroom methods can call but that users of the class can't call externally. In other words, I want my method implementation to be able to do: Restaurant.prototype.use_restroom = function() { this.private_stuff(); } But this shouldn't work: var r = new Restaurant(); r.private_stuff(); How do I define private_stuff as a private method so both of those hold true? I've read [Doug Crockford's writeup][1] a few times but it doesn't seem like "private" methods can be called by public methods and "privileged" methods can be called externally. [1]: http://javascript.crockford.com/private.html
javascript
methods
private
null
null
null
open
JavaScript private methods === To make a JavaScript class with a public method I'd do something like: function Restaurant() { } Restaurant.prototype.buy_food = function() { // something here } Restaurant.prototype.use_restroom = function() { // something here } That way users of my class can: var restaurant = new Restaurant(); restaurant.buy_food(); restaurant.use_restroom(); How do I create a private method that my public buy_food and use_restroom methods can call but that users of the class can't call externally. In other words, I want my method implementation to be able to do: Restaurant.prototype.use_restroom = function() { this.private_stuff(); } But this shouldn't work: var r = new Restaurant(); r.private_stuff(); How do I define private_stuff as a private method so both of those hold true? I've read [Doug Crockford's writeup][1] a few times but it doesn't seem like "private" methods can be called by public methods and "privileged" methods can be called externally. [1]: http://javascript.crockford.com/private.html
0
55,612
09/11/2008 01:13:56
204
08/03/2008 13:27:56
764
34
CSS to increase size of first word
This one has me kind of stumped. I want to make the first word of all the paragraphs in my #content div at 14pt instead of the default for the paragraphs (12pt). Is there a way to do this in straight CSS or am I left wrapping the first word in a span to accomplish this?
css
null
null
null
null
null
open
CSS to increase size of first word === This one has me kind of stumped. I want to make the first word of all the paragraphs in my #content div at 14pt instead of the default for the paragraphs (12pt). Is there a way to do this in straight CSS or am I left wrapping the first word in a span to accomplish this?
0
55,615
09/11/2008 01:15:02
3,834
08/31/2008 06:25:52
51
8
Free hosting providers for ASP.Net and SQL server apps
I am not sure whether anyone is providing free hosting service for ASP.Net and MS SQL server? I have a few pet projects and will love to see them go live. I don't mind if there is any bandwidth or other limitatino
asp.net
hosting
null
null
null
null
open
Free hosting providers for ASP.Net and SQL server apps === I am not sure whether anyone is providing free hosting service for ASP.Net and MS SQL server? I have a few pet projects and will love to see them go live. I don't mind if there is any bandwidth or other limitatino
0
55,622
09/11/2008 01:18:09
1,709
08/18/2008 07:05:30
892
75
Best tool(s) for working with DocBook XML documents?
I <a href="http://www.wincue.org/docbook/">experimented with DocBook XML</a> a while back, and also used it professionally for documenting a few software projects, but since the tool support at the time was not very good, I soon abandoned it in favor of hand-written <a href="http://en.wikipedia.org/wiki/LaTeX">LaTeX</a>, and later <a href="http://www.lyx.org/">LyX</a>. Now I'm considering taking another look at DoocBook, and I was wondering, what are the best tools for working with DocBook XML documents today?
xml
productivity
doocbook
null
null
null
open
Best tool(s) for working with DocBook XML documents? === I <a href="http://www.wincue.org/docbook/">experimented with DocBook XML</a> a while back, and also used it professionally for documenting a few software projects, but since the tool support at the time was not very good, I soon abandoned it in favor of hand-written <a href="http://en.wikipedia.org/wiki/LaTeX">LaTeX</a>, and later <a href="http://www.lyx.org/">LyX</a>. Now I'm considering taking another look at DoocBook, and I was wondering, what are the best tools for working with DocBook XML documents today?
0
55,633
09/11/2008 01:23:24
5,295
09/08/2008 22:12:56
8
1
Where is the console API for WebKit/Safari?
WebKit/Safari supports the console object, which is similar to what Firebug does. But what exactly is supported? There is a [console documentation for Firebug][1], but where can I find the console documentation for Safari/WebKit? [1]: http://getfirebug.com/console.html
javascript
console
safari
null
null
null
open
Where is the console API for WebKit/Safari? === WebKit/Safari supports the console object, which is similar to what Firebug does. But what exactly is supported? There is a [console documentation for Firebug][1], but where can I find the console documentation for Safari/WebKit? [1]: http://getfirebug.com/console.html
0
55,639
09/11/2008 01:29:21
1,096,640
09/08/2008 13:10:56
11
2
How do you communicate between Windows Vista Session 0 and Desktop?
In prior versions of Windows before Vista you could have a Windows Service interact with the current logged in desktop user to easy display information on the screen from the service. In Windows Vista Session 0 was added for security to isolate the services from the desktop. What is an easy way to communicate between a service and an application running outside of Session 0? So far I have gotten around this by using TCP/IP to communicate between the two but it seems to be kind of a sloppy way to do it.
windows-vista
null
null
null
null
null
open
How do you communicate between Windows Vista Session 0 and Desktop? === In prior versions of Windows before Vista you could have a Windows Service interact with the current logged in desktop user to easy display information on the screen from the service. In Windows Vista Session 0 was added for security to isolate the services from the desktop. What is an easy way to communicate between a service and an application running outside of Session 0? So far I have gotten around this by using TCP/IP to communicate between the two but it seems to be kind of a sloppy way to do it.
0
55,641
09/11/2008 01:30:32
5,694
09/11/2008 01:30:32
1
0
Unicode in C++
What's the best practice of unicode processing in C++?
c++
unicode
null
null
null
null
open
Unicode in C++ === What's the best practice of unicode processing in C++?
0
55,643
09/11/2008 01:31:57
3,578
08/29/2008 07:03:34
1
0
How do I keep a mySQL database secure?
I'm going to be implementing a PHP/mySQL setup to store credit card information. It seems like AES_ENCRYPT/AES_DECRYPT is the way to go, but I'm still confused on one point: how do I keep the encryption key secure? Hardwiring it into my PHP scripts (which will live on the same server as the db) seems like a major security hole. What's the "best practice" solution here?
php
mysql
security
aes
null
null
open
How do I keep a mySQL database secure? === I'm going to be implementing a PHP/mySQL setup to store credit card information. It seems like AES_ENCRYPT/AES_DECRYPT is the way to go, but I'm still confused on one point: how do I keep the encryption key secure? Hardwiring it into my PHP scripts (which will live on the same server as the db) seems like a major security hole. What's the "best practice" solution here?
0
55,658
09/11/2008 01:40:57
5,386
09/09/2008 12:02:25
1
0
Are there any good recent reference books on IPC programming?
I grew up on <a href="http://www.kohala.com/start/unpv22e/unpv22e.html">UNIX Network Programming, Volume 2, Second Edition: Interprocess Communications</a> (RIP, Richard Stevens), which was the essential reading for designing a multiprocess program back in the days. Re-reading it, it is rather lacking in more modern multiprocess/multithread topics, such as <a href="http://en.wikipedia.org/wiki/D-Bus">dbus</a>, etc. Are there any good books which covers the more recent IPC techniques?
books
unix
ipc
dbus
null
null
open
Are there any good recent reference books on IPC programming? === I grew up on <a href="http://www.kohala.com/start/unpv22e/unpv22e.html">UNIX Network Programming, Volume 2, Second Edition: Interprocess Communications</a> (RIP, Richard Stevens), which was the essential reading for designing a multiprocess program back in the days. Re-reading it, it is rather lacking in more modern multiprocess/multithread topics, such as <a href="http://en.wikipedia.org/wiki/D-Bus">dbus</a>, etc. Are there any good books which covers the more recent IPC techniques?
0
55,669
09/11/2008 02:01:04
3,149
08/27/2008 01:05:12
103
4
SharePoint Permissions
I would like to create a folder that users who do not have privileges to view the rest of the site can see. This user group would be granted access to the site, but I only want them to be able to view one particular page. Is this possible to do without going to every single page and removing the new user group's access?
sharepoint
permissions
null
null
null
null
open
SharePoint Permissions === I would like to create a folder that users who do not have privileges to view the rest of the site can see. This user group would be granted access to the site, but I only want them to be able to view one particular page. Is this possible to do without going to every single page and removing the new user group's access?
0
55,670
09/11/2008 02:02:25
1,226
08/13/2008 13:55:55
190
12
Service that provides DVD Covers art?
Are there any services that allow you to retrieve DVD cover information? I'm working on a small WPF application where this functionality would be handy. If a user inserts a DVD or types a title in, it'll automatically grab the cover art for that DVD. Thanks.
dvd
cover
art
service
null
null
open
Service that provides DVD Covers art? === Are there any services that allow you to retrieve DVD cover information? I'm working on a small WPF application where this functionality would be handy. If a user inserts a DVD or types a title in, it'll automatically grab the cover art for that DVD. Thanks.
0
55,677
09/11/2008 02:07:45
3,715
08/30/2008 09:17:39
163
23
How do I get the coordinates of a mouse click on a canvas element?
What's the simplest way to add a click event handler to a canvas element that will return the x and y coordinates of the click (relative to the canvas element)? No legacy browser compatibility required, Safari, Opera and Firefox will do.
javascript
canvas
null
null
null
null
open
How do I get the coordinates of a mouse click on a canvas element? === What's the simplest way to add a click event handler to a canvas element that will return the x and y coordinates of the click (relative to the canvas element)? No legacy browser compatibility required, Safari, Opera and Firefox will do.
0
55,692
09/11/2008 02:26:45
3,340
08/28/2008 02:03:37
40
6
.NET namespaces
My background is primarily as a Java Developer, but lately I have been doing some work in .NET. So I have been trying to do some simple projects at home to get better at working with .NET. I have been able to transfer much of my Java experience into working with .NET (specifically C#), but the only thing that has really perplexed me is namespaces. I know namespaces are similar to Java packages, but as from what I can tell the main difference is that with Java packages they use actual file folders to show the seperation, while in .NET it does not and all the files reside in a single folder and the namespace is simply declared in each class. I find this odd, because I always saw packages as a way to organize and group related code, making it easier to navigate and comprehend. Since in .NET it does not work this work this way, overtime, the project appears more overcrowded and not as easy to navigate. Am I missing something here? I have to be. Should I be breaking things into separate projects within the solution? Or is there a better way to keep the classes and files organized within a project?
.net
organizing
null
null
null
null
open
.NET namespaces === My background is primarily as a Java Developer, but lately I have been doing some work in .NET. So I have been trying to do some simple projects at home to get better at working with .NET. I have been able to transfer much of my Java experience into working with .NET (specifically C#), but the only thing that has really perplexed me is namespaces. I know namespaces are similar to Java packages, but as from what I can tell the main difference is that with Java packages they use actual file folders to show the seperation, while in .NET it does not and all the files reside in a single folder and the namespace is simply declared in each class. I find this odd, because I always saw packages as a way to organize and group related code, making it easier to navigate and comprehend. Since in .NET it does not work this work this way, overtime, the project appears more overcrowded and not as easy to navigate. Am I missing something here? I have to be. Should I be breaking things into separate projects within the solution? Or is there a better way to keep the classes and files organized within a project?
0
55,693
09/11/2008 02:29:25
4,792
09/05/2008 16:08:18
11
3
How do you use FogBugz with an Agile methodology?
"Evidence-based scheduling" in FogBugz is interesting, but how do I use it w/ an Agile methodology?
agile
fogbugz
schedule
null
null
null
open
How do you use FogBugz with an Agile methodology? === "Evidence-based scheduling" in FogBugz is interesting, but how do I use it w/ an Agile methodology?
0
55,709
09/11/2008 02:40:12
4,974
09/07/2008 05:48:06
1
0
Streaming large files in a java servlet
I am building a java server that needs to scale. One of the servlets will be serving images stored in Amazon S3. Recently under load, I ran out of memory in my VM and it was after I added the code to serve the images so I'm pretty sure that streaming larger servlet responses is causing my troubles. My question is : is there any best practice in how to code a java servlet to stream a large (>200k) response back to a browser when read from a database or other cloud storage? I've considered writing the file to a local temp drive and then spawning another thread to handle the streaming so that the tomcat servlet thread can be re-used. This seems like it would be io heavy. Any thoughts would be appreciated. Thanks.
java
java-io
null
null
null
null
open
Streaming large files in a java servlet === I am building a java server that needs to scale. One of the servlets will be serving images stored in Amazon S3. Recently under load, I ran out of memory in my VM and it was after I added the code to serve the images so I'm pretty sure that streaming larger servlet responses is causing my troubles. My question is : is there any best practice in how to code a java servlet to stream a large (>200k) response back to a browser when read from a database or other cloud storage? I've considered writing the file to a local temp drive and then spawning another thread to handle the streaming so that the tomcat servlet thread can be re-used. This seems like it would be io heavy. Any thoughts would be appreciated. Thanks.
0
55,711
09/11/2008 02:40:50
3,764
08/30/2008 16:14:55
33
2
Options for distribution of an offline Ruby on Rails application
I am developing an application in using Ruby on Rails, mostly as an excuse to learn the language. This is not intended to be a web-based application - and perhaps I have chosen the wrong language, but... My understanding is, that in order to run an instance of this application on somebody else's computer, they would need to install ruby on rails, and a webserver (or webrick, perhaps), as well as my application code. I am just curious if there are any other options for distributing my application as a standalone app, or perhaps just a simple way to package up a web browser and ROR together with my app for a simple, one-step install?
ruby
ruby-on-rails
desktop-application
software-distribution
offline
null
open
Options for distribution of an offline Ruby on Rails application === I am developing an application in using Ruby on Rails, mostly as an excuse to learn the language. This is not intended to be a web-based application - and perhaps I have chosen the wrong language, but... My understanding is, that in order to run an instance of this application on somebody else's computer, they would need to install ruby on rails, and a webserver (or webrick, perhaps), as well as my application code. I am just curious if there are any other options for distributing my application as a standalone app, or perhaps just a simple way to package up a web browser and ROR together with my app for a simple, one-step install?
0
55,713
09/11/2008 02:42:09
5,056
09/07/2008 15:43:17
560
49
PHP: How do I check if all public methods of two classes return the same values?
In effect, if I have a class c and instances of $c1 and $c2 which might have different private variable amounts but all their public methods return the same values I would like to be able to check that $c1 == $c2? Does anyone know an easy way to do this?
php
oop
null
null
null
null
open
PHP: How do I check if all public methods of two classes return the same values? === In effect, if I have a class c and instances of $c1 and $c2 which might have different private variable amounts but all their public methods return the same values I would like to be able to check that $c1 == $c2? Does anyone know an easy way to do this?
0
55,720
09/11/2008 02:47:49
3,983
09/01/2008 07:09:13
1
0
Find out where your PHP code is slowing down (Performance Issue)
Here's my first question at SO. I have a internal application for my company which I've been recently ask to maintain. The applications is built in PHP and its fairly well coded (OO, DB Abstraction, Smarty) nothing WTF-ish. The problem is the applications is **very slow**. How do I go about finding out what's slowing the application down? I've optimized the code to make very few DB queries, so I know that it is the PHP code which is taking a while to execute. I need to get some tools which can help me with this and need to devise a strategy for checking my code. I can do the checking/strategy work myself, but I need more PHP tools to figure out where my app is crapping up. Thoughts?
php
mysql
performance
null
null
null
open
Find out where your PHP code is slowing down (Performance Issue) === Here's my first question at SO. I have a internal application for my company which I've been recently ask to maintain. The applications is built in PHP and its fairly well coded (OO, DB Abstraction, Smarty) nothing WTF-ish. The problem is the applications is **very slow**. How do I go about finding out what's slowing the application down? I've optimized the code to make very few DB queries, so I know that it is the PHP code which is taking a while to execute. I need to get some tools which can help me with this and need to devise a strategy for checking my code. I can do the checking/strategy work myself, but I need more PHP tools to figure out where my app is crapping up. Thoughts?
0
55,729
09/11/2008 02:59:13
4,883
09/06/2008 10:24:59
625
5
How often should you use git-gc?
How often should you use git-gc? The [manual page](http://www.kernel.org/pub/software/scm/git/docs/git-gc.html) simply says: >Users are encouraged to run this task on a regular basis within each repository to maintain good disk space utilization and good operating performance. Are there some commands to get some object counts to find out whether it's time to gc?
git
null
null
null
null
null
open
How often should you use git-gc? === How often should you use git-gc? The [manual page](http://www.kernel.org/pub/software/scm/git/docs/git-gc.html) simply says: >Users are encouraged to run this task on a regular basis within each repository to maintain good disk space utilization and good operating performance. Are there some commands to get some object counts to find out whether it's time to gc?
0
55,735
09/11/2008 03:05:48
2,925
08/26/2008 03:06:46
259
14
How Do I detect Text and Cursor position changes in Word using VSTO
I want to write a word addin that does some computations and updates some ui whenever the user types something or moves the current insertion point. From looking at the MSDN docs, I don't see any obvious way such as an TextTyped event on the document or application objects. Does anyone know if this is possible without polling the document?
vsto
office
null
null
null
null
open
How Do I detect Text and Cursor position changes in Word using VSTO === I want to write a word addin that does some computations and updates some ui whenever the user types something or moves the current insertion point. From looking at the MSDN docs, I don't see any obvious way such as an TextTyped event on the document or application objects. Does anyone know if this is possible without polling the document?
0
55,752
09/11/2008 03:23:30
4,888
09/06/2008 11:28:10
8
5
What is the best way to cache a menu system locally, in the browser?
I have a very large cascading menu system with over 300 items in it. (I know it's large but it's a requirement.) Currently, it's written in javascript so the external file is cache by browsers. To improve search engine results I need to convert this to a css menu system. I realize the browsers will also cache external stylesheets but is there a way to cache the menu content (`<ul>` and `<li>` tags)? If I use javascript (document.write) to write the content I could have this in an external javascript file, which would be cached locally, but would this be search engine friendly? What is the best solution?
css
menu
null
null
null
null
open
What is the best way to cache a menu system locally, in the browser? === I have a very large cascading menu system with over 300 items in it. (I know it's large but it's a requirement.) Currently, it's written in javascript so the external file is cache by browsers. To improve search engine results I need to convert this to a css menu system. I realize the browsers will also cache external stylesheets but is there a way to cache the menu content (`<ul>` and `<li>` tags)? If I use javascript (document.write) to write the content I could have this in an external javascript file, which would be cached locally, but would this be search engine friendly? What is the best solution?
0
55,753
09/11/2008 03:25:26
1,682
08/18/2008 00:10:52
1
2
Creating Custom Performance Counters in Visual C++
Does anybody know of a method for creating custom Performance Counters using ordinary unmanaged Visual C++? I know that it can be done easily using managed C++, but I need to do it using an unmanaged Windows service. I also know that you can retrieve performance counter data, but I need to create some custom counters and increment them during the applications runtime.
performance
counters
null
null
null
null
open
Creating Custom Performance Counters in Visual C++ === Does anybody know of a method for creating custom Performance Counters using ordinary unmanaged Visual C++? I know that it can be done easily using managed C++, but I need to do it using an unmanaged Windows service. I also know that you can retrieve performance counter data, but I need to create some custom counters and increment them during the applications runtime.
0
55,754
09/11/2008 03:25:41
3,020
08/26/2008 12:20:35
1
0
Bash script to pack file names
What is the best way, using Bash, to rename files in the form: (foo1, foo2, ..., foo1300, ..., fooN) With zero packed file names: (foo00001, foo00002, ..., foo01300, ..., fooN)
bash
rename
null
null
null
null
open
Bash script to pack file names === What is the best way, using Bash, to rename files in the form: (foo1, foo2, ..., foo1300, ..., fooN) With zero packed file names: (foo00001, foo00002, ..., foo01300, ..., fooN)
0