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
40,779
09/02/2008 22:02:14
3,799
08/30/2008 22:14:42
8
0
Custom Build Numbering in Visual Studio
I've inherited a .NET application that automatically updates it's version number with each release. The problem, as I see it, is in the verbosity of the version number: currently it is 3.5.3167.26981 which is a mouthful for the users to say when they are reporting bugs. What I would like is something more like this: 3.5 (build 3198) where I would have to manually update the major and minor versions, but the build number updates automatically. Even better, I don't want the build number to increment unless I am compiling in RELEASE mode. Anyone know if there is a way to do this -- and how?
visual-studio
null
null
null
null
null
open
Custom Build Numbering in Visual Studio === I've inherited a .NET application that automatically updates it's version number with each release. The problem, as I see it, is in the verbosity of the version number: currently it is 3.5.3167.26981 which is a mouthful for the users to say when they are reporting bugs. What I would like is something more like this: 3.5 (build 3198) where I would have to manually update the major and minor versions, but the build number updates automatically. Even better, I don't want the build number to increment unless I am compiling in RELEASE mode. Anyone know if there is a way to do this -- and how?
0
40,814
09/02/2008 22:20:02
369
08/05/2008 08:33:43
869
47
How do I execute a large SQL script (with GO commands) from c#?
I need to execute a large set of sql statements (creating a bunch of tables, views and stored procedures) from within a c# program. These statements need to be separated by "GO" statements, but SqlCommand.ExecuteNonQuery() does not like "GO" statements. My solution, which I suppose I'll post for reference, was to split the sql string on "GO" lines, and execute each batch separately. Is there an easier/better way?
c#
mssql
null
null
null
null
open
How do I execute a large SQL script (with GO commands) from c#? === I need to execute a large set of sql statements (creating a bunch of tables, views and stored procedures) from within a c# program. These statements need to be separated by "GO" statements, but SqlCommand.ExecuteNonQuery() does not like "GO" statements. My solution, which I suppose I'll post for reference, was to split the sql string on "GO" lines, and execute each batch separately. Is there an easier/better way?
0
40,816
09/02/2008 22:21:17
230
08/03/2008 19:32:46
480
32
Styling Html Helpers MVC.Net
If i have a html helper like so: Name:<br /> <%=Html.TextBox("txtName",20) %><br /> How do i apply a css class to it? Do i have to wrap it in a span? Or do i need to somehow utilize the HtmlAttributes property of the helper?
css
asp.net-mvc
html-helper
null
null
null
open
Styling Html Helpers MVC.Net === If i have a html helper like so: Name:<br /> <%=Html.TextBox("txtName",20) %><br /> How do i apply a css class to it? Do i have to wrap it in a span? Or do i need to somehow utilize the HtmlAttributes property of the helper?
0
40,821
09/02/2008 22:24:48
4,332
09/02/2008 21:56:33
1
2
SCJP 1.6 Exam
I'm doing my SCJP 1.6 exam in a couple of days. Unfortunately, I only had the Java 1.5 study guide to work with. I know that the additional material includes java.io.Console and the Navigable stuff. Could anyone give me some idea of the kind of questions that might be asked? Also, were there actually many 1.6 specific questions? Given the lack of extra material, I'm guessing it's not much different from the 1.5 exam.
java
scjp
null
null
null
null
open
SCJP 1.6 Exam === I'm doing my SCJP 1.6 exam in a couple of days. Unfortunately, I only had the Java 1.5 study guide to work with. I know that the additional material includes java.io.Console and the Navigable stuff. Could anyone give me some idea of the kind of questions that might be asked? Also, were there actually many 1.6 specific questions? Given the lack of extra material, I'm guessing it's not much different from the 1.5 exam.
0
40,840
09/02/2008 22:34:03
3,114
08/26/2008 18:05:52
500
38
Cannot create an environment variable in the registry
I have a custom installer action that updates the PATH environment, and creates an additional environment variable. Appending a directory to the existing path variable is working fine, but for some reason my attempts to create a new environment variable have been unsuccessful. The code I am using is: using (RegistryKey reg = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\Session Manager\Environment", true)) { reg.SetValue("MYVAR", "SomeVal", RegistryValueKind.ExpandString); }
c#
registry
environment
null
null
null
open
Cannot create an environment variable in the registry === I have a custom installer action that updates the PATH environment, and creates an additional environment variable. Appending a directory to the existing path variable is working fine, but for some reason my attempts to create a new environment variable have been unsuccessful. The code I am using is: using (RegistryKey reg = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\Session Manager\Environment", true)) { reg.SetValue("MYVAR", "SomeVal", RegistryValueKind.ExpandString); }
0
40,845
09/02/2008 22:37:37
2,495
08/22/2008 14:30:23
113
7
how do F# Units of Measurement work
Has anyone had a chance to dig into how [F# Units of Measurement](http://blogs.msdn.com/andrewkennedy/archive/2008/08/20/units-of-measure-in-f-part-one-introducing-units.aspx) work? Is it just type-based chicanery, or are there CLR types hiding underneath that could (potentially) be used from other .net languages? Will it work for any numerical unit, or is it limited to floating point values (which is what all the examples use)?
.net
f#
null
null
null
null
open
how do F# Units of Measurement work === Has anyone had a chance to dig into how [F# Units of Measurement](http://blogs.msdn.com/andrewkennedy/archive/2008/08/20/units-of-measure-in-f-part-one-introducing-units.aspx) work? Is it just type-based chicanery, or are there CLR types hiding underneath that could (potentially) be used from other .net languages? Will it work for any numerical unit, or is it limited to floating point values (which is what all the examples use)?
0
40,853
09/02/2008 22:43:39
4,337
09/02/2008 22:43:39
1
0
How to store passwords in Winforms application?
I have some code like this in a winforms app I was writing to query a user's mail box Storage Quota. DirectoryEntry mbstore = new DirectoryEntry(@"LDAP://" + strhome, m_serviceaccount, **m_pwd**, AuthenticationTypes.Secure); No matter what approach I tried (like SecureString), I am easily able to see the password (m_pwd) either using Reflector or using strings tab of Process Explorer for the executable. I know I could put this code on the server or tighten up the security using mechanisms like delegation and giving only the required privileges to the service account. Can somebody suggest a reasonably secure way to store the password in the local application without revealing the password to hackers? Hashing is not possible since I need to know the exact password (not just the hash for matching purpose). Encryption/Decryption mechanisms are not working since they are machine dependent. Not sure if Obfuscation will work.
winforms
passwords
hacking
security
null
null
open
How to store passwords in Winforms application? === I have some code like this in a winforms app I was writing to query a user's mail box Storage Quota. DirectoryEntry mbstore = new DirectoryEntry(@"LDAP://" + strhome, m_serviceaccount, **m_pwd**, AuthenticationTypes.Secure); No matter what approach I tried (like SecureString), I am easily able to see the password (m_pwd) either using Reflector or using strings tab of Process Explorer for the executable. I know I could put this code on the server or tighten up the security using mechanisms like delegation and giving only the required privileges to the service account. Can somebody suggest a reasonably secure way to store the password in the local application without revealing the password to hackers? Hashing is not possible since I need to know the exact password (not just the hash for matching purpose). Encryption/Decryption mechanisms are not working since they are machine dependent. Not sure if Obfuscation will work.
0
40,859
09/02/2008 22:49:26
4,263
09/02/2008 14:57:19
1
1
IDE for use on a Java-enabled smart phone?
Is there an IDE that I can load on a Blackberry, E71, or an iPhone?
ide
null
null
null
null
null
open
IDE for use on a Java-enabled smart phone? === Is there an IDE that I can load on a Blackberry, E71, or an iPhone?
0
40,863
09/02/2008 22:56:14
3,717
08/30/2008 09:44:24
260
14
Business Application UI Design
Basically I'm going to go a bit broad here and ask a few questions to get a bit of a picture of how people are handling UI these days. Lately I've found it pretty easy to do some fancy things with UI design and with WPF specifically we're finding new ways to do layouts that are better looking and more functional for the user, but in contrast one of the business focused guys at our local .NET User Group wouldn't even think of using WPF until it had a datagrid that he could use to make Excel like input forms. 1. So basically, have you rethought the design of your business apps as you move to Web/WPF/Silverlight designs, because for us at least - in winforms we kept things fairly functional and uniform, or are you trying to keep that "known" UI? 2. Would a dedicated design guy (for larger teams), or a dev with more design chops rank higher when looking at hiring these days? (Check out what a designer did for [Scott Hanselman's BabySmash][1] and [Microsoft's Prism demo][2]) 3. Are there any design hints/tips/guidelines you use for your UI - especially for WPF? 4. What sites would you recommend for design? [1]: http://www.hanselman.com/blog/LearningWPFWithBabySmashManuallyManagingClickOnceAndSomeMoreDesignerGoodness.aspx [2]: http://codebetter.com/blogs/glenn.block/archive/2008/05/08/wpf-from-this-to-that-wow.aspx
wpf
design
user-interface
null
null
null
open
Business Application UI Design === Basically I'm going to go a bit broad here and ask a few questions to get a bit of a picture of how people are handling UI these days. Lately I've found it pretty easy to do some fancy things with UI design and with WPF specifically we're finding new ways to do layouts that are better looking and more functional for the user, but in contrast one of the business focused guys at our local .NET User Group wouldn't even think of using WPF until it had a datagrid that he could use to make Excel like input forms. 1. So basically, have you rethought the design of your business apps as you move to Web/WPF/Silverlight designs, because for us at least - in winforms we kept things fairly functional and uniform, or are you trying to keep that "known" UI? 2. Would a dedicated design guy (for larger teams), or a dev with more design chops rank higher when looking at hiring these days? (Check out what a designer did for [Scott Hanselman's BabySmash][1] and [Microsoft's Prism demo][2]) 3. Are there any design hints/tips/guidelines you use for your UI - especially for WPF? 4. What sites would you recommend for design? [1]: http://www.hanselman.com/blog/LearningWPFWithBabySmashManuallyManagingClickOnceAndSomeMoreDesignerGoodness.aspx [2]: http://codebetter.com/blogs/glenn.block/archive/2008/05/08/wpf-from-this-to-that-wow.aspx
0
40,870
09/02/2008 23:00:09
572
08/06/2008 20:56:54
2,632
205
Why don't people use PHP for desktop applications?
Other scripting languages popular on the web, such as Python and Ruby, are used in desktop applications. However, I've rarely (if ever) seen a PHP application designed to be deployed on a desktop. Why is this? What about PHP is holding it back from this, or what about these other languages make them popular for the dual use?
php
desktop-application
scripting-language
null
null
null
open
Why don't people use PHP for desktop applications? === Other scripting languages popular on the web, such as Python and Ruby, are used in desktop applications. However, I've rarely (if ever) seen a PHP application designed to be deployed on a desktop. Why is this? What about PHP is holding it back from this, or what about these other languages make them popular for the dual use?
0
40,873
09/02/2008 23:01:32
234
08/03/2008 20:25:38
3,298
206
Searching for phone numbers in mysql
I have a table which is full of arbitratily formatted phone numbers, like this 027 123 5644 021 393-5593 (07) 123 456 042123456 I need to search for a phone number in a similiarly arbitrary format ( eg `07123456` should find the entry `(07) 123 456` The way I'd do this in a normal programming language is to strip all the non-digit characters out of the 'needle', then go through each number in the haystack, strip all non-digit characters out of it, then compare against the needle, eg (in ruby) digits_only = lambda{ |n| n.gsub /[^\d]/, '' } needle = digits_only[input_phone_number] haystack.map(&digits_only).include?(needle) The catch is, I need to do this in MySQL. It has a host of string functions, none of which really seem to do what I want. Currently I can think of 2 'solutions' * Hack together a franken-query of `CONCAT` and `SUBSTR` * Insert a `%` between every character of the needle ( so it's like this: `%0%7%1%2%3%4%5%6%` ) However, neither of these seem like particularly elegant solutions. Hopefully someone can help or I might be forcced to use the %%%%%% solution
mysql
string
search
numbers
null
null
open
Searching for phone numbers in mysql === I have a table which is full of arbitratily formatted phone numbers, like this 027 123 5644 021 393-5593 (07) 123 456 042123456 I need to search for a phone number in a similiarly arbitrary format ( eg `07123456` should find the entry `(07) 123 456` The way I'd do this in a normal programming language is to strip all the non-digit characters out of the 'needle', then go through each number in the haystack, strip all non-digit characters out of it, then compare against the needle, eg (in ruby) digits_only = lambda{ |n| n.gsub /[^\d]/, '' } needle = digits_only[input_phone_number] haystack.map(&digits_only).include?(needle) The catch is, I need to do this in MySQL. It has a host of string functions, none of which really seem to do what I want. Currently I can think of 2 'solutions' * Hack together a franken-query of `CONCAT` and `SUBSTR` * Insert a `%` between every character of the needle ( so it's like this: `%0%7%1%2%3%4%5%6%` ) However, neither of these seem like particularly elegant solutions. Hopefully someone can help or I might be forcced to use the %%%%%% solution
0
40,884
09/02/2008 23:08:54
777
08/08/2008 19:35:20
43
6
vb.net object persisted in database
How can I go about storing a vb.net user defined object in a sql database. I am not trying to replicate the properties with columns. I mean something along the lines of converting or encoding my object to a byte array and then storing that in a field in the db. Like when you store an instance of an object in session, but I need the info to persist past the current session.
vb.net
sql
null
null
null
null
open
vb.net object persisted in database === How can I go about storing a vb.net user defined object in a sql database. I am not trying to replicate the properties with columns. I mean something along the lines of converting or encoding my object to a byte array and then storing that in a field in the db. Like when you store an instance of an object in session, but I need the info to persist past the current session.
0
40,902
09/02/2008 23:18:41
981
08/11/2008 12:08:30
1
1
Looking for MySQL IDE?
I've recently been tasked with developing a web application that will use a MySQL database on the back end. I for most of my career I have worked with MS-SQL Manager. My greatest weakness is in defining foreign key constraints I usually use MS-SQL Manager's diagramming tool to draw my relationship lines between tables.
mysql
ide
management
null
null
null
open
Looking for MySQL IDE? === I've recently been tasked with developing a web application that will use a MySQL database on the back end. I for most of my career I have worked with MS-SQL Manager. My greatest weakness is in defining foreign key constraints I usually use MS-SQL Manager's diagramming tool to draw my relationship lines between tables.
0
40,907
09/02/2008 23:22:39
4,263
09/02/2008 14:57:19
6
1
Does anyone know of a web based IDE?
Does anyone know of a web based IDE (Like VS, Eclipse, IDEA)? Besides [ECCO][1]? [1]: http://ecco.sourceforge.net/
web-ide
null
null
null
null
null
open
Does anyone know of a web based IDE? === Does anyone know of a web based IDE (Like VS, Eclipse, IDEA)? Besides [ECCO][1]? [1]: http://ecco.sourceforge.net/
0
40,912
09/02/2008 23:27:23
4,191
09/02/2008 09:25:59
1
1
How to check if page is postback within reserved function pageLoad on asp.net ajax
I'm looking for a way to check within pageLoad() if this method is raised during load event because of a postback/async postback or because of being loaded and access the first time. This is similar to Page.IsPostback property within code behind page. TIA, Ricky
asp.net
javascript
ajax
postback
lifecycle
null
open
How to check if page is postback within reserved function pageLoad on asp.net ajax === I'm looking for a way to check within pageLoad() if this method is raised during load event because of a postback/async postback or because of being loaded and access the first time. This is similar to Page.IsPostback property within code behind page. TIA, Ricky
0
40,913
09/02/2008 23:28:59
1,638
08/17/2008 17:58:57
386
46
How do I loop through result objects in Flex?
I am having problems manually looping through xml data that is received via an HTTPService call, the xml looks something like this: <pre> <code> &lt;DataTable&gt; &lt;Row&gt; &lt;text&gt;foo&lt;/text&gt; &lt;/Row&gt; &lt;Row&gt; &lt;text&gt;bar&lt;/text&gt; &lt;/Row&gt; &lt;/DataTable&gt; </code> </pre> When the webservie result event is fired I do something like this: <pre> <code> for(var i:int=0;i&lt;event.result.DataTable.Row.length;i++) { if(event.result.DataTable.Row[i].text == "foo") mx.controls.Alert.show('foo found!'); } </code> </pre> This code works then there is more then 1 "Row" nodes returned, however it seems that if there is only one "Row" node then the event.DataTable.Row object is not an error and the code subsequently breaks. What is the proper way to loop through the HTTPService result object? Do I need to convert it to some type of XMLList collection or an ArrayCollection? I have tried setting the resultFormat to "e4x" and that has yet to fix the problem... Thanks
flex
actionscript-3
actionscript
null
null
null
open
How do I loop through result objects in Flex? === I am having problems manually looping through xml data that is received via an HTTPService call, the xml looks something like this: <pre> <code> &lt;DataTable&gt; &lt;Row&gt; &lt;text&gt;foo&lt;/text&gt; &lt;/Row&gt; &lt;Row&gt; &lt;text&gt;bar&lt;/text&gt; &lt;/Row&gt; &lt;/DataTable&gt; </code> </pre> When the webservie result event is fired I do something like this: <pre> <code> for(var i:int=0;i&lt;event.result.DataTable.Row.length;i++) { if(event.result.DataTable.Row[i].text == "foo") mx.controls.Alert.show('foo found!'); } </code> </pre> This code works then there is more then 1 "Row" nodes returned, however it seems that if there is only one "Row" node then the event.DataTable.Row object is not an error and the code subsequently breaks. What is the proper way to loop through the HTTPService result object? Do I need to convert it to some type of XMLList collection or an ArrayCollection? I have tried setting the resultFormat to "e4x" and that has yet to fix the problem... Thanks
0
40,935
09/02/2008 23:53:10
4,495
09/04/2008 07:45:31
1
0
VB6 NegotiateMenus
I have a vb6 form that I've put an ocx control on. Setting NegotiateMenus on the form displays the ocx's control (which is what I want). I then add my own control to the form. When that control has focus, the menu from the ocx disappears. How can I always keep the menu from the ocx displayed, regardless of who has focus?
vb6
null
null
null
null
null
open
VB6 NegotiateMenus === I have a vb6 form that I've put an ocx control on. Setting NegotiateMenus on the form displays the ocx's control (which is what I want). I then add my own control to the form. When that control has focus, the menu from the ocx disappears. How can I always keep the menu from the ocx displayed, regardless of who has focus?
0
40,939
09/02/2008 23:58:37
2,555
08/22/2008 20:27:46
179
6
Best Screencasting Program For Windows That Has An API
Looking for a screencasting program with an api. Free or open source is not a requirement, but is a plus. I've been writing software that will automate screencasts, but I need to find a decent screencasting app that will be easily available. Something like iShowU for windows.
api
screencasts
null
null
null
null
open
Best Screencasting Program For Windows That Has An API === Looking for a screencasting program with an api. Free or open source is not a requirement, but is a plus. I've been writing software that will automate screencasts, but I need to find a decent screencasting app that will be easily available. Something like iShowU for windows.
0
40,943
09/03/2008 00:02:42
277
08/04/2008 10:55:22
391
14
How to Automatically Start a Download in PHP?
What code do you need to add in PHP to automatically have the browser download a file to the local machine when a link is visited? I am specifically thinking of functionality similar to that of download sites that prompt the user to save a file to disk once you click on the name of the software?
php
automation
download
null
null
null
open
How to Automatically Start a Download in PHP? === What code do you need to add in PHP to automatically have the browser download a file to the local machine when a link is visited? I am specifically thinking of functionality similar to that of download sites that prompt the user to save a file to disk once you click on the name of the software?
0
40,957
09/03/2008 00:19:51
4,160
09/02/2008 07:15:12
71
1
Keeping development databases in multiple environments in sync
I'm early in development on a web application built in VS2008. I have both a desktop PC (where most of the work gets done) and a laptop (for occasional portability) on which I use AnkhSVN to keep the project code synced. What's the best way to keep my development database (SQL Server Express) synced up as well? I have a VS database project in SVN containing create scripts which I re-generate when the schema changes. The original idea was to recreate the DB whenever something changed, but it's quickly becoming a pain. Also, I'd lose all the sample rows I entered to make sure data is being displayed properly. I'm considering putting the .MDF and .LDF files under source control, but I doubt SQL Server Express will handle it gracefully if I do an SVN Update and the files get yanked out from under it, replaced with newer copies. Sticking a couple big binary files into source control doesn't seem like an elegant solution either, even if it is just a throwaway development database. Any suggestions?
database
svn
vs2008
version-control
null
null
open
Keeping development databases in multiple environments in sync === I'm early in development on a web application built in VS2008. I have both a desktop PC (where most of the work gets done) and a laptop (for occasional portability) on which I use AnkhSVN to keep the project code synced. What's the best way to keep my development database (SQL Server Express) synced up as well? I have a VS database project in SVN containing create scripts which I re-generate when the schema changes. The original idea was to recreate the DB whenever something changed, but it's quickly becoming a pain. Also, I'd lose all the sample rows I entered to make sure data is being displayed properly. I'm considering putting the .MDF and .LDF files under source control, but I doubt SQL Server Express will handle it gracefully if I do an SVN Update and the files get yanked out from under it, replaced with newer copies. Sticking a couple big binary files into source control doesn't seem like an elegant solution either, even if it is just a throwaway development database. Any suggestions?
0
40,962
09/03/2008 00:27:29
2,062
08/20/2008 03:30:36
1
1
How do I close a parent Form from child form in Windows Forms 2.0?
I have a need to close a parent form from within child form from a Windows application. What would be the best way to do this?
c#
winforms
null
null
null
null
open
How do I close a parent Form from child form in Windows Forms 2.0? === I have a need to close a parent form from within child form from a Windows application. What would be the best way to do this?
0
40,966
09/03/2008 00:32:40
122
08/02/2008 07:56:07
3,340
158
Should I use window.onload or script block?
I have a javascript function that manipulates the DOM when it is called (adds CSS classes, etc). This is invoked when the user changes some values in a form. When the document is first loading, I want to invoke this function to prepare the initial state (which is simpler in this case than setting up the DOM from the server side to the correct initial state). Is it better to use window.onload to do this functionality or have a script block after the DOM elements I need to modify? For either case, why is it better? For example: function updateDOM(id) { // updates the id element based on form state } should I invoke it via: window.onload = function() { updateDOM("myElement"); }; or: <div id="myElement">...</div> <script language="javascript"> updateDOM("myElement"); </script> The former seems to be the standard way to do it, but the latter seems to be just as good, perhaps better since it will update the element as soon as the script is hit, and as long as it is placed after the element, I don't see a problem with it. Any thoughts? Is one version really better than the other?
javascript
dom
null
null
null
null
open
Should I use window.onload or script block? === I have a javascript function that manipulates the DOM when it is called (adds CSS classes, etc). This is invoked when the user changes some values in a form. When the document is first loading, I want to invoke this function to prepare the initial state (which is simpler in this case than setting up the DOM from the server side to the correct initial state). Is it better to use window.onload to do this functionality or have a script block after the DOM elements I need to modify? For either case, why is it better? For example: function updateDOM(id) { // updates the id element based on form state } should I invoke it via: window.onload = function() { updateDOM("myElement"); }; or: <div id="myElement">...</div> <script language="javascript"> updateDOM("myElement"); </script> The former seems to be the standard way to do it, but the latter seems to be just as good, perhaps better since it will update the element as soon as the script is hit, and as long as it is placed after the element, I don't see a problem with it. Any thoughts? Is one version really better than the other?
0
40,969
09/03/2008 00:35:11
4,269
09/02/2008 15:26:27
31
2
Linked in API
Do you know if it's possible to build an application for the Linked In platform? Thanks
linked-in
social-media
null
null
null
null
open
Linked in API === Do you know if it's possible to build an application for the Linked In platform? Thanks
0
40,994
09/03/2008 01:09:04
1,782
08/18/2008 14:30:58
1,155
85
Is Google Chrome's V8 engine really that good?
Did anyone have time to take a look at it? I've read a bit and it promises a lot, if it's half what they say, it'll change web programming a lot
google-chrome
v8
javascript
null
null
null
open
Is Google Chrome's V8 engine really that good? === Did anyone have time to take a look at it? I've read a bit and it promises a lot, if it's half what they say, it'll change web programming a lot
0
40,999
09/03/2008 01:10:45
2,916
08/25/2008 23:34:09
21
2
How to Convert a StreamReader into an XMLReader object in .Net 2.0/C#
Here's a quick question I've been banging my head against today. I'm trying to convert a .Net dataset into an XML stream, transform it with an xsl file in memory, then output the result to a new XML file. Here's my current code: BufferedStream stream = new BufferedStream(new MemoryStream()); DataSet ds = new DataSet(); da.Fill(ds); ds.WriteXml(stream); StreamReader sr = new StreamReader(stream, true); stream.Position = 0; XmlReader reader = XmlReader.Create(sr, null); XslCompiledTransform transformer = new XslCompiledTransform(); transformer.Load(@"<path to xsl file>"); transformer.Transform(reader, null, writer); For some reason in the transformer.Transform method, the reader has no root node, in fact the reader isn't reading anything from the StreamReader. My questions is what is wrong with this code? Secondarily, is there a better way to convert/transform/store a dataset into XML?
xml
c#
.net
xslt
stream
null
open
How to Convert a StreamReader into an XMLReader object in .Net 2.0/C# === Here's a quick question I've been banging my head against today. I'm trying to convert a .Net dataset into an XML stream, transform it with an xsl file in memory, then output the result to a new XML file. Here's my current code: BufferedStream stream = new BufferedStream(new MemoryStream()); DataSet ds = new DataSet(); da.Fill(ds); ds.WriteXml(stream); StreamReader sr = new StreamReader(stream, true); stream.Position = 0; XmlReader reader = XmlReader.Create(sr, null); XslCompiledTransform transformer = new XslCompiledTransform(); transformer.Load(@"<path to xsl file>"); transformer.Transform(reader, null, writer); For some reason in the transformer.Transform method, the reader has no root node, in fact the reader isn't reading anything from the StreamReader. My questions is what is wrong with this code? Secondarily, is there a better way to convert/transform/store a dataset into XML?
0
41,009
09/03/2008 01:16:07
194
08/03/2008 10:56:49
2,087
144
IRAPIStream COM Interface in .NET
I'm trying to use the OpenNETCF RAPI class to interact with a windows mobile device using the RAPI.Invoke() method. According to the following article: <http://blog.opennetcf.com/ncowburn/2007/07/27/HOWTORetrieveTheDeviceIDFromTheDesktop.aspx> You can do the communication in either block or stream mode. I have used block mode before, but now I need to do something a bit more complicated with a lot more data and continuous communication and therefore need to use the stream mode. Unfortunately on that article, *and basically everywhere else*, there is no explaination of how to use IRAPIStream in .NET I have found C/C++ documentation, but my desktop app needs to be written in C# Does anyone know how to properly implement the IRAPIStream COM interface in .NET? And better yet, anyone actually used RAPI.Invoke() with IRAPIStream before? Examples would be much appreciated.
rapi
compactframework
.net
c#
windows-mobile
null
open
IRAPIStream COM Interface in .NET === I'm trying to use the OpenNETCF RAPI class to interact with a windows mobile device using the RAPI.Invoke() method. According to the following article: <http://blog.opennetcf.com/ncowburn/2007/07/27/HOWTORetrieveTheDeviceIDFromTheDesktop.aspx> You can do the communication in either block or stream mode. I have used block mode before, but now I need to do something a bit more complicated with a lot more data and continuous communication and therefore need to use the stream mode. Unfortunately on that article, *and basically everywhere else*, there is no explaination of how to use IRAPIStream in .NET I have found C/C++ documentation, but my desktop app needs to be written in C# Does anyone know how to properly implement the IRAPIStream COM interface in .NET? And better yet, anyone actually used RAPI.Invoke() with IRAPIStream before? Examples would be much appreciated.
0
41,010
09/03/2008 01:18:45
2,976
08/26/2008 09:42:25
441
34
Smarty integration into the Code Igniter framework.
A little background: I've been looking at a few php framework recently and it came down to 2 framework. The zend framework or Code Igniter. I prefer CI because if it's simple design. It's very barebone and just kept it simple. But the thing I didn't like is the weak template system. The template system is important for me because I will be working with another designer being able to give him a good template system is a big plus. Zend was the second choice because of a better template system builtin. But zend is a different beast from CI. It emphasis 'loose coupling between modules' but It is a bigger framework and I don't like to feel like i have all things things under the hood that I never use. Those are unecessary overhead in my opinion. So I thought about putting a template system into CI, namely smarty. So, my question is: How easy/hard is the process. From my initial scan of the CI documentation I can see that the layout of the framework is easy enough to understand and I anticipate no problems. But I want to know if anyone of you used it before and therefore are aware of any gotchas that I don't know that is going this hard/impossible. I also want to know if this is a good thing to do at all. Is the template system in CI enough for normal use?(which I doubt, it is very limited, you have to escape into php to do pretty much everything) Is there any other template module that is good for CI? Or am I better off with Zend Framework? In short, is any wheel being invented here?
php
frameworks
zend-framework
code-igniter
null
null
open
Smarty integration into the Code Igniter framework. === A little background: I've been looking at a few php framework recently and it came down to 2 framework. The zend framework or Code Igniter. I prefer CI because if it's simple design. It's very barebone and just kept it simple. But the thing I didn't like is the weak template system. The template system is important for me because I will be working with another designer being able to give him a good template system is a big plus. Zend was the second choice because of a better template system builtin. But zend is a different beast from CI. It emphasis 'loose coupling between modules' but It is a bigger framework and I don't like to feel like i have all things things under the hood that I never use. Those are unecessary overhead in my opinion. So I thought about putting a template system into CI, namely smarty. So, my question is: How easy/hard is the process. From my initial scan of the CI documentation I can see that the layout of the framework is easy enough to understand and I anticipate no problems. But I want to know if anyone of you used it before and therefore are aware of any gotchas that I don't know that is going this hard/impossible. I also want to know if this is a good thing to do at all. Is the template system in CI enough for normal use?(which I doubt, it is very limited, you have to escape into php to do pretty much everything) Is there any other template module that is good for CI? Or am I better off with Zend Framework? In short, is any wheel being invented here?
0
41,018
09/03/2008 01:23:49
2,453
08/22/2008 11:19:34
11
2
How do you access two databases in Grails
Grails makes it very easy to configure datasources for different environments (development, test, production) in its DataSources.groovy file, but there seems to be no facility for configuring multiple datasources in one environment. What to I do if I need to access several databases from the same Grails application?
grails
null
null
null
null
null
open
How do you access two databases in Grails === Grails makes it very easy to configure datasources for different environments (development, test, production) in its DataSources.groovy file, but there seems to be no facility for configuring multiple datasources in one environment. What to I do if I need to access several databases from the same Grails application?
0
41,024
09/03/2008 01:29:50
4,352
09/03/2008 01:22:11
1
0
FXRuby FXFileDialog box default directory
In FXRuby; how do I set the FXFileDialog to be at the home directory when it opens?
fxruby
null
null
null
null
null
open
FXRuby FXFileDialog box default directory === In FXRuby; how do I set the FXFileDialog to be at the home directory when it opens?
0
41,027
09/03/2008 01:33:57
364
08/05/2008 05:33:41
454
25
What's a good bit of JS or JQuery for horizontally scrolling news ticker
I am looking for a little bit of JQuery or JS that allows me to produce a horizontally scrolling "news ticker" list. The produced HTML needs to be standards compliant as well. I have tried [LiScroll][1] but this has a habit of breaking (some content ends up on a second line at the start of the scroll), especially with longer lists. I have also tried [this News Ticker][2] but when a DOCTYPE is included the scrolling will jolt rather than cycle smoothly at the end of each cycle. Any suggestsions are appreciated. [1]: http://www.gcmingati.net/wordpress/wp-content/lab/jquery/newsticker/jq-liscroll/scrollanimate.html [2]: http://www.mioplanet.com/rsc/newsticker_javascript.htm
js
jquery
scroll
null
null
null
open
What's a good bit of JS or JQuery for horizontally scrolling news ticker === I am looking for a little bit of JQuery or JS that allows me to produce a horizontally scrolling "news ticker" list. The produced HTML needs to be standards compliant as well. I have tried [LiScroll][1] but this has a habit of breaking (some content ends up on a second line at the start of the scroll), especially with longer lists. I have also tried [this News Ticker][2] but when a DOCTYPE is included the scrolling will jolt rather than cycle smoothly at the end of each cycle. Any suggestsions are appreciated. [1]: http://www.gcmingati.net/wordpress/wp-content/lab/jquery/newsticker/jq-liscroll/scrollanimate.html [2]: http://www.mioplanet.com/rsc/newsticker_javascript.htm
0
41,031
09/03/2008 01:39:46
44,972
09/02/2008 10:00:56
-11
0
Recommendations for books/articals/posts about boosting concentration
Mostly while studying CS, or at work.
workspace
study
recommendation
null
null
null
open
Recommendations for books/articals/posts about boosting concentration === Mostly while studying CS, or at work.
0
41,039
09/03/2008 01:49:04
952
08/11/2008 00:37:15
420
22
Find in Files: Search all code in Team Foundation Server
Is there a way to search the latest version of every file in TFS for a specific string or regex? This is probably the only thing I miss from Visual Source Safe... Currently I perform a Get Latest on the entire codebase and use Windows Search, but this gets quite painful with over 1GB of code in 75,000 files.
vs2008
search
tfs
null
null
null
open
Find in Files: Search all code in Team Foundation Server === Is there a way to search the latest version of every file in TFS for a specific string or regex? This is probably the only thing I miss from Visual Source Safe... Currently I perform a Get Latest on the entire codebase and use Windows Search, but this gets quite painful with over 1GB of code in 75,000 files.
0
41,042
09/03/2008 02:01:45
4,354
09/03/2008 01:45:25
1
0
XML dataset in Crystal Reports
I am trying to print a report from within an InfoPath template. So my dataset is an XML DOM that I will load into the Crystal Report at runtime. But how do I define the dataset off which the Crystal Report is developed? Crystal Reports has a great tool to build a dataset from an SQL database. Is there something similar for XML schema that I am missing?
xml
crystal-reports
infopath
null
null
null
open
XML dataset in Crystal Reports === I am trying to print a report from within an InfoPath template. So my dataset is an XML DOM that I will load into the Crystal Report at runtime. But how do I define the dataset off which the Crystal Report is developed? Crystal Reports has a great tool to build a dataset from an SQL database. Is there something similar for XML schema that I am missing?
0
41,045
09/03/2008 02:09:29
2,994
08/26/2008 10:47:23
16
5
Can I have polymorhic containers with value semantics in C++?
As a general rule, I prefer using value rather than pointer semantics in C++ (ie using vector&lt;Class&gt; instead of vector&lt;Class*&gt;). Usually the slight loss in performance is more than made up for by not having to remember to delete dynamically allocated objects. Unfortunately, value collections don't work when you want to store a variety of object types that all derive from a common base. See the example below. #include <iostream> using namespace std; class Parent { public: Parent() : parent_mem(1) {} virtual void write() { cout << "Parent: " << parent_mem << endl; } int parent_mem; }; class Child : public Parent { public: Child() : child_mem(2) { parent_mem = 2; } void write() { cout << "Child: " << parent_mem << ", " << child_mem << endl; } int child_mem; }; int main(int, char**) { // I can have a polymorphic container with pointer semantics vector<Parent*> pointerVec; pointerVec.push_back(new Parent()); pointerVec.push_back(new Child()); pointerVec[0]->write(); pointerVec[1]->write(); // Output: // // Parent: 1 // Child: 2, 2 // But I can't do it with value semantics vector<Parent> valueVec; valueVec.push_back(Parent()); valueVec.push_back(Child()); // gets turned into a Parent object :( valueVec[0].write(); valueVec[1].write(); // Output: // // Parent: 1 // Parent: 2 } My question is: Can I have have my cake (value semantics) and eat it too (polymorphic containers)? Or do I have to use pointers?
c++
stl
null
null
null
null
open
Can I have polymorhic containers with value semantics in C++? === As a general rule, I prefer using value rather than pointer semantics in C++ (ie using vector&lt;Class&gt; instead of vector&lt;Class*&gt;). Usually the slight loss in performance is more than made up for by not having to remember to delete dynamically allocated objects. Unfortunately, value collections don't work when you want to store a variety of object types that all derive from a common base. See the example below. #include <iostream> using namespace std; class Parent { public: Parent() : parent_mem(1) {} virtual void write() { cout << "Parent: " << parent_mem << endl; } int parent_mem; }; class Child : public Parent { public: Child() : child_mem(2) { parent_mem = 2; } void write() { cout << "Child: " << parent_mem << ", " << child_mem << endl; } int child_mem; }; int main(int, char**) { // I can have a polymorphic container with pointer semantics vector<Parent*> pointerVec; pointerVec.push_back(new Parent()); pointerVec.push_back(new Child()); pointerVec[0]->write(); pointerVec[1]->write(); // Output: // // Parent: 1 // Child: 2, 2 // But I can't do it with value semantics vector<Parent> valueVec; valueVec.push_back(Parent()); valueVec.push_back(Child()); // gets turned into a Parent object :( valueVec[0].write(); valueVec[1].write(); // Output: // // Parent: 1 // Parent: 2 } My question is: Can I have have my cake (value semantics) and eat it too (polymorphic containers)? Or do I have to use pointers?
0
41,050
09/03/2008 02:12:34
202
08/03/2008 13:02:31
1,129
52
Where do you store your connectionstring? Should it be cached?
I usually store my connectionstring in web.config or in the application settings of my Visual Studio project. The application I'm currently working on makes a lot of trips to the database which means it will look up the connectionstring every time. Should I be putting the connectionstring in the cache or should I be looking at storing the whole SqlConnection object in the cache to eliminate the need to open and close them all the time?
asp.net
null
null
null
null
null
open
Where do you store your connectionstring? Should it be cached? === I usually store my connectionstring in web.config or in the application settings of my Visual Studio project. The application I'm currently working on makes a lot of trips to the database which means it will look up the connectionstring every time. Should I be putting the connectionstring in the cache or should I be looking at storing the whole SqlConnection object in the cache to eliminate the need to open and close them all the time?
0
41,056
09/03/2008 02:18:15
4,343
09/02/2008 23:19:17
1
1
Best java tools for emacs
I'm a long-time emacs user, and I'm now working about 1/2 time in Java. What are the best emacs libraries for 1. Debugging Java 2. Code Completion/Intellisense 3. Javadoc browsing ?
java
ide
debugging
emacs
javadoc
09/03/2011 23:18:27
not constructive
Best java tools for emacs === I'm a long-time emacs user, and I'm now working about 1/2 time in Java. What are the best emacs libraries for 1. Debugging Java 2. Code Completion/Intellisense 3. Javadoc browsing ?
4
41,073
09/03/2008 02:29:03
4,171
09/02/2008 08:46:59
13
3
.NET Mass Downloader with VS.NET 2005?
After downloading all .NET framework symbols and sources using [NetMassDownloader][1], is it possible to setup the VS.NET 2005 for debugging into .NET 2.0 source files? [1]: http://www.codeplex.com/NetMassDownloader
.net
debugging
null
null
null
null
open
.NET Mass Downloader with VS.NET 2005? === After downloading all .NET framework symbols and sources using [NetMassDownloader][1], is it possible to setup the VS.NET 2005 for debugging into .NET 2.0 source files? [1]: http://www.codeplex.com/NetMassDownloader
0
41,089
09/03/2008 02:39:52
4,495
09/04/2008 07:45:31
1
2
How do I click a button on a vb6 form?
I have a vb6 form with an ocx control on it. The ocx control has a button on it that I want to press from code. How do I do this? I have: Dim b As CommandButton Set b = ocx.GetButton("btnPrint") SendMessage ocx.hwnd, WM_COMMAND, GetWindowLong(b.hwnd, GWL_ID), b.hwnd but it doesn't seem to work.
vb6
null
null
null
null
null
open
How do I click a button on a vb6 form? === I have a vb6 form with an ocx control on it. The ocx control has a button on it that I want to press from code. How do I do this? I have: Dim b As CommandButton Set b = ocx.GetButton("btnPrint") SendMessage ocx.hwnd, WM_COMMAND, GetWindowLong(b.hwnd, GWL_ID), b.hwnd but it doesn't seem to work.
0
41,097
09/03/2008 02:45:08
4,069
09/01/2008 16:22:50
31
9
What are some compact algorithms for generating interesting time series data?
The question sort of says it all. Whether it's for code testing purposes, or you're modeling a real-world process, or you're trying to impress a loved one, what are some algorithms that folks use to generate interesting time series data? Are there any good resources out there with a consolidated list? No constraints on values (except plus or minus infinity), but I'm looking for examples that people have found useful or exciting in practice. Bonus points for parsimonious and readable code samples.
algorithm
language-agnostic
null
null
null
null
open
What are some compact algorithms for generating interesting time series data? === The question sort of says it all. Whether it's for code testing purposes, or you're modeling a real-world process, or you're trying to impress a loved one, what are some algorithms that folks use to generate interesting time series data? Are there any good resources out there with a consolidated list? No constraints on values (except plus or minus infinity), but I'm looking for examples that people have found useful or exciting in practice. Bonus points for parsimonious and readable code samples.
0
41,107
09/03/2008 02:58:43
3,803
08/30/2008 22:59:05
1
0
How to generate a random alpha-numeric string in Java
I've been looking for a **simple** java algorithm to generate a pseudo-random alpha-numeric string. In my situation it would be used as a unique session/key identifier that would "likely" be unique over 500K+ generation (my needs don't really require anything much more sophisticated) . Ideally I would be able to specify a length depending on my uniqueness needs. For example, a generated string of length 12 might look something like "AEYGF7K0DM1X".
java
null
null
null
null
null
open
How to generate a random alpha-numeric string in Java === I've been looking for a **simple** java algorithm to generate a pseudo-random alpha-numeric string. In my situation it would be used as a unique session/key identifier that would "likely" be unique over 500K+ generation (my needs don't really require anything much more sophisticated) . Ideally I would be able to specify a length depending on my uniqueness needs. For example, a generated string of length 12 might look something like "AEYGF7K0DM1X".
0
41,118
09/03/2008 03:10:00
4,356
09/03/2008 02:34:07
1
1
Recommend a build tool for a large legacy Java project.
I am the build manager on a large legacy Java project. It currently uses a combination of ant and nested shell scripts to do building, testing, and packaging. It is fragile and complex and old. We'd like to replace it with a fresh set of scripts and are considering alternatives to ant. Maven 2 sounds interesting. We like the dependency management features, but the directory structure is to rigid for a legacy project and it seems overly difficult to do anything outside of their process. Does anyone have a recommendation for this situation? Or experience in updating the build scripts of a legacy java project?
build-automation
ant
legacy
null
null
null
open
Recommend a build tool for a large legacy Java project. === I am the build manager on a large legacy Java project. It currently uses a combination of ant and nested shell scripts to do building, testing, and packaging. It is fragile and complex and old. We'd like to replace it with a fresh set of scripts and are considering alternatives to ant. Maven 2 sounds interesting. We like the dependency management features, but the directory structure is to rigid for a legacy project and it seems overly difficult to do anything outside of their process. Does anyone have a recommendation for this situation? Or experience in updating the build scripts of a legacy java project?
0
41,134
09/03/2008 03:23:00
1,797
08/18/2008 15:46:11
907
49
How do I install the mysql ruby gem under OS X 10.5.4
Here is the deal. $ gem --version > 1.1.0 $ sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config > Bulk updating Gem source index for: > http://gems.rubyforge.org/ ERROR: > could not find mysql locally or in a > repository $ sudo gem update > Updating installed gems Bulk updating > Gem source index for: > http://gems.rubyforge.org/ > Updating > RedCloth ERROR: While executing gem > ... (Gem::GemNotFoundException) > could not find RedCloth locally or in a repository I've tried [this](http://www.gregbenedict.com/2008/02/21/mysql-ruby-gem-install-issues-solved/), [this](http://dev.mysql.com/downloads/ruby.html), [this](http://installingcats.com/2007/12/13/mysql-ruby-gem-install-problem-on-mac-os-x-leopard/), [this](http://www.docuverse.com/blog/donpark/2007/06/14/os-x-mysql-ruby-gem-install-problem), and a ton of others. None of them have worked for me. Is anyone else having this problem? If so what did you do to fix it that is not mentioned above?
ruby
gem
mysql
null
null
null
open
How do I install the mysql ruby gem under OS X 10.5.4 === Here is the deal. $ gem --version > 1.1.0 $ sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config > Bulk updating Gem source index for: > http://gems.rubyforge.org/ ERROR: > could not find mysql locally or in a > repository $ sudo gem update > Updating installed gems Bulk updating > Gem source index for: > http://gems.rubyforge.org/ > Updating > RedCloth ERROR: While executing gem > ... (Gem::GemNotFoundException) > could not find RedCloth locally or in a repository I've tried [this](http://www.gregbenedict.com/2008/02/21/mysql-ruby-gem-install-issues-solved/), [this](http://dev.mysql.com/downloads/ruby.html), [this](http://installingcats.com/2007/12/13/mysql-ruby-gem-install-problem-on-mac-os-x-leopard/), [this](http://www.docuverse.com/blog/donpark/2007/06/14/os-x-mysql-ruby-gem-install-problem), and a ton of others. None of them have worked for me. Is anyone else having this problem? If so what did you do to fix it that is not mentioned above?
0
41,155
09/03/2008 04:03:49
831
08/09/2008 06:37:00
74
4
WCF Service Returning "Method Not Allowed"
In the process of developing my first WCF service and when I try to use it I get "Method not Allowed" with no other explanation. I've got my interface set up with the ServiceContract and OperationContract: [OperationContract] void FileUpload(UploadedFile file); Along with the actual method: public void FileUpload(UploadedFile file) {}; To access the Service I enter http://localhost/project/myService.svc/FileUpload but I get the "Method not Allowed" error Am I missing something?
web-services
wcf
null
null
null
null
open
WCF Service Returning "Method Not Allowed" === In the process of developing my first WCF service and when I try to use it I get "Method not Allowed" with no other explanation. I've got my interface set up with the ServiceContract and OperationContract: [OperationContract] void FileUpload(UploadedFile file); Along with the actual method: public void FileUpload(UploadedFile file) {}; To access the Service I enter http://localhost/project/myService.svc/FileUpload but I get the "Method not Allowed" error Am I missing something?
0
41,159
09/03/2008 04:13:46
3,615
08/29/2008 14:57:54
6
0
Fastest way to find common items across multiple lists in C#
Given the following: List<List<Option>> options; what would be a quick way to determine the subset of Option objects that appear in all N lists? Equality is determined through some string property such as option1.Value == option2.Value.
c#
null
null
null
null
null
open
Fastest way to find common items across multiple lists in C# === Given the following: List<List<Option>> options; what would be a quick way to determine the subset of Option objects that appear in all N lists? Equality is determined through some string property such as option1.Value == option2.Value.
0
41,162
09/03/2008 04:18:18
742
08/08/2008 13:33:41
116
6
Javascript spinning wait hourglass-type thing
I'd like to indicate to the user of a web app that a long-running task is being performed. On Once upon a time, this concept would have been communicated to the user by displaying an hourglass. Nowadays, it seems to be an animated spinning circle. (e.g., when you are loading a new tab in Firefox, or booting in Mac OS X. Coincidentally, the overflowing stack in the stackoverflow logo looks like one quarter of the circle). Is there a simple way to create this effect using Javascript (in particular, JQuery)? Ideally, I'd like to have one of these little spinners as elements in a table, to indicate to the user that the system is still active in processing a pending task (i.e., it hasn't forgotten or crashed). (Of course, I realize it's possible that the back-end has crashed and the front-end still show as an animating spinning thing, it's more for the psychological purpose of the user seeing activity). <table border="1"> <tr> <th>Job ID</th> <th>Status</th> </tr> <tr> <td>1</td> <td>starting up</td> <td>(spinning thing here) </tr> <tr> <td>2</td> <td>running</td> </tr> <tr> <td>3</td> <td>cancelled</td> </tr> </table> And what do you call that spinning thing, anyways?
jquery
javascript
null
null
null
null
open
Javascript spinning wait hourglass-type thing === I'd like to indicate to the user of a web app that a long-running task is being performed. On Once upon a time, this concept would have been communicated to the user by displaying an hourglass. Nowadays, it seems to be an animated spinning circle. (e.g., when you are loading a new tab in Firefox, or booting in Mac OS X. Coincidentally, the overflowing stack in the stackoverflow logo looks like one quarter of the circle). Is there a simple way to create this effect using Javascript (in particular, JQuery)? Ideally, I'd like to have one of these little spinners as elements in a table, to indicate to the user that the system is still active in processing a pending task (i.e., it hasn't forgotten or crashed). (Of course, I realize it's possible that the back-end has crashed and the front-end still show as an animating spinning thing, it's more for the psychological purpose of the user seeing activity). <table border="1"> <tr> <th>Job ID</th> <th>Status</th> </tr> <tr> <td>1</td> <td>starting up</td> <td>(spinning thing here) </tr> <tr> <td>2</td> <td>running</td> </tr> <tr> <td>3</td> <td>cancelled</td> </tr> </table> And what do you call that spinning thing, anyways?
0
41,169
09/03/2008 04:28:34
816
08/09/2008 04:15:12
141
6
How do I write Firefox add-on that automatically enters proxy passwords?
Suppose someone worked for a company that put up an HTTP proxy preventing internet access without password authentication (NTLM, I think). Also suppose that this password rotated on a daily basis, which added very little security, but mostly served to annoy its employees. How would one get started writing a Firefox add-on that automatically entered these rotating passwords?
firefox
proxy
authentication
passwords
null
null
open
How do I write Firefox add-on that automatically enters proxy passwords? === Suppose someone worked for a company that put up an HTTP proxy preventing internet access without password authentication (NTLM, I think). Also suppose that this password rotated on a daily basis, which added very little security, but mostly served to annoy its employees. How would one get started writing a Firefox add-on that automatically entered these rotating passwords?
0
41,179
09/03/2008 04:38:35
4,262
09/02/2008 14:54:42
79
4
Can you use the JavaScript engine in web browsers to process local files?
I have a number of users with multi-megabyte files that need to be processed before they can be uploaded. I am trying to find a way to do this without having to install any executable software on their machines. If every machine shipped with, say, Python it would be easy. I could have a Python script do everything. The only scripting language I can think of that's on every machine is JavaScript. However I know there are security restrictions that prevent reading and writing local files from web browsers. Is there any way to use this extremely pervasive scripting language for general purpose computing tasks?
javascript
null
null
null
null
null
open
Can you use the JavaScript engine in web browsers to process local files? === I have a number of users with multi-megabyte files that need to be processed before they can be uploaded. I am trying to find a way to do this without having to install any executable software on their machines. If every machine shipped with, say, Python it would be easy. I could have a Python script do everything. The only scripting language I can think of that's on every machine is JavaScript. However I know there are security restrictions that prevent reading and writing local files from web browsers. Is there any way to use this extremely pervasive scripting language for general purpose computing tasks?
0
41,185
09/03/2008 04:42:04
4,322
09/02/2008 20:31:47
3
1
Vista Console App?
I'm doing a fair bit of work in Ruby recently, and using ruby script/console Is absolutely critical. However, I'm really disappointed with the default Windows console in Vista, especially in that there's a really annoying bug where moving the cursor back when at the bottom of the screen irregularly causes it to jump back. Anyone have a decent console app they use in Windows?
windows
ruby
windows-vista
console
null
null
open
Vista Console App? === I'm doing a fair bit of work in Ruby recently, and using ruby script/console Is absolutely critical. However, I'm really disappointed with the default Windows console in Vista, especially in that there's a really annoying bug where moving the cursor back when at the bottom of the screen irregularly causes it to jump back. Anyone have a decent console app they use in Windows?
0
41,188
09/03/2008 04:54:21
2,293
08/21/2008 14:02:56
135
9
Waveform Visualization in Ruby
I'm about to start a project that will record and edit audio files, and I'm looking for a good library (preferably Ruby, but will consider anything other than Java or .NET) for on-the-fly visualization of waveforms. Does anybody know where I should start my search?
ruby
audio
mp3
visualization
waveform
null
open
Waveform Visualization in Ruby === I'm about to start a project that will record and edit audio files, and I'm looking for a good library (preferably Ruby, but will consider anything other than Java or .NET) for on-the-fly visualization of waveforms. Does anybody know where I should start my search?
0
41,198
09/03/2008 05:05:37
2,592
08/23/2008 12:32:00
40
2
CSS: Getting image to stretch a div
How can i get an image to stretch the height of a div class? Currently it looks like this: <img src="http://i36.tinypic.com/34osrdg.png" width=650/> **Edit**: Turns out the img didnt embed properly. Here is the link http://i36.tinypic.com/34osrdg.png But i would like the div to be stretched so the image fits properly. I do not want to resize the image. Here is the css for the div (the grey box) .product1 { width: 100%; padding: 5px; margin: 0px 0px 15px -5px; background: #ADA19A; color: #000000; min-height: 100px; } And the css being applied on the image: .product{ display: inline; float: left; } So, how can i fix this?
css
image
null
null
null
null
open
CSS: Getting image to stretch a div === How can i get an image to stretch the height of a div class? Currently it looks like this: <img src="http://i36.tinypic.com/34osrdg.png" width=650/> **Edit**: Turns out the img didnt embed properly. Here is the link http://i36.tinypic.com/34osrdg.png But i would like the div to be stretched so the image fits properly. I do not want to resize the image. Here is the css for the div (the grey box) .product1 { width: 100%; padding: 5px; margin: 0px 0px 15px -5px; background: #ADA19A; color: #000000; min-height: 100px; } And the css being applied on the image: .product{ display: inline; float: left; } So, how can i fix this?
0
41,204
09/03/2008 05:15:24
3,499
08/28/2008 19:39:37
177
19
Can Ruby convert an acts_as_nested_set to a JSON hash cleanly without recursion?
Is there a fast and clean way of returning a JSON hash back from any node in a Ruby on Rails' acts_as_nested_set without using recursion? Here's the recursive solution for reference: class Node < ActiveRecord::Base has_many :products def json_hash if children.size > 0 children.collect { |node| { node.name => node.json_hash }.to_json else { node.name => node.products.find(:all).collect(&:name) }.to_json end end end
ruby
ruby-on-rails
recursion
null
null
null
open
Can Ruby convert an acts_as_nested_set to a JSON hash cleanly without recursion? === Is there a fast and clean way of returning a JSON hash back from any node in a Ruby on Rails' acts_as_nested_set without using recursion? Here's the recursive solution for reference: class Node < ActiveRecord::Base has_many :products def json_hash if children.size > 0 children.collect { |node| { node.name => node.json_hash }.to_json else { node.name => node.products.find(:all).collect(&:name) }.to_json end end end
0
41,207
09/03/2008 05:27:19
720
08/08/2008 08:47:12
766
27
JavaScript shell with completion
For debugging and testing I'm searching for a JavaScript shell with auto completion and if possible object introspection (like ipython). The online [JavaScript Shell](http://www.squarefree.com/shell/) is really nice, but I'm looking for something local, without the need for an browser. So far I have tested the standalone JavaScript interpreter rhino, spidermonkey and google V8. But neither of them has completion. At least Rhino with jline and spidermonkey have some kind of command history via key up/down, but nothing more. Any suggestions?
javascript
shell
null
null
null
null
open
JavaScript shell with completion === For debugging and testing I'm searching for a JavaScript shell with auto completion and if possible object introspection (like ipython). The online [JavaScript Shell](http://www.squarefree.com/shell/) is really nice, but I'm looking for something local, without the need for an browser. So far I have tested the standalone JavaScript interpreter rhino, spidermonkey and google V8. But neither of them has completion. At least Rhino with jline and spidermonkey have some kind of command history via key up/down, but nothing more. Any suggestions?
0
41,218
09/03/2008 05:44:06
4,247
09/02/2008 14:04:58
23
2
Testing HTTPS files with MAMP
I am running MAMP locally on my laptop, and I like to test as much as I can locally. Unfortunately, since I work on e-commerce stuff (PHP), I normally force ssl in most of the checkout forms and it just fails on my laptop. Is there any easy configuration that I might be missing to allow "https" to run under MAMP? Please note, I know that I **could** configure Apache by hand, re-compile PHP, etc. but I'm just wondering if there's an easier way for a lazy programmer. Thanks
osx
apache
ssl
https
mamp
05/18/2012 13:19:03
off topic
Testing HTTPS files with MAMP === I am running MAMP locally on my laptop, and I like to test as much as I can locally. Unfortunately, since I work on e-commerce stuff (PHP), I normally force ssl in most of the checkout forms and it just fails on my laptop. Is there any easy configuration that I might be missing to allow "https" to run under MAMP? Please note, I know that I **could** configure Apache by hand, re-compile PHP, etc. but I'm just wondering if there's an easier way for a lazy programmer. Thanks
2
41,220
09/03/2008 05:46:20
3,546
08/29/2008 04:36:13
76
10
Is there a best .NET algorithm for credit card encryption?
The .NET `System.Security.Cryptography` namespace has a rather bewildering collection of algorithms that I could use for encryption of credit card details. Which is the best? It clearly needs to be secure for a relatively short string.
.net
security
encryption
cryptography
null
null
open
Is there a best .NET algorithm for credit card encryption? === The .NET `System.Security.Cryptography` namespace has a rather bewildering collection of algorithms that I could use for encryption of credit card details. Which is the best? It clearly needs to be secure for a relatively short string.
0
41,233
09/03/2008 06:10:15
1,915
08/19/2008 14:11:04
123
11
Java and SQLite
I'm attracted to the neatness that a single file database provides. What driver/connector library is out there to connect and use SQLite with Java. I've discovered a wrapper library, [http://www.ch-werner.de/javasqlite][1], but are the other more prominent projects available? [1]: http://www.ch-werner.de/javasqlite/
java
sqlite
null
null
null
null
open
Java and SQLite === I'm attracted to the neatness that a single file database provides. What driver/connector library is out there to connect and use SQLite with Java. I've discovered a wrapper library, [http://www.ch-werner.de/javasqlite][1], but are the other more prominent projects available? [1]: http://www.ch-werner.de/javasqlite/
0
41,234
09/03/2008 06:11:09
3,966
09/01/2008 03:51:27
1
0
Apache serving files that should not be served.
This is so strange. Today I discovered that my fresh installation of Apache HTTP Server is able to serve files from my C:\uploads\ directory. I have two folders in c:\uploads: c:\uploads\templates c:\uploads\sites Both folders contain testimage.jpg. I found that Apache will serve the files from the templates folder if I request - http://localhost/templates/testimage.jpg However, http://localhost/sites/testimage.jpg 404's! OMG - firstly, why does Apache serve the *templates* folder in the first place. Is it special. Secondly, by what arbitrary set of rules does apache disallow access to other folders such the sites?! I'm so confused. Perhaps I've taken a wrong turn somewhere during the installation.
apache
null
null
null
null
null
open
Apache serving files that should not be served. === This is so strange. Today I discovered that my fresh installation of Apache HTTP Server is able to serve files from my C:\uploads\ directory. I have two folders in c:\uploads: c:\uploads\templates c:\uploads\sites Both folders contain testimage.jpg. I found that Apache will serve the files from the templates folder if I request - http://localhost/templates/testimage.jpg However, http://localhost/sites/testimage.jpg 404's! OMG - firstly, why does Apache serve the *templates* folder in the first place. Is it special. Secondly, by what arbitrary set of rules does apache disallow access to other folders such the sites?! I'm so confused. Perhaps I've taken a wrong turn somewhere during the installation.
0
41,239
09/03/2008 06:16:34
380
08/05/2008 10:39:18
2,228
179
I am having trouble getting phpBB to authenticate with our Active Directory
I am pretty sure that the settings that I am using are correct, so all possible things can be wrong which I should check out so that I can make authentication with our Active Directory work.
activedirectory
phpbb
null
null
null
null
open
I am having trouble getting phpBB to authenticate with our Active Directory === I am pretty sure that the settings that I am using are correct, so all possible things can be wrong which I should check out so that I can make authentication with our Active Directory work.
0
41,244
09/03/2008 06:30:31
1,786
08/18/2008 14:52:43
337
32
Dynamic LINQ OrderBy
I found an example in the [VS2008 Examples][1] for Dynamic LINQ that allows you to use a sql-like string (e.g. OrderBy("Name, Age DESC")) for ordering. Unfortunately, the method included only works on IQueryable&lt;T&gt;. Is there any way to get this functionality on IEnumerable&lt;T&gt;? [1]: http://msdn2.microsoft.com/en-us/bb330936.aspx
c#
linq
null
null
null
null
open
Dynamic LINQ OrderBy === I found an example in the [VS2008 Examples][1] for Dynamic LINQ that allows you to use a sql-like string (e.g. OrderBy("Name, Age DESC")) for ordering. Unfortunately, the method included only works on IQueryable&lt;T&gt;. Is there any way to get this functionality on IEnumerable&lt;T&gt;? [1]: http://msdn2.microsoft.com/en-us/bb330936.aspx
0
41,256
09/03/2008 06:49:23
3,359
08/28/2008 07:51:36
1
1
Added Types in .NET framework 2.0 Service Pack 1
I couldn't find the the newly added types documented anywhere; only the bug fixes are listed. Any ideas...
.net
.net-2.0
null
null
null
null
open
Added Types in .NET framework 2.0 Service Pack 1 === I couldn't find the the newly added types documented anywhere; only the bug fixes are listed. Any ideas...
0
41,290
09/03/2008 07:44:40
832
08/09/2008 06:51:40
3,404
222
File Access Strategy in a Multi-Threaded Environment (Web App)
I have a file which is an XML representation of some data that is taken from a Web service and cached locally within a Web Application. The idea being is that this data is _very_ static, but just _might_ change. So I have set it up to cache to a file, and stuck a monitor against it to check if it has been deleted. Once deleted, the file will be refreshed from its source and rebuilt. I am now running in to problems though, because obviously in a multi-threaded environment it falls over as it is trying to access the data when it is still reading/writing the file. This is confusing me, because I added a object to lock against, and this is always locked during read/write. It was my understanding that attempted access from other threads would be told to "wait" until the lock was released? Just to let you know, I am real new to multi-threaded development, so I am totally willing to accept this is a screw up on my part :) * **Am I missing something?** * **What is the best file access strategy in a multi-threaded environment?**
caching
file-io
files
multithreading
web-application
null
open
File Access Strategy in a Multi-Threaded Environment (Web App) === I have a file which is an XML representation of some data that is taken from a Web service and cached locally within a Web Application. The idea being is that this data is _very_ static, but just _might_ change. So I have set it up to cache to a file, and stuck a monitor against it to check if it has been deleted. Once deleted, the file will be refreshed from its source and rebuilt. I am now running in to problems though, because obviously in a multi-threaded environment it falls over as it is trying to access the data when it is still reading/writing the file. This is confusing me, because I added a object to lock against, and this is always locked during read/write. It was my understanding that attempted access from other threads would be told to "wait" until the lock was released? Just to let you know, I am real new to multi-threaded development, so I am totally willing to accept this is a screw up on my part :) * **Am I missing something?** * **What is the best file access strategy in a multi-threaded environment?**
0
41,297
09/03/2008 07:51:59
1,196
08/13/2008 12:33:04
1,300
77
What tool do you miss more for WPF development?
In my [previous][1] question we have gathered a list of useful WPF tools. Today my question is what tool do you miss more? Personally I miss a WPF designer *for programmer*. I want to concentrate on writing code, so I need a good XAML editor with intellisense support not a fancy forms editor. Take a look at Paul Stovell’s article “[Thought: Evolution of the WPF designer][2]” Another problem in my opinion is XML. I don’t get any fun writing countless angle brackets. I prefer to have python-like syntax for XAML. So, what do think? Which tool can improve your productivity? [1]: http://stackoverflow.com/questions/38642/what-tools-do-you-use-for-wpf-development [2]: http://www.paulstovell.com/blog/evolution-of-the-wpf-designer
wpf
null
null
null
null
null
open
What tool do you miss more for WPF development? === In my [previous][1] question we have gathered a list of useful WPF tools. Today my question is what tool do you miss more? Personally I miss a WPF designer *for programmer*. I want to concentrate on writing code, so I need a good XAML editor with intellisense support not a fancy forms editor. Take a look at Paul Stovell’s article “[Thought: Evolution of the WPF designer][2]” Another problem in my opinion is XML. I don’t get any fun writing countless angle brackets. I prefer to have python-like syntax for XAML. So, what do think? Which tool can improve your productivity? [1]: http://stackoverflow.com/questions/38642/what-tools-do-you-use-for-wpf-development [2]: http://www.paulstovell.com/blog/evolution-of-the-wpf-designer
0
41,300
09/03/2008 08:04:11
473
08/06/2008 05:51:32
78
2
Emacs in Windows
How do you run Emacs in Windows? What is the best flavor of Emacs to use in Windows, and where can I download it? And where is the .emacs file located?
windows
emacs
null
null
null
null
open
Emacs in Windows === How do you run Emacs in Windows? What is the best flavor of Emacs to use in Windows, and where can I download it? And where is the .emacs file located?
0
41,304
09/03/2008 08:06:08
71
08/01/2008 15:05:56
1,202
110
Find item in Winforms/WPF ComboBox
I know in ASP.NET I can get an item from a DropDownList by using DropDownList1.Items.FindByText Is there a similar method I can use in WinForms/WPF for a ComboBox?
.net
winforms
wpf
usercontrols
null
null
open
Find item in Winforms/WPF ComboBox === I know in ASP.NET I can get an item from a DropDownList by using DropDownList1.Items.FindByText Is there a similar method I can use in WinForms/WPF for a ComboBox?
0
41,319
09/03/2008 08:35:24
615
08/07/2008 11:06:07
2,712
140
Checking if a list is empty with LINQ
What's the "best" (taking both speed and readability into account) way to determine if a list is empty? Even if the list is of type `IEnumerable<T>` and doesn't have a Count property. Right now I'm tossing up between this: if (myList.Count() == 0) { ... } and this: if (!myList.Any()) { ... } My guess is that the second option is faster, since it'll come back with a result as soon as it sees the first item, whereas the second option (for an IEnumerable) will need to visit every item to return the count. That being said, does the second option look as readable to you? Which would you prefer? Or can you think of a better way to test for an empty list?
.net
c#
linq
null
null
null
open
Checking if a list is empty with LINQ === What's the "best" (taking both speed and readability into account) way to determine if a list is empty? Even if the list is of type `IEnumerable<T>` and doesn't have a Count property. Right now I'm tossing up between this: if (myList.Count() == 0) { ... } and this: if (!myList.Any()) { ... } My guess is that the second option is faster, since it'll come back with a result as soon as it sees the first item, whereas the second option (for an IEnumerable) will need to visit every item to return the count. That being said, does the second option look as readable to you? Which would you prefer? Or can you think of a better way to test for an empty list?
0
41,320
09/03/2008 08:35:49
91
08/01/2008 17:55:22
5,428
234
Working on a Visual Studio Project with multiple users?
I just wonder what the best approach is to have multiple users work on a Project in Visual Studio 2005 Professional. We got a Solution with multiple Class Libraries, but when everyone opens the solution, we keep getting the "X was modified, Reload/Discard?" prompt all the time. Just opening one project is an obvious alternative, but I find it harder to use as you can't just see some of the other classes in other projects that way. Are there any Guidelines for Team Development with VS2005 Pro?
visual-studio
null
null
null
null
null
open
Working on a Visual Studio Project with multiple users? === I just wonder what the best approach is to have multiple users work on a Project in Visual Studio 2005 Professional. We got a Solution with multiple Class Libraries, but when everyone opens the solution, we keep getting the "X was modified, Reload/Discard?" prompt all the time. Just opening one project is an obvious alternative, but I find it harder to use as you can't just see some of the other classes in other projects that way. Are there any Guidelines for Team Development with VS2005 Pro?
0
41,330
09/03/2008 08:46:48
1,509,946
08/26/2008 08:23:02
11
1
How to detect the presence of a default recording device in the system?
How do I detect if the system has a default recording device installed? I bet this can be done through some calls to the Win32 API, anyone has any experience with this? I'm talking about doing this through code, not by opening the control panel and taking a look under sound options.
winapi
audio
device
null
null
null
open
How to detect the presence of a default recording device in the system? === How do I detect if the system has a default recording device installed? I bet this can be done through some calls to the Win32 API, anyone has any experience with this? I'm talking about doing this through code, not by opening the control panel and taking a look under sound options.
0
41,338
09/03/2008 09:04:36
1,196
08/13/2008 12:33:04
1,315
79
Sharing a project in heterogeneous environment
Here is a situation: You have a project (for example Visual Studio solution with multiple projects) Project relies on various environment variables, libraries, tools and other dependencies. You have to share this project (via source control repository) across multiple developers. Developers don't have similar environment (e.g. libraries live in different places, etc.) for various reasons. How would you deal with inconsistency? Would you enforce developers to have similar environment? Do you use some kind of configuration scripts?
teamwork
null
null
null
null
05/08/2012 17:50:48
off topic
Sharing a project in heterogeneous environment === Here is a situation: You have a project (for example Visual Studio solution with multiple projects) Project relies on various environment variables, libraries, tools and other dependencies. You have to share this project (via source control repository) across multiple developers. Developers don't have similar environment (e.g. libraries live in different places, etc.) for various reasons. How would you deal with inconsistency? Would you enforce developers to have similar environment? Do you use some kind of configuration scripts?
2
41,353
09/03/2008 09:21:36
4,189
09/02/2008 09:19:58
1
4
.Net ESB's out there
Does anyone know about .Net ESB's out there, I would prefer Open Source. Personally I know about - NServiceBus http://www.nservicebus.com/ - ESB.Net http://www.codeplex.com/KeystrokeEsbNet - Microsofts guidance on ESB using BizTalk
.net
esb
null
null
null
null
open
.Net ESB's out there === Does anyone know about .Net ESB's out there, I would prefer Open Source. Personally I know about - NServiceBus http://www.nservicebus.com/ - ESB.Net http://www.codeplex.com/KeystrokeEsbNet - Microsofts guidance on ESB using BizTalk
0
41,355
09/03/2008 09:24:35
4,189
09/02/2008 09:19:58
1
4
Dynamic programming with WCF
Has anybody got any kind of experience with dynamic programming using WCF. By dynamic programming I mean runtime consumption of WSDL's. I have found one blog entry/tool: http://blogs.msdn.com/vipulmodi/archive/2006/11/16/dynamic-programming-with-wcf.aspx Has anybody here found good tools for this?
.net
wcf
null
null
null
null
open
Dynamic programming with WCF === Has anybody got any kind of experience with dynamic programming using WCF. By dynamic programming I mean runtime consumption of WSDL's. I have found one blog entry/tool: http://blogs.msdn.com/vipulmodi/archive/2006/11/16/dynamic-programming-with-wcf.aspx Has anybody here found good tools for this?
0
41,367
09/03/2008 09:30:40
4,376
09/03/2008 09:30:40
1
0
How can I make my applications scale well?
In general, what kinds of design decisions help an application scale well?
algorithm
scalability
null
null
null
null
open
How can I make my applications scale well? === In general, what kinds of design decisions help an application scale well?
0
41,375
09/03/2008 09:42:45
2,981
08/26/2008 10:03:45
24
7
Compromising My Integrity ?
I have recently written a small simple application that takes snapshots of your monitor(s) every X seconds / minutes. The idea is to keep a record of your activity. More details here: http://www.artenscience.co.uk/artenscience/ScreenAudit.html I've since had several emails from people asking for me to introduce a 'Stealth Mode', basically make the application invisible whilst running. Also to introduce an FTP or email mechanism for the captured screenshots. Technically this is straightforward, however I can guess how this will be used ... almost certainly used as a way of capturing information covertly for dishonest purposes. However it could also be used in a good way. But I know thats not the intention. Do I develop this functionality knowing that it *could* and most probably *will* be used in ways that I am not comfortable with ? At the moment I am tending to NOT do the development. What's the views of the community ? I realise this is not a straightforward programming question, but I can't think of a better place to ask this.
programmer-integrity
dilemma
null
null
null
05/03/2012 01:42:51
not constructive
Compromising My Integrity ? === I have recently written a small simple application that takes snapshots of your monitor(s) every X seconds / minutes. The idea is to keep a record of your activity. More details here: http://www.artenscience.co.uk/artenscience/ScreenAudit.html I've since had several emails from people asking for me to introduce a 'Stealth Mode', basically make the application invisible whilst running. Also to introduce an FTP or email mechanism for the captured screenshots. Technically this is straightforward, however I can guess how this will be used ... almost certainly used as a way of capturing information covertly for dishonest purposes. However it could also be used in a good way. But I know thats not the intention. Do I develop this functionality knowing that it *could* and most probably *will* be used in ways that I am not comfortable with ? At the moment I am tending to NOT do the development. What's the views of the community ? I realise this is not a straightforward programming question, but I can't think of a better place to ask this.
4
41,397
09/03/2008 10:08:11
832
08/09/2008 06:51:40
3,420
222
Asking a Generic Method to Throw Specific Exception Type on FAIL
Right, I know I am totally going to look an idiot with this one, but my brain is just _not_ kicking in to gear this morning. I want to have a method where I can say "if it goes bad, come back with this type of Exception", right? For example, something like (**and this doesn't work**): static ExType TestException<ExType>(string message) where ExType:Exception { Exception ex1 = new Exception(); ExType ex = new Exception(message); return ex; } Now whats confusing me is that we _KNOW_ that the generic type is going to be of an Exception type due to the _where_ clause. However, the code fails because we cannot implicitly cast *Exception* to *ExType*. We cannot explicitly convert it either, such as: static ExType TestException<ExType>(string message) where ExType:Exception { Exception ex1 = new Exception(); ExType ex = (ExType)(new Exception(message)); return ex; } As that fails too.. So **is this kind of thing possible?** I have a strong feeling its going to be real simple, but I am having a tough day with the old noggin, so cut me some slack :P
exception
generics
null
null
null
null
open
Asking a Generic Method to Throw Specific Exception Type on FAIL === Right, I know I am totally going to look an idiot with this one, but my brain is just _not_ kicking in to gear this morning. I want to have a method where I can say "if it goes bad, come back with this type of Exception", right? For example, something like (**and this doesn't work**): static ExType TestException<ExType>(string message) where ExType:Exception { Exception ex1 = new Exception(); ExType ex = new Exception(message); return ex; } Now whats confusing me is that we _KNOW_ that the generic type is going to be of an Exception type due to the _where_ clause. However, the code fails because we cannot implicitly cast *Exception* to *ExType*. We cannot explicitly convert it either, such as: static ExType TestException<ExType>(string message) where ExType:Exception { Exception ex1 = new Exception(); ExType ex = (ExType)(new Exception(message)); return ex; } As that fails too.. So **is this kind of thing possible?** I have a strong feeling its going to be real simple, but I am having a tough day with the old noggin, so cut me some slack :P
0
41,400
09/03/2008 10:12:27
123
08/02/2008 08:01:26
1,009
47
How to wrap a function with variable length arguments?
I am looking to do this in C/C++. I came across [**Variable Length Arguments**][1] but this is not pure C/C++ solution. Any suggestion is appreciated. [1]: http://www.swig.org/Doc1.3/Varargs.html
c
c++
null
null
null
null
open
How to wrap a function with variable length arguments? === I am looking to do this in C/C++. I came across [**Variable Length Arguments**][1] but this is not pure C/C++ solution. Any suggestion is appreciated. [1]: http://www.swig.org/Doc1.3/Varargs.html
0
41,405
09/03/2008 10:13:30
493
08/06/2008 10:25:05
2,979
184
Working with Common/Utility Libraries
At the company I work for we have a "Utility" project that is referenced by pretty much ever application we build. It's got lots of things like NullHelpers, ConfigSettingHelpers, Common ExtensionMethods etc. The way we work is that when we want to make a new project, we get the latest version of the project from source control add it to the solution and then reference the project from any new projects that get added to the solution. This has worked ok, however there have been a couple of instances where people have made "breaking changes" to the common project, which works for them, but doesn't work for others. I've been thinking that rather than adding the common library as a project reference perhaps we should start developing the common library as a standalone dll and publish different versions and target a particular version for a particular project so that changes can be made without any risk to other projects using the common library. Having said all that I'm interested to see how others reference or use their common libraries.
c#
visual-studio
api
null
null
null
open
Working with Common/Utility Libraries === At the company I work for we have a "Utility" project that is referenced by pretty much ever application we build. It's got lots of things like NullHelpers, ConfigSettingHelpers, Common ExtensionMethods etc. The way we work is that when we want to make a new project, we get the latest version of the project from source control add it to the solution and then reference the project from any new projects that get added to the solution. This has worked ok, however there have been a couple of instances where people have made "breaking changes" to the common project, which works for them, but doesn't work for others. I've been thinking that rather than adding the common library as a project reference perhaps we should start developing the common library as a standalone dll and publish different versions and target a particular version for a particular project so that changes can be made without any risk to other projects using the common library. Having said all that I'm interested to see how others reference or use their common libraries.
0
41,406
09/03/2008 10:14:26
3,654
08/29/2008 17:52:22
213
12
How do I execute PHP that is stored in a MySQL database?
I'm trying to write a page that calls PHP that's stored in a MySQL database. The page that is stored in the MySQL database contains PHP (and HTML) code which I want to run on page load. How could I go about doing this?
php
mysql
null
null
null
null
open
How do I execute PHP that is stored in a MySQL database? === I'm trying to write a page that calls PHP that's stored in a MySQL database. The page that is stored in the MySQL database contains PHP (and HTML) code which I want to run on page load. How could I go about doing this?
0
41,407
09/03/2008 10:15:11
909
08/10/2008 09:56:57
386
23
Parsing a log file with regular expressions
I'm currently working on a parser for our internal log files (generated by log4php, log4net and log4j). So far I have a nice regular expression to parse the logs, except for one annoying bit: Some log messages span multiple lines, which I can't get to match properly. The regex I have now is this: (?<date>\d{2}/\d{2}/\d{2})\s(?<time>\d{2}):\d{2}:\d{2}),\d{3})\s(?<message>.+) The log format (which I use for testing the parser) is this: 07/23/08 14:17:31,321 log message spanning multiple lines 07/23/08 14:17:31,321 log message on one line When I run the parser right now, I get only the line the log starts on. If I change it to span multiple lines, I get only one result (the whole log file). Help please ;-)
regex
c#
null
null
null
null
open
Parsing a log file with regular expressions === I'm currently working on a parser for our internal log files (generated by log4php, log4net and log4j). So far I have a nice regular expression to parse the logs, except for one annoying bit: Some log messages span multiple lines, which I can't get to match properly. The regex I have now is this: (?<date>\d{2}/\d{2}/\d{2})\s(?<time>\d{2}):\d{2}:\d{2}),\d{3})\s(?<message>.+) The log format (which I use for testing the parser) is this: 07/23/08 14:17:31,321 log message spanning multiple lines 07/23/08 14:17:31,321 log message on one line When I run the parser right now, I get only the line the log starts on. If I change it to span multiple lines, I get only one result (the whole log file). Help please ;-)
0
41,424
09/03/2008 10:36:13
2,644
08/23/2008 21:56:47
442
38
How do you implement a "Did you mean"?
Suppose you have a search system already in your website. How can you implement the "Did you mean: <spell_checked_word>" like Google does in some [search queries][1]? [1]: http://www.google.com/search?hl=en&q=spellling&btnG=Search
google
null
null
null
null
null
open
How do you implement a "Did you mean"? === Suppose you have a search system already in your website. How can you implement the "Did you mean: <spell_checked_word>" like Google does in some [search queries][1]? [1]: http://www.google.com/search?hl=en&q=spellling&btnG=Search
0
41,429
09/03/2008 10:37:43
2,257
08/21/2008 11:26:12
1,581
105
Setting viewstate on postback
I am trying to set a ViewState-variable when a button is pressed, but it only works the second time i click the button. Here is the codebehind: protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack) { lblInfo.InnerText = String.Format("Hello {0} at {1}!", YourName, DateTime.Now.ToLongTimeString()); } } private string YourName { get { return (string)ViewState["YourName"]; } set { ViewState["YourName"] = value; } } protected void btnSubmit_Click(object sender, EventArgs e) { YourName = txtName.Text; } Is there something I am missing? Here is the form-part of the design-file, very basic just as a POC: <form id="form1" runat="server"> <div> Enter your name: <asp:TextBox runat="server" ID="txtName"></asp:TextBox> <asp:Button runat="server" ID="btnSubmit" Text="OK" onclick="btnSubmit_Click" /> <hr /> <label id="lblInfo" runat="server"></label> </div> </form> PS: The sample is very simplified, "use txtName.Text instead of ViewState" is not the correct answer, i need the info to be in ViewState.
asp.net
postback
null
null
null
null
open
Setting viewstate on postback === I am trying to set a ViewState-variable when a button is pressed, but it only works the second time i click the button. Here is the codebehind: protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack) { lblInfo.InnerText = String.Format("Hello {0} at {1}!", YourName, DateTime.Now.ToLongTimeString()); } } private string YourName { get { return (string)ViewState["YourName"]; } set { ViewState["YourName"] = value; } } protected void btnSubmit_Click(object sender, EventArgs e) { YourName = txtName.Text; } Is there something I am missing? Here is the form-part of the design-file, very basic just as a POC: <form id="form1" runat="server"> <div> Enter your name: <asp:TextBox runat="server" ID="txtName"></asp:TextBox> <asp:Button runat="server" ID="btnSubmit" Text="OK" onclick="btnSubmit_Click" /> <hr /> <label id="lblInfo" runat="server"></label> </div> </form> PS: The sample is very simplified, "use txtName.Text instead of ViewState" is not the correct answer, i need the info to be in ViewState.
0
41,446
09/03/2008 10:54:28
268
08/04/2008 10:11:11
674
33
Generating JavaScript stubs from WSDL
I'm looking for a tool to generate a JavaScript stub from a WSDL. Although I usually prefer to use REST services with JSON or XML, there are some tools I am currently integrating that works only using SOAP. I already created a first version of the client in JavaScript but I'm parsing the SOAP envelope by hand and I doubt that my code can survive a service upgrade for example, seeing how complexe the SOAP envelope specification is. So is there any tool to automatically generate fully SOAP compliant stubs for JavaScript from the WSDL so I can be more confident on the future of my client code.
javascript
soap
wsdl
null
null
null
open
Generating JavaScript stubs from WSDL === I'm looking for a tool to generate a JavaScript stub from a WSDL. Although I usually prefer to use REST services with JSON or XML, there are some tools I am currently integrating that works only using SOAP. I already created a first version of the client in JavaScript but I'm parsing the SOAP envelope by hand and I doubt that my code can survive a service upgrade for example, seeing how complexe the SOAP envelope specification is. So is there any tool to automatically generate fully SOAP compliant stubs for JavaScript from the WSDL so I can be more confident on the future of my client code.
0
41,449
09/03/2008 10:55:53
2,012
08/19/2008 19:30:28
11
4
I get a "An attempt was made to load a program with an incorrect format" error on a SQL Server replication project
The exact error is as follows "Could not load file or assembly 'Microsoft.SqlServer.Replication, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. An attempt was made to load a program with an incorrect format." I've recently started working on this project again after a two month move to another project. It worked perfectly before, and I've double checked all the references.
c#
sql-server
replication
null
null
null
open
I get a "An attempt was made to load a program with an incorrect format" error on a SQL Server replication project === The exact error is as follows "Could not load file or assembly 'Microsoft.SqlServer.Replication, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. An attempt was made to load a program with an incorrect format." I've recently started working on this project again after a two month move to another project. It worked perfectly before, and I've double checked all the references.
0
41,453
09/03/2008 10:59:05
3,233
08/27/2008 13:54:44
26
2
How can I add reflection to C++?
I'd like to be able to introspect a C++ class for it's name, contents etc. I'm talking native C++ here, not managed C++, which has reflection. References to classes, along with code examples, or just code examples would be beneficial. I'm not scared of templates! :)
c++
templates
null
null
null
null
open
How can I add reflection to C++? === I'd like to be able to introspect a C++ class for it's name, contents etc. I'm talking native C++ here, not managed C++, which has reflection. References to classes, along with code examples, or just code examples would be beneficial. I'm not scared of templates! :)
0
41,460
09/03/2008 11:05:11
3,233
08/27/2008 13:54:44
26
2
What are the differences between GNU v2 and GNU v3 licenses?
In simple terms, what are the reasons for, and what are the differences between the GNU v2 and GNU v3 open source licenses? Explanations and references to legal terms and further descriptions would be appreciated.
licensing
null
null
null
null
null
open
What are the differences between GNU v2 and GNU v3 licenses? === In simple terms, what are the reasons for, and what are the differences between the GNU v2 and GNU v3 open source licenses? Explanations and references to legal terms and further descriptions would be appreciated.
0
41,469
09/03/2008 11:20:26
2,644
08/23/2008 21:56:47
457
38
How to fetch a Book Title from an ISBN number?
I am planning on creating a small website for my personal book collection. To automate the process a little bit, I would like to create the following functionality: The website will ask me for the ISBN number of the book and will then automatically fetch the title and add it to my database. Although I am mainly interested in doing this in php, I also have some Java implementation ideas for this. I believe it could also help if the answer was as much language-agnostic as possible.
php
language-agnostic
books
null
null
null
open
How to fetch a Book Title from an ISBN number? === I am planning on creating a small website for my personal book collection. To automate the process a little bit, I would like to create the following functionality: The website will ask me for the ISBN number of the book and will then automatically fetch the title and add it to my database. Although I am mainly interested in doing this in php, I also have some Java implementation ideas for this. I believe it could also help if the answer was as much language-agnostic as possible.
0
41,479
09/03/2008 11:29:57
3,394
08/28/2008 12:35:39
1,191
67
Use of var keyword in C#
After discussion with colleagues regarding the use of the 'var' keyword in C# 3 I wondered what people's opinions were on the appropriate uses of type inference via var? For example I rather lazily used var in questionable circumstances, e.g.:- foreach(var item in someList) { // ... } // Type of 'item' not clear. var something = someObject.SomeProperty; // Type of 'something' not clear. var something = someMethod(); // Type of 'something' not clear. More legitimate uses of var are as follows:- var l = new List<string>(); // Obvious what l will be. var s = new SomeClass(); // Obvious what s will be. Interestingly LINQ seems to be a bit of a grey area, e.g.:- var results = from r in dataContext.SomeTable select r; // Not *entirely clear* what results will be here. It's clear what results will be in that it will be a type which implements IEnumerable<RowType>, however it isn't entirely obvious in the same way a var declaring a new object is. It's even worse when it comes to LINQ to objects, e.g.:- var results = from item in someList where item != 3 select item; This is no better than the equivilent foreach(var item in someList) { // ... } equivilent. There is a real concern about type safety here - for example if we were to place the results of that query into an overloaded method that accepted IEnumerable&lt;int&gt; and IEnumerable&lt;double&gt; the caller might inadvertently pass in the wrong type.
var
type-inference
c#
.net
null
01/09/2012 15:21:20
not constructive
Use of var keyword in C# === After discussion with colleagues regarding the use of the 'var' keyword in C# 3 I wondered what people's opinions were on the appropriate uses of type inference via var? For example I rather lazily used var in questionable circumstances, e.g.:- foreach(var item in someList) { // ... } // Type of 'item' not clear. var something = someObject.SomeProperty; // Type of 'something' not clear. var something = someMethod(); // Type of 'something' not clear. More legitimate uses of var are as follows:- var l = new List<string>(); // Obvious what l will be. var s = new SomeClass(); // Obvious what s will be. Interestingly LINQ seems to be a bit of a grey area, e.g.:- var results = from r in dataContext.SomeTable select r; // Not *entirely clear* what results will be here. It's clear what results will be in that it will be a type which implements IEnumerable<RowType>, however it isn't entirely obvious in the same way a var declaring a new object is. It's even worse when it comes to LINQ to objects, e.g.:- var results = from item in someList where item != 3 select item; This is no better than the equivilent foreach(var item in someList) { // ... } equivilent. There is a real concern about type safety here - for example if we were to place the results of that query into an overloaded method that accepted IEnumerable&lt;int&gt; and IEnumerable&lt;double&gt; the caller might inadvertently pass in the wrong type.
4
41,490
09/03/2008 11:38:25
2,686
08/24/2008 14:42:08
38
6
web proxy appliance
I'm looking for a cheap, simple, reliable web proxy appliance. Just a box that plugs into power and ethernet, and that redirects HTTP traffic to other existing web servers. It's intended for low volume web sites. Should I * [build a tiny, ultra low power pc][1] to do this * buy a cheap consumer-level router with this feature * buy a dedicated enterprise-level appliance Please indicate which solution you recommend (hardware and/or software), and feel free to share any experiences. [not sure if this question belongs on stackoverflow, but I guess the web developer crowd might have some experience with this] [1]: http://www.codinghorror.com/blog/archives/001156.html
hardware
http
proxy
appliance
null
02/04/2011 12:51:42
off topic
web proxy appliance === I'm looking for a cheap, simple, reliable web proxy appliance. Just a box that plugs into power and ethernet, and that redirects HTTP traffic to other existing web servers. It's intended for low volume web sites. Should I * [build a tiny, ultra low power pc][1] to do this * buy a cheap consumer-level router with this feature * buy a dedicated enterprise-level appliance Please indicate which solution you recommend (hardware and/or software), and feel free to share any experiences. [not sure if this question belongs on stackoverflow, but I guess the web developer crowd might have some experience with this] [1]: http://www.codinghorror.com/blog/archives/001156.html
2
41,492
09/03/2008 11:40:15
1,111
08/12/2008 12:40:23
5
6
ActiveX default property discovery
Is it possible to determine which property of an ActiveX control is the default property?
activex
vb6
null
null
null
null
open
ActiveX default property discovery === Is it possible to determine which property of an ActiveX control is the default property?
0
41,498
09/03/2008 11:45:32
4,384
09/03/2008 11:45:32
1
0
Rails - recovering database from Production.log
We recently lost a database and I want to recover the data from de Production.log. Every request is logged like this: Processing ChamadosController#create (for XXX.XXX.XXX.40 at 2008-07-30 11:07:30) [POST] Session ID: 74c865cefa0fdd96b4e4422497b828f9 Parameters: {"commit"=>"Gravar", "action"=>"create", "funcionario"=>"6" ... (all other parameters go here). But some stuff to post on de database were in the session. In the request I have the Session ID, and I also have all the session files from the server. Is there anyway I can, from this Session ID, open de session file and get it's contents?
ruby-on-rails
session
null
null
null
null
open
Rails - recovering database from Production.log === We recently lost a database and I want to recover the data from de Production.log. Every request is logged like this: Processing ChamadosController#create (for XXX.XXX.XXX.40 at 2008-07-30 11:07:30) [POST] Session ID: 74c865cefa0fdd96b4e4422497b828f9 Parameters: {"commit"=>"Gravar", "action"=>"create", "funcionario"=>"6" ... (all other parameters go here). But some stuff to post on de database were in the session. In the request I have the Session ID, and I also have all the session files from the server. Is there anyway I can, from this Session ID, open de session file and get it's contents?
0
41,499
09/03/2008 11:46:34
3,150
08/27/2008 01:43:38
51
4
Java serialization with static initialization
In Java, static and transient fields are not serialized. However, I found out that initialization of static fields causes the generated serialVersionUID to be changed. For example, `static int MYINT = 3;` causes the serialVersionUID to change. In this example, it makes sense because different versions of the class would get different initial values. Why does any initialization change the serialVersionUID? For example, `static String MYSTRING = System.getProperty("foo");` also causes the serialVersionUID to change.
java
serialization
null
null
null
null
open
Java serialization with static initialization === In Java, static and transient fields are not serialized. However, I found out that initialization of static fields causes the generated serialVersionUID to be changed. For example, `static int MYINT = 3;` causes the serialVersionUID to change. In this example, it makes sense because different versions of the class would get different initial values. Why does any initialization change the serialVersionUID? For example, `static String MYSTRING = System.getProperty("foo");` also causes the serialVersionUID to change.
0
41,504
09/03/2008 11:52:41
797
08/09/2008 02:14:04
1,039
37
Timezone lookup from latitude longitude
Is there any library (or even better, web service) available which can convert from a latitude/longitude into a time zone?
web-services
api
timezone
geocoding
null
null
open
Timezone lookup from latitude longitude === Is there any library (or even better, web service) available which can convert from a latitude/longitude into a time zone?
0
41,511
09/03/2008 12:00:26
4,386
09/03/2008 12:00:26
1
0
How to use 32bit alpha-blended BMP in .Net
Is there any way to use this kind of format in .Net (C#)? I want to use the same skin format that uTorrent uses in my app, but i can't get the transparent background. Any ideas? Thanks for your time.
c#
.net
alpha
blending
null
null
open
How to use 32bit alpha-blended BMP in .Net === Is there any way to use this kind of format in .Net (C#)? I want to use the same skin format that uTorrent uses in my app, but i can't get the transparent background. Any ideas? Thanks for your time.
0
41,522
09/03/2008 12:09:48
277
08/04/2008 10:55:22
403
14
Tips for Learning Elisp?
I have been using emacs for years now and I keep meaning to get a better understanding of elisp so I can customize the editor. One problem I have found is that it is a fairly daunting task to get started with. I have a basic understanding of LISP syntax, but is there any articles out there to help someone get started? Perhaps a tutorial on the programming, or a couple of suggestions of useful and straightforward things to implement?
emacs
elisp
tutorial
null
null
null
open
Tips for Learning Elisp? === I have been using emacs for years now and I keep meaning to get a better understanding of elisp so I can customize the editor. One problem I have found is that it is a fairly daunting task to get started with. I have a basic understanding of LISP syntax, but is there any articles out there to help someone get started? Perhaps a tutorial on the programming, or a couple of suggestions of useful and straightforward things to implement?
0
41,547
09/03/2008 12:22:44
3,355
08/28/2008 07:36:57
101
5
Always including the user in the django template context
I am working on a small intranet site for a small company, where user should be able to post. I have imagined a very simple authentication mechanism where people just enter their email address, and gets sent a unique login url, that sets a cookie that will always identify them for future requests. In my template setup, I have base.html, and the other pages extend this. I want to show logged in or register button in the base.html, but how can I ensure that the necessary variables are always a part of the context? It seems that each view just sets up the context as they like, and there is no global context population. Is there a way of doing this without including the user in each context creation? Or will I have to make my own custom shortcuts to setup the context properly?
python
authentication
django
session
cookies
null
open
Always including the user in the django template context === I am working on a small intranet site for a small company, where user should be able to post. I have imagined a very simple authentication mechanism where people just enter their email address, and gets sent a unique login url, that sets a cookie that will always identify them for future requests. In my template setup, I have base.html, and the other pages extend this. I want to show logged in or register button in the base.html, but how can I ensure that the necessary variables are always a part of the context? It seems that each view just sets up the context as they like, and there is no global context population. Is there a way of doing this without including the user in each context creation? Or will I have to make my own custom shortcuts to setup the context properly?
0
41,561
09/03/2008 12:34:44
4,315
09/02/2008 20:08:30
51
1
XML namespaces and attributes
I'm trying to understand how namespaces work in XML. When I have an element like foo:bar, the attributes will often not have namespaces on them. But sometimes they will. Are the attribute in the namespace of the element, even when the default namespace has been declared? Looking over the xsd for xhtml it seems the attributes are part of the schema and should be in the namespace for xhtml, but they are never presented that way...
xml
namespaces
xsd
null
null
null
open
XML namespaces and attributes === I'm trying to understand how namespaces work in XML. When I have an element like foo:bar, the attributes will often not have namespaces on them. But sometimes they will. Are the attribute in the namespace of the element, even when the default namespace has been declared? Looking over the xsd for xhtml it seems the attributes are part of the schema and should be in the namespace for xhtml, but they are never presented that way...
0
41,562
09/03/2008 12:35:45
4,319
09/02/2008 20:20:46
94
8
How do I do monkeypatching in python?
I've had to do some introspection in python and it wasn't pretty: name = sys._getframe(1).f_code name = "%s:%d %s()" %(os.path.split(name.co_filename)[1],name.co_firstlineno,name.co_name) To get something like foo.py:22 bar() blah blah In our debugging output. I'd ideally like to prepend anything to stderr with this sort of information -- Is it possible to change the behaviour of print globally within python?
python
monkeypatching
null
null
null
null
open
How do I do monkeypatching in python? === I've had to do some introspection in python and it wasn't pretty: name = sys._getframe(1).f_code name = "%s:%d %s()" %(os.path.split(name.co_filename)[1],name.co_firstlineno,name.co_name) To get something like foo.py:22 bar() blah blah In our debugging output. I'd ideally like to prepend anything to stderr with this sort of information -- Is it possible to change the behaviour of print globally within python?
0
41,568
09/03/2008 12:39:52
832
08/09/2008 06:51:40
3,432
223
Whats the best way to test a method from multiple threads?
this kind of follows on from another [question](http://stackoverflow.com/questions/41290/file-access-strategy-in-a-multi-threaded-environment-web-app) of mine. Basically, once I have the code to access the file (will review the answers there in a minute) what would be the best way to **test** it? I am thinking create method which just spawns lots of [BackgroundWorker][1]'s or something and tells them to all load/save the file, and test with varying file/object sizes. Then, get a response back from the threads to see if it failed/succeeded/made the world implode etc. Can you guys offer any suggestions on the best way to approach this? As I said before, this is all kinda new to me :) Many thanks. [1]: http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx
c#
multithreading
unit-testing
testing
null
null
open
Whats the best way to test a method from multiple threads? === this kind of follows on from another [question](http://stackoverflow.com/questions/41290/file-access-strategy-in-a-multi-threaded-environment-web-app) of mine. Basically, once I have the code to access the file (will review the answers there in a minute) what would be the best way to **test** it? I am thinking create method which just spawns lots of [BackgroundWorker][1]'s or something and tells them to all load/save the file, and test with varying file/object sizes. Then, get a response back from the threads to see if it failed/succeeded/made the world implode etc. Can you guys offer any suggestions on the best way to approach this? As I said before, this is all kinda new to me :) Many thanks. [1]: http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx
0
41,576
09/03/2008 12:43:50
91
08/01/2008 17:55:22
5,430
234
Conditional Display in ASPX Pages on Sharepoint
I wonder what the best practice for this scenario is: I have a Sharepoint Site (MOSS2007) with an ASPX Page on it. However, I cannot use any inline source and stuff like Event handlers do not work, because Sharepoint does not allow Server Side Script on ASPX Pages per default. Two solutions: 1. Change the PageParserPath in web.config as per [this site][1] > &lt;PageParserPaths&gt; > &lt;PageParserPath VirtualPath="/pages/test.aspx" CompilationMode="Always" AllowServerSideScript="true" /&gt; > &lt;/PageParserPaths&gt; 2. Create all the controls and Wire them up to Events in the .cs File, thus completely eliminating some of the benefits of ASP.net I wonder what the best practice would be? Number 1 looks like it's the correct choice, but changing the web.config is something I want to use sparingly whenever possible. [1]: http://blogs.msdn.com/kaevans/archive/2007/04/26/code-blocks-are-not-allowed-in-this-file-using-server-side-code-with-sharepoint.aspx
asp.net
sharepoint
null
null
null
null
open
Conditional Display in ASPX Pages on Sharepoint === I wonder what the best practice for this scenario is: I have a Sharepoint Site (MOSS2007) with an ASPX Page on it. However, I cannot use any inline source and stuff like Event handlers do not work, because Sharepoint does not allow Server Side Script on ASPX Pages per default. Two solutions: 1. Change the PageParserPath in web.config as per [this site][1] > &lt;PageParserPaths&gt; > &lt;PageParserPath VirtualPath="/pages/test.aspx" CompilationMode="Always" AllowServerSideScript="true" /&gt; > &lt;/PageParserPaths&gt; 2. Create all the controls and Wire them up to Events in the .cs File, thus completely eliminating some of the benefits of ASP.net I wonder what the best practice would be? Number 1 looks like it's the correct choice, but changing the web.config is something I want to use sparingly whenever possible. [1]: http://blogs.msdn.com/kaevans/archive/2007/04/26/code-blocks-are-not-allowed-in-this-file-using-server-side-code-with-sharepoint.aspx
0
41,580
09/03/2008 12:47:10
2,820
08/25/2008 11:37:16
82
7
Should I Keep Registering A Failure?
I'm working on an automated regression test suite for an app which I maintain. While developing the automated regression test, I ran across some behavior that's almost certainly a bug. So, for now, I've modified the automated regression test to not register a failure--it's deliberately allowing this bad behavior to go by, I mean. So, I am interested in the opinions of others on this site. Obviously, I'll add a bug to our defect tracking to make sure this error behavior gets fixed. But are there any compelling reasons (either way) to either change the regression test to constantly indicate failure or leave the regression test broken and not have a failure until we can get to fixing the defective behavior? I think of this as a 6 of one and a half-dozen of the other type of question but I ask here because I thought others may see it differently.
testing
patterns
qa
regression
null
null
open
Should I Keep Registering A Failure? === I'm working on an automated regression test suite for an app which I maintain. While developing the automated regression test, I ran across some behavior that's almost certainly a bug. So, for now, I've modified the automated regression test to not register a failure--it's deliberately allowing this bad behavior to go by, I mean. So, I am interested in the opinions of others on this site. Obviously, I'll add a bug to our defect tracking to make sure this error behavior gets fixed. But are there any compelling reasons (either way) to either change the regression test to constantly indicate failure or leave the regression test broken and not have a failure until we can get to fixing the defective behavior? I think of this as a 6 of one and a half-dozen of the other type of question but I ask here because I thought others may see it differently.
0
41,583
09/03/2008 12:48:42
1,034
08/11/2008 16:29:38
8
4
How to do a sample rate conversion in Windows (and OSX)
I am about to write an audio file converter for my side job at the university. As part of this I would need sample rate conversion. However, my professor said that it would be pretty hard to write a sample rate converter that was *both* of good quality *and* fast. On my research on the subject, I found some functions in the OSX CoreAudio-framework, that could do a sample rate conversion (AudioConverter.h). After all, an OS has to have some facilities to do that for its own audio stack. Do you know a similar method for C/C++ and Windows, that are either part of the OS or open source? I am pretty sure that this function exists within DirectX Audio (XAudio2?), but I seem to be unable to find a reference to it in the MSDN library.
c++
windows
osx
audio
null
null
open
How to do a sample rate conversion in Windows (and OSX) === I am about to write an audio file converter for my side job at the university. As part of this I would need sample rate conversion. However, my professor said that it would be pretty hard to write a sample rate converter that was *both* of good quality *and* fast. On my research on the subject, I found some functions in the OSX CoreAudio-framework, that could do a sample rate conversion (AudioConverter.h). After all, an OS has to have some facilities to do that for its own audio stack. Do you know a similar method for C/C++ and Windows, that are either part of the OS or open source? I am pretty sure that this function exists within DirectX Audio (XAudio2?), but I seem to be unable to find a reference to it in the MSDN library.
0
41,590
09/03/2008 12:54:06
1,585
08/16/2008 21:03:55
351
21
How do you properly use namespaces in C++?
I come from a Java background, where packages are used, not namespaces. I'm used to putting classes that work together to form a complete object into packages, and then reusing them later from that package. But now I'm working in C++. How do you use namespaces in C++? Do you create a single namespace for the entire application, or do you create namespaces for the major components? If so, how do you create objects from classes in other namespaces?
c++
qt
namespace
null
null
null
open
How do you properly use namespaces in C++? === I come from a Java background, where packages are used, not namespaces. I'm used to putting classes that work together to form a complete object into packages, and then reusing them later from that package. But now I'm working in C++. How do you use namespaces in C++? Do you create a single namespace for the entire application, or do you create namespaces for the major components? If so, how do you create objects from classes in other namespaces?
0
41,594
09/03/2008 12:55:25
2,720
08/24/2008 17:15:55
33
2
Import OLE Object from Access to MySQL
I have a table in an access table which contains Product entries, one of the columns has a jpg image stored as an OLE Object. I am trying to import this table to MySQL but nothing seems to work. I have tried the MySQL migration tool but that has a known issue with Access and OLE Objects. (The issue being it doesnt work and leaves the fields blank) I also tried the suggestion on [this site][1] [1]: http://www.plus2net.com/sql_tutorial/access_to_mysql.php and while the data is imported it seems as though the image is getting corrupted in the transfer. When i try to preview the image i just get a binary view, if i save it on disk as a jpg image and try to open it i get an error stating the image is corrupt. The images in Access are fine and can be previewed. Access is storing the data as an OLE Object and when i import it to MySql it is saved in a MediumBlob field. Has anyone had this issue before and how did they resolve it ?
mysql
ms-access
import
data-transfer
null
null
open
Import OLE Object from Access to MySQL === I have a table in an access table which contains Product entries, one of the columns has a jpg image stored as an OLE Object. I am trying to import this table to MySQL but nothing seems to work. I have tried the MySQL migration tool but that has a known issue with Access and OLE Objects. (The issue being it doesnt work and leaves the fields blank) I also tried the suggestion on [this site][1] [1]: http://www.plus2net.com/sql_tutorial/access_to_mysql.php and while the data is imported it seems as though the image is getting corrupted in the transfer. When i try to preview the image i just get a binary view, if i save it on disk as a jpg image and try to open it i get an error stating the image is corrupt. The images in Access are fine and can be previewed. Access is storing the data as an OLE Object and when i import it to MySql it is saved in a MediumBlob field. Has anyone had this issue before and how did they resolve it ?
0