question_id
int64
4
6.31M
answer_id
int64
7
6.31M
title
stringlengths
9
150
question_body
stringlengths
0
28.8k
answer_body
stringlengths
60
27.2k
question_text
stringlengths
40
28.9k
combined_text
stringlengths
124
39.6k
tags
listlengths
1
6
question_score
int64
0
26.3k
answer_score
int64
0
28.8k
view_count
int64
15
14M
answer_count
int64
0
182
favorite_count
int64
0
32
question_creation_date
stringdate
2008-07-31 21:42:52
2011-06-10 18:12:18
answer_creation_date
stringdate
2008-07-31 22:17:57
2011-06-10 18:14:17
198,581
198,592
Non-deterministic finite state machines in software development?
Recently I've been thinking about finite state machines (FSMs), and how I would implement them in software (programming language doesn't matter). My understanding is that deterministic state machines are in widespread use (parses/lexers, compilers and so on), but what's the matter with non-deterministic state machines?...
Most regular expression engines use non -deterministic automata since they offer much greater flexibility. DFAs are much more restricted. Have a look at some implementations and you'll see this. Microsoft even underlines this fact in their documentation of the.NET Regex class: The.NET Framework regular expression engin...
Non-deterministic finite state machines in software development? Recently I've been thinking about finite state machines (FSMs), and how I would implement them in software (programming language doesn't matter). My understanding is that deterministic state machines are in widespread use (parses/lexers, compilers and so ...
TITLE: Non-deterministic finite state machines in software development? QUESTION: Recently I've been thinking about finite state machines (FSMs), and how I would implement them in software (programming language doesn't matter). My understanding is that deterministic state machines are in widespread use (parses/lexers,...
[ "algorithm", "language-agnostic", "math", "state-machine" ]
8
8
4,764
8
0
2008-10-13T18:41:20.420000
2008-10-13T18:44:18.430000
198,606
199,286
Can I use commas in a URL?
I typically use URL rewriting to pass content IDs to my website, so this Foo.1.aspx rewrites to Foo.aspx?id=1 For a specific application I need to pass in multiple IDs to a single page, so I've rewritten things to accept this: Foo.1,2,3,4,5.aspx This works fine in Cassini (the built-in ad hoc web server for Visual Stud...
I recall that Url Routing by default first checks to see if the file exists, and commas are not legal in filenames, which is parhaps why you are getting errors. IIS may have legacy code that aborts the request before it can get to asp.net for processing. Scott Hanselman's blog post talks a bit about this and may be rel...
Can I use commas in a URL? I typically use URL rewriting to pass content IDs to my website, so this Foo.1.aspx rewrites to Foo.aspx?id=1 For a specific application I need to pass in multiple IDs to a single page, so I've rewritten things to accept this: Foo.1,2,3,4,5.aspx This works fine in Cassini (the built-in ad hoc...
TITLE: Can I use commas in a URL? QUESTION: I typically use URL rewriting to pass content IDs to my website, so this Foo.1.aspx rewrites to Foo.aspx?id=1 For a specific application I need to pass in multiple IDs to a single page, so I've rewritten things to accept this: Foo.1,2,3,4,5.aspx This works fine in Cassini (t...
[ "asp.net", "iis", "url", "url-rewriting" ]
53
31
127,009
8
0
2008-10-13T18:46:20.970000
2008-10-13T22:37:29.257000
198,612
198,636
Any free HTML Image Slicer?
I was given one big JPG of the HTML interface. Now I need to break it down into pieces and assemble them with html table. Without a slicer it's pretty arduous and error prone. I do not have photoshop or firework, does anybody know of any free utilities that I can use?
I guess you could do it with GIMP. It is free and opensource.
Any free HTML Image Slicer? I was given one big JPG of the HTML interface. Now I need to break it down into pieces and assemble them with html table. Without a slicer it's pretty arduous and error prone. I do not have photoshop or firework, does anybody know of any free utilities that I can use?
TITLE: Any free HTML Image Slicer? QUESTION: I was given one big JPG of the HTML interface. Now I need to break it down into pieces and assemble them with html table. Without a slicer it's pretty arduous and error prone. I do not have photoshop or firework, does anybody know of any free utilities that I can use? ANSW...
[ "html", "image" ]
3
8
26,143
11
0
2008-10-13T18:48:26.660000
2008-10-13T18:55:00.283000
198,625
200,260
Determine if IP is blocked
Does anyone know if it is possible to reliably determine (programattically C/C++...) whether or not a firewall or IP filtering software is installed on a Windows PC? I need to detect whether a certain server IP is being blocked in my client software by the host OS. I don't need to worry about external hardware firewals...
After reading some of your comments in reply to other answers, I think this might actually be closer to what you're looking for. It might not catch every type of firewall but any major firewall vendor should be registered with the Security Center and therefore detected with this method. You could also combine this with...
Determine if IP is blocked Does anyone know if it is possible to reliably determine (programattically C/C++...) whether or not a firewall or IP filtering software is installed on a Windows PC? I need to detect whether a certain server IP is being blocked in my client software by the host OS. I don't need to worry about...
TITLE: Determine if IP is blocked QUESTION: Does anyone know if it is possible to reliably determine (programattically C/C++...) whether or not a firewall or IP filtering software is installed on a Windows PC? I need to detect whether a certain server IP is being blocked in my client software by the host OS. I don't n...
[ "c++", "windows", "security", "networking" ]
2
3
7,912
8
0
2008-10-13T18:52:27.527000
2008-10-14T07:31:13.127000
198,650
199,070
Multiple Data Tables in PHP/MySQL?
In asp.net, you can retrieve MULTIPLE datatables from a single call to the database. Can you do the same thing in php? Example: $sql ="select * from t1; select * from t2;"; $result = SomeQueryFunc($sql); print_r($result[0]); // dump results for t1 print_r($result[1]); // dump results for t2 Can you do something like th...
This is called "multi-query." The mysql extension in PHP does not have any means to enable multi-query. The mysqli extension does allow you to use multi-query, but only through the multi_query() method. See http://php.net/manual/en/mysqli.multi-query.php Using multi-query is not recommended, because it can increase the...
Multiple Data Tables in PHP/MySQL? In asp.net, you can retrieve MULTIPLE datatables from a single call to the database. Can you do the same thing in php? Example: $sql ="select * from t1; select * from t2;"; $result = SomeQueryFunc($sql); print_r($result[0]); // dump results for t1 print_r($result[1]); // dump results ...
TITLE: Multiple Data Tables in PHP/MySQL? QUESTION: In asp.net, you can retrieve MULTIPLE datatables from a single call to the database. Can you do the same thing in php? Example: $sql ="select * from t1; select * from t2;"; $result = SomeQueryFunc($sql); print_r($result[0]); // dump results for t1 print_r($result[1])...
[ "php", "mysql", "dataset" ]
3
3
2,102
4
0
2008-10-13T18:57:31.120000
2008-10-13T21:19:34.297000
198,654
206,623
Looking for evolutionary music example code
I would like to implement an interactive evolutionary algorithm for generating music (probably just simple melodies to start with). I'd like to use JFugue for this. Its website claims that it is well-suited to evolutionary music, but I can't find any evolutionary examples. I already have a framework to provide the evol...
So far I've found only this, which is a genetic programming example in C. Update (January 2010): And this online system, which doesn't have source code but is an example of what can be achieved. I also found Grammidity, which allows for sequences of MIDI events to be evolved from grammars. Update (July 2011): I've just...
Looking for evolutionary music example code I would like to implement an interactive evolutionary algorithm for generating music (probably just simple melodies to start with). I'd like to use JFugue for this. Its website claims that it is well-suited to evolutionary music, but I can't find any evolutionary examples. I ...
TITLE: Looking for evolutionary music example code QUESTION: I would like to implement an interactive evolutionary algorithm for generating music (probably just simple melodies to start with). I'd like to use JFugue for this. Its website claims that it is well-suited to evolutionary music, but I can't find any evoluti...
[ "java", "genetic-algorithm", "evolutionary-algorithm", "jfugue" ]
8
1
1,771
3
0
2008-10-13T18:58:36.327000
2008-10-15T21:42:12.847000
198,668
336,403
.NET assemblyBinding configuration ignored in machine.config
I have a situation where I need to be able to load assemblies in the GAC based on their partial names. In order to do this I have added the following to my app.config file: This works exactly the way I want it to. However, if I place the same element in my machine.config file, it seems to be ignored, and I get FileNotF...
The framework won't read qualifyAssebmly configuration from machine.config, it only reads it from your application configuration file. The framework does recognize your runtim element, however it does not recognize the qualifyAssembly element.
.NET assemblyBinding configuration ignored in machine.config I have a situation where I need to be able to load assemblies in the GAC based on their partial names. In order to do this I have added the following to my app.config file: This works exactly the way I want it to. However, if I place the same element in my ma...
TITLE: .NET assemblyBinding configuration ignored in machine.config QUESTION: I have a situation where I need to be able to load assemblies in the GAC based on their partial names. In order to do this I have added the following to my app.config file: This works exactly the way I want it to. However, if I place the sam...
[ ".net", "configuration", "clr", "gac", "fusion" ]
0
2
3,881
2
0
2008-10-13T19:05:15.020000
2008-12-03T07:17:01.107000
198,670
198,901
JQuery Select Box and Loop Help
Thanks for reading. I'm a bit new to jQuery, and am trying to make a script I can include in all my websites to solve a problem that always drives me crazy... The problem: Select boxes with long options get cut off in Internet Explorer. For example, these select boxes: http://discoverfire.com/test/select.php In Firefox...
To modify each select, try this: $('select').each(function(){ $('option', this).each(function() { // your normalizing script here }) }); The second parameter (this) on the second jQuery call scopes the selecter ('option'), so it is essentially 'all option elements within this select'. You can think of that second pa...
JQuery Select Box and Loop Help Thanks for reading. I'm a bit new to jQuery, and am trying to make a script I can include in all my websites to solve a problem that always drives me crazy... The problem: Select boxes with long options get cut off in Internet Explorer. For example, these select boxes: http://discoverfir...
TITLE: JQuery Select Box and Loop Help QUESTION: Thanks for reading. I'm a bit new to jQuery, and am trying to make a script I can include in all my websites to solve a problem that always drives me crazy... The problem: Select boxes with long options get cut off in Internet Explorer. For example, these select boxes: ...
[ "javascript", "jquery", "forms", "element" ]
9
11
36,087
2
0
2008-10-13T19:05:51.837000
2008-10-13T20:22:11.510000
198,679
198,807
Convert audio stream to WAV byte array in Java without temp file
Given an InputStream called in which contains audio data in a compressed format (such as MP3 or OGG), I wish to create a byte array containing a WAV conversion of the input data. Unfortunately, if you try to do this, JavaSound hands you the following error: java.io.IOException: stream length not specified I managed to ...
The problem is that the most AudioFileWriters need to know the file size in advance if writing to an OutputStream. Because you can't provide this, it always fails. Unfortunatly, the default Java sound API implementation doesn't have any alternatives. But you can try using the AudioOutputStream architecture from the Tri...
Convert audio stream to WAV byte array in Java without temp file Given an InputStream called in which contains audio data in a compressed format (such as MP3 or OGG), I wish to create a byte array containing a WAV conversion of the input data. Unfortunately, if you try to do this, JavaSound hands you the following erro...
TITLE: Convert audio stream to WAV byte array in Java without temp file QUESTION: Given an InputStream called in which contains audio data in a compressed format (such as MP3 or OGG), I wish to create a byte array containing a WAV conversion of the input data. Unfortunately, if you try to do this, JavaSound hands you ...
[ "java", "audio", "wav", "javasound" ]
9
7
29,124
5
0
2008-10-13T19:07:11.553000
2008-10-13T19:53:03.817000
198,692
198,748
Can I pickle a python dictionary into a sqlite3 text field?
Any gotchas I should be aware of? Can I store it in a text field, or do I need to use a blob? (I'm not overly familiar with either pickle or sqlite, so I wanted to make sure I'm barking up the right tree with some of my high-level design ideas.)
If you want to store a pickled object, you'll need to use a blob, since it is binary data. However, you can, say, base64 encode the pickled object to get a string that can be stored in a text field. Generally, though, doing this sort of thing is indicative of bad design, since you're storing opaque data you lose the ab...
Can I pickle a python dictionary into a sqlite3 text field? Any gotchas I should be aware of? Can I store it in a text field, or do I need to use a blob? (I'm not overly familiar with either pickle or sqlite, so I wanted to make sure I'm barking up the right tree with some of my high-level design ideas.)
TITLE: Can I pickle a python dictionary into a sqlite3 text field? QUESTION: Any gotchas I should be aware of? Can I store it in a text field, or do I need to use a blob? (I'm not overly familiar with either pickle or sqlite, so I wanted to make sure I'm barking up the right tree with some of my high-level design idea...
[ "python", "sqlite", "pickle" ]
44
23
34,381
14
0
2008-10-13T19:11:13.853000
2008-10-13T19:31:36.213000
198,703
199,110
Why isn't querying a JDBC-compliant database from Oracle as easy as pie?
Ok, so it's almost as easy as pie already. But it really should be as easier than it is. I think I should be able to connect to another database just by putting a JDBC connection string into TNSNAMES. Every database vendor has a type-4 JDBC driver and there's usually a good, free alternative. With Oracle being such kee...
It's a real question - perhaps slightly jokey but certainly not rhetorical. It is entirely in Oracle's interest to make it really easy to access other people's data. At the moment there's lots of ways to do it but none sufficiently straightforward. There's a JVM in the database and JDBC drivers to every other database ...
Why isn't querying a JDBC-compliant database from Oracle as easy as pie? Ok, so it's almost as easy as pie already. But it really should be as easier than it is. I think I should be able to connect to another database just by putting a JDBC connection string into TNSNAMES. Every database vendor has a type-4 JDBC driver...
TITLE: Why isn't querying a JDBC-compliant database from Oracle as easy as pie? QUESTION: Ok, so it's almost as easy as pie already. But it really should be as easier than it is. I think I should be able to connect to another database just by putting a JDBC connection string into TNSNAMES. Every database vendor has a ...
[ "java", "oracle", "jdbc" ]
0
0
745
4
0
2008-10-13T19:16:29.833000
2008-10-13T21:32:54.067000
198,717
199,212
asp:SiteMapPath with dynamic images
Ok, so I'm building bread crumbs and depending on the value of the breadcrumb an image will be the seperator. So "HOME" will have one image and "SEARCH" will have another. I know I can do this programatically (at least I ASSUME) but is there an easier way to do this? Can I link an image to a node based on the value of ...
I see you have already accepted an answer, but I thought some code would help, so here is some: Site1.Master Site1.Master.cs private string lastItemKey = ""; public void Item_Bound(Object sender, SiteMapNodeItemEventArgs e) { if (e.Item.ItemType == SiteMapNodeItemType.PathSeparator) { string imageUrl = ((Image) e.Item....
asp:SiteMapPath with dynamic images Ok, so I'm building bread crumbs and depending on the value of the breadcrumb an image will be the seperator. So "HOME" will have one image and "SEARCH" will have another. I know I can do this programatically (at least I ASSUME) but is there an easier way to do this? Can I link an im...
TITLE: asp:SiteMapPath with dynamic images QUESTION: Ok, so I'm building bread crumbs and depending on the value of the breadcrumb an image will be the seperator. So "HOME" will have one image and "SEARCH" will have another. I know I can do this programatically (at least I ASSUME) but is there an easier way to do this...
[ "controls", "asp.net-3.5", "sitemappath" ]
1
0
1,794
2
0
2008-10-13T19:20:09.047000
2008-10-13T22:17:07.910000
198,720
198,745
ColdFusion web.xml?
Is there a ColdFusion analog for the deployment descriptor/web.xml file found in a J2EE web container? I know CF is running on top of JRun and that I could just tweak the JRun dd, but what about an application-specific configuration file? Is there something like this that I'm not aware of or do you just have to roll yo...
ColdFusion 8 has several application-specific configurations that can be set in the application.cfc file application.cfc also implements several "general events" which occur during application execution.
ColdFusion web.xml? Is there a ColdFusion analog for the deployment descriptor/web.xml file found in a J2EE web container? I know CF is running on top of JRun and that I could just tweak the JRun dd, but what about an application-specific configuration file? Is there something like this that I'm not aware of or do you ...
TITLE: ColdFusion web.xml? QUESTION: Is there a ColdFusion analog for the deployment descriptor/web.xml file found in a J2EE web container? I know CF is running on top of JRun and that I could just tweak the JRun dd, but what about an application-specific configuration file? Is there something like this that I'm not a...
[ "jakarta-ee", "coldfusion" ]
3
3
1,008
5
0
2008-10-13T19:20:40.307000
2008-10-13T19:30:46.887000
198,721
198,734
Converting a Word document into usable HTML in PHP
I have a set of Word documents which I want to publish using a PHP tool I've written. I copy and paste the Word documents into a text box and then save them into MySQL using the PHP program. The problem I Have arises from all the non-standard characters that Word documents have, like curly quotes and ellipses ("..."). ...
A better solution would be to ensure that your database is set-up to support UTF-8 characters. The additional characters available in the extended set should cover all the "non-standard" characters that you're talking about. Otherwise, if you really must convert these characters into HTML entities, use htmlentities().
Converting a Word document into usable HTML in PHP I have a set of Word documents which I want to publish using a PHP tool I've written. I copy and paste the Word documents into a text box and then save them into MySQL using the PHP program. The problem I Have arises from all the non-standard characters that Word docum...
TITLE: Converting a Word document into usable HTML in PHP QUESTION: I have a set of Word documents which I want to publish using a PHP tool I've written. I copy and paste the Word documents into a text box and then save them into MySQL using the PHP program. The problem I Have arises from all the non-standard characte...
[ "php", "ms-word" ]
6
4
7,456
5
0
2008-10-13T19:20:43.927000
2008-10-13T19:27:01.810000
198,726
198,800
Subversion repository layout for libraries developed across different programs
I'm responsible for several (rather small) programs, which share a lot of code via different libraries. I'm wondering what the best repository layout is to develop the different prorgrams (and libraries), and keep the libraries in sync across all the programs. For the sake of argument let's say there are two programs w...
Well, I guess I disagree that externals are out of the question. I've had a similar problem in the past. I solved it using the svn property externals. Create your library repositories: svnadmin create /path/library1 svnadmin create /path/library2... Create client repositories: svnadmin create /path/program1 svnadmin cr...
Subversion repository layout for libraries developed across different programs I'm responsible for several (rather small) programs, which share a lot of code via different libraries. I'm wondering what the best repository layout is to develop the different prorgrams (and libraries), and keep the libraries in sync acros...
TITLE: Subversion repository layout for libraries developed across different programs QUESTION: I'm responsible for several (rather small) programs, which share a lot of code via different libraries. I'm wondering what the best repository layout is to develop the different prorgrams (and libraries), and keep the libra...
[ "svn", "repository" ]
13
9
2,162
2
0
2008-10-13T19:23:54.793000
2008-10-13T19:48:52.717000
198,744
198,797
Remove the *.cs, *.Designer.cs codebehind files?
Yeah, its a bit on this side of pointless, but I was wondering... I've got all these codebehind files cluttering my MVC app. The only reason why I need these files, as far as I can tell, is to tell ASP.NET that my page extends from ViewPage rather than Page. I've tried a couple different Page directives changes, but no...
Delete the codebehind and use a page directive like this: <%@ Page Title="Title" Inherits="System.Web.Mvc.ViewPage" Language="C#" MasterPageFile="~/Views/Layouts/Site.Master" %> Or, if you want to get rid of the codebehind but still want to use strongly typed view, then read this link: http://devlicio.us/blogs/tim_barc...
Remove the *.cs, *.Designer.cs codebehind files? Yeah, its a bit on this side of pointless, but I was wondering... I've got all these codebehind files cluttering my MVC app. The only reason why I need these files, as far as I can tell, is to tell ASP.NET that my page extends from ViewPage rather than Page. I've tried a...
TITLE: Remove the *.cs, *.Designer.cs codebehind files? QUESTION: Yeah, its a bit on this side of pointless, but I was wondering... I've got all these codebehind files cluttering my MVC app. The only reason why I need these files, as far as I can tell, is to tell ASP.NET that my page extends from ViewPage rather than ...
[ "asp.net-mvc", "code-behind" ]
2
4
3,332
3
0
2008-10-13T19:30:46.183000
2008-10-13T19:47:58.943000
198,754
255,795
How do you map a native to IL instruction pointer in-process
When using the unmanaged API for the.NET framework to profile a.NET process in-process, is it possible to look up the IL instruction pointer that correlates to the native instruction pointer provided to the StackSnapshotCallback function? As is probably obvious, I am taking a snapshot of the current stack, and would li...
In order to translate from a native instruction pointer as provided by ICorProfilerInfo2::DoStackSnapshot to an intermediate language method offset, you must take two steps since DoStackSnapshot provides a FunctionID and native instruction pointer as a virtual memory address. Step 1, is to convert the instruction point...
How do you map a native to IL instruction pointer in-process When using the unmanaged API for the.NET framework to profile a.NET process in-process, is it possible to look up the IL instruction pointer that correlates to the native instruction pointer provided to the StackSnapshotCallback function? As is probably obvio...
TITLE: How do you map a native to IL instruction pointer in-process QUESTION: When using the unmanaged API for the.NET framework to profile a.NET process in-process, is it possible to look up the IL instruction pointer that correlates to the native instruction pointer provided to the StackSnapshotCallback function? As...
[ ".net", "profiling", "clr-profiling-api" ]
12
9
1,689
2
0
2008-10-13T19:33:32.530000
2008-11-01T17:21:06.130000
198,772
624,641
Convert a Visual Studio resource file to a text file?
I know there are tools to get text files to resource files for Visual Studio. But I want to get the text from my resource files to a text file so they can be translated. Or is there a better way to do this?
You can use Simple Resx Editor, it has some interesting features that will help you into the translation process.
Convert a Visual Studio resource file to a text file? I know there are tools to get text files to resource files for Visual Studio. But I want to get the text from my resource files to a text file so they can be translated. Or is there a better way to do this?
TITLE: Convert a Visual Studio resource file to a text file? QUESTION: I know there are tools to get text files to resource files for Visual Studio. But I want to get the text from my resource files to a text file so they can be translated. Or is there a better way to do this? ANSWER: You can use Simple Resx Editor, ...
[ "visual-studio", "localization", "resource-file" ]
8
2
15,223
7
0
2008-10-13T19:38:16.653000
2009-03-09T00:46:04.203000
198,777
199,529
Windows Powershell & visual studio '08 paths
I'm trying to configure Windows Powershell to work with Visual Studio. Nothing fancy, just get things set so I can cl & nmake. I think all I need to do is edit the path setting(but I don't know how to set that in WPSH).
After much digging around, I created a directory in My Documents named WindowsPowerShell, created a file named Microsoft.PowerShell_profile.ps1, and(after a few iterations), inserted the following code in it, and it works. function Get-Batchfile($file) { $theCmd = "`"$file`" & set" cmd /c $theCmd | Foreach-Object { $th...
Windows Powershell & visual studio '08 paths I'm trying to configure Windows Powershell to work with Visual Studio. Nothing fancy, just get things set so I can cl & nmake. I think all I need to do is edit the path setting(but I don't know how to set that in WPSH).
TITLE: Windows Powershell & visual studio '08 paths QUESTION: I'm trying to configure Windows Powershell to work with Visual Studio. Nothing fancy, just get things set so I can cl & nmake. I think all I need to do is edit the path setting(but I don't know how to set that in WPSH). ANSWER: After much digging around, I...
[ "visual-studio", "powershell", "configuration-files" ]
2
2
830
2
0
2008-10-13T19:39:55.993000
2008-10-14T00:14:13.163000
198,781
198,790
RegEx to tell if a string does not contain a specific character
Easy question this time. I'm trying to test whether or not a string does not contain a character using regular expressions. I thought the expression was of the form "[^ x ]" where x is the character that you don't want to appear, but that doesn't seem to be working. For example, Regex.IsMatch("103","[^0]") and Regex.Is...
Your solution is half right. The match you see is for the other characters. What you want to say is something like "hey! I do not want to see this character in the entire string". In that case you do: Regex.IsMatch("103","^[^0]*$")
RegEx to tell if a string does not contain a specific character Easy question this time. I'm trying to test whether or not a string does not contain a character using regular expressions. I thought the expression was of the form "[^ x ]" where x is the character that you don't want to appear, but that doesn't seem to b...
TITLE: RegEx to tell if a string does not contain a specific character QUESTION: Easy question this time. I'm trying to test whether or not a string does not contain a character using regular expressions. I thought the expression was of the form "[^ x ]" where x is the character that you don't want to appear, but that...
[ ".net", "regex", "regex-negation" ]
35
54
89,735
6
0
2008-10-13T19:43:06.113000
2008-10-13T19:45:27.310000
198,803
198,815
Secure methods of storing keys, passwords for asp.net
What is the best practice for storing keys, and or passwords for a website. These keys are for various 3rd party web services. Is it best to have them in the Web.config file, or in the database, or encrypted somehow?
Assuming your database isn't accessible from the outside world or that you have it properly locked down that would be the preferred way to store the keys. This allows all of your applications to pull from the same store of keys/passwords making changes very quick and easy.
Secure methods of storing keys, passwords for asp.net What is the best practice for storing keys, and or passwords for a website. These keys are for various 3rd party web services. Is it best to have them in the Web.config file, or in the database, or encrypted somehow?
TITLE: Secure methods of storing keys, passwords for asp.net QUESTION: What is the best practice for storing keys, and or passwords for a website. These keys are for various 3rd party web services. Is it best to have them in the Web.config file, or in the database, or encrypted somehow? ANSWER: Assuming your database...
[ "security" ]
2
3
1,334
3
0
2008-10-13T19:51:35.380000
2008-10-13T19:56:36.570000
198,805
201,538
How to send email in HTML format with Microsoft Enterprise Library?
I know how to send mails using the Microsoft Enterprise Library 2.0 using a text formatter. But these emails are always in plain text. Is there any way with entlib 2.0 to send these mails in HTML format?
Well that is funny, I am now writing my own answer. What I did was use the source code of entlib. Within Microsoft.Practices.EnterpriseLibrary.Logging and Microsoft.Practices.EnterpriseLibrary.Logging.TraceListenerData I found the classes that I needed. Copy EmailMessage.cs to EmailMessageHTML.cs Copy EmailTraceListene...
How to send email in HTML format with Microsoft Enterprise Library? I know how to send mails using the Microsoft Enterprise Library 2.0 using a text formatter. But these emails are always in plain text. Is there any way with entlib 2.0 to send these mails in HTML format?
TITLE: How to send email in HTML format with Microsoft Enterprise Library? QUESTION: I know how to send mails using the Microsoft Enterprise Library 2.0 using a text formatter. But these emails are always in plain text. Is there any way with entlib 2.0 to send these mails in HTML format? ANSWER: Well that is funny, I...
[ "html", "logging", "enterprise-library" ]
7
7
3,672
1
0
2008-10-13T19:52:39.573000
2008-10-14T15:02:59.830000
198,819
198,894
Does it make sense to put a "Send it to a friend" button on a webpage?
How often do we see stuff like "Send this page to a friend" on a webpages? Well, I see them quite often. My question is, how do you guys see it's effectiveness? If I hit a webpage that's interesting, and I think my friend would enjoy it, I can just copy the URL from my browser bar, paste it into the email and press "Se...
The tell-a-friend button has a number of uses that are not so obvious. From the users perspective: A tell a friend button will remind a user to tell a friend when they may not have thought of it themselves, which increases referrals. As part of the page, it's much more noticeable. It also removes technical questions li...
Does it make sense to put a "Send it to a friend" button on a webpage? How often do we see stuff like "Send this page to a friend" on a webpages? Well, I see them quite often. My question is, how do you guys see it's effectiveness? If I hit a webpage that's interesting, and I think my friend would enjoy it, I can just ...
TITLE: Does it make sense to put a "Send it to a friend" button on a webpage? QUESTION: How often do we see stuff like "Send this page to a friend" on a webpages? Well, I see them quite often. My question is, how do you guys see it's effectiveness? If I hit a webpage that's interesting, and I think my friend would enj...
[ "language-agnostic" ]
4
5
1,483
6
0
2008-10-13T19:57:35.007000
2008-10-13T20:19:12.997000
198,825
198,842
Best way to get rid of hungarian notation?
Let's say you've inherited a C# codebase that uses one class with 200 static methods to provide core functionality (such as database lookups). Of the many nightmares in that class, there's copious use of Hungarian notation (the bad kind). Would you refactor the variable names to remove the Hungarian notation, or would ...
Refactor -- I find Hungarian notation on that scale really interferes with the natural readability of the code, and the exercise is a good way of getting familiar with what's there. However, if there are other team members who know the code base you would need consensus on the refactoring, and if any of the variables a...
Best way to get rid of hungarian notation? Let's say you've inherited a C# codebase that uses one class with 200 static methods to provide core functionality (such as database lookups). Of the many nightmares in that class, there's copious use of Hungarian notation (the bad kind). Would you refactor the variable names ...
TITLE: Best way to get rid of hungarian notation? QUESTION: Let's say you've inherited a C# codebase that uses one class with 200 static methods to provide core functionality (such as database lookups). Of the many nightmares in that class, there's copious use of Hungarian notation (the bad kind). Would you refactor t...
[ "coding-style", "refactoring", "hungarian-notation" ]
4
18
3,751
20
0
2008-10-13T19:59:10.947000
2008-10-13T20:04:46.023000
198,831
199,064
Activerecord association question: getting has_many :through to work
I'm building an app in Ruby on Rails, and I'm including 3 of my models (and their migration scripts) to show what I'm trying to do, and what isn't working. Here's the rundown: I have users in my application that belong to teams, and each team can have multiple coaches. I want to be able to pull a list of the coaches th...
You can't do a has_many:through twice in a row. It'll tell you that its an invalid association. If you don't want to add finder_sql like above, you can add a method that mimics what you're trying to do. def coaches self.teams.collect do |team| team.coaches end.flatten.uniq end
Activerecord association question: getting has_many :through to work I'm building an app in Ruby on Rails, and I'm including 3 of my models (and their migration scripts) to show what I'm trying to do, and what isn't working. Here's the rundown: I have users in my application that belong to teams, and each team can have...
TITLE: Activerecord association question: getting has_many :through to work QUESTION: I'm building an app in Ruby on Rails, and I'm including 3 of my models (and their migration scripts) to show what I'm trying to do, and what isn't working. Here's the rundown: I have users in my application that belong to teams, and ...
[ "ruby-on-rails", "ruby", "activerecord" ]
4
4
3,135
5
0
2008-10-13T20:00:44.750000
2008-10-13T21:18:23.567000
198,848
198,860
Set application icon from resources in VS 05
I know I can add a icon to the Resources.resx file of a project and then reference that icon from within the code. How do I set the icon of the entire EXE from the resources? All I see is a place to browse for another file. I want to use the current icon file that I have in my resources and not have to have a duplicate...
The way that the adding of an application icon is that you must select it from the local file system, and then it is embedded into the application at build time. As far as I know it is not possible to have it first pull from a resource file.
Set application icon from resources in VS 05 I know I can add a icon to the Resources.resx file of a project and then reference that icon from within the code. How do I set the icon of the entire EXE from the resources? All I see is a place to browse for another file. I want to use the current icon file that I have in ...
TITLE: Set application icon from resources in VS 05 QUESTION: I know I can add a icon to the Resources.resx file of a project and then reference that icon from within the code. How do I set the icon of the entire EXE from the resources? All I see is a place to browse for another file. I want to use the current icon fi...
[ "visual-studio-2005", "resources", "icons" ]
3
2
3,869
2
0
2008-10-13T20:06:29.077000
2008-10-13T20:09:26.527000
198,849
198,969
How do I make my default (or any static) route permanent on Linux (Fedora 9 specifically)?
I've just performed a new installation of the very latest (Fall, 2008) version of Fedora 9 Linux and am perplexed that it never set the default route properly and that even traveling the labyrinthine ways of this OS, there's no obvious way. Of course, it's clear that one can do it on a one-off basis like this: route ad...
The gateway is normally set in /etc/sysconfig/network-scripts/ifcfg-eth0, not in /etc/sysconfig/network. For example, on my current machine: /etc/sysconfig/network NETWORKING=yes NETWORKING_IPV6=no HOSTNAME=flyboys NISDOMAIN=ekcineon /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 ONBOOT=yes HWADDR=00:1d:09:31:3a...
How do I make my default (or any static) route permanent on Linux (Fedora 9 specifically)? I've just performed a new installation of the very latest (Fall, 2008) version of Fedora 9 Linux and am perplexed that it never set the default route properly and that even traveling the labyrinthine ways of this OS, there's no o...
TITLE: How do I make my default (or any static) route permanent on Linux (Fedora 9 specifically)? QUESTION: I've just performed a new installation of the very latest (Fall, 2008) version of Fedora 9 Linux and am perplexed that it never set the default route properly and that even traveling the labyrinthine ways of thi...
[ "linux", "installation", "default", "fedora", "routes" ]
8
9
59,776
6
0
2008-10-13T20:06:41.400000
2008-10-13T20:44:17.347000
198,852
209,093
Visual Studio 2003 Merge Modules
I am using Visual Studio 2005 to make an install. The application has a dependency on a DLL that was built with MFC 7.1 (from Visual Studio 2003). Are there merge modules for MFC 7.1 or other redistributables like there are for MFC 8? Where could they be found?
These merge modules are usually located in %ProgramFiles%\Common Files\Merge Modules. Look for these files: vc_user_crt71_rtl_x86_---.msm (has msvcr71.dll) vc_user_mfc71_rtl_x86_---.msm (has mfc71.dll) vc_user_stl71_rtl_x86_---.msm (has msvcp71.dll) vc_user_mfc71_loc_rtl_x86_---.msm (has mfc71*.dll localized versions)
Visual Studio 2003 Merge Modules I am using Visual Studio 2005 to make an install. The application has a dependency on a DLL that was built with MFC 7.1 (from Visual Studio 2003). Are there merge modules for MFC 7.1 or other redistributables like there are for MFC 8? Where could they be found?
TITLE: Visual Studio 2003 Merge Modules QUESTION: I am using Visual Studio 2005 to make an install. The application has a dependency on a DLL that was built with MFC 7.1 (from Visual Studio 2003). Are there merge modules for MFC 7.1 or other redistributables like there are for MFC 8? Where could they be found? ANSWER...
[ "visual-studio", "visual-studio-2005", "installation", "visual-studio-2003", "merge-module" ]
2
3
2,129
2
0
2008-10-13T20:07:32.023000
2008-10-16T15:36:26.373000
198,857
198,887
Linq to SQL - Can you submit changes for a single object?
Is there support in Linq to SQL for submitting changes to a single object? The SubmitChanges method sends all of the changes to the database, but what if I'm associating with an errorlog table and only want to save the records going into the errorlog without submitting all of the changes to my other tables? Example: Ob...
Here is a good article about how to manage the lifetime of the Linq to SQL DataContext, might help you...
Linq to SQL - Can you submit changes for a single object? Is there support in Linq to SQL for submitting changes to a single object? The SubmitChanges method sends all of the changes to the database, but what if I'm associating with an errorlog table and only want to save the records going into the errorlog without sub...
TITLE: Linq to SQL - Can you submit changes for a single object? QUESTION: Is there support in Linq to SQL for submitting changes to a single object? The SubmitChanges method sends all of the changes to the database, but what if I'm associating with an errorlog table and only want to save the records going into the er...
[ ".net", "linq-to-sql" ]
1
2
3,384
2
0
2008-10-13T20:08:25.330000
2008-10-13T20:18:00.427000
198,868
198,923
Suggestions for a MessageBox.Show replacement that does not block GUI thread?
a while back I ran across a situation where we needed to display message-boxes to the user for notifications but we could not use MessageBox.Show because it blocks the GUI thread (so nothing on the screen gets updated while the dialog is active). Any suggestions on an alternative? [I coded an alternative at the time bu...
I agree with rslite and Mitchel Sellers. Creating a non-Modal form to display the information needed is the best route to go. If you have multiple messages, you might want to consider putting them into a ListBox and have the user double-click on them to get the full information needing to be displayed.
Suggestions for a MessageBox.Show replacement that does not block GUI thread? a while back I ran across a situation where we needed to display message-boxes to the user for notifications but we could not use MessageBox.Show because it blocks the GUI thread (so nothing on the screen gets updated while the dialog is acti...
TITLE: Suggestions for a MessageBox.Show replacement that does not block GUI thread? QUESTION: a while back I ran across a situation where we needed to display message-boxes to the user for notifications but we could not use MessageBox.Show because it blocks the GUI thread (so nothing on the screen gets updated while ...
[ ".net", "user-interface", "messagebox" ]
3
4
5,861
7
0
2008-10-13T20:12:21.937000
2008-10-13T20:30:11.587000
198,870
329,240
Does Google Maps respect the <BalloonStyle> definition in KML?
I'm using the GGeoXml object to overlay KML on an embedded Google Map. I need to customize the popup balloon for placemarks, so I'm trying to use the element: Concessions... This works as expected in Google Earth, but the embedded map API appears to ignore this altogether. I suppose I could just leave out the element a...
No, like you have mentioned, html in the description is the only way I know that you can control the style of balloons through kml/georss feed.
Does Google Maps respect the <BalloonStyle> definition in KML? I'm using the GGeoXml object to overlay KML on an embedded Google Map. I need to customize the popup balloon for placemarks, so I'm trying to use the element: Concessions... This works as expected in Google Earth, but the embedded map API appears to ignore ...
TITLE: Does Google Maps respect the <BalloonStyle> definition in KML? QUESTION: I'm using the GGeoXml object to overlay KML on an embedded Google Map. I need to customize the popup balloon for placemarks, so I'm trying to use the element: Concessions... This works as expected in Google Earth, but the embedded map API ...
[ "google-maps", "kml" ]
2
1
3,044
3
0
2008-10-13T20:14:11.447000
2008-11-30T19:51:47.590000
198,873
198,925
OS Compatibility for various .NET Framework versions
What are the minimum OS requirements for each of the.Net frameworks? E.g. for which version is it impossible to run each OS on: Windows 95 Windows 98 Windows 98SE Windows ME Windows NT 3.x Windows NT 4 Windows 2000 I believe all.Net frameworks are compatible w/ XP, Vista, Windows Server 2003, and Windows Server 2008 (p...
1.x and 2.0 work all the way back to Win98 but stop before Windows 8 (not verified)..NET Framework 2.0 Supported Operating Systems according to Microsoft: Windows 98 Windows ME Windows 2000 Windows XP Windows Vista (included with OS) Windows Server 2003 Windows Server 2008 (included with OS).NET Framework 3.0 Supported...
OS Compatibility for various .NET Framework versions What are the minimum OS requirements for each of the.Net frameworks? E.g. for which version is it impossible to run each OS on: Windows 95 Windows 98 Windows 98SE Windows ME Windows NT 3.x Windows NT 4 Windows 2000 I believe all.Net frameworks are compatible w/ XP, V...
TITLE: OS Compatibility for various .NET Framework versions QUESTION: What are the minimum OS requirements for each of the.Net frameworks? E.g. for which version is it impossible to run each OS on: Windows 95 Windows 98 Windows 98SE Windows ME Windows NT 3.x Windows NT 4 Windows 2000 I believe all.Net frameworks are c...
[ ".net", "windows", "version-compatibility" ]
57
110
62,364
4
0
2008-10-13T20:14:34.223000
2008-10-13T20:30:49.807000
198,892
198,903
img onload doesn't work well in IE7
I have an img tag in my webapp that uses the onload handler to resize the image: This works fine in Firefox 3, but fails in IE7 because the image object being passed to the SizeImage() function has a width and height of 0 for some reason -- maybe IE calls the function before it finishes loading?. In researching this, I...
IE7 is trying to resize the image before the DOM tree is fully rendered. You need to run it on document.onload... you'll just need to make sure your function can handle being passed a reference to the element that isn't "this." Alternatively... and I hope this isn't a flameable offense... jQuery makes stuff like this r...
img onload doesn't work well in IE7 I have an img tag in my webapp that uses the onload handler to resize the image: This works fine in Firefox 3, but fails in IE7 because the image object being passed to the SizeImage() function has a width and height of 0 for some reason -- maybe IE calls the function before it finis...
TITLE: img onload doesn't work well in IE7 QUESTION: I have an img tag in my webapp that uses the onload handler to resize the image: This works fine in Firefox 3, but fails in IE7 because the image object being passed to the SizeImage() function has a width and height of 0 for some reason -- maybe IE calls the functi...
[ "javascript", "html", "internet-explorer", "image" ]
14
6
30,082
8
0
2008-10-13T20:18:52.937000
2008-10-13T20:23:40.790000
198,910
200,185
How can I add an image to my Run for a RichTextBlock?
I wrote a small WPF app where I like to prepend text into a RichTextBox, so that the newest stuff is on top. I wrote this, and it works: /// /// Prepends the text to the rich textbox /// /// The text representing the character information. private void PrependSimpleText(string textoutput) { Run run = new Run(textoutput...
Try the following: BitmapImage bi = new BitmapImage(new Uri(@"C:\SimpleImage.jpg")); Image image = new Image(); image.Source = bi; InlineUIContainer container = new InlineUIContainer(image); Paragraph paragraph = new Paragraph(container); RichTextBoxOutput.Document.Blocks.Add(paragraph); The InlineUIContainer is the "m...
How can I add an image to my Run for a RichTextBlock? I wrote a small WPF app where I like to prepend text into a RichTextBox, so that the newest stuff is on top. I wrote this, and it works: /// /// Prepends the text to the rich textbox /// /// The text representing the character information. private void PrependSimple...
TITLE: How can I add an image to my Run for a RichTextBlock? QUESTION: I wrote a small WPF app where I like to prepend text into a RichTextBox, so that the newest stuff is on top. I wrote this, and it works: /// /// Prepends the text to the rich textbox /// /// The text representing the character information. private ...
[ "c#", "wpf" ]
1
11
6,104
2
0
2008-10-13T20:26:49.380000
2008-10-14T06:36:38.027000
198,936
204,537
Best practices for grails index page
What is the right way to populate the model for the index page in a grails app? There is no IndexController by default, is there some other mechanism for getting lists of this and that into the model?
I won't claim that this is the right way, but it is one way to start things off. It doesn't take much to have a controller be the default. Add a mapping to UrlMappings.groovy: class UrlMappings { static mappings = { "/$controller/$action?/$id?"{ constraints { // apply constraints here } } "500"(view:'/error') "/" { con...
Best practices for grails index page What is the right way to populate the model for the index page in a grails app? There is no IndexController by default, is there some other mechanism for getting lists of this and that into the model?
TITLE: Best practices for grails index page QUESTION: What is the right way to populate the model for the index page in a grails app? There is no IndexController by default, is there some other mechanism for getting lists of this and that into the model? ANSWER: I won't claim that this is the right way, but it is one...
[ "grails", "indexing", "model" ]
27
36
23,622
4
0
2008-10-13T20:34:12.187000
2008-10-15T12:34:44.323000
198,945
199,031
How do I use raw sockets in Perl?
How can you get a raw socket in Perl, and then what's the best way to built a packet for use with it?
Looks like Net::RawIP was what I was looking for: use Net::RawIP; $a = new Net::RawIP; $a->set({ip => {saddr => 'my.target.lan',daddr => 'my.target.lan'}, tcp => {source => 139,dest => 139,psh => 1, syn => 1}}); $a->send; $a->ethnew("eth0"); $a->ethset(source => 'my.target.lan',dest =>'my.target.lan'); $a->ethsend; $...
How do I use raw sockets in Perl? How can you get a raw socket in Perl, and then what's the best way to built a packet for use with it?
TITLE: How do I use raw sockets in Perl? QUESTION: How can you get a raw socket in Perl, and then what's the best way to built a packet for use with it? ANSWER: Looks like Net::RawIP was what I was looking for: use Net::RawIP; $a = new Net::RawIP; $a->set({ip => {saddr => 'my.target.lan',daddr => 'my.target.lan'}, tc...
[ "perl", "networking", "sockets" ]
4
4
10,384
7
0
2008-10-13T20:35:34.680000
2008-10-13T21:05:55.337000
198,952
198,962
Correct way to give users access to additional schemas in Oracle
I have two users Bob and Alice in Oracle, both created by running the following commands as sysdba from sqlplus: create user $blah identified by $password; grant resource, connect, create view to $blah; I want Bob to have complete access to Alice's schema (that is, all tables), but I'm not sure what grant to run, and w...
AFAIK you need to do the grants object one at a time. Typically you'd use a script to do this, something along the lines of: SELECT 'GRANT ALL ON '||table_name||' TO BOB;' FROM ALL_TABLES WHERE OWNER = 'ALICE'; And similar for other db objects. You could put a package in each schema that you need to issue the grant fro...
Correct way to give users access to additional schemas in Oracle I have two users Bob and Alice in Oracle, both created by running the following commands as sysdba from sqlplus: create user $blah identified by $password; grant resource, connect, create view to $blah; I want Bob to have complete access to Alice's schema...
TITLE: Correct way to give users access to additional schemas in Oracle QUESTION: I have two users Bob and Alice in Oracle, both created by running the following commands as sysdba from sqlplus: create user $blah identified by $password; grant resource, connect, create view to $blah; I want Bob to have complete access...
[ "oracle", "schema", "sql-grant" ]
15
22
93,268
3
0
2008-10-13T20:39:30.010000
2008-10-13T20:41:59.753000
198,970
198,980
Is it possible to initialize a const struct without using a function?
I have a fairly simple const struct in some C code that simply holds a few pointers and would like to initialize it statically if possible. Can I and, if so, how?
You can, if the pointers point to global objects: // In global scope int x, y; const struct {int *px, *py; } s = {&x, &y};
Is it possible to initialize a const struct without using a function? I have a fairly simple const struct in some C code that simply holds a few pointers and would like to initialize it statically if possible. Can I and, if so, how?
TITLE: Is it possible to initialize a const struct without using a function? QUESTION: I have a fairly simple const struct in some C code that simply holds a few pointers and would like to initialize it statically if possible. Can I and, if so, how? ANSWER: You can, if the pointers point to global objects: // In glob...
[ "c" ]
12
15
14,628
4
0
2008-10-13T20:44:26.927000
2008-10-13T20:47:46.810000
198,974
199,085
ASP.NET Regular Expression Validator (Password Strength)
I have a validation control that has the following expression: (?=(.*\\d.*){2,})(?=(.*\\w.*){2,})(?=(.*\\W.*){1,}).{8,} That's a password with at least 2 digits, 2 alpha characters, 1 non-alphanumeric and 8 character minimum. Unfortunately this doesn't seem to be cross-browser compliant. This validation works perfectly...
(?=(.*\W.*){0,}) is not 0 non-alphanumeric characters. It is at least 0 non-alphanumeric characters. If you wanted the password to not contain any non-alphanumeric characters you could do either (?!.*\W) or (?=\w*$). A simpler solution would be to skip the \W look-ahead, and use \w{8,} instead of.{8,}. Also, \w include...
ASP.NET Regular Expression Validator (Password Strength) I have a validation control that has the following expression: (?=(.*\\d.*){2,})(?=(.*\\w.*){2,})(?=(.*\\W.*){1,}).{8,} That's a password with at least 2 digits, 2 alpha characters, 1 non-alphanumeric and 8 character minimum. Unfortunately this doesn't seem to be...
TITLE: ASP.NET Regular Expression Validator (Password Strength) QUESTION: I have a validation control that has the following expression: (?=(.*\\d.*){2,})(?=(.*\\w.*){2,})(?=(.*\\W.*){1,}).{8,} That's a password with at least 2 digits, 2 alpha characters, 1 non-alphanumeric and 8 character minimum. Unfortunately this ...
[ "javascript", "asp.net", "regex", "validation" ]
10
15
31,326
3
0
2008-10-13T20:44:46.143000
2008-10-13T21:23:39.577000
198,979
201,719
VS2008 Debugger Hang
I'm using Visual Studio 2008 Team System with SP1, and I've noticed an annoying tendency for the IDE to hang for several (10-15) seconds whenever I stop debugging an application. At first I thought this only happened with WPF apps, but I've observed the behavior in Windows Forms apps and ASP.NET sites as well. I've mad...
Looking at your ProcMon results, it appears that it's that CreateFile() call that's taking all the time. I'm assuming that all activity is waiting for that thread to return. You can verify this -- with some difficulty -- in Process Explorer (also part of the SysInternals package previously linked), using the Threads ta...
VS2008 Debugger Hang I'm using Visual Studio 2008 Team System with SP1, and I've noticed an annoying tendency for the IDE to hang for several (10-15) seconds whenever I stop debugging an application. At first I thought this only happened with WPF apps, but I've observed the behavior in Windows Forms apps and ASP.NET si...
TITLE: VS2008 Debugger Hang QUESTION: I'm using Visual Studio 2008 Team System with SP1, and I've noticed an annoying tendency for the IDE to hang for several (10-15) seconds whenever I stop debugging an application. At first I thought this only happened with WPF apps, but I've observed the behavior in Windows Forms a...
[ "visual-studio-2008" ]
6
2
4,427
9
0
2008-10-13T20:47:25.423000
2008-10-14T15:46:22.423000
198,982
199,063
How to do Gesture Recognition using Accelerometers
My goal is to recognize simple gestures from accelerometers mounted on a sun spot. A gesture could be as simple as rotating the device or moving the device in several different motions. The device currently only has accelerometers but we are considering adding gyroscopes if it would make it easier/more accurate. Does a...
The accelerometers will be registering a constant acceleration due to gravity, plus any acceleration the device is subjected to by the user, plus noise. You will need to low pass filter the samples to get rid of as much irrelevant noise as you can. The worst of the noise will generally be higher frequency than any poss...
How to do Gesture Recognition using Accelerometers My goal is to recognize simple gestures from accelerometers mounted on a sun spot. A gesture could be as simple as rotating the device or moving the device in several different motions. The device currently only has accelerometers but we are considering adding gyroscop...
TITLE: How to do Gesture Recognition using Accelerometers QUESTION: My goal is to recognize simple gestures from accelerometers mounted on a sun spot. A gesture could be as simple as rotating the device or moving the device in several different motions. The device currently only has accelerometers but we are consideri...
[ "java", "embedded", "accelerometer", "gesture-recognition" ]
20
23
19,677
4
0
2008-10-13T20:48:05.123000
2008-10-13T21:17:57.310000
198,984
199,002
Global Find and Replace in Visual Studio
I have a solution with multiple projects and we need to do some serious global replacements. Is there a way to do a wildcard replacement where some values remain in after the replace? So, for instance if I want every HttpContext.Current.Session[“whatevervalue”] to become HttpContext.Current.Session[“whatevervalue”].ToS...
First, Backup your Projects, just in case... Always a good idea before mass replacements. Then, in the Find/Replace Dialog, select the Use Regular Expressions checkbox: In the Find box, use the pattern: HttpContext\.Current\.Session\["{.@}"\] and in the Replace box, use: HttpContext.Current.Session["\1"].ToString()
Global Find and Replace in Visual Studio I have a solution with multiple projects and we need to do some serious global replacements. Is there a way to do a wildcard replacement where some values remain in after the replace? So, for instance if I want every HttpContext.Current.Session[“whatevervalue”] to become HttpCon...
TITLE: Global Find and Replace in Visual Studio QUESTION: I have a solution with multiple projects and we need to do some serious global replacements. Is there a way to do a wildcard replacement where some values remain in after the replace? So, for instance if I want every HttpContext.Current.Session[“whatevervalue”]...
[ "visual-studio", "ide", "replace", "find" ]
5
18
5,137
6
0
2008-10-13T20:48:22.223000
2008-10-13T20:54:14.410000
198,991
199,069
Recommendations for a small c-based vector and matrix library
I'm in need of a lightweight library for 2d & 3d vectors and 3x3 & 4x4 matrices. In basic C. Just so I don't reinvent the wheel suboptimally. Any suggestions?
Meschach is a c-only vector/matrix library, significantly smaller than e.g. LAPACK (according to the FAQ, at least:)
Recommendations for a small c-based vector and matrix library I'm in need of a lightweight library for 2d & 3d vectors and 3x3 & 4x4 matrices. In basic C. Just so I don't reinvent the wheel suboptimally. Any suggestions?
TITLE: Recommendations for a small c-based vector and matrix library QUESTION: I'm in need of a lightweight library for 2d & 3d vectors and 3x3 & 4x4 matrices. In basic C. Just so I don't reinvent the wheel suboptimally. Any suggestions? ANSWER: Meschach is a c-only vector/matrix library, significantly smaller than e...
[ "c", "math", "vector" ]
15
11
18,627
7
0
2008-10-13T20:50:45.557000
2008-10-13T21:19:29.350000
198,994
199,001
Whats the best way to offer credit card payment on your website?
I want to offer credit card payment on my website and was wondering whats the best (or prefered) way to do so? I know I could use Google checkout, paypal, etc. but this is not what i am looking for. I am looking for a simple basic CC payment which supports all the different credit cards only.
If you don't want to use an external processor, this is hard. The security issues are huge, and I can't seriously imagine a bank allowing you to do it. I would strongly recommend you use Paypal, Google Checkout or WorldPay, or whatever payment processing system is provided/recommended by your bank.
Whats the best way to offer credit card payment on your website? I want to offer credit card payment on my website and was wondering whats the best (or prefered) way to do so? I know I could use Google checkout, paypal, etc. but this is not what i am looking for. I am looking for a simple basic CC payment which support...
TITLE: Whats the best way to offer credit card payment on your website? QUESTION: I want to offer credit card payment on my website and was wondering whats the best (or prefered) way to do so? I know I could use Google checkout, paypal, etc. but this is not what i am looking for. I am looking for a simple basic CC pay...
[ "web", "credit-card", "payment" ]
6
3
4,750
9
0
2008-10-13T20:51:45.927000
2008-10-13T20:54:11.790000
198,996
200,281
Absolute Positioning using XSL to be transformed and rendered to PDF
How does one accomplish absolute positioning using XSL? I am working on a XSL transformation to FO to PDF for mailing letters and am trying to figure out how to absolutely position the fo:blocks containing the Return Address and Recipient Address so that they are displayed in the windows on the envelope. Anyone have su...
I'm not an expert at this and neither do I have (at the moment) an XSL-FO processor here to test this but shouldn't something like this work? (don't take it literally please) BLABLABLABLABLABLABLABLABLABLABLABLABLABLABLABLABLABLABLABLA absolute
Absolute Positioning using XSL to be transformed and rendered to PDF How does one accomplish absolute positioning using XSL? I am working on a XSL transformation to FO to PDF for mailing letters and am trying to figure out how to absolutely position the fo:blocks containing the Return Address and Recipient Address so t...
TITLE: Absolute Positioning using XSL to be transformed and rendered to PDF QUESTION: How does one accomplish absolute positioning using XSL? I am working on a XSL transformation to FO to PDF for mailing letters and am trying to figure out how to absolutely position the fo:blocks containing the Return Address and Reci...
[ "xslt", "pdf", "xsl-fo" ]
4
9
7,583
1
0
2008-10-13T20:52:09.390000
2008-10-14T07:42:19.843000
199,006
199,020
Using an ObservableCollection<T> with Background Threads
It seems like Microsoft had a great idea with the ObservableCollection. They are great for binding, and are super fast on the UI. However, requiring a context switch to the Dispatcher Thread every time you want to tweak it seems like a bit much. Does anyone know the best practices for using them? Is it simply to popula...
Is updating the ObservableCollection on the UI thread really causing that much of a bottleneck for your application? If not, stick with updating it on the UI thread. Remember, it's not really a context switch that's happening when you run something with the Dispatcher - instead, you're simply submitting a job to the UI...
Using an ObservableCollection<T> with Background Threads It seems like Microsoft had a great idea with the ObservableCollection. They are great for binding, and are super fast on the UI. However, requiring a context switch to the Dispatcher Thread every time you want to tweak it seems like a bit much. Does anyone know ...
TITLE: Using an ObservableCollection<T> with Background Threads QUESTION: It seems like Microsoft had a great idea with the ObservableCollection. They are great for binding, and are super fast on the UI. However, requiring a context switch to the Dispatcher Thread every time you want to tweak it seems like a bit much....
[ ".net", "design-patterns", "observablecollection" ]
6
2
1,333
2
0
2008-10-13T20:55:31.240000
2008-10-13T21:00:19.950000
199,014
201,190
Getting "Object is read only" error when setting ClientCredentials in WCF
I have a proxy object generated by Visual Studio (client side) named ServerClient. I am attempting to set ClientCredentials.UserName.UserName/Password before opening up a new connection using this code: InstanceContext context = new InstanceContext(this); m_client = new ServerClient(context); m_client.ClientCredential...
It appears that you can only access these properties pretty early in the instanciation cycle. If I override the constructor in the proxy class (ServerClient), I'm able to set these properties: base.ClientCredentials.UserName.UserName = "Sample"; I'm beginning to appreciate the people who suggest not using the automatic...
Getting "Object is read only" error when setting ClientCredentials in WCF I have a proxy object generated by Visual Studio (client side) named ServerClient. I am attempting to set ClientCredentials.UserName.UserName/Password before opening up a new connection using this code: InstanceContext context = new InstanceConte...
TITLE: Getting "Object is read only" error when setting ClientCredentials in WCF QUESTION: I have a proxy object generated by Visual Studio (client side) named ServerClient. I am attempting to set ClientCredentials.UserName.UserName/Password before opening up a new connection using this code: InstanceContext context =...
[ "visual-studio", "wcf" ]
23
10
31,889
13
0
2008-10-13T20:57:31.110000
2008-10-14T13:43:11.517000
199,016
206,933
wglCreateContext in C# failing but not in managed C++
I'm trying to use opengl in C#. I have following code which fails with error 2000 ERROR_INVALID_PIXEL_FORMAT First definitions: [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true, ExactSpelling = true)] public static extern IntPtr GetDC(IntPtr hWnd); [StructLayout(LayoutKind.Sequential)] public struc...
Found solution. Problem is very strange ugly and really hard to find. Somwhere on the internet I found that when you are linking opengl32.lib while compiling c++ application it must be placed before gdi32.lib. The reason for this is that (supposedly) opengl32.dll is overwriting ChoosePixelFormat and SetPixelFormat func...
wglCreateContext in C# failing but not in managed C++ I'm trying to use opengl in C#. I have following code which fails with error 2000 ERROR_INVALID_PIXEL_FORMAT First definitions: [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true, ExactSpelling = true)] public static extern IntPtr GetDC(IntPtr hWnd...
TITLE: wglCreateContext in C# failing but not in managed C++ QUESTION: I'm trying to use opengl in C#. I have following code which fails with error 2000 ERROR_INVALID_PIXEL_FORMAT First definitions: [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true, ExactSpelling = true)] public static extern IntPtr...
[ "c#", "c++", "opengl" ]
5
15
4,903
3
0
2008-10-13T20:59:16.567000
2008-10-15T23:48:01.327000
199,017
199,123
Strict HTML Validation and Filtering in PHP
I'm looking for best practices for performing strict (whitelist) validation/filtering of user-submitted HTML. Main purpose is to filter out XSS and similar nasties that may be entered via web forms. Secondary purpose is to limit breakage of HTML content entered by non-technical users e.g. via WYSIWYG editor that has an...
I've tested all exploits I know on HTML Purifier and it did very well. It filters not only HTML, but also CSS and URLs. Once you narrow elements and attributes to innocent ones, the pitfalls are in attribute content – javascript: pseudo-URLs (IE allows tab characters in protocol name - java script: still works) and CSS...
Strict HTML Validation and Filtering in PHP I'm looking for best practices for performing strict (whitelist) validation/filtering of user-submitted HTML. Main purpose is to filter out XSS and similar nasties that may be entered via web forms. Secondary purpose is to limit breakage of HTML content entered by non-technic...
TITLE: Strict HTML Validation and Filtering in PHP QUESTION: I'm looking for best practices for performing strict (whitelist) validation/filtering of user-submitted HTML. Main purpose is to filter out XSS and similar nasties that may be entered via web forms. Secondary purpose is to limit breakage of HTML content ente...
[ "php", "html", "security", "validation", "xss" ]
16
8
5,246
4
0
2008-10-13T21:00:04.523000
2008-10-13T21:39:12.040000
199,035
199,166
PHP PEAR Spreadsheet_Excel_Writer sending an empty file
Has anyone used Pear: Spreadsheet_Excel_Writer? The Formatting Tutorial lists a script similar to what I'm working with: (trimmed down) addWorksheet(); $worksheet->write(0, 0, "Quarterly Profits for Dotcom.Com"); $workbook->send('test.xls'); $workbook->close();?> What I think I understand so far about it... $workbook-...
Here is some sample code: addWorksheet('My first worksheet'); if (PEAR::isError($worksheet)) { die($worksheet->getMessage()); } $workbook->close();?> I think for starters, give your worksheet a name and try to write a file directly (without send() ). Also, make sure with all methods you call, test the response with PEA...
PHP PEAR Spreadsheet_Excel_Writer sending an empty file Has anyone used Pear: Spreadsheet_Excel_Writer? The Formatting Tutorial lists a script similar to what I'm working with: (trimmed down) addWorksheet(); $worksheet->write(0, 0, "Quarterly Profits for Dotcom.Com"); $workbook->send('test.xls'); $workbook->close();?>...
TITLE: PHP PEAR Spreadsheet_Excel_Writer sending an empty file QUESTION: Has anyone used Pear: Spreadsheet_Excel_Writer? The Formatting Tutorial lists a script similar to what I'm working with: (trimmed down) addWorksheet(); $worksheet->write(0, 0, "Quarterly Profits for Dotcom.Com"); $workbook->send('test.xls'); $wo...
[ "php", "export-to-excel", "pear" ]
2
3
10,091
5
0
2008-10-13T21:07:16.303000
2008-10-13T22:01:54.070000
199,045
199,386
Is there a PHP equivalent of Perl's WWW::Mechanize?
I'm looking for a library that has functionality similar to Perl's WWW::Mechanize, but for PHP. Basically, it should allow me to submit HTTP GET and POST requests with a simple syntax, and then parse the resulting page and return in a simple format all forms and their fields, along with all links on the page. I know ab...
SimpleTest's ScriptableBrowser can be used independendly from the testing framework. I've used it for numerous automation-jobs.
Is there a PHP equivalent of Perl's WWW::Mechanize? I'm looking for a library that has functionality similar to Perl's WWW::Mechanize, but for PHP. Basically, it should allow me to submit HTTP GET and POST requests with a simple syntax, and then parse the resulting page and return in a simple format all forms and their...
TITLE: Is there a PHP equivalent of Perl's WWW::Mechanize? QUESTION: I'm looking for a library that has functionality similar to Perl's WWW::Mechanize, but for PHP. Basically, it should allow me to submit HTTP GET and POST requests with a simple syntax, and then parse the resulting page and return in a simple format a...
[ "php", "automation", "screen-scraping", "mechanize", "www-mechanize" ]
26
23
15,671
9
0
2008-10-13T21:12:14.310000
2008-10-13T23:11:50.980000
199,046
199,057
How do I select a mouse hovered object with JQuery?
I have a list of dynamically generated div-tags with a class-attribute but no id. How do I select the one which is hovered with mouse cursor? In CSS it would be like this: div.classname:hover Oh, and I wouldn't like to use any extra Jquery-plugins.
$('div.classname').hover( function mouseover() { /* do something */}, function mouseout() { /* do other thing */} ); EDIT: Thanks, Micah!
How do I select a mouse hovered object with JQuery? I have a list of dynamically generated div-tags with a class-attribute but no id. How do I select the one which is hovered with mouse cursor? In CSS it would be like this: div.classname:hover Oh, and I wouldn't like to use any extra Jquery-plugins.
TITLE: How do I select a mouse hovered object with JQuery? QUESTION: I have a list of dynamically generated div-tags with a class-attribute but no id. How do I select the one which is hovered with mouse cursor? In CSS it would be like this: div.classname:hover Oh, and I wouldn't like to use any extra Jquery-plugins. ...
[ "javascript", "jquery" ]
3
13
1,603
1
0
2008-10-13T21:12:58.367000
2008-10-13T21:15:55.303000
199,056
199,135
Machine Learning, AI, and Soft Computing
What is the difference between these three heavily related fields? Is there one specific whole they are all a part of (aside from CS)?
Machine Learning could be considered a part of AI, however I would classify Machine Learning as the study of creation of semantic models and adaptive behavior with AI being the overall science of systems that intelligent-seeming behavior. Most of what goes as "AI" is rather simplistic, but highly effective, such as heu...
Machine Learning, AI, and Soft Computing What is the difference between these three heavily related fields? Is there one specific whole they are all a part of (aside from CS)?
TITLE: Machine Learning, AI, and Soft Computing QUESTION: What is the difference between these three heavily related fields? Is there one specific whole they are all a part of (aside from CS)? ANSWER: Machine Learning could be considered a part of AI, however I would classify Machine Learning as the study of creation...
[ "artificial-intelligence", "machine-learning" ]
6
4
8,238
2
0
2008-10-13T21:15:45.083000
2008-10-13T21:46:08.703000
199,059
199,075
A pythonic way to insert a space before capital letters
I've got a file whose format I'm altering via a python script. I have several camel cased strings in this file where I just want to insert a single space before the capital letter - so "WordWordWord" becomes "Word Word Word". My limited regex experience just stalled out on me - can someone think of a decent regex to do...
You could try: >>> re.sub(r"(\w)([A-Z])", r"\1 \2", "WordWordWord") 'Word Word Word'
A pythonic way to insert a space before capital letters I've got a file whose format I'm altering via a python script. I have several camel cased strings in this file where I just want to insert a single space before the capital letter - so "WordWordWord" becomes "Word Word Word". My limited regex experience just stall...
TITLE: A pythonic way to insert a space before capital letters QUESTION: I've got a file whose format I'm altering via a python script. I have several camel cased strings in this file where I just want to insert a single space before the capital letter - so "WordWordWord" becomes "Word Word Word". My limited regex exp...
[ "python", "regex", "text-files" ]
35
61
41,130
10
0
2008-10-13T21:16:40.043000
2008-10-13T21:20:55.540000
199,065
199,083
JavaScript fake dictionaries
I've declared Javascript arrays in such a way that I could then access them by a key, but it was a long time ago, and I've forgotten how I did it. Basically, I have two fields I want to store, a unique key, and its value. I know there is a way to do it.. something like: var jsArray = new {key: 'test test', value: 'valu...
You can do it in different ways: var a = {'a':0, 'b':1, 'c':2}; var b = new Array(); b['a'] = 0; b['b'] = 1; b['c'] = 2; var c = new Object(); c.a = 0; c.b = 1; c.c = 2;
JavaScript fake dictionaries I've declared Javascript arrays in such a way that I could then access them by a key, but it was a long time ago, and I've forgotten how I did it. Basically, I have two fields I want to store, a unique key, and its value. I know there is a way to do it.. something like: var jsArray = new {k...
TITLE: JavaScript fake dictionaries QUESTION: I've declared Javascript arrays in such a way that I could then access them by a key, but it was a long time ago, and I've forgotten how I did it. Basically, I have two fields I want to store, a unique key, and its value. I know there is a way to do it.. something like: va...
[ "javascript", "arrays", "dictionary", "associative-array" ]
1
7
658
4
0
2008-10-13T21:18:23.970000
2008-10-13T21:22:52.853000
199,077
199,310
What is a good toolkit for developing Blackberry applications?
Looking for a toolkit/SDK for general Blackberry development or application toolkits. Anything like an MVC framework?
My understanding is that blackberry's OS is Java ME - based, and that there's a decent development kit for them. I presume you have already looked over everything here... you can find a lot of information, including the development kit download link. Regarding model-view-controller, there's no particular framework to m...
What is a good toolkit for developing Blackberry applications? Looking for a toolkit/SDK for general Blackberry development or application toolkits. Anything like an MVC framework?
TITLE: What is a good toolkit for developing Blackberry applications? QUESTION: Looking for a toolkit/SDK for general Blackberry development or application toolkits. Anything like an MVC framework? ANSWER: My understanding is that blackberry's OS is Java ME - based, and that there's a decent development kit for them....
[ "java", "blackberry", "java-me", "mobile" ]
5
5
1,581
2
0
2008-10-13T21:21:35.523000
2008-10-13T22:43:44.640000
199,078
199,118
Are we moving towards classic ASP using MVC framework in .Net 3.5?
Looking at MVC framework, it seems we require more of classic ASP knowledge then ASP.NET postbacks and Viewstates. Are we moving backwards to complex UI + code logic in the actual frontend HTML markup?
We're moving back to not trying to abstract away fundamental concepts like HTML and HTTP Requests. On the UI end, that translates into the Views being more tightly integrated with the output, which isn't a bad thing. the classic ASP model translated into having everything tightly integrated with the output, which is a ...
Are we moving towards classic ASP using MVC framework in .Net 3.5? Looking at MVC framework, it seems we require more of classic ASP knowledge then ASP.NET postbacks and Viewstates. Are we moving backwards to complex UI + code logic in the actual frontend HTML markup?
TITLE: Are we moving towards classic ASP using MVC framework in .Net 3.5? QUESTION: Looking at MVC framework, it seems we require more of classic ASP knowledge then ASP.NET postbacks and Viewstates. Are we moving backwards to complex UI + code logic in the actual frontend HTML markup? ANSWER: We're moving back to not...
[ "asp.net-mvc", "asp-classic", ".net-3.5", "tags" ]
7
8
702
5
0
2008-10-13T21:21:56.727000
2008-10-13T21:37:09.503000
199,080
199,783
How do I detect what .NET Framework versions and service packs are installed?
A similar question was asked here, but it was specific to.NET 3.5. Specifically, I'm looking for the following: What is the correct way to determine which.NET Framework versions and service packs are installed? Is there a list of registry keys that can be used? Are there any dependencies between Framework versions?
The registry is the official way to detect if a specific version of the Framework is installed. Which registry keys are needed change depending on the Framework version you are looking for: Framework Version Registry Key ------------------------------------------------------------------------------------------ 1.0 HKLM...
How do I detect what .NET Framework versions and service packs are installed? A similar question was asked here, but it was specific to.NET 3.5. Specifically, I'm looking for the following: What is the correct way to determine which.NET Framework versions and service packs are installed? Is there a list of registry key...
TITLE: How do I detect what .NET Framework versions and service packs are installed? QUESTION: A similar question was asked here, but it was specific to.NET 3.5. Specifically, I'm looking for the following: What is the correct way to determine which.NET Framework versions and service packs are installed? Is there a li...
[ ".net", "installation", "version-detection" ]
296
372
341,751
13
0
2008-10-13T21:22:21.357000
2008-10-14T02:04:20.587000
199,099
484,541
How to manage a redirect request after a jQuery Ajax call
I'm using $.post() to call a servlet using Ajax and then using the resulting HTML fragment to replace a div element in the user's current page. However, if the session times out, the server sends a redirect directive to send the user to the login page. In this case, jQuery is replacing the div element with the contents...
The solution that was eventually implemented was to use a wrapper for the callback function of the Ajax call and in this wrapper check for the existence of a specific element on the returned HTML chunk. If the element was found then the wrapper executed a redirection. If not, the wrapper forwarded the call to the actua...
How to manage a redirect request after a jQuery Ajax call I'm using $.post() to call a servlet using Ajax and then using the resulting HTML fragment to replace a div element in the user's current page. However, if the session times out, the server sends a redirect directive to send the user to the login page. In this c...
TITLE: How to manage a redirect request after a jQuery Ajax call QUESTION: I'm using $.post() to call a servlet using Ajax and then using the resulting HTML fragment to replace a div element in the user's current page. However, if the session times out, the server sends a redirect directive to send the user to the log...
[ "javascript", "jquery", "ajax", "redirect" ]
1,532
105
1,149,370
34
0
2008-10-13T21:29:50.063000
2009-01-27T18:10:32.743000
199,113
199,122
How do you cast from Page.Master to a specific master page in ASP.NET
I have a BasePage which inherits from System.Web.UI.Page, and every page that inherits the BasePage will have the same master page. How do I cast the Page.Master of the BasePage to the specific master page so I can access properties on it?
Overriden Master can't be done (its not Virtual), and masking it with new causes an issue with the page class not being able to get its master, so the best thing to do is a second property. Something like: public CustomMasterPage MasterPage { get { return this.Master as CustomMasterPage; } } In your BasePage class.
How do you cast from Page.Master to a specific master page in ASP.NET I have a BasePage which inherits from System.Web.UI.Page, and every page that inherits the BasePage will have the same master page. How do I cast the Page.Master of the BasePage to the specific master page so I can access properties on it?
TITLE: How do you cast from Page.Master to a specific master page in ASP.NET QUESTION: I have a BasePage which inherits from System.Web.UI.Page, and every page that inherits the BasePage will have the same master page. How do I cast the Page.Master of the BasePage to the specific master page so I can access properties...
[ "asp.net-2.0" ]
3
3
3,350
3
0
2008-10-13T21:34:05.453000
2008-10-13T21:38:20.857000
199,127
199,524
Are hidden fields on child window inaccessible from parent window
I have asp.net form that contains fields. When I access this window, my javascript functions can access the fields via the DOM with the getElementById() method and when I postpack to the server I am receiving the updates made by the client. However, when I launch the form as a child window using Telerik's RadWindow con...
To get the ID of your asp.net control do something like this: <%= theControl.ClientID %> getElementByName is not as commonly used as getElementById. The ID attribute is supposed to be unique for each element on the page whereas the name attribute can be duplicated.
Are hidden fields on child window inaccessible from parent window I have asp.net form that contains fields. When I access this window, my javascript functions can access the fields via the DOM with the getElementById() method and when I postpack to the server I am receiving the updates made by the client. However, when...
TITLE: Are hidden fields on child window inaccessible from parent window QUESTION: I have asp.net form that contains fields. When I access this window, my javascript functions can access the fields via the DOM with the getElementById() method and when I postpack to the server I am receiving the updates made by the cli...
[ "asp.net", "javascript", "telerik" ]
1
1
2,224
5
0
2008-10-13T21:41:55.717000
2008-10-14T00:12:12.670000
199,130
199,199
How do I increase the /proc/pid/cmdline 4096 byte limit?
For my Java apps with very long classpaths, I cannot see the main class specified near the end of the arg list when using ps. I think this stems from my Ubuntu system's size limit on /proc/pid/cmdline. How can I increase this limit?
You can't change this dynamically, the limit is hard-coded in the kernel to PAGE_SIZE in fs/proc/base.c: 274 int res = 0; 275 unsigned int len; 276 struct mm_struct *mm = get_task_mm(task); 277 if (!mm) 278 goto out; 279 if (!mm->arg_end) 280 goto out_mm; /* Shh! No looking before we're done */ 281 282 len = mm->arg_en...
How do I increase the /proc/pid/cmdline 4096 byte limit? For my Java apps with very long classpaths, I cannot see the main class specified near the end of the arg list when using ps. I think this stems from my Ubuntu system's size limit on /proc/pid/cmdline. How can I increase this limit?
TITLE: How do I increase the /proc/pid/cmdline 4096 byte limit? QUESTION: For my Java apps with very long classpaths, I cannot see the main class specified near the end of the arg list when using ps. I think this stems from my Ubuntu system's size limit on /proc/pid/cmdline. How can I increase this limit? ANSWER: You...
[ "linux", "process", "classpath", "pid", "limits" ]
42
19
20,397
8
0
2008-10-13T21:43:53.607000
2008-10-13T22:13:50.847000
199,138
199,250
How can I implement Caching Strategy in my Asp.net Mvc With linq2sql repository?
I dont know if I should use the httpcontext caching or the Enterprise Library Caching Application Block. Also, what is the best pattern for the caching Strategy when deleting or updating an entity that is part of a cached list? Should I remove all of a list from the cache or only remove the item from the cached list? I...
There are several approaches to implement caching,httpcontext being the easiest one, but it's not necessarily the worst. Take a look at memcached or MS Velocity, both of which can be used as backends for the ASP.NET Cache. Especially memcached has a reputation of doing a really good job. As for caching policy: you have...
How can I implement Caching Strategy in my Asp.net Mvc With linq2sql repository? I dont know if I should use the httpcontext caching or the Enterprise Library Caching Application Block. Also, what is the best pattern for the caching Strategy when deleting or updating an entity that is part of a cached list? Should I re...
TITLE: How can I implement Caching Strategy in my Asp.net Mvc With linq2sql repository? QUESTION: I dont know if I should use the httpcontext caching or the Enterprise Library Caching Application Block. Also, what is the best pattern for the caching Strategy when deleting or updating an entity that is part of a cached...
[ "asp.net-mvc", "linq-to-sql", "caching", "datacontext" ]
6
2
2,048
3
0
2008-10-13T21:47:18.267000
2008-10-13T22:27:04.237000
199,142
199,148
ASP.NET : Passing a outside variable into a <asp:sqldatasource> tag ASP.NET 2.0
I'm designing some VB based ASP.NET 2.0, and I am trying to make more use of the various ASP tags that visual studio provides, rather than hand writing everything in the code-behind. I want to pass in an outside variable from the Session to identify who the user is for the query. And on my code behind I have: Protected...
I believe Oracle uses the colon ":", not the at-symbol "@". "user" is probably a reserved word. Change it to "userID", or something similar.
ASP.NET : Passing a outside variable into a <asp:sqldatasource> tag ASP.NET 2.0 I'm designing some VB based ASP.NET 2.0, and I am trying to make more use of the various ASP tags that visual studio provides, rather than hand writing everything in the code-behind. I want to pass in an outside variable from the Session to...
TITLE: ASP.NET : Passing a outside variable into a <asp:sqldatasource> tag ASP.NET 2.0 QUESTION: I'm designing some VB based ASP.NET 2.0, and I am trying to make more use of the various ASP tags that visual studio provides, rather than hand writing everything in the code-behind. I want to pass in an outside variable f...
[ "sql", "vb.net", "asp.net-2.0", "selectcommand" ]
0
3
8,659
4
0
2008-10-13T21:48:51.197000
2008-10-13T21:51:20.113000
199,145
336,820
How do you programatically authenticate to a web server using NTLM Authentication with apache's commons httpclient?
I'm using this code, and I get the stack trace that is listed below. I've got this working with just https and with basic authentication, but not ntlm. HttpClient client = null; HttpMethod get = null; try { Protocol myhttps = new Protocol("https", ((ProtocolSocketFactory) new EasySSLProtocolSocketFactory()), 443); Prot...
HttpClient does not fully support NTLM. Please have a look at Known limitations and problems. The HttpClient documentation regarding NTLM is a bit confusing, but the bottom line is that they do not support NTLMv2 which makes it hardly usable in this regard. NTLM is supported by standard java HttpURLConnection ( link ),...
How do you programatically authenticate to a web server using NTLM Authentication with apache's commons httpclient? I'm using this code, and I get the stack trace that is listed below. I've got this working with just https and with basic authentication, but not ntlm. HttpClient client = null; HttpMethod get = null; try...
TITLE: How do you programatically authenticate to a web server using NTLM Authentication with apache's commons httpclient? QUESTION: I'm using this code, and I get the stack trace that is listed below. I've got this working with just https and with basic authentication, but not ntlm. HttpClient client = null; HttpMeth...
[ "java", "httpclient" ]
3
2
6,878
2
0
2008-10-13T21:50:02.457000
2008-12-03T11:00:11.873000
199,152
199,262
Force a full Java applet refresh (AWT)
I have a Java Applet that uses AWT. In some (rare) circumstances, the platform does not refresh the screen properly. I can move or minimize/maximize the window and see that my applet refreshed properly. I am looking for code that will give me the fullest possible applet screen repaint, simulating the behaviour of a min...
This happens all the time if you are not programming carefully in AWT/Swing. First of all, you should do ALL work on the event thread. This means you can't do any of it in your main statement (or anything it calls directly). I know every Java GUI app ever invented violates this rule, but that's the rule. For the most p...
Force a full Java applet refresh (AWT) I have a Java Applet that uses AWT. In some (rare) circumstances, the platform does not refresh the screen properly. I can move or minimize/maximize the window and see that my applet refreshed properly. I am looking for code that will give me the fullest possible applet screen rep...
TITLE: Force a full Java applet refresh (AWT) QUESTION: I have a Java Applet that uses AWT. In some (rare) circumstances, the platform does not refresh the screen properly. I can move or minimize/maximize the window and see that my applet refreshed properly. I am looking for code that will give me the fullest possible...
[ "java", "macos", "applet", "refresh", "awt" ]
1
2
11,902
5
0
2008-10-13T21:53:51.247000
2008-10-13T22:30:23.513000
199,158
199,232
Join query and what do I do with it to display data correctly?
I have a table that stores all the volunteers, and each volunteer will be assigned to an appropriate venue to work the event. There is a table that stores all the venues. It stores the volunteer's appropriate venue assignment into the column venue_id. table: venues columns: id, venue_name table: volunteers_2009 column...
General SQL LEFT Outer join syntax. SELECT volunteers.id, volunteers.lname, volunteers.fname, volunteers.venue_id, venues.venue_name FROM Volunteers_2009 AS Volunteers LEFT OUTER JOIN Venues ON (Volunteers.venue_id = Venues.id)
Join query and what do I do with it to display data correctly? I have a table that stores all the volunteers, and each volunteer will be assigned to an appropriate venue to work the event. There is a table that stores all the venues. It stores the volunteer's appropriate venue assignment into the column venue_id. table...
TITLE: Join query and what do I do with it to display data correctly? QUESTION: I have a table that stores all the volunteers, and each volunteer will be assigned to an appropriate venue to work the event. There is a table that stores all the venues. It stores the volunteer's appropriate venue assignment into the colu...
[ "php", "mysql" ]
0
0
294
3
0
2008-10-13T21:56:02.180000
2008-10-13T22:22:06.447000
199,173
199,208
What is the WiX equivilent of Environment.SpecialFolder.ApplicationData from .NET?
I need to install a file into the Environment.SpecialFolder.ApplicationData folder, which differs between XP and Vista. Is there a built in way to reference the correct folder in WiX or will I have to use conditional checks for OS and do it manually? If I have to do the latter, how do I reference the current windows us...
Use Directory element with Id set to AppDataFolder: This will result in test1.txt being installed to C:\Users\ username \AppData\Roaming\My on Windows 7 and to C:\Documents and Settings\ username \Application Data\My on Windows XP. MSDN has a list of properties that you can use to reference special folders.
What is the WiX equivilent of Environment.SpecialFolder.ApplicationData from .NET? I need to install a file into the Environment.SpecialFolder.ApplicationData folder, which differs between XP and Vista. Is there a built in way to reference the correct folder in WiX or will I have to use conditional checks for OS and do...
TITLE: What is the WiX equivilent of Environment.SpecialFolder.ApplicationData from .NET? QUESTION: I need to install a file into the Environment.SpecialFolder.ApplicationData folder, which differs between XP and Vista. Is there a built in way to reference the correct folder in WiX or will I have to use conditional ch...
[ "wix", "installation", "special-folders" ]
28
52
17,104
1
0
2008-10-13T22:06:07.290000
2008-10-13T22:15:56.587000
199,178
199,189
Is there a .NET namespace where I can find the WIN32 API message-related #defines, like WM_COMMAND, etc
I'm overriding WndProc, so I want to write code like if (m.Msg == WM_COMMAND) my special stuff else base.WndProc(ref m)
AFAIK.NET does not ship with these constants. This site has all the values so is a matter of copy paste. private const UInt32 WM_ACTIVATE = 0x0006; private const UInt32 WM_ACTIVATEAPP = 0x001C; private const UInt32 WM_AFXFIRST = 0x0360; private const UInt32 WM_AFXLAST = 0x037F; private const UInt32 WM_APP = 0x8000; pri...
Is there a .NET namespace where I can find the WIN32 API message-related #defines, like WM_COMMAND, etc I'm overriding WndProc, so I want to write code like if (m.Msg == WM_COMMAND) my special stuff else base.WndProc(ref m)
TITLE: Is there a .NET namespace where I can find the WIN32 API message-related #defines, like WM_COMMAND, etc QUESTION: I'm overriding WndProc, so I want to write code like if (m.Msg == WM_COMMAND) my special stuff else base.WndProc(ref m) ANSWER: AFAIK.NET does not ship with these constants. This site has all the v...
[ ".net", "winapi", "wndproc" ]
2
5
1,430
1
0
2008-10-13T22:07:58.817000
2008-10-13T22:11:23.723000
199,180
201,420
Is there any way to get python omnicomplete to work with non-system modules in vim?
The only thing I can get python omnicomplete to work with are system modules. I get nothing for help with modules in my site-packages or modules that I'm currently working on.
I get completion for my own modules in my PYTHONPATH or site-packages. I'm not sure what version of the pythoncomplete.vim script you're using, but you may want to make sure it's the latest. EDIT: Here's some examples of what I'm seeing on my system... This file (mymodule.py), I puth in a directory in PYTHONPATH, and t...
Is there any way to get python omnicomplete to work with non-system modules in vim? The only thing I can get python omnicomplete to work with are system modules. I get nothing for help with modules in my site-packages or modules that I'm currently working on.
TITLE: Is there any way to get python omnicomplete to work with non-system modules in vim? QUESTION: The only thing I can get python omnicomplete to work with are system modules. I get nothing for help with modules in my site-packages or modules that I'm currently working on. ANSWER: I get completion for my own modul...
[ "python", "vim", "omnicomplete" ]
9
2
5,047
6
0
2008-10-13T22:08:26.913000
2008-10-14T14:35:18.747000
199,184
199,203
How do I check if a number is a palindrome?
How do I check if a number is a palindrome? Any language. Any algorithm. (except the algorithm of making the number a string and then reversing the string).
This is one of the Project Euler problems. When I solved it in Haskell I did exactly what you suggest, convert the number to a String. It's then trivial to check that the string is a pallindrome. If it performs well enough, then why bother making it more complex? Being a pallindrome is a lexical property rather than a ...
How do I check if a number is a palindrome? How do I check if a number is a palindrome? Any language. Any algorithm. (except the algorithm of making the number a string and then reversing the string).
TITLE: How do I check if a number is a palindrome? QUESTION: How do I check if a number is a palindrome? Any language. Any algorithm. (except the algorithm of making the number a string and then reversing the string). ANSWER: This is one of the Project Euler problems. When I solved it in Haskell I did exactly what yo...
[ "algorithm", "language-agnostic" ]
137
138
252,320
54
0
2008-10-13T22:10:39.153000
2008-10-13T22:14:30.643000
199,207
199,326
Do you draw a distinction between text editors and IDEs?
I've seen several responses to questions asking for IDEs where text editors were suggested and vice-versa. That makes me think that people treat them as the same thing, where I draw clear distinctions. How do you define "text editor" and "IDE"? Do you see a difference between the two tools? Note that I accepted an answ...
I use both and I suggest you do too. Sometimes an IDE can make development faster - like code completion and refactoring support. Fast find of files and symbols, functions, classes in project not to mention project management features. Sometimes they'll manage the build for you. Maybe it has a built in debugger (a good...
Do you draw a distinction between text editors and IDEs? I've seen several responses to questions asking for IDEs where text editors were suggested and vice-versa. That makes me think that people treat them as the same thing, where I draw clear distinctions. How do you define "text editor" and "IDE"? Do you see a diffe...
TITLE: Do you draw a distinction between text editors and IDEs? QUESTION: I've seen several responses to questions asking for IDEs where text editors were suggested and vice-versa. That makes me think that people treat them as the same thing, where I draw clear distinctions. How do you define "text editor" and "IDE"? ...
[ "ide", "text-editor" ]
6
3
2,260
7
0
2008-10-13T22:15:28.880000
2008-10-13T22:50:22.397000
199,219
199,254
Ping always succeeds, cant easily check uptime using ping on a url
Im getting frustrated because of OpenDNS and other services (ie: roadrunner) that now always returns a ping even if you type any invalid url ie: lkjsdaflkjdsjf.com --- I had created software for my own use that would ping a url to verify if the site was up or not. This no longer works. Does anyone have any ideas about ...
You could create a simple web page with an address bar for the website and some javascript that uses AJAX to hit a site. If you get any HTTP response other than 200 on the async callback, the site isn't working. Site To Check: This code depends on the browser not being IE and I haven't tested it, but it should give you...
Ping always succeeds, cant easily check uptime using ping on a url Im getting frustrated because of OpenDNS and other services (ie: roadrunner) that now always returns a ping even if you type any invalid url ie: lkjsdaflkjdsjf.com --- I had created software for my own use that would ping a url to verify if the site was...
TITLE: Ping always succeeds, cant easily check uptime using ping on a url QUESTION: Im getting frustrated because of OpenDNS and other services (ie: roadrunner) that now always returns a ping even if you type any invalid url ie: lkjsdaflkjdsjf.com --- I had created software for my own use that would ping a url to veri...
[ "c#", ".net", "ping", "system.net" ]
1
2
2,820
10
0
2008-10-13T22:18:48.343000
2008-10-13T22:27:40.400000
199,238
199,332
How can I find the position where a string is malformed XML (in C#)?
I'm writing a lightweight XML editor, and in cases where the user's input is not well formed, I would like to indicate to the user where the problem is, or at least where the first problem is. Does anyone know of an existing algorithm for this? If looking at code helps, if I could fill in the FindIndexOfInvalidXml meth...
I'd probably just cheat.:) This will get you a line number and position: string s = " Some text. "; System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); try { doc.LoadXml(s); } catch(System.Xml.XmlException ex) { MessageBox.Show(ex.LineNumber.ToString()); MessageBox.Show(ex.LinePosition.ToString()); }
How can I find the position where a string is malformed XML (in C#)? I'm writing a lightweight XML editor, and in cases where the user's input is not well formed, I would like to indicate to the user where the problem is, or at least where the first problem is. Does anyone know of an existing algorithm for this? If loo...
TITLE: How can I find the position where a string is malformed XML (in C#)? QUESTION: I'm writing a lightweight XML editor, and in cases where the user's input is not well formed, I would like to indicate to the user where the problem is, or at least where the first problem is. Does anyone know of an existing algorith...
[ "c#", "xml", "algorithm" ]
1
5
1,708
4
0
2008-10-13T22:23:39.953000
2008-10-13T22:53:06.197000
199,241
199,251
java in-memory compilation
How can i generate bytecode (Byte[]) from a String at runtime, without using a "javac" process or something of this sort? is there a simple way of calling the compiler like that? later addition: I chose to accept the solution that actually best fits my situation. my application is a hobby-project still in design sketch...
You might find something like rhino or groovy more useful in practice.
java in-memory compilation How can i generate bytecode (Byte[]) from a String at runtime, without using a "javac" process or something of this sort? is there a simple way of calling the compiler like that? later addition: I chose to accept the solution that actually best fits my situation. my application is a hobby-pro...
TITLE: java in-memory compilation QUESTION: How can i generate bytecode (Byte[]) from a String at runtime, without using a "javac" process or something of this sort? is there a simple way of calling the compiler like that? later addition: I chose to accept the solution that actually best fits my situation. my applicat...
[ "java", "runtime", "compilation" ]
10
4
6,467
4
0
2008-10-13T22:24:20.750000
2008-10-13T22:27:04.580000
199,252
199,304
What is the best way to manage permissions for a web application - bitmask or database table?
I'm considering the best way to design a permissions system for an "admin" web application. The application is likely to have many users, each of whom could be assigned a certain role; some of these users could be permitted to perform specific tasks outside the role. I can think of two ways to design this: one, with a ...
I think it's a general rule of thumb to stay away from mystical bitstrings that encode the meaning of the universe. While perhaps clunkier, having a table of possible permissions, a table of users, and a link table between them is the best and clearest way to organize this. It also makes your queries and maintenance (e...
What is the best way to manage permissions for a web application - bitmask or database table? I'm considering the best way to design a permissions system for an "admin" web application. The application is likely to have many users, each of whom could be assigned a certain role; some of these users could be permitted to...
TITLE: What is the best way to manage permissions for a web application - bitmask or database table? QUESTION: I'm considering the best way to design a permissions system for an "admin" web application. The application is likely to have many users, each of whom could be assigned a certain role; some of these users cou...
[ "database-design", "web-applications", "permissions" ]
62
84
54,010
9
0
2008-10-13T22:27:09.637000
2008-10-13T22:42:00.667000
199,260
199,279
How do I reverse a UTF-8 string in place?
Recently, someone asked about an algorithm for reversing a string in place in C. Most of the proposed solutions had troubles when dealing with non single-byte strings. So, I was wondering what could be a good algorithm for dealing specifically with utf-8 strings. I came up with some code, which I'm posting as an answer...
I'd make one pass reversing the bytes, then a second pass that reverses the bytes in any multibyte characters (which are easily detected in UTF8) back to their correct order. You can definitely handle this in line in a single pass, but I wouldn't bother unless the routine became a bottleneck.
How do I reverse a UTF-8 string in place? Recently, someone asked about an algorithm for reversing a string in place in C. Most of the proposed solutions had troubles when dealing with non single-byte strings. So, I was wondering what could be a good algorithm for dealing specifically with utf-8 strings. I came up with...
TITLE: How do I reverse a UTF-8 string in place? QUESTION: Recently, someone asked about an algorithm for reversing a string in place in C. Most of the proposed solutions had troubles when dealing with non single-byte strings. So, I was wondering what could be a good algorithm for dealing specifically with utf-8 strin...
[ "utf-8", "string", "algorithm", "performance" ]
14
13
12,638
5
0
2008-10-13T22:30:19.973000
2008-10-13T22:34:52.180000
199,263
199,289
Should I make sure arguments aren't null before using them in a function?
The title may not really explain what I'm really trying to get at, couldn't really think of a way to describe what I mean. I was wondering if it is good practice to check the arguments that a function accepts for nulls or empty before using them. I have this function which just wraps some hash creation like so. Public ...
In general, I'd suggest it's good practice to validate all of the arguments to public functions/methods before using them, and fail early rather than after executing half of the function. In this case, you're right to throw the exception. Depending on what your method is doing, failing early could be important. If your...
Should I make sure arguments aren't null before using them in a function? The title may not really explain what I'm really trying to get at, couldn't really think of a way to describe what I mean. I was wondering if it is good practice to check the arguments that a function accepts for nulls or empty before using them....
TITLE: Should I make sure arguments aren't null before using them in a function? QUESTION: The title may not really explain what I'm really trying to get at, couldn't really think of a way to describe what I mean. I was wondering if it is good practice to check the arguments that a function accepts for nulls or empty ...
[ "validation", "function", "exception", "arguments" ]
6
20
1,642
10
0
2008-10-13T22:30:58.303000
2008-10-13T22:39:00.627000
199,266
199,270
Make xargs execute the command once for each line of input
How can I make xargs execute the command exactly once for each line of input given? It's default behavior is to chunk the lines and execute the command once, passing multiple lines to each instance. From http://en.wikipedia.org/wiki/Xargs: find /path -type f -print0 | xargs -0 rm In this example, find feeds the input o...
The following will only work if you do not have spaces in your input: xargs -L 1 xargs --max-lines=1 # synonym for the -L option from the man page: -L max-lines Use at most max-lines nonblank input lines per command line. Trailing blanks cause an input line to be logically continued on the next input line. Implies -x.
Make xargs execute the command once for each line of input How can I make xargs execute the command exactly once for each line of input given? It's default behavior is to chunk the lines and execute the command once, passing multiple lines to each instance. From http://en.wikipedia.org/wiki/Xargs: find /path -type f -p...
TITLE: Make xargs execute the command once for each line of input QUESTION: How can I make xargs execute the command exactly once for each line of input given? It's default behavior is to chunk the lines and execute the command once, passing multiple lines to each instance. From http://en.wikipedia.org/wiki/Xargs: fin...
[ "xargs" ]
495
516
317,243
13
0
2008-10-13T22:31:24.527000
2008-10-13T22:32:42.510000
199,321
199,351
Advanced Console IO in .NET
What is the best way to write data to the text console at arbitrary locations on the screen and with custom fore/background colors?
Console.SetCursorPosition, Console.BackgroundColor, Console.ForegroundColor, and Console.ResetColor. Note these were added to the.NET Framework in version 2.0. Prior to that you would have needed PInvoke.
Advanced Console IO in .NET What is the best way to write data to the text console at arbitrary locations on the screen and with custom fore/background colors?
TITLE: Advanced Console IO in .NET QUESTION: What is the best way to write data to the text console at arbitrary locations on the screen and with custom fore/background colors? ANSWER: Console.SetCursorPosition, Console.BackgroundColor, Console.ForegroundColor, and Console.ResetColor. Note these were added to the.NET...
[ ".net", "console" ]
19
27
8,842
4
0
2008-10-13T22:47:54.227000
2008-10-13T22:58:27.780000
199,336
199,344
Print spinning cursor in a terminal running application using C
How would I print a spinning curser in a utility that runs in a terminal using standard C? I'm looking for something that prints: \ | / - over and over in the same position on the screen? Thanks
You could use the backspace character ( \b ) like this: printf("processing... |"); fflush(stdout); // do something printf("\b/"); fflush(stdout); // do some more printf("\b-"); fflush(stdout); etc. You need the fflush(stdout) because normally stdout is buffered until you output a newline.
Print spinning cursor in a terminal running application using C How would I print a spinning curser in a utility that runs in a terminal using standard C? I'm looking for something that prints: \ | / - over and over in the same position on the screen? Thanks
TITLE: Print spinning cursor in a terminal running application using C QUESTION: How would I print a spinning curser in a utility that runs in a terminal using standard C? I'm looking for something that prints: \ | / - over and over in the same position on the screen? Thanks ANSWER: You could use the backspace charac...
[ "c", "printf" ]
16
23
14,060
5
0
2008-10-13T22:54:11.377000
2008-10-13T22:57:14.863000
199,348
199,402
How can I roll-back a ClickOnce application?
Is there a way (hacky will do) to allow a user to go back to a previous version of a ClickOnce network deployed application? I've looked in the docs and API and there seems to be no way. You can selectively choose if you would like to update, but once updated there is, seemingly, no way back.
ClickOnce will use whatever version you send them. If you send them an old version, they will rollback to that old version. Back in May my buddy David wrote an article on how to do this on a per-user basis. We can literally have every user on a different version. The application even tells the database which version th...
How can I roll-back a ClickOnce application? Is there a way (hacky will do) to allow a user to go back to a previous version of a ClickOnce network deployed application? I've looked in the docs and API and there seems to be no way. You can selectively choose if you would like to update, but once updated there is, seemi...
TITLE: How can I roll-back a ClickOnce application? QUESTION: Is there a way (hacky will do) to allow a user to go back to a previous version of a ClickOnce network deployed application? I've looked in the docs and API and there seems to be no way. You can selectively choose if you would like to update, but once updat...
[ "clickonce" ]
56
21
33,516
9
0
2008-10-13T22:57:53.397000
2008-10-13T23:20:21.277000
199,378
199,389
Best CSS color wheel sites
What site(s) do you recommend for looking at complimentary colors for site design? It would also be beneficial to enter a hex or RGB value and have the color wheel spit back complimentary colors. Most popular: Kuler Others in alphabetical order: 4096 Color Wheel Allprofitallfree - color-wheel2 Color Wheel v1.2 Javascri...
Adobe's Kuler - http://kuler.adobe.com/ is widely considered to be the best color palette selector out there, as it also lets you share color palettes other users have created. Sign in, click create, and you'll have options including "complementary" that give you a good starting point if you have one color in mind.
Best CSS color wheel sites What site(s) do you recommend for looking at complimentary colors for site design? It would also be beneficial to enter a hex or RGB value and have the color wheel spit back complimentary colors. Most popular: Kuler Others in alphabetical order: 4096 Color Wheel Allprofitallfree - color-wheel...
TITLE: Best CSS color wheel sites QUESTION: What site(s) do you recommend for looking at complimentary colors for site design? It would also be beneficial to enter a hex or RGB value and have the color wheel spit back complimentary colors. Most popular: Kuler Others in alphabetical order: 4096 Color Wheel Allprofitall...
[ "css", "colors", "styling", "color-scheme" ]
61
47
52,587
12
0
2008-10-13T23:08:42.437000
2008-10-13T23:12:32.290000
199,384
199,515
Getting gps data from blackberry (pearl) directly from usb interface
Has anyone researched how to access the gps chipset on a blackberry over usb so that it is unnecessary to transmit this data over the cell carrier's data network? Is it possible to access the GPS chipset, store information in a buffer, and open an interface connection (over the usb charging port), for access? Not sure ...
Checkout the "UsbDemo" project and the "GPSDemo" that are included in the blackberry JDE. the GPSDemo listens to the GPS and stores the location information into a buffer that gets sent over the network. The USB Demo shows how to interact with a desktop client over USB. You should be able to pull on the network code fr...
Getting gps data from blackberry (pearl) directly from usb interface Has anyone researched how to access the gps chipset on a blackberry over usb so that it is unnecessary to transmit this data over the cell carrier's data network? Is it possible to access the GPS chipset, store information in a buffer, and open an int...
TITLE: Getting gps data from blackberry (pearl) directly from usb interface QUESTION: Has anyone researched how to access the gps chipset on a blackberry over usb so that it is unnecessary to transmit this data over the cell carrier's data network? Is it possible to access the GPS chipset, store information in a buffe...
[ "blackberry", "java-me", "usb", "gps", "rim-4.5" ]
3
4
1,758
1
0
2008-10-13T23:11:02.387000
2008-10-14T00:07:53.940000
199,390
199,406
What's the best way to embed IronPython inside my C# App?
I have an application used by pretty tech-savey people and they want small island of programmability so I've used embedded Iron Python. However, since IronPython 2.0 Eval() doesn't work any more. Specifically I can't both load modules and inject local variables. There is a work around where I can still call Execute(), ...
Could you be a little more specific about the problem, and maybe provide a code example? The "eval"-style functionality is definitely still present, though as you've noticed, the hosting interface has changed considerably since 1.0. This works in beta 5: ScriptEngine engine = Python.CreateEngine(); ScriptSource source ...
What's the best way to embed IronPython inside my C# App? I have an application used by pretty tech-savey people and they want small island of programmability so I've used embedded Iron Python. However, since IronPython 2.0 Eval() doesn't work any more. Specifically I can't both load modules and inject local variables....
TITLE: What's the best way to embed IronPython inside my C# App? QUESTION: I have an application used by pretty tech-savey people and they want small island of programmability so I've used embedded Iron Python. However, since IronPython 2.0 Eval() doesn't work any more. Specifically I can't both load modules and injec...
[ "c#", ".net", "ironpython", "dynamic-language-runtime" ]
2
2
2,018
2
0
2008-10-13T23:13:02.850000
2008-10-13T23:24:30.893000
199,397
199,451
Visual Studio 2008 -- Can I change which "add reference" tab is selected by default?
Every time you start Visual Studio, the first time you click "Add Reference" to add a DLL reference to a project, by default, the.NET tab on that dialog box is selected. As most people reading this have probably noticed, it can take a long time -- often more than 30 seconds -- for the full list of.NET components to fil...
I use this tip to do this in a different way. Open your Object Browser (Cntrl + Alt + J). Change Browse dropdown to "My Solution". Select the project you want. On Toolbar, click "Add to References in Selected Project in Solution Explorer". A neat work around which has saved me many hours.
Visual Studio 2008 -- Can I change which "add reference" tab is selected by default? Every time you start Visual Studio, the first time you click "Add Reference" to add a DLL reference to a project, by default, the.NET tab on that dialog box is selected. As most people reading this have probably noticed, it can take a ...
TITLE: Visual Studio 2008 -- Can I change which "add reference" tab is selected by default? QUESTION: Every time you start Visual Studio, the first time you click "Add Reference" to add a DLL reference to a project, by default, the.NET tab on that dialog box is selected. As most people reading this have probably notic...
[ "visual-studio", "configuration" ]
13
8
1,259
6
0
2008-10-13T23:14:52.067000
2008-10-13T23:44:11.057000
199,403
199,419
C++: What's the simplest way to read and write BMP files using C++ on Windows?
I would like to load a BMP file, do some operations on it in memory, and output a new BMP file using C++ on Windows (Win32 native). I am aware of ImageMagick and it's C++ binding Magick++, but I think it's an overkill for this project since I am currently not interested in other file formats or platforms. What would be...
When developing just for Windows I usually just use the ATL CImage class
C++: What's the simplest way to read and write BMP files using C++ on Windows? I would like to load a BMP file, do some operations on it in memory, and output a new BMP file using C++ on Windows (Win32 native). I am aware of ImageMagick and it's C++ binding Magick++, but I think it's an overkill for this project since ...
TITLE: C++: What's the simplest way to read and write BMP files using C++ on Windows? QUESTION: I would like to load a BMP file, do some operations on it in memory, and output a new BMP file using C++ on Windows (Win32 native). I am aware of ImageMagick and it's C++ binding Magick++, but I think it's an overkill for t...
[ "c++", "windows", "winapi", "image-manipulation", "bmp" ]
11
8
42,977
7
0
2008-10-13T23:21:08.233000
2008-10-13T23:31:32.440000
199,405
283,302
Eclipse POJO generator plugin
Does anyone know of a good Eclipse POJO generator? The generate getter\setters and constructor from fields functions are all really nice, but it would be useful to have that tied into a new class\POJO dialog.
This is not an Eclipse plug-in, but here's one way to generate Java beans. Define the schema using Relax NG Compact syntax, convert it to XML Schema (xsd file), and generate Java code using JAXB ( xjc ).
Eclipse POJO generator plugin Does anyone know of a good Eclipse POJO generator? The generate getter\setters and constructor from fields functions are all really nice, but it would be useful to have that tied into a new class\POJO dialog.
TITLE: Eclipse POJO generator plugin QUESTION: Does anyone know of a good Eclipse POJO generator? The generate getter\setters and constructor from fields functions are all really nice, but it would be useful to have that tied into a new class\POJO dialog. ANSWER: This is not an Eclipse plug-in, but here's one way to ...
[ "eclipse", "plugins", "pojo" ]
3
0
7,941
1
0
2008-10-13T23:23:59.053000
2008-11-12T08:23:34.587000
199,418
199,422
Using C++ library in C code
I have a C++ library that provides various classes for managing data. I have the source code for the library. I want to extend the C++ API to support C function calls so that the library can be used with C code and C++ code at the same time. I'm using GNU tool chain (gcc, glibc, etc), so language and architecture suppo...
Yes, this is certainly possible. You will need to write an interface layer in C++ that declares functions with extern "C": extern "C" int foo(char *bar) { return realFoo(std::string(bar)); } Then, you will call foo() from your C module, which will pass the call on to the realFoo() function which is implemented in C++. ...
Using C++ library in C code I have a C++ library that provides various classes for managing data. I have the source code for the library. I want to extend the C++ API to support C function calls so that the library can be used with C code and C++ code at the same time. I'm using GNU tool chain (gcc, glibc, etc), so lan...
TITLE: Using C++ library in C code QUESTION: I have a C++ library that provides various classes for managing data. I have the source code for the library. I want to extend the C++ API to support C function calls so that the library can be used with C code and C++ code at the same time. I'm using GNU tool chain (gcc, g...
[ "c++", "c", "gcc", "glibc" ]
118
79
106,368
4
0
2008-10-13T23:30:20.663000
2008-10-13T23:33:49.063000
199,426
199,490
Open command prompt using Eclipse
I am new to Java and am trying to run a program using Eclipse. But I have no idea how to get the command prompt running in with Eclipse... I did some online research and couldn't get anything consolidated! Update: I'm not using an applet. It's a normal Java program trying to read a line from command prompt. I'm trying ...
Check out this lesson plan on how to get started with Eclipse programs: Lesson Specifically, see this image: If the Console tab is not visible in your Eclipse, go to Window -> Show View -> Console in the menu bar.
Open command prompt using Eclipse I am new to Java and am trying to run a program using Eclipse. But I have no idea how to get the command prompt running in with Eclipse... I did some online research and couldn't get anything consolidated! Update: I'm not using an applet. It's a normal Java program trying to read a lin...
TITLE: Open command prompt using Eclipse QUESTION: I am new to Java and am trying to run a program using Eclipse. But I have no idea how to get the command prompt running in with Eclipse... I did some online research and couldn't get anything consolidated! Update: I'm not using an applet. It's a normal Java program tr...
[ "java", "eclipse" ]
5
7
17,067
4
0
2008-10-13T23:35:01.840000
2008-10-13T23:55:27.023000
199,439
201,961
Visual Studio 2008 crashes horribly
This has happened to me 3 times now, and I am wondering if anyone is having the same problem. I am running Visual Studio 2008 SP1, and hitting SQL Server 2005 developer edition. For testing, I use the Server Explorer to browse a database I have already created. For testing I will insert data by hand (right click table ...
Just so you know, when your computer just snaps right back to the BIOS boot screen with no blue screen or other crash data, this is called a " triple fault " Basically, there was an exception (on a hardware level) whose exception handler triggered an exception whose exception handler triggered an exception. This is alm...
Visual Studio 2008 crashes horribly This has happened to me 3 times now, and I am wondering if anyone is having the same problem. I am running Visual Studio 2008 SP1, and hitting SQL Server 2005 developer edition. For testing, I use the Server Explorer to browse a database I have already created. For testing I will ins...
TITLE: Visual Studio 2008 crashes horribly QUESTION: This has happened to me 3 times now, and I am wondering if anyone is having the same problem. I am running Visual Studio 2008 SP1, and hitting SQL Server 2005 developer edition. For testing, I use the Server Explorer to browse a database I have already created. For ...
[ "c#", "sql-server", "visual-studio", "visual-studio-2008", "ide" ]
5
15
2,687
12
0
2008-10-13T23:40:45.430000
2008-10-14T16:50:59.597000
199,459
199,519
Cross platform Encryption / Decryption applications for secure file transport
I have a client who is in need of a file based encryption / decryption application to be used between Linux / Windows 2003 Server. The goal is to have a single file compressed nightly on a linux platform and secured using a script, transmitted over FTP, decrypted on the Windows 2003 server and available for other impor...
You could try GnuPG, it's cross platform and since you are only sending files internally you don't really need a certificate signed by a big-name certificate authority.
Cross platform Encryption / Decryption applications for secure file transport I have a client who is in need of a file based encryption / decryption application to be used between Linux / Windows 2003 Server. The goal is to have a single file compressed nightly on a linux platform and secured using a script, transmitte...
TITLE: Cross platform Encryption / Decryption applications for secure file transport QUESTION: I have a client who is in need of a file based encryption / decryption application to be used between Linux / Windows 2003 Server. The goal is to have a single file compressed nightly on a linux platform and secured using a ...
[ "security", "encryption" ]
3
7
2,910
5
0
2008-10-13T23:46:08.540000
2008-10-14T00:09:23.767000
199,461
199,699
Silverlight 2.0 ready for line of business apps
Now that Silverlight 2.0 has been officially released I was wondering if anyone was using it for any line of business apps, for example POS, Vertical Market apps etc. If so how were your experiences compared to an old WinForms app or Web app?
I think Silverlight is going to be huge for business applications. This is some bullet points highlighting strengths of Silverlight as a LOB platform inside the browser. It's something i wrote to help a colleague out who was comparing ASP.NET vs. Silverlight, but hopefully it includes some hints. Extra Silverlight Func...
Silverlight 2.0 ready for line of business apps Now that Silverlight 2.0 has been officially released I was wondering if anyone was using it for any line of business apps, for example POS, Vertical Market apps etc. If so how were your experiences compared to an old WinForms app or Web app?
TITLE: Silverlight 2.0 ready for line of business apps QUESTION: Now that Silverlight 2.0 has been officially released I was wondering if anyone was using it for any line of business apps, for example POS, Vertical Market apps etc. If so how were your experiences compared to an old WinForms app or Web app? ANSWER: I ...
[ ".net", "asp.net", "silverlight" ]
4
13
901
2
0
2008-10-13T23:46:32.707000
2008-10-14T01:20:42.080000
199,469
199,516
Capitalize every file in a directory, in bash, using 'svn mv'
I need to change the capitalization of a set of files in a subversion working copy, like so: svn mv test.txt Test.txt svn mv test2.txt Test2.txt svn mv testn.txt Testn.txt... svn commit -m "caps" How can I automate this process? Standard linux install tools available.
ls | awk '{system("svn mv " $0 " " toupper(substr($0,1,1)) substr($0,2))}' obviously, other scripting languages will work just as well. awk has the advantage that it it ubiquitous.
Capitalize every file in a directory, in bash, using 'svn mv' I need to change the capitalization of a set of files in a subversion working copy, like so: svn mv test.txt Test.txt svn mv test2.txt Test2.txt svn mv testn.txt Testn.txt... svn commit -m "caps" How can I automate this process? Standard linux install tools ...
TITLE: Capitalize every file in a directory, in bash, using 'svn mv' QUESTION: I need to change the capitalization of a set of files in a subversion working copy, like so: svn mv test.txt Test.txt svn mv test2.txt Test2.txt svn mv testn.txt Testn.txt... svn commit -m "caps" How can I automate this process? Standard li...
[ "svn", "shell", "file", "batch-file", "rename" ]
6
13
2,416
5
0
2008-10-13T23:48:31.907000
2008-10-14T00:08:57.777000
199,470
199,484
What's the main difference between int.Parse() and Convert.ToInt32
What is the main difference between int.Parse() and Convert.ToInt32()? Which one is to be preferred
If you've got a string, and you expect it to always be an integer (say, if some web service is handing you an integer in string format), you'd use Int32.Parse(). If you're collecting input from a user, you'd generally use Int32.TryParse(), since it allows you more fine-grained control over the situation when the user e...
What's the main difference between int.Parse() and Convert.ToInt32 What is the main difference between int.Parse() and Convert.ToInt32()? Which one is to be preferred
TITLE: What's the main difference between int.Parse() and Convert.ToInt32 QUESTION: What is the main difference between int.Parse() and Convert.ToInt32()? Which one is to be preferred ANSWER: If you've got a string, and you expect it to always be an integer (say, if some web service is handing you an integer in strin...
[ "c#" ]
583
517
355,640
14
0
2008-10-13T23:48:33.857000
2008-10-13T23:53:09.133000
199,483
199,500
SQL Server command LIKE [0-9] won't match any digit between 0 and 9
This is the constraint I have on the Customers table. ALTER TABLE Customers ADD CONSTRAINT CN_CustomerPhone CHECK (Phone LIKE '([0-9][0-9][0-9]) [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]') Why does this fail? INSERT INTO Customers (CustomerName, Address, City, State, Zip, Phone) VALUES ('Some Name','An Address', 'City goes ...
Check the length of the Phone field. Is it 15 or more characters? Using your code with a temp table here create table #temp (phone varchar(15)) ALTER TABLE #temp ADD CONSTRAINT CN_CustomerPhone CHECK (Phone LIKE '([0-9][0-9][0-9]) [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]') INSERT INTO #temp (Phone) VALUES ('(800) 555-121...
SQL Server command LIKE [0-9] won't match any digit between 0 and 9 This is the constraint I have on the Customers table. ALTER TABLE Customers ADD CONSTRAINT CN_CustomerPhone CHECK (Phone LIKE '([0-9][0-9][0-9]) [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]') Why does this fail? INSERT INTO Customers (CustomerName, Address, Ci...
TITLE: SQL Server command LIKE [0-9] won't match any digit between 0 and 9 QUESTION: This is the constraint I have on the Customers table. ALTER TABLE Customers ADD CONSTRAINT CN_CustomerPhone CHECK (Phone LIKE '([0-9][0-9][0-9]) [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]') Why does this fail? INSERT INTO Customers (Custome...
[ "database", "sql-server-2005", "debugging" ]
1
7
12,344
2
0
2008-10-13T23:53:02.910000
2008-10-14T00:00:17.980000
199,488
199,635
Why would the rollback method not be available for a DBI handle?
For some reason I am having troubles with a DBI handle. Basically what happened was that I made a special connect function in a perl module and switched from doing: do 'foo.pl' to use Foo; and then I do $dbh = Foo->connect; And now for some reason I keep getting the error: Can't locate object method "rollback" via pack...
From perlfunc: do 'stat.pl'; is just like eval `cat stat.pl`; So when you do 'foo.pl', you execute the code in the current context. Because I don't know what goes on in foo.pl or Foo.pm, I can't tell you what's changed. But, I can tell you that it's always executed in the current context, and now in executes in Foo::...
Why would the rollback method not be available for a DBI handle? For some reason I am having troubles with a DBI handle. Basically what happened was that I made a special connect function in a perl module and switched from doing: do 'foo.pl' to use Foo; and then I do $dbh = Foo->connect; And now for some reason I keep ...
TITLE: Why would the rollback method not be available for a DBI handle? QUESTION: For some reason I am having troubles with a DBI handle. Basically what happened was that I made a special connect function in a perl module and switched from doing: do 'foo.pl' to use Foo; and then I do $dbh = Foo->connect; And now for s...
[ "perl", "module", "dbi", "rollback" ]
4
4
578
3
0
2008-10-13T23:54:13.080000
2008-10-14T00:55:17.933000
199,498
199,549
Foreign Key naming scheme
I'm just getting started working with foreign keys for the first time and I'm wondering if there's a standard naming scheme to use for them? Given these tables: task (id, userid, title) note (id, taskid, userid, note); user (id, name) Where Tasks have Notes, Tasks are owned by Users, and Users author Notes. How would t...
The standard convention in SQL Server is: FK_ForeignKeyTable_PrimaryKeyTable So, for example, the key between notes and tasks would be: FK_note_task And the key between tasks and users would be: FK_task_user This gives you an 'at a glance' view of which tables are involved in the key, so it makes it easy to see which t...
Foreign Key naming scheme I'm just getting started working with foreign keys for the first time and I'm wondering if there's a standard naming scheme to use for them? Given these tables: task (id, userid, title) note (id, taskid, userid, note); user (id, name) Where Tasks have Notes, Tasks are owned by Users, and Users...
TITLE: Foreign Key naming scheme QUESTION: I'm just getting started working with foreign keys for the first time and I'm wondering if there's a standard naming scheme to use for them? Given these tables: task (id, userid, title) note (id, taskid, userid, note); user (id, name) Where Tasks have Notes, Tasks are owned b...
[ "database", "naming-conventions", "foreign-keys" ]
195
222
155,830
10
0
2008-10-13T23:59:32.257000
2008-10-14T00:21:37.487000
199,499
199,572
What descriptive variable name can I use here?
I'm creating a custom Java Struts tag that is for building and formatting an html select box in a standardised way (part of our usability guidelines). Each select box has an additional/initial value which describes the requirement of the value returned by the select element, i.e.: Mandatory - with the label "Please Sel...
NOTE: See EDIT below for a different approach than the one given here How about requirementConstraint? A B C Another possiblity is not to tri-state the value in the first place. For example, you can instead provide two separate properties: required ( "yes" | "no" ), and selectAll ( "yes" | "no" ) to make the intent cle...
What descriptive variable name can I use here? I'm creating a custom Java Struts tag that is for building and formatting an html select box in a standardised way (part of our usability guidelines). Each select box has an additional/initial value which describes the requirement of the value returned by the select elemen...
TITLE: What descriptive variable name can I use here? QUESTION: I'm creating a custom Java Struts tag that is for building and formatting an html select box in a standardised way (part of our usability guidelines). Each select box has an additional/initial value which describes the requirement of the value returned by...
[ "java", "variables", "struts", "html-select" ]
3
6
543
4
0
2008-10-13T23:59:45.080000
2008-10-14T00:30:35.033000
199,508
199,567
How do I show running processes in Oracle DB?
Is it possible to show other processes in progress on an Oracle database? Something like Sybases sp_who
I suspect you would just want to grab a few columns from V$SESSION and the SQL statement from V$SQL. Assuming you want to exclude the background processes that Oracle itself is running SELECT sess.process, sess.status, sess.username, sess.schemaname, sql.sql_text FROM v$session sess, v$sql sql WHERE sql.sql_id(+) = ses...
How do I show running processes in Oracle DB? Is it possible to show other processes in progress on an Oracle database? Something like Sybases sp_who
TITLE: How do I show running processes in Oracle DB? QUESTION: Is it possible to show other processes in progress on an Oracle database? Something like Sybases sp_who ANSWER: I suspect you would just want to grab a few columns from V$SESSION and the SQL statement from V$SQL. Assuming you want to exclude the backgroun...
[ "oracle", "process" ]
66
92
366,542
4
0
2008-10-14T00:04:52.810000
2008-10-14T00:28:27.473000