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
117,508
117,520
Create custom code snippet in Visual Studio 2008
Like the title says, how do you create custom code snippets in Visual Studio 2008?
Here's a link to a utility for Creating/editing Snippets. It works for more languages than just VB despite the classification in the link. http://msdn.microsoft.com/en-us/vbasic/bb973770.aspx
Create custom code snippet in Visual Studio 2008 Like the title says, how do you create custom code snippets in Visual Studio 2008?
TITLE: Create custom code snippet in Visual Studio 2008 QUESTION: Like the title says, how do you create custom code snippets in Visual Studio 2008? ANSWER: Here's a link to a utility for Creating/editing Snippets. It works for more languages than just VB despite the classification in the link. http://msdn.microsoft....
[ "visual-studio-2008", "code-snippets" ]
13
11
13,592
5
0
2008-09-22T20:43:55.650000
2008-09-22T20:45:51.167000
117,512
117,578
Joining other tables in oracle tree queries
Given a simple (id, description) table t1, such as id description -- ----------- 1 Alice 2 Bob 3 Carol 4 David 5 Erica 6 Fred And a parent-child relationship table t2, such as parent child ------ ----- 1 2 1 3 4 5 5 6 Oracle offers a way of traversing this as a tree with some custom syntax extensions: select parent, ch...
In your query, replace T2 with a subquery that joins T1 and T2, and returns parent, child and child description. Then in the sys_connect_by_path function, reference the child description from your subquery.
Joining other tables in oracle tree queries Given a simple (id, description) table t1, such as id description -- ----------- 1 Alice 2 Bob 3 Carol 4 David 5 Erica 6 Fred And a parent-child relationship table t2, such as parent child ------ ----- 1 2 1 3 4 5 5 6 Oracle offers a way of traversing this as a tree with some...
TITLE: Joining other tables in oracle tree queries QUESTION: Given a simple (id, description) table t1, such as id description -- ----------- 1 Alice 2 Bob 3 Carol 4 David 5 Erica 6 Fred And a parent-child relationship table t2, such as parent child ------ ----- 1 2 1 3 4 5 5 6 Oracle offers a way of traversing this a...
[ "sql", "oracle", "tree", "connect-by" ]
8
7
10,037
3
0
2008-09-22T20:44:29.953000
2008-09-22T20:53:44.987000
117,536
118,951
How do I clear the cache of Ruby Phusion Passenger in Ubuntu?
I've tried restarting apache and the cached pages still appear, so there must be a folder someplace. I don't have a 'public/cache', so what other places should I look? Is there a URL flag that could trigger this effect as well?
You need to touch a file to have phusion clear out, like: touch /webapps/mycook/tmp/restart.txt See the docs
How do I clear the cache of Ruby Phusion Passenger in Ubuntu? I've tried restarting apache and the cached pages still appear, so there must be a folder someplace. I don't have a 'public/cache', so what other places should I look? Is there a URL flag that could trigger this effect as well?
TITLE: How do I clear the cache of Ruby Phusion Passenger in Ubuntu? QUESTION: I've tried restarting apache and the cached pages still appear, so there must be a folder someplace. I don't have a 'public/cache', so what other places should I look? Is there a URL flag that could trigger this effect as well? ANSWER: You...
[ "ruby", "caching", "passenger", "phusion" ]
5
9
7,561
5
0
2008-09-22T20:47:49.837000
2008-09-23T03:28:51.153000
117,547
117,583
Scriptaculous Droppables onDrop callback, How to reference each element?
Documentation can be found here It says in the example: onDrop: Called whenever a Draggable is released over the Droppable and the Droppable is accepts it. The callback gets three parameters: the Draggable element, the Droppable element and the Event. You can extract additional information about the drop – like if the ...
Going by the example further down the page, the callback function can take as many of the parameters as you need: onDrop: function() { $('droppable_demo').highlight(); } In this case, they have used none of the callback parameters. To this end, presumably to access all three as mentioned in the paragraph you quoted, yo...
Scriptaculous Droppables onDrop callback, How to reference each element? Documentation can be found here It says in the example: onDrop: Called whenever a Draggable is released over the Droppable and the Droppable is accepts it. The callback gets three parameters: the Draggable element, the Droppable element and the Ev...
TITLE: Scriptaculous Droppables onDrop callback, How to reference each element? QUESTION: Documentation can be found here It says in the example: onDrop: Called whenever a Draggable is released over the Droppable and the Droppable is accepts it. The callback gets three parameters: the Draggable element, the Droppable ...
[ "javascript", "scriptaculous", "droppable" ]
3
2
3,113
2
0
2008-09-22T20:49:31.003000
2008-09-22T20:54:32.083000
117,551
117,628
javascript: cancel all kinds of requests
My website makes a lot of requests. I often need to cancel all current requests, so that the browser is not blocking relevant new requests. I have 3 kinds of requests: Ajax inserted script-tags (which do JSONP-Communication) inserted image-tags (which cause the browser to request data from various servers) For Ajax its...
window.stop() should cancel any pending image or script requests.
javascript: cancel all kinds of requests My website makes a lot of requests. I often need to cancel all current requests, so that the browser is not blocking relevant new requests. I have 3 kinds of requests: Ajax inserted script-tags (which do JSONP-Communication) inserted image-tags (which cause the browser to reques...
TITLE: javascript: cancel all kinds of requests QUESTION: My website makes a lot of requests. I often need to cancel all current requests, so that the browser is not blocking relevant new requests. I have 3 kinds of requests: Ajax inserted script-tags (which do JSONP-Communication) inserted image-tags (which cause the...
[ "javascript", "ajax", "dom", "httprequest" ]
22
53
19,441
2
0
2008-09-22T20:50:24.557000
2008-09-22T21:02:46.743000
117,558
117,637
Inner join across multiple access db's
I am re-designing an application for a ASP.NET CMS that I really don't like. I have made som improvements in performance only to discover that not only does this CMS use MS SQL but some users "simply" use MS Access database. The problem is that I have some tables which I inner join, that with the MS Access version are ...
If you have access to the MDBs, and are able to change them, you might consider using Linked Tables. Access provides the ability to link to external data (in other MDBs, in Excel files, even in SQL Server or Oracle), and then you can perform your joins against the links. I'd strongly encourage performance testing such ...
Inner join across multiple access db's I am re-designing an application for a ASP.NET CMS that I really don't like. I have made som improvements in performance only to discover that not only does this CMS use MS SQL but some users "simply" use MS Access database. The problem is that I have some tables which I inner joi...
TITLE: Inner join across multiple access db's QUESTION: I am re-designing an application for a ASP.NET CMS that I really don't like. I have made som improvements in performance only to discover that not only does this CMS use MS SQL but some users "simply" use MS Access database. The problem is that I have some tables...
[ "asp.net", "ms-access", "inner-join" ]
3
3
7,617
4
0
2008-09-22T20:51:09.597000
2008-09-22T21:04:10.623000
117,570
117,642
Best approach for sortable table with a lot of data
On our web application, the search results are displayed in sortable tables. The user can click on any column and sort the result. The problem is some times, the user does a broad search and gets a lot of data returned. To make the sortable part work, you probably need all the results, which takes a long time. Or I can...
Using sorting paging at the database level is the correct answer. If your query returns 1000 rows, but you're only going to show the user 10 of them, there is no need for the other 990 to be sent across the network. Here is a mysql example. Say you need 10 rows, 21-30, from the 'people' table: SELECT * FROM people LIMI...
Best approach for sortable table with a lot of data On our web application, the search results are displayed in sortable tables. The user can click on any column and sort the result. The problem is some times, the user does a broad search and gets a lot of data returned. To make the sortable part work, you probably nee...
TITLE: Best approach for sortable table with a lot of data QUESTION: On our web application, the search results are displayed in sortable tables. The user can click on any column and sort the result. The problem is some times, the user does a broad search and gets a lot of data returned. To make the sortable part work...
[ "javascript", "database", "jquery-ui-sortable" ]
4
3
827
6
0
2008-09-22T20:52:53.367000
2008-09-22T21:04:26.677000
117,589
117,608
IIS CSS Caching
When we are developing new sites or testing changes in new ones that involve css after the new code is committed and someone goes to check the changes they always see a cached version of the old css. This is causing a lot of problems in testing because people never are sure if they have the latest css on screen (I know...
If you're serving your CSS from static files (or anything that the query string doesn't matter for), try varying that to ensure that the browser makes a fresh request, as it will think that it's pulling a completley different resource, so have for example: "styles.css?token=1234" in the CSS reference in your markup and...
IIS CSS Caching When we are developing new sites or testing changes in new ones that involve css after the new code is committed and someone goes to check the changes they always see a cached version of the old css. This is causing a lot of problems in testing because people never are sure if they have the latest css o...
TITLE: IIS CSS Caching QUESTION: When we are developing new sites or testing changes in new ones that involve css after the new code is committed and someone goes to check the changes they always see a cached version of the old css. This is causing a lot of problems in testing because people never are sure if they hav...
[ "css", "iis", "iis-6" ]
13
9
14,140
4
0
2008-09-22T20:55:45.717000
2008-09-22T20:58:19.250000
117,598
117,639
Can Mercurial be integrated into Visual Studio 2008?
Is there a tool to integrate Mercurial into Visual Studio? I am just curious. Mercurial is pretty nice, even with 'just' TortoiseHG, but integration with Visual Studio would be better.
VisualHG Way to go, me. (Found the answer myself afterwards. Oh well, someone might find this useful.)
Can Mercurial be integrated into Visual Studio 2008? Is there a tool to integrate Mercurial into Visual Studio? I am just curious. Mercurial is pretty nice, even with 'just' TortoiseHG, but integration with Visual Studio would be better.
TITLE: Can Mercurial be integrated into Visual Studio 2008? QUESTION: Is there a tool to integrate Mercurial into Visual Studio? I am just curious. Mercurial is pretty nice, even with 'just' TortoiseHG, but integration with Visual Studio would be better. ANSWER: VisualHG Way to go, me. (Found the answer myself afterw...
[ "visual-studio-2008", "version-control", "mercurial", "tortoisehg" ]
11
12
1,342
2
0
2008-09-22T20:56:54.433000
2008-09-22T21:04:13.823000
117,623
117,672
Delegates as parameters in VB.NET
Backstory: I'm using log4net to handle all logging for a project I'm working on. One particular method can be called under several different circumstances -- some that warrant the log messages to be errors and others that warrant the log messages to be warnings. So, as an example, how could I turn Public Sub CheckDiffe...
Declare your delegate signature: Public Delegate Sub Format(ByVal value As String) Define your Test function: Public Sub CheckDifference(ByVal A As Integer, _ ByVal B As Integer, _ ByVal format As Format) If (B - A) > 5 Then format.Invoke(String.Format( _ "Difference ({0}) is outside of acceptable range.", (B - A))) En...
Delegates as parameters in VB.NET Backstory: I'm using log4net to handle all logging for a project I'm working on. One particular method can be called under several different circumstances -- some that warrant the log messages to be errors and others that warrant the log messages to be warnings. So, as an example, how ...
TITLE: Delegates as parameters in VB.NET QUESTION: Backstory: I'm using log4net to handle all logging for a project I'm working on. One particular method can be called under several different circumstances -- some that warrant the log messages to be errors and others that warrant the log messages to be warnings. So, a...
[ "vb.net", "delegates", "lambda", "log4net" ]
9
15
20,317
3
0
2008-09-22T21:01:11.957000
2008-09-22T21:11:09.920000
117,641
118,480
How to remove duplicate elements from an xml file?
I have an XML file like I would want to remove the duplicates based on the fistname, last name and date_join and data_end. Please, can someone explain how to achive this with XSLT?
Here are some samples of how to remove duplicates based on element name and id field. It should be not too hard to extend this to arbitrary fields. Q: Expansion. A part of my xml looks like this: xxxx yyyy xxxx The desired output is: xxxx yyyy That is, duplicate values of state should not be printed. Can this be done?
How to remove duplicate elements from an xml file? I have an XML file like I would want to remove the duplicates based on the fistname, last name and date_join and data_end. Please, can someone explain how to achive this with XSLT?
TITLE: How to remove duplicate elements from an xml file? QUESTION: I have an XML file like I would want to remove the duplicates based on the fistname, last name and date_join and data_end. Please, can someone explain how to achive this with XSLT? ANSWER: Here are some samples of how to remove duplicates based on el...
[ "xml", "xslt", "xpath" ]
0
5
16,114
1
0
2008-09-22T21:04:15.867000
2008-09-23T00:48:37.293000
117,651
117,664
How can I create my custom Shell Context Handlers for Windows?
Problem Language: C# 2.0 or later I would like to register context handlers to create menues when the user right clicks certain files (in my case *.eic). What is the procedure to register, unregister (clean up) and handle events (clicks) from these menues? I have a clue it's something to do with the windows registry, b...
Resist writing Shell Extensions in managed languages - there are a multitude of things that could go bang if you pursue this route. Have a browse through this thread for more details. It contains links to do it if really want, and sagely advice of why it can be done, but shouldn't. http://social.msdn.microsoft.com/Foru...
How can I create my custom Shell Context Handlers for Windows? Problem Language: C# 2.0 or later I would like to register context handlers to create menues when the user right clicks certain files (in my case *.eic). What is the procedure to register, unregister (clean up) and handle events (clicks) from these menues? ...
TITLE: How can I create my custom Shell Context Handlers for Windows? QUESTION: Problem Language: C# 2.0 or later I would like to register context handlers to create menues when the user right clicks certain files (in my case *.eic). What is the procedure to register, unregister (clean up) and handle events (clicks) f...
[ "c#", ".net", "windows-shell" ]
4
6
3,065
7
0
2008-09-22T21:05:46.987000
2008-09-22T21:09:33.060000
117,665
117,988
jquery: fastest DOM insertion?
I got this bad feeling about how I insert larger amounts of HTML. Lets assume we got: var html=".... " and I want to put this into $("#mydiv") previously I did something like var html_obj = $(html); $("#mydiv").append(html_obj); Is it correct that jQuery is parsing html to create DOM-Objects? Well this is what I read s...
innerHTML is remarkably fast, and in many cases you will get the best results just setting that (I would just use append). However, if there is much already in "mydiv" then you are forcing the browser to parse and render all of that content again (everything that was there before, plus all of your new content). You can...
jquery: fastest DOM insertion? I got this bad feeling about how I insert larger amounts of HTML. Lets assume we got: var html=".... " and I want to put this into $("#mydiv") previously I did something like var html_obj = $(html); $("#mydiv").append(html_obj); Is it correct that jQuery is parsing html to create DOM-Obje...
TITLE: jquery: fastest DOM insertion? QUESTION: I got this bad feeling about how I insert larger amounts of HTML. Lets assume we got: var html=".... " and I want to put this into $("#mydiv") previously I did something like var html_obj = $(html); $("#mydiv").append(html_obj); Is it correct that jQuery is parsing html ...
[ "javascript", "jquery", "dom" ]
21
22
27,645
8
0
2008-09-22T21:09:42.623000
2008-09-22T22:22:32.137000
117,690
117,711
Wait until any of Future<T> is done
I have few asynchronous tasks running and I need to wait until at least one of them is finished (in the future probably I'll need to wait util M out of N tasks are finished). Currently they are presented as Future, so I need something like /** * Blocks current thread until one of specified futures is done and returns i...
As far as I know, Java has no analogous structure to the WaitHandle.WaitAny method. It seems to me that this could be achieved through a "WaitableFuture" decorator: public WaitableFuture extends Future { private CountDownLatch countDownLatch; WaitableFuture(CountDownLatch countDownLatch) { super(); this.countDownLatc...
Wait until any of Future<T> is done I have few asynchronous tasks running and I need to wait until at least one of them is finished (in the future probably I'll need to wait util M out of N tasks are finished). Currently they are presented as Future, so I need something like /** * Blocks current thread until one of spe...
TITLE: Wait until any of Future<T> is done QUESTION: I have few asynchronous tasks running and I need to wait until at least one of them is finished (in the future probably I'll need to wait util M out of N tasks are finished). Currently they are presented as Future, so I need something like /** * Blocks current threa...
[ "java", "multithreading", "concurrency" ]
58
4
38,526
8
0
2008-09-22T21:13:14.597000
2008-09-22T21:18:03.853000
117,691
117,723
How would you display an array of integers as a set of ranges? (algorithm)
Given an array of integers, what is the simplest way to iterate over it and figure out all the ranges it covers? for example, for an array such as: $numbers = array(1,3,4,5,6,8,11,12,14,15,16); The ranges would be: 1,3-6,8,11-12,14-16
If the array is sorted in ascending order, then the problem is easy. Define a Range structure or class, which has a beginning and an end. Then go through the array. If the current element is one more than the previous, update Range.end, otherwise create a new range with this element as Range.begin. Store the ranges to ...
How would you display an array of integers as a set of ranges? (algorithm) Given an array of integers, what is the simplest way to iterate over it and figure out all the ranges it covers? for example, for an array such as: $numbers = array(1,3,4,5,6,8,11,12,14,15,16); The ranges would be: 1,3-6,8,11-12,14-16
TITLE: How would you display an array of integers as a set of ranges? (algorithm) QUESTION: Given an array of integers, what is the simplest way to iterate over it and figure out all the ranges it covers? for example, for an array such as: $numbers = array(1,3,4,5,6,8,11,12,14,15,16); The ranges would be: 1,3-6,8,11-1...
[ "algorithm", "arrays", "language-agnostic", "range" ]
8
14
5,431
16
0
2008-09-22T21:13:15.127000
2008-09-22T21:21:38.430000
117,693
118,095
How to initialize Pango under Win32?
Having downloaded Pango and GLib from the GTK+ Project's Win32 downloads page and having created and configured a Win32 project under Visual Studio 2005 so it points to the proper lib and include directories, how do you initialize Pango for rendering to a Win32 window? Should the first call be to pango_win32_get_contex...
Pango is a GObject based library. As such, you need to make sure that the glib dynamic type system is initialized before using any of its functionality. This can be done by calling g_type_init() (either directly or indirectly via something like gtk_init() ). Could this be your problem?
How to initialize Pango under Win32? Having downloaded Pango and GLib from the GTK+ Project's Win32 downloads page and having created and configured a Win32 project under Visual Studio 2005 so it points to the proper lib and include directories, how do you initialize Pango for rendering to a Win32 window? Should the fi...
TITLE: How to initialize Pango under Win32? QUESTION: Having downloaded Pango and GLib from the GTK+ Project's Win32 downloads page and having created and configured a Win32 project under Visual Studio 2005 so it points to the proper lib and include directories, how do you initialize Pango for rendering to a Win32 win...
[ "c++", "winapi", "graphics", "fonts", "pango" ]
1
5
1,110
1
0
2008-09-22T21:13:56.093000
2008-09-22T22:53:35.777000
117,698
117,873
Any way to use Help.ShowHelp in Windows CE Core license build?
I am developing a Compact Framework 3.5 application for Windows CE 6.0. Help.ShowHelp() throws a NotSupportedException. At windowsembedded.com I found this statement: "Help is not included in the Core run-time because it requires a browser." Is this the reason for the exception? If so, is there any recommended way to g...
ShowHelp uses the browser control (via webview.dll IIRC) under CE. The browser control is definitely part of the Professional CE license SKU (assessment tool here. There used to be a Word doc that listed every component, but I can't seem to locate a download for it), so you will have to roll your own Help framework if ...
Any way to use Help.ShowHelp in Windows CE Core license build? I am developing a Compact Framework 3.5 application for Windows CE 6.0. Help.ShowHelp() throws a NotSupportedException. At windowsembedded.com I found this statement: "Help is not included in the Core run-time because it requires a browser." Is this the rea...
TITLE: Any way to use Help.ShowHelp in Windows CE Core license build? QUESTION: I am developing a Compact Framework 3.5 application for Windows CE 6.0. Help.ShowHelp() throws a NotSupportedException. At windowsembedded.com I found this statement: "Help is not included in the Core run-time because it requires a browser...
[ "compact-framework", "windows-ce" ]
1
1
479
1
0
2008-09-22T21:15:23.483000
2008-09-22T21:51:25.347000
117,708
117,760
nonvirtual interface idiom for more than two levels of inheritance?
The non-virtual interface idiom describes how the virtual methods are nonpublic customisation points, and public methods are nonvirtual to allow the base class to control at all times how the customisation points are called. This is an elegant idiom and I like to use it, but how does it work if the derived class is a b...
It works, because the derived class can override a private virtual function of a base class, even if the base class function overrides its base class function. This is perfectly legal: class Parent { public: int foo() {return bar();} // the non-virtual public interface private virtual int bar(); }; class Child: public...
nonvirtual interface idiom for more than two levels of inheritance? The non-virtual interface idiom describes how the virtual methods are nonpublic customisation points, and public methods are nonvirtual to allow the base class to control at all times how the customisation points are called. This is an elegant idiom an...
TITLE: nonvirtual interface idiom for more than two levels of inheritance? QUESTION: The non-virtual interface idiom describes how the virtual methods are nonpublic customisation points, and public methods are nonvirtual to allow the base class to control at all times how the customisation points are called. This is a...
[ "c++", "inheritance", "class-design", "non-virtual-interface" ]
5
5
717
2
0
2008-09-22T21:17:24.883000
2008-09-22T21:28:53.107000
117,732
118,350
Can you do LINQ-like queries in a language like Python or Boo?
Take this simple C# LINQ query, and imagine that db.Numbers is an SQL table with one column Number: var result = from n in db.Numbers where n.Number < 5 select n.Number; This will run very efficiently in C#, because it generates an SQL query something like select Number from Numbers where Number < 5 What it doesn't do ...
I believe that when IronPython 2.0 is complete, it will have LINQ support (see this thread for some example discussion). Right now you should be able to write something like: Queryable.Select(Queryable.Where(someInputSequence, somePredicate), someFuncThatReturnsTheSequenceElement) Something better might have made it in...
Can you do LINQ-like queries in a language like Python or Boo? Take this simple C# LINQ query, and imagine that db.Numbers is an SQL table with one column Number: var result = from n in db.Numbers where n.Number < 5 select n.Number; This will run very efficiently in C#, because it generates an SQL query something like ...
TITLE: Can you do LINQ-like queries in a language like Python or Boo? QUESTION: Take this simple C# LINQ query, and imagine that db.Numbers is an SQL table with one column Number: var result = from n in db.Numbers where n.Number < 5 select n.Number; This will run very efficiently in C#, because it generates an SQL que...
[ "python", "linq", "linq-to-sql", "ironpython", "boo" ]
5
4
7,562
6
0
2008-09-22T21:24:00.547000
2008-09-23T00:11:39.660000
117,751
416,975
Spring JTA TransactionManager config: Supporting both Tomcat and JBoss
I have a web application using JPA and JTA with Spring. I would like to support both JBoss and Tomcat. When running on JBoss, I'd like to use JBoss' own TransactionManager, and when running on Tomcat, I'd like to use JOTM. I have both scenarios working, but I now find that I seem to need two separate Spring configurati...
I think you have missed the point of JNDI. JNDI was pretty much written to solve the problem you have! I think you can take it up a level, so instead of using the "userTransaction" or "transactionManager from JNDI" depending on your situation. Why not add the "JtaTransactionManager" to JNDI. That way you push the confi...
Spring JTA TransactionManager config: Supporting both Tomcat and JBoss I have a web application using JPA and JTA with Spring. I would like to support both JBoss and Tomcat. When running on JBoss, I'd like to use JBoss' own TransactionManager, and when running on Tomcat, I'd like to use JOTM. I have both scenarios work...
TITLE: Spring JTA TransactionManager config: Supporting both Tomcat and JBoss QUESTION: I have a web application using JPA and JTA with Spring. I would like to support both JBoss and Tomcat. When running on JBoss, I'd like to use JBoss' own TransactionManager, and when running on Tomcat, I'd like to use JOTM. I have b...
[ "java", "spring", "jboss", "jta", "jotm" ]
10
14
50,106
5
0
2008-09-22T21:27:26.263000
2009-01-06T15:33:51.070000
117,754
117,791
Can you recommend a Windows based Network emulator?
I'm looking for a Windows network emulator that can emulate the packet-loss & latency characteristics of a 3G wireless network. I used to use a tool from GIPs that has been end-of-life'd. I've also tried Shunra Virtual Enterprise but found it a bit too basic
There's a FreeBSD tool called dummynet that can do this. Since you have a Windows setup, you could put it on a separate box and route through it for testing, or perhaps even run it on a VM on your Windows machine. I know of no Windows solution to this problem, but perhaps others will.
Can you recommend a Windows based Network emulator? I'm looking for a Windows network emulator that can emulate the packet-loss & latency characteristics of a 3G wireless network. I used to use a tool from GIPs that has been end-of-life'd. I've also tried Shunra Virtual Enterprise but found it a bit too basic
TITLE: Can you recommend a Windows based Network emulator? QUESTION: I'm looking for a Windows network emulator that can emulate the packet-loss & latency characteristics of a 3G wireless network. I used to use a tool from GIPs that has been end-of-life'd. I've also tried Shunra Virtual Enterprise but found it a bit t...
[ "networking", "wireless" ]
2
2
11,996
3
0
2008-09-22T21:27:57.620000
2008-09-22T21:34:45.573000
117,755
118,442
Getting a char* from a _variant_t in optimal time
Here's the code I want to speed up. It's getting a value from an ADO recordset and converting it to a char*. But this is slow. Can I skip the creation of the _bstr_t? _variant_t var = pRs->Fields->GetItem(i)->GetValue(); if (V_VT(&var) == VT_BSTR) { char* p = (const char*) (_bstr_t) var;
The first 4 bytes of the BSTR contain the length. You can loop through and get every other character if unicode or every character if multibyte. Some sort of memcpy or other method would work too. IIRC, this can be faster than W2A or casting (LPCSTR)(_bstr_t)
Getting a char* from a _variant_t in optimal time Here's the code I want to speed up. It's getting a value from an ADO recordset and converting it to a char*. But this is slow. Can I skip the creation of the _bstr_t? _variant_t var = pRs->Fields->GetItem(i)->GetValue(); if (V_VT(&var) == VT_BSTR) { char* p = (const ch...
TITLE: Getting a char* from a _variant_t in optimal time QUESTION: Here's the code I want to speed up. It's getting a value from an ADO recordset and converting it to a char*. But this is slow. Can I skip the creation of the _bstr_t? _variant_t var = pRs->Fields->GetItem(i)->GetValue(); if (V_VT(&var) == VT_BSTR) { c...
[ "c++", "visual-c++", "com", "ole", "bstr" ]
4
3
5,905
5
0
2008-09-22T21:28:08.990000
2008-09-23T00:36:15.887000
117,774
117,919
Decipher database schema
I've recently inherited the job of maintaining a database that wasn't designed very well and the designers aren't available to ask any questions. And I have a couple more coming my way in the near future. It's been tough trying to figure out the relationships between the tables without any kind of visual aid or databas...
Try SchemaSpy. I ran it against a rather complex database and I was quite pleased by the result, with advice on optimization.
Decipher database schema I've recently inherited the job of maintaining a database that wasn't designed very well and the designers aren't available to ask any questions. And I have a couple more coming my way in the near future. It's been tough trying to figure out the relationships between the tables without any kind...
TITLE: Decipher database schema QUESTION: I've recently inherited the job of maintaining a database that wasn't designed very well and the designers aren't available to ask any questions. And I have a couple more coming my way in the near future. It's been tough trying to figure out the relationships between the table...
[ "database", "database-design", "diagram" ]
9
15
14,379
13
0
2008-09-22T21:32:03.710000
2008-09-22T22:03:00.843000
117,776
1,177,804
Loading an existing database into WWW SQL Designer?
I've used WWW SQL Designer several times to design databases for applications. I'm now in charge of working on an application with a lot of tables (100+ mysql tables) and I would love to be able to look at the relations between tables in a manner similar to what WWW SQL Designer provides. It seems that it comes with th...
http://code.google.com/p/database-diagram/ This takes a SQL structure (SQL dump) and shows a diagram:)
Loading an existing database into WWW SQL Designer? I've used WWW SQL Designer several times to design databases for applications. I'm now in charge of working on an application with a lot of tables (100+ mysql tables) and I would love to be able to look at the relations between tables in a manner similar to what WWW S...
TITLE: Loading an existing database into WWW SQL Designer? QUESTION: I've used WWW SQL Designer several times to design databases for applications. I'm now in charge of working on an application with a lot of tables (100+ mysql tables) and I would love to be able to look at the relations between tables in a manner sim...
[ "sql", "mysql", "diagram" ]
3
1
3,572
6
0
2008-09-22T21:32:25.347000
2009-07-24T13:48:34.037000
117,800
118,402
How to get Django AutoFields to start at a higher number
For our Django App, we'd like to get an AutoField to start at a number other than 1. There doesn't seem to be an obvious way to do this. Any ideas?
Like the others have said, this would be much easier to do on the database side than the Django side. For Postgres, it'd be like so: ALTER SEQUENCE sequence_name RESTART WITH 12345; Look at your own DB engine's docs for how you'd do it there.
How to get Django AutoFields to start at a higher number For our Django App, we'd like to get an AutoField to start at a number other than 1. There doesn't seem to be an obvious way to do this. Any ideas?
TITLE: How to get Django AutoFields to start at a higher number QUESTION: For our Django App, we'd like to get an AutoField to start at a number other than 1. There doesn't seem to be an obvious way to do this. Any ideas? ANSWER: Like the others have said, this would be much easier to do on the database side than the...
[ "python", "django", "autofield" ]
31
23
18,592
9
0
2008-09-22T21:37:00.937000
2008-09-23T00:25:54.977000
117,810
117,867
Upload files directly to Amazon S3 from ASP.NET application
My ASP.NET MVC application will take a lot of bandwidth and storage space. How can I setup an ASP.NET upload page so the file the user uploaded will go straight to Amazon S3 without using my web server's storage and bandwidth?
Update Feb 2016: The AWS SDK can handle a lot more of this now. Check out how to build the form, and how to build the signature. That should prevent you from needing the bandwidth on your end, assuming you need to do no processing of the content yourself before sending it to S3.
Upload files directly to Amazon S3 from ASP.NET application My ASP.NET MVC application will take a lot of bandwidth and storage space. How can I setup an ASP.NET upload page so the file the user uploaded will go straight to Amazon S3 without using my web server's storage and bandwidth?
TITLE: Upload files directly to Amazon S3 from ASP.NET application QUESTION: My ASP.NET MVC application will take a lot of bandwidth and storage space. How can I setup an ASP.NET upload page so the file the user uploaded will go straight to Amazon S3 without using my web server's storage and bandwidth? ANSWER: Update...
[ "asp.net" ]
27
27
22,749
6
0
2008-09-22T21:39:17.233000
2008-09-22T21:50:18.703000
117,844
117,870
Converting string of 1s and 0s into binary value
I'm trying to convert an incoming sting of 1s and 0s from stdin into their respective binary values (where a string such as "11110111" would be converted to 0xF7). This seems pretty trivial but I don't want to reinvent the wheel so I'm wondering if there's anything in the C/C++ standard libs that can already perform su...
#include #include int main(void) { char * ptr; long parsed = strtol("11110111", & ptr, 2); printf("%lX\n", parsed); return EXIT_SUCCESS; } For larger numbers, there as a long long version, strtoll.
Converting string of 1s and 0s into binary value I'm trying to convert an incoming sting of 1s and 0s from stdin into their respective binary values (where a string such as "11110111" would be converted to 0xF7). This seems pretty trivial but I don't want to reinvent the wheel so I'm wondering if there's anything in th...
TITLE: Converting string of 1s and 0s into binary value QUESTION: I'm trying to convert an incoming sting of 1s and 0s from stdin into their respective binary values (where a string such as "11110111" would be converted to 0xF7). This seems pretty trivial but I don't want to reinvent the wheel so I'm wondering if ther...
[ "c++", "c", "binary" ]
23
37
22,622
5
0
2008-09-22T21:46:19.883000
2008-09-22T21:50:56.410000
117,851
117,980
How can I determine the current focused process name and version in C#
For example if I'm working on Visual Studio 2008, I want the values devenv and 2008 or 9. The version number is very important...
This is going to be PInvoke city... You'll need to PInvoke the following API's in User32.dll Win32::GetForegroundWindow() in returns the HWND of the currently active window. /// /// The GetForegroundWindow function returns a handle to the foreground window. /// [DllImport("user32.dll")] static extern IntPtr GetForegrou...
How can I determine the current focused process name and version in C# For example if I'm working on Visual Studio 2008, I want the values devenv and 2008 or 9. The version number is very important...
TITLE: How can I determine the current focused process name and version in C# QUESTION: For example if I'm working on Visual Studio 2008, I want the values devenv and 2008 or 9. The version number is very important... ANSWER: This is going to be PInvoke city... You'll need to PInvoke the following API's in User32.dll...
[ "c#", "process", "pinvoke", "user32" ]
1
8
2,696
3
0
2008-09-22T21:48:12.780000
2008-09-22T22:20:32.063000
117,864
117,898
Testing your code for speed?
I'm a total newbie, but I was writing a little program that worked on strings in C# and I noticed that if I did a few things differently, the code executed significantly faster. So it had me wondering, how do you go about clocking your code's execution speed? Are there any (free)utilities? Do you go about it the old-fa...
What you are describing is known as performance profiling. There are many programs you can get to do this such as Jetbrains profiler or Ants profiler, although most will slow down your application whilst in the process of measuring its performance. To hand-roll your own performance profiling, you can use System.Diagnos...
Testing your code for speed? I'm a total newbie, but I was writing a little program that worked on strings in C# and I noticed that if I did a few things differently, the code executed significantly faster. So it had me wondering, how do you go about clocking your code's execution speed? Are there any (free)utilities? ...
TITLE: Testing your code for speed? QUESTION: I'm a total newbie, but I was writing a little program that worked on strings in C# and I noticed that if I did a few things differently, the code executed significantly faster. So it had me wondering, how do you go about clocking your code's execution speed? Are there any...
[ "c#", "performance", "profiling", "timing" ]
13
18
20,163
9
0
2008-09-22T21:50:04.897000
2008-09-22T21:56:07.503000
117,900
224,447
How do I unload a externally loaded SWF file from a SWFLoader component in Adobe Flex?
I have an application that loads external SWF files and plays them inside a Adobe Flex / Air application via the SWFLoader Flex component. I have been trying to find a way to unload them from a button click event. I have Google'd far and wide and no one seems to have been able to do it without a hack. The combination o...
... isn't that a problem with the Flex architecture? Yes it is, and it also affects Flash in general. Until you can take advantage of the Loader.unloadAndStop() method in FP10 (AIR 1.5), you can't guarantee that externally loaded content will not continue to consume memory and cpu resources, even if you use the Loader....
How do I unload a externally loaded SWF file from a SWFLoader component in Adobe Flex? I have an application that loads external SWF files and plays them inside a Adobe Flex / Air application via the SWFLoader Flex component. I have been trying to find a way to unload them from a button click event. I have Google'd far...
TITLE: How do I unload a externally loaded SWF file from a SWFLoader component in Adobe Flex? QUESTION: I have an application that loads external SWF files and plays them inside a Adobe Flex / Air application via the SWFLoader Flex component. I have been trying to find a way to unload them from a button click event. I...
[ "apache-flex", "air", "adobe", "swfloader" ]
3
6
15,988
7
0
2008-09-22T21:57:27.330000
2008-10-22T04:00:36.930000
117,920
325,632
How do I open Office 2007 files stored on a website?
I have a website where people can upload documents, and view them later at their convenience. I store the binary info along with the mime type in my db, and later just stream the binary content straight to the browser. This works for for every file type except Office 2007 files. When I try to view the Office 2007 files...
Check out this explanation on VS Office Developer. It gives a registry hack which your users could choose to apply to rid suppress this warning.
How do I open Office 2007 files stored on a website? I have a website where people can upload documents, and view them later at their convenience. I store the binary info along with the mime type in my db, and later just stream the binary content straight to the browser. This works for for every file type except Office...
TITLE: How do I open Office 2007 files stored on a website? QUESTION: I have a website where people can upload documents, and view them later at their convenience. I store the binary info along with the mime type in my db, and later just stream the binary content straight to the browser. This works for for every file ...
[ "asp.net", "security", "office-2007" ]
0
2
471
4
0
2008-09-22T22:03:05.630000
2008-11-28T12:18:19.190000
117,931
117,968
apache mod_rewrite one rule for any number of possibilities
I'm building a fairly large website and my.htaccess is starting to feel a bit bloated, is there a way of replacing my current system of - one rule for each of the possibile number of vars that could be passed, to one catch all expression that can account for varying numbers of inputs? for example I currently have: Rewr...
Do like Drupal: RewriteCond %{REQUEST_FILENAME}!-f RewriteCond %{REQUEST_FILENAME}!-d RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] And then handle all the stuff in your script using php code something like this $pathmap = (); if ($_GET["q"]){ $path = split("/", $_GET["q"]); for ($i=0; $i+1
apache mod_rewrite one rule for any number of possibilities I'm building a fairly large website and my.htaccess is starting to feel a bit bloated, is there a way of replacing my current system of - one rule for each of the possibile number of vars that could be passed, to one catch all expression that can account for v...
TITLE: apache mod_rewrite one rule for any number of possibilities QUESTION: I'm building a fairly large website and my.htaccess is starting to feel a bit bloated, is there a way of replacing my current system of - one rule for each of the possibile number of vars that could be passed, to one catch all expression that...
[ "regex", "apache", "mod-rewrite" ]
12
9
2,641
3
0
2008-09-22T22:06:02.253000
2008-09-22T22:17:16.097000
117,940
118,027
Best practice for translating exceptions in C++/CLI wrapper class
I am writing a.NET wrapper class for an existing native class which throws exceptions. What are the best practices for translating between native C++ exceptions and Managed exceptions? Catch and re-throw on a one-to-one basis (e.g. std::invalid_argument -> System.System.ArgumentException)? Is there a mapping already dr...
There is no standard mapping that I know of. What I've done in the past is translate the ones I know about, and a catch block for System.Runtime.InteropServices.SEHException. All non-translated exceptions will be turned into that exception. As long as you have a debug build of the code that is throwing the exception, y...
Best practice for translating exceptions in C++/CLI wrapper class I am writing a.NET wrapper class for an existing native class which throws exceptions. What are the best practices for translating between native C++ exceptions and Managed exceptions? Catch and re-throw on a one-to-one basis (e.g. std::invalid_argument ...
TITLE: Best practice for translating exceptions in C++/CLI wrapper class QUESTION: I am writing a.NET wrapper class for an existing native class which throws exceptions. What are the best practices for translating between native C++ exceptions and Managed exceptions? Catch and re-throw on a one-to-one basis (e.g. std:...
[ ".net", "exception", "error-handling", "c++-cli" ]
5
5
4,343
4
0
2008-09-22T22:11:29.917000
2008-09-22T22:32:34.703000
117,945
183,455
What Could Affect Values Returned By Serialport.Read()
I've written a simple app in C# 2.0 using the.Net Framework 2.0 Serialport class to communicate with a controller card via COM1. A problem occurred recently were the bytes returned by the Read method are incorrect. It returned the right amount of bytes, only the values were incorrect. A similar app written in Delphi st...
Well, it seems as if the problem has been resolved (at least for the time being). Apparently a framing error caused the return of incorrect values. I wrote a VB6 app, using the MSComm control, which worked fine, and compared the log files generated by Portmon. I picked up the following differences VB6 App: IOCTL_SERIAL...
What Could Affect Values Returned By Serialport.Read() I've written a simple app in C# 2.0 using the.Net Framework 2.0 Serialport class to communicate with a controller card via COM1. A problem occurred recently were the bytes returned by the Read method are incorrect. It returned the right amount of bytes, only the va...
TITLE: What Could Affect Values Returned By Serialport.Read() QUESTION: I've written a simple app in C# 2.0 using the.Net Framework 2.0 Serialport class to communicate with a controller card via COM1. A problem occurred recently were the bytes returned by the Read method are incorrect. It returned the right amount of ...
[ ".net", "serial-port" ]
4
2
3,992
4
0
2008-09-22T22:12:25.530000
2008-10-08T15:44:56.407000
117,952
118,014
Transact-SQL - sub query or left-join?
I have two tables containing Tasks and Notes, and want to retrieve a list of tasks with the number of associated notes for each one. These two queries do the job: select t.TaskId, (select count(n.TaskNoteId) from TaskNote n where n.TaskId = t.TaskId) 'Notes' from Task t -- or select t.TaskId, count(n.TaskNoteId) 'Note...
On small datasets they are wash when it comes to performance. When indexed, the LOJ is a little better. I've found on large datasets that an inner join (an inner join will work too.) will outperform the subquery by a very large factor (sorry, no numbers).
Transact-SQL - sub query or left-join? I have two tables containing Tasks and Notes, and want to retrieve a list of tasks with the number of associated notes for each one. These two queries do the job: select t.TaskId, (select count(n.TaskNoteId) from TaskNote n where n.TaskId = t.TaskId) 'Notes' from Task t -- or sel...
TITLE: Transact-SQL - sub query or left-join? QUESTION: I have two tables containing Tasks and Notes, and want to retrieve a list of tasks with the number of associated notes for each one. These two queries do the job: select t.TaskId, (select count(n.TaskNoteId) from TaskNote n where n.TaskId = t.TaskId) 'Notes' from...
[ "sql", "t-sql" ]
11
12
12,014
7
0
2008-09-22T22:13:27.150000
2008-09-22T22:29:13.557000
117,960
117,983
How to refactor in a branch without losing my mind?
I refactor my and other people's code all the time. When I work in a branch and not in Trunk, this sometimes results in some extremely painful merges, especially if I don't merge back to Trunk regularly (the code at the branch slowly shifts away from the Trunc, and when people modify Trunk I have to figure out manually...
Refactoring on a large scale needs to be done at the right time in the development timeline. If you do huge amounts of refactoring near release you'll end up hurting yourself because you'll introduce painful merges at a time when changes should be minimized. The more disruptive your refactoring will be the earlier in t...
How to refactor in a branch without losing my mind? I refactor my and other people's code all the time. When I work in a branch and not in Trunk, this sometimes results in some extremely painful merges, especially if I don't merge back to Trunk regularly (the code at the branch slowly shifts away from the Trunc, and wh...
TITLE: How to refactor in a branch without losing my mind? QUESTION: I refactor my and other people's code all the time. When I work in a branch and not in Trunk, this sometimes results in some extremely painful merges, especially if I don't merge back to Trunk regularly (the code at the branch slowly shifts away from...
[ "refactoring", "branch" ]
5
6
1,401
8
0
2008-09-22T22:15:16.727000
2008-09-22T22:21:17.320000
117,962
117,977
What is a simple and efficient way to find rows with time-interval overlaps in SQL?
I have two tables, both with start time and end time fields. I need to find, for each row in the first table, all of the rows in the second table where the time intervals intersect. For example: <-----row 1 interval-------> <---find this--> <--and this--> <--and this--> Please phrase your answer in the form of a SQL WH...
SELECT * FROM table1,table2 WHERE table2.start <= table1.end AND (table2.end IS NULL OR table2.end >= table1.start)
What is a simple and efficient way to find rows with time-interval overlaps in SQL? I have two tables, both with start time and end time fields. I need to find, for each row in the first table, all of the rows in the second table where the time intervals intersect. For example: <-----row 1 interval-------> <---find thi...
TITLE: What is a simple and efficient way to find rows with time-interval overlaps in SQL? QUESTION: I have two tables, both with start time and end time fields. I need to find, for each row in the first table, all of the rows in the second table where the time intervals intersect. For example: <-----row 1 interval---...
[ "sql" ]
39
68
49,120
5
0
2008-09-22T22:16:05.693000
2008-09-22T22:20:06.357000
117,966
117,997
Best practices for withstanding launch day traffic burst
We are working on a website for a client that (for once) is expected to get a fair amount of traffic on day one. There are press releases, people are blogging about it, etc. I am a little concerned that we're going to fall flat on our face on day one. What are the main things you would look at to ensure (in advance wit...
To prepare or handle a spike (or peak) performance, I would first determine whether you are ready through some simple performance testing with something like jmeter. It is easy to set up and get started and will give you early metrics whether you will handle an expected peak load. However, given your time constraints, ...
Best practices for withstanding launch day traffic burst We are working on a website for a client that (for once) is expected to get a fair amount of traffic on day one. There are press releases, people are blogging about it, etc. I am a little concerned that we're going to fall flat on our face on day one. What are th...
TITLE: Best practices for withstanding launch day traffic burst QUESTION: We are working on a website for a client that (for once) is expected to get a fair amount of traffic on day one. There are press releases, people are blogging about it, etc. I am a little concerned that we're going to fall flat on our face on da...
[ "php", "mysql", "linux", "apache", "lamp" ]
17
1
1,042
7
0
2008-09-22T22:17:01.340000
2008-09-22T22:25:34.267000
117,974
117,979
What is the OleDb equivalent for INFORMATION_SCHEMA
In SQL you can use SELECT * FROM INFORMATION_SCHEMA.TABLES etc to get information about the database structure. I need to know how to achieve the same thing for an Access database.
The equivalent operation can be accomplished using OleDbConnection.GetOleDbSchemaTable() method. see http://support.microsoft.com/kb/309488 for more information
What is the OleDb equivalent for INFORMATION_SCHEMA In SQL you can use SELECT * FROM INFORMATION_SCHEMA.TABLES etc to get information about the database structure. I need to know how to achieve the same thing for an Access database.
TITLE: What is the OleDb equivalent for INFORMATION_SCHEMA QUESTION: In SQL you can use SELECT * FROM INFORMATION_SCHEMA.TABLES etc to get information about the database structure. I need to know how to achieve the same thing for an Access database. ANSWER: The equivalent operation can be accomplished using OleDbConn...
[ ".net", "sql", "oledb" ]
5
5
1,222
2
0
2008-09-22T22:19:19.103000
2008-09-22T22:20:26.417000
117,986
118,142
Debug/Monitor middleware for python wsgi applications
I'm searching a wsgi middleware which I can warp around a wsgi applications and which lets me monitor incoming and outgoing http requests and header fields. Something like firefox live headers, but for the server side.
The middleware from wsgiref.util import request_uri import sys def logging_middleware(application, stream=sys.stdout): def _logger(environ, start_response): stream.write('REQUEST\n') stream.write('%s %s\n' %( environ['REQUEST_METHOD'], request_uri(environ), )) for name, value in environ.items(): if name.startswith('H...
Debug/Monitor middleware for python wsgi applications I'm searching a wsgi middleware which I can warp around a wsgi applications and which lets me monitor incoming and outgoing http requests and header fields. Something like firefox live headers, but for the server side.
TITLE: Debug/Monitor middleware for python wsgi applications QUESTION: I'm searching a wsgi middleware which I can warp around a wsgi applications and which lets me monitor incoming and outgoing http requests and header fields. Something like firefox live headers, but for the server side. ANSWER: The middleware from ...
[ "python", "debugging", "wsgi", "middleware" ]
1
2
2,411
5
0
2008-09-22T22:22:18.957000
2008-09-22T23:05:34.310000
117,987
149,411
Best text search engine for integrating with custom web app?
We have a web app that allows users to upload documents, create their own documents, and so on. Uploaded files are stored on Amazon S3, created information is stored in a MySQL database. What I'm looking for is some sort of search engine, where I feed it all of our text documents, each with a unique ID, and it builds a...
Take a look at Solr. It's based on Lucene, so it's very fast, and it's really easy to use from any platform.
Best text search engine for integrating with custom web app? We have a web app that allows users to upload documents, create their own documents, and so on. Uploaded files are stored on Amazon S3, created information is stored in a MySQL database. What I'm looking for is some sort of search engine, where I feed it all ...
TITLE: Best text search engine for integrating with custom web app? QUESTION: We have a web app that allows users to upload documents, create their own documents, and so on. Uploaded files are stored on Amazon S3, created information is stored in a MySQL database. What I'm looking for is some sort of search engine, wh...
[ "linux", "search", "web-applications", "full-text-search" ]
4
5
1,676
6
0
2008-09-22T22:22:24.103000
2008-09-29T16:12:50.320000
118,023
153,458
Does anyone work with Function Points?
Some questions about Function Points: 1) Is it a reasonably precise way to do estimates? (I'm not unreasonable here, but just want to know compared to other estimation methods) 2) And is the effort required worth the benefit you get out of it? 3) Which type of Function Points do you use? 4) Do you use any tools for doi...
Mike Cohn in his Agile Estimating and Planning consider FPs to be great but difficult to get right. He (obviously) recommends to use story points-based estimation instead. I tend to agree with this as with each new project I see the benefits of Agile approach more and more. 1) Is it a reasonably precise way to do estim...
Does anyone work with Function Points? Some questions about Function Points: 1) Is it a reasonably precise way to do estimates? (I'm not unreasonable here, but just want to know compared to other estimation methods) 2) And is the effort required worth the benefit you get out of it? 3) Which type of Function Points do y...
TITLE: Does anyone work with Function Points? QUESTION: Some questions about Function Points: 1) Is it a reasonably precise way to do estimates? (I'm not unreasonable here, but just want to know compared to other estimation methods) 2) And is the effort required worth the benefit you get out of it? 3) Which type of Fu...
[ "estimation", "function-points" ]
14
10
5,263
6
0
2008-09-22T22:31:05.610000
2008-09-30T15:04:12.020000
118,038
127,709
Web Site Compliance with the Americans with Disabilities Act (ADA)
Are there any automatic, online or off, tools for testing xhtml/css for compliance with screen readers and other visual guidelines of the Americans with Disabilities Act (ADA)?
I'm in agreement with @Jim that accessibility compliance is at the moment is not a 100% objective science. Take the classic case of image alt text. Suppose a story about education in America includes a closeup photo of a smiling female Hispanic student, approximately ten years old, at a desk in a classroom writing on a...
Web Site Compliance with the Americans with Disabilities Act (ADA) Are there any automatic, online or off, tools for testing xhtml/css for compliance with screen readers and other visual guidelines of the Americans with Disabilities Act (ADA)?
TITLE: Web Site Compliance with the Americans with Disabilities Act (ADA) QUESTION: Are there any automatic, online or off, tools for testing xhtml/css for compliance with screen readers and other visual guidelines of the Americans with Disabilities Act (ADA)? ANSWER: I'm in agreement with @Jim that accessibility com...
[ "accessibility", "w3c", "standards-compliance", "section508", "wcag" ]
10
8
4,074
2
0
2008-09-22T22:35:30.750000
2008-09-24T15:02:53.300000
118,043
118,263
Can you use Silverlight with AJAX without any UI element?
I know you can just use CSS to hide the DIV or Silverlight Plugin, but is there a way to instantiate a Silverlight Component/App using JavaScript that doesn't show any UI element at all? There is alot of great functionality in Silverlight, like MultiThreading and compiled code, that could be utilized by traditional Aja...
Yes you can, and some of the reasons you make makes perfect sense. I did a talk on the HTML bridge at CodeCampNZ some weeks back, and have a good collection of resources up on my blog. I also recommend checking out Wilco Bauwers blog for lots of detail on the HTML bridge. Some other scenarios for non visual Silverlight...
Can you use Silverlight with AJAX without any UI element? I know you can just use CSS to hide the DIV or Silverlight Plugin, but is there a way to instantiate a Silverlight Component/App using JavaScript that doesn't show any UI element at all? There is alot of great functionality in Silverlight, like MultiThreading an...
TITLE: Can you use Silverlight with AJAX without any UI element? QUESTION: I know you can just use CSS to hide the DIV or Silverlight Plugin, but is there a way to instantiate a Silverlight Component/App using JavaScript that doesn't show any UI element at all? There is alot of great functionality in Silverlight, like...
[ "javascript", "ajax", "silverlight" ]
3
3
878
3
0
2008-09-22T22:37:16.080000
2008-09-22T23:45:46.523000
118,051
118,438
C# grid binding not update
I have a grid that is binded to a collection. For some reason that I do not know, now when I do some action in the grid, the grid doesn't update. Situation: When I click a button in the grid, it increase a value that is in the same line. When I click, I can debug and see the value increment but the value doesn't change...
In order for the binding to be bidirectional, from control to datasource and from datasource to control the datasource must implement property changing notification events, in one of the 2 possible ways: Implement the INotifyPropertyChanged interface, and raise the event when the properties change: public string Name {...
C# grid binding not update I have a grid that is binded to a collection. For some reason that I do not know, now when I do some action in the grid, the grid doesn't update. Situation: When I click a button in the grid, it increase a value that is in the same line. When I click, I can debug and see the value increment b...
TITLE: C# grid binding not update QUESTION: I have a grid that is binded to a collection. For some reason that I do not know, now when I do some action in the grid, the grid doesn't update. Situation: When I click a button in the grid, it increase a value that is in the same line. When I click, I can debug and see the...
[ "c#", "data-binding", "datagridview" ]
2
2
1,550
3
0
2008-09-22T22:40:20.910000
2008-09-23T00:35:37.573000
118,062
118,072
How do you design a website to make the best use of ads?
Is anyone aware of general UI design guidelines for increasing ad revenue from web ads? Obviously many SO users use adblock, and probably find this type of question reprehensible, but I believe that it is possible to integrate advertising (and other revenue streams) into sites so that they are visually appealing, on-ta...
In fact, one of the people who created this site made a post regarding this on his blog
How do you design a website to make the best use of ads? Is anyone aware of general UI design guidelines for increasing ad revenue from web ads? Obviously many SO users use adblock, and probably find this type of question reprehensible, but I believe that it is possible to integrate advertising (and other revenue strea...
TITLE: How do you design a website to make the best use of ads? QUESTION: Is anyone aware of general UI design guidelines for increasing ad revenue from web ads? Obviously many SO users use adblock, and probably find this type of question reprehensible, but I believe that it is possible to integrate advertising (and o...
[ "user-interface" ]
2
4
205
2
0
2008-09-22T22:43:57.937000
2008-09-22T22:46:46.447000
118,064
120,354
Managing user stories for a large project
We are just starting on a pretty big project with lots of sub projects. we don't currently use any kind of named process but I am hoping to get some kind of agile/scrumlike process in by the back door. The area I will be focusing on most is having a good backlog for the whole project and, at least in my head, the idea ...
I would counsel you to think carefully before adopting a tool, especially since it sounds like your process is likely to be fluid at first as you find your feet. My feeling is that a tool may be more likely to constrain you than enable you at this stage, and you will find it no substitute for a good card-wall in physic...
Managing user stories for a large project We are just starting on a pretty big project with lots of sub projects. we don't currently use any kind of named process but I am hoping to get some kind of agile/scrumlike process in by the back door. The area I will be focusing on most is having a good backlog for the whole p...
TITLE: Managing user stories for a large project QUESTION: We are just starting on a pretty big project with lots of sub projects. we don't currently use any kind of named process but I am hoping to get some kind of agile/scrumlike process in by the back door. The area I will be focusing on most is having a good backl...
[ "project-management", "agile", "scrum", "user-stories" ]
13
9
4,179
7
0
2008-09-22T22:45:41.317000
2008-09-23T11:07:13.127000
118,068
118,177
Why doesn't GCC optimize structs?
Systems demand that certain primitives be aligned to certain points within the memory (ints to bytes that are multiples of 4, shorts to bytes that are multiples of 2, etc.). Of course, these can be optimized to waste the least space in padding. My question is why doesn't GCC do this automatically? Is the more obvious h...
gcc does not reorder the elements of a struct, because that would violate the C standard. Section 6.7.2.1 of the C99 standard states: Within a structure object, the non-bit-field members and the units in which bit-fields reside have addresses that increase in the order in which they are declared.
Why doesn't GCC optimize structs? Systems demand that certain primitives be aligned to certain points within the memory (ints to bytes that are multiples of 4, shorts to bytes that are multiples of 2, etc.). Of course, these can be optimized to waste the least space in padding. My question is why doesn't GCC do this au...
TITLE: Why doesn't GCC optimize structs? QUESTION: Systems demand that certain primitives be aligned to certain points within the memory (ints to bytes that are multiples of 4, shorts to bytes that are multiples of 2, etc.). Of course, these can be optimized to waste the least space in padding. My question is why does...
[ "c", "optimization", "gcc", "struct" ]
53
82
12,173
7
0
2008-09-22T22:46:19.287000
2008-09-22T23:13:43.637000
118,091
118,118
What name do you give the MSBuild project build file?
I am trying to learn how to use MSBuild so we can use it to build our project. There's what seems to be a very big hole in the documentation, and I find the hole everywhere I look, the hole being how do you name or otherwise designate the MSBuild project file? For example, the tutorial on MSBuild that can be downloaded...
You can name the file as you see fit. From the help for MSBuild msbuild.exe /? Microsoft (R) Build Engine Version 2.0.50727.3053 [Microsoft.NET Framework, Version 2.0.50727.3053] Copyright (C) Microsoft Corporation 2005. All rights reserved. Syntax: MSBuild.exe [options] [project file] So if you save the file as mybu...
What name do you give the MSBuild project build file? I am trying to learn how to use MSBuild so we can use it to build our project. There's what seems to be a very big hole in the documentation, and I find the hole everywhere I look, the hole being how do you name or otherwise designate the MSBuild project file? For e...
TITLE: What name do you give the MSBuild project build file? QUESTION: I am trying to learn how to use MSBuild so we can use it to build our project. There's what seems to be a very big hole in the documentation, and I find the hole everywhere I look, the hole being how do you name or otherwise designate the MSBuild p...
[ "msbuild" ]
7
5
3,474
5
0
2008-09-22T22:51:30.477000
2008-09-22T22:58:23.720000
118,096
118,187
How can i parse a comma delimited string into a list (caveat)?
I need to be able to take a string like: '''foo, bar, "one, two", three four''' into: ['foo', 'bar', 'one, two', 'three four'] I have an feeling (with hints from #python) that the solution is going to involve the shlex module.
The shlex module solution allows escaped quotes, one quote escape another, and all fancy stuff shell supports. >>> import shlex >>> my_splitter = shlex.shlex('''foo, bar, "one, two", three four''', posix=True) >>> my_splitter.whitespace += ',' >>> my_splitter.whitespace_split = True >>> print list(my_splitter) ['foo', ...
How can i parse a comma delimited string into a list (caveat)? I need to be able to take a string like: '''foo, bar, "one, two", three four''' into: ['foo', 'bar', 'one, two', 'three four'] I have an feeling (with hints from #python) that the solution is going to involve the shlex module.
TITLE: How can i parse a comma delimited string into a list (caveat)? QUESTION: I need to be able to take a string like: '''foo, bar, "one, two", three four''' into: ['foo', 'bar', 'one, two', 'three four'] I have an feeling (with hints from #python) that the solution is going to involve the shlex module. ANSWER: The...
[ "python", "split", "escaping", "quotes" ]
25
27
35,920
6
0
2008-09-22T22:54:10.347000
2008-09-22T23:15:45.050000
118,100
692,737
What tool do you use to do burndown charts?
do you use a tool? or just manually make them?
Google charts api/server can make one fairly easily You specify everything in the URL so it's easy to update: http://chart.apis.google.com/chart? chs=600x250& // the size of the chart chtt=Burndown& // Title cht=lc& // The chart type - "lc" means a line chart that only needs Y values chdl=estimated|actual& // The two l...
What tool do you use to do burndown charts? do you use a tool? or just manually make them?
TITLE: What tool do you use to do burndown charts? QUESTION: do you use a tool? or just manually make them? ANSWER: Google charts api/server can make one fairly easily You specify everything in the URL so it's easy to update: http://chart.apis.google.com/chart? chs=600x250& // the size of the chart chtt=Burndown& // ...
[ "project-management", "charts" ]
13
14
11,140
12
0
2008-09-22T22:55:07.877000
2009-03-28T13:03:47.487000
118,126
118,140
Tips for avoiding big ball of mud with ASP.NET WebForms
Although ASP.NET MVC seems to have all the hype these days, WebForms are still quite pervasive. How do you keep your project sane? Let's collect some tips here.
Create web user controls for anything that will be shown on more than one page that isn't a part of masterpage type content. Example: If your application displays product information on 10 pages, it's best to have a user control that is used on 10 pages rather than cut'n'pasting the display code 10 times. Put as little...
Tips for avoiding big ball of mud with ASP.NET WebForms Although ASP.NET MVC seems to have all the hype these days, WebForms are still quite pervasive. How do you keep your project sane? Let's collect some tips here.
TITLE: Tips for avoiding big ball of mud with ASP.NET WebForms QUESTION: Although ASP.NET MVC seems to have all the hype these days, WebForms are still quite pervasive. How do you keep your project sane? Let's collect some tips here. ANSWER: Create web user controls for anything that will be shown on more than one pa...
[ "asp.net", "webforms" ]
7
2
776
6
0
2008-09-22T23:00:32
2008-09-22T23:04:31.910000
118,130
118,170
C# - Why won't a fullscreen winform app ALWAYS cover the taskbar?
I'm using Windows Vista and C#.net 3.5, but I had my friend run the program on XP and has the same problem. So I have a C# program that I have running in the background with an icon in the SystemTray. I have a low level keyboard hook so when I press two keys (Ctr+windows in this case) it'll pull of the application's ma...
Try this (where this is your form): this.Bounds = Screen.PrimaryScreen.Bounds; this.TopMost = true; That'll set the form to fullscreen, and it'll cover the taskbar.
C# - Why won't a fullscreen winform app ALWAYS cover the taskbar? I'm using Windows Vista and C#.net 3.5, but I had my friend run the program on XP and has the same problem. So I have a C# program that I have running in the background with an icon in the SystemTray. I have a low level keyboard hook so when I press two ...
TITLE: C# - Why won't a fullscreen winform app ALWAYS cover the taskbar? QUESTION: I'm using Windows Vista and C#.net 3.5, but I had my friend run the program on XP and has the same problem. So I have a C# program that I have running in the background with an icon in the SystemTray. I have a low level keyboard hook so...
[ "c#", ".net", "winforms", "fullscreen", "keyboard-hook" ]
23
20
17,334
5
0
2008-09-22T23:02:07.283000
2008-09-22T23:11:44.593000
118,143
118,163
Python Regex vs PHP Regex
Not a competition, it is instead me trying to find why a certain regex works in one but not the other. (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?) That's my Regex and I'm trying to run it on 127.255.0.0 Us...
It works for me. You must be doing something wrong. >>> re.match(r'(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)', '127.255.0.0').groups() ('127', '255', '0', '0') Don't forget to escape the regex using raw ...
Python Regex vs PHP Regex Not a competition, it is instead me trying to find why a certain regex works in one but not the other. (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?) That's my Regex and I'm trying t...
TITLE: Python Regex vs PHP Regex QUESTION: Not a competition, it is instead me trying to find why a certain regex works in one but not the other. (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?) That's my Rege...
[ "php", "python", "regex" ]
3
7
3,174
6
0
2008-09-22T23:06:02.547000
2008-09-22T23:10:13.520000
118,144
118,169
What's the most efficient way to select the last n rows in a table without changing the table's structure?
What's the most efficient way to select the last n number of rows in a table using mySQL? The table contains millions of rows, and at any given time I don't know how large the table is (it is constantly growing). The table does have a column that is automatically incremented and used as a unique identifier for each row...
SELECT * FROM table_name ORDER BY auto_incremented_id DESC LIMIT n
What's the most efficient way to select the last n rows in a table without changing the table's structure? What's the most efficient way to select the last n number of rows in a table using mySQL? The table contains millions of rows, and at any given time I don't know how large the table is (it is constantly growing). ...
TITLE: What's the most efficient way to select the last n rows in a table without changing the table's structure? QUESTION: What's the most efficient way to select the last n number of rows in a table using mySQL? The table contains millions of rows, and at any given time I don't know how large the table is (it is con...
[ "mysql", "sql" ]
19
46
28,519
8
0
2008-09-22T23:06:05.433000
2008-09-22T23:11:27.650000
118,151
118,179
Best way to rotate content within a DIV using JavaScript?
For example, see the MySQL website. It's only going to be used to rotate through about 3-5 "ads" to noteworthy areas of the site. I'd like to have some kind of link control to backtrack to the other content (again, like the MySQL site). Google gives me a bunch of very easy to implement stuff for the rotation itself, it...
I found the cycle plug-in for jQuery to be very versatile. It can rotate elements in several ways and can add a next / prev control menu.
Best way to rotate content within a DIV using JavaScript? For example, see the MySQL website. It's only going to be used to rotate through about 3-5 "ads" to noteworthy areas of the site. I'd like to have some kind of link control to backtrack to the other content (again, like the MySQL site). Google gives me a bunch o...
TITLE: Best way to rotate content within a DIV using JavaScript? QUESTION: For example, see the MySQL website. It's only going to be used to rotate through about 3-5 "ads" to noteworthy areas of the site. I'd like to have some kind of link control to backtrack to the other content (again, like the MySQL site). Google ...
[ "javascript", "html" ]
1
6
5,658
1
0
2008-09-22T23:07:08.957000
2008-09-22T23:14:14.370000
118,157
119,427
How can I detect and invoke a user's local installation of the AIR runtime on a particular AIR application?
I am writing a program that has an AIR front-end, but a back-end written in another language (Python, in this case). Since AIR can't invoke other executables, the relationship has to be the other way around, with Python running an AIR subprocess. How can I locate the user's AIR runtime? I'd like to be able to do this o...
First, you can get a (free) licenses to redistribute the AIR runtime installed: See: http://www.mikechambers.com/blog/2008/04/07/redistributing-the-adobe-air-runtime-installer/ and http://www.adobe.com/products/air/runtime_distribution1.html#license As far as launching an AIR application, you can launch it like any oth...
How can I detect and invoke a user's local installation of the AIR runtime on a particular AIR application? I am writing a program that has an AIR front-end, but a back-end written in another language (Python, in this case). Since AIR can't invoke other executables, the relationship has to be the other way around, with...
TITLE: How can I detect and invoke a user's local installation of the AIR runtime on a particular AIR application? QUESTION: I am writing a program that has an AIR front-end, but a back-end written in another language (Python, in this case). Since AIR can't invoke other executables, the relationship has to be the othe...
[ "apache-flex", "installation", "air", "adobe" ]
6
3
771
1
0
2008-09-22T23:08:18.283000
2008-09-23T06:41:34.497000
118,185
118,310
Tips on helping to move to MS SQL from MySQL
I have been interested in database developing for some time now and decided that MS SQL has a lot to offer in terms of T-SQL and generally much more functionality (not saying that Oracle or Postgres don't have that). I would like to know: What are the big paradigm changes I should expect to see? How much effort do "reg...
Can't answer #1 as I've never worked with mysql but I'll take a shot at #2 and #3. This tends to depend on the size of the database and/or the size (or professionalism) of the company. Companies with large databases with many users spend a great deal of time indeed making sure that the database both has integrity and i...
Tips on helping to move to MS SQL from MySQL I have been interested in database developing for some time now and decided that MS SQL has a lot to offer in terms of T-SQL and generally much more functionality (not saying that Oracle or Postgres don't have that). I would like to know: What are the big paradigm changes I ...
TITLE: Tips on helping to move to MS SQL from MySQL QUESTION: I have been interested in database developing for some time now and decided that MS SQL has a lot to offer in terms of T-SQL and generally much more functionality (not saying that Oracle or Postgres don't have that). I would like to know: What are the big p...
[ "mysql", "sql-server", "data-migration" ]
0
1
241
3
0
2008-09-22T23:15:41.853000
2008-09-22T23:56:28.917000
118,190
118,210
How do I ignore ampersands in a SQL script running from SQL Plus?
I have a SQL script that creates a package with a comment containing an ampersand (&). When I run the script from SQL Plus, I am prompted to enter a substitute value for the string starting with &. How do I disable this feature so that SQL Plus ignores the ampersand?
This may work for you: set define off Otherwise the ampersand needs to be at the end of a string, 'StackOverflow &' || ' you' EDIT: I was click-happy when saving... This was referenced from a blog.
How do I ignore ampersands in a SQL script running from SQL Plus? I have a SQL script that creates a package with a comment containing an ampersand (&). When I run the script from SQL Plus, I am prompted to enter a substitute value for the string starting with &. How do I disable this feature so that SQL Plus ignores t...
TITLE: How do I ignore ampersands in a SQL script running from SQL Plus? QUESTION: I have a SQL script that creates a package with a comment containing an ampersand (&). When I run the script from SQL Plus, I am prompted to enter a substitute value for the string starting with &. How do I disable this feature so that ...
[ "sql", "oracle", "sqlplus" ]
123
217
214,076
7
0
2008-09-22T23:19:04.093000
2008-09-22T23:25:36.213000
118,199
118,311
C++ Thread, shared data
I have an application where 2 threads are running... Is there any certanty that when I change a global variable from one thread, the other will notice this change? I don't have any syncronization or Mutual exclusion system in place... but should this code work all the time (imagine a global bool named dataUpdated ): Th...
Yes. No. Maybe. First, as others have mentioned you need to make dataUpdated volatile; otherwise the compiler may be free to lift reading it out of the loop (depending on whether or not it can see that doSomethingElse doesn't touch it). Secondly, depending on your processor and ordering needs, you may need memory barri...
C++ Thread, shared data I have an application where 2 threads are running... Is there any certanty that when I change a global variable from one thread, the other will notice this change? I don't have any syncronization or Mutual exclusion system in place... but should this code work all the time (imagine a global bool...
TITLE: C++ Thread, shared data QUESTION: I have an application where 2 threads are running... Is there any certanty that when I change a global variable from one thread, the other will notice this change? I don't have any syncronization or Mutual exclusion system in place... but should this code work all the time (ima...
[ "c++", "multithreading", "synchronization", "mutex" ]
30
25
34,087
10
0
2008-09-22T23:22:06.783000
2008-09-22T23:56:36.297000
118,203
118,239
How to "Open in New Window" using WebBrowser control?
When you use the WebBrowser control in.NET you can "embed" an instance of IE in your application, essentially making your own IE-based Web Browser. Does anyone know how to make any new windows created (like when the user selects "Open in New Window" from the context menu) open up in another Window of Your Web Browser A...
Maybe the Source Code from this CodeProject article can help: Extended.NET 2.0 WebBrowser Control
How to "Open in New Window" using WebBrowser control? When you use the WebBrowser control in.NET you can "embed" an instance of IE in your application, essentially making your own IE-based Web Browser. Does anyone know how to make any new windows created (like when the user selects "Open in New Window" from the context...
TITLE: How to "Open in New Window" using WebBrowser control? QUESTION: When you use the WebBrowser control in.NET you can "embed" an instance of IE in your application, essentially making your own IE-based Web Browser. Does anyone know how to make any new windows created (like when the user selects "Open in New Window...
[ ".net", "internet-explorer", "browser" ]
6
5
22,223
4
0
2008-09-22T23:23:39.743000
2008-09-22T23:36:45.330000
118,205
118,246
How can I publish a subversion repository to a local IIS?
At work, we have a windows server 2003 with IIS and Subversion installed. We use it to publish and test locally our ASP.NET websites. Every programmer has Tortoise installed on his PC and can update/commit content to the server. Hosting the repositories is working fine. But the files kept in those repositories needs th...
Just keep the web server's file area as a working copy, and perform an svn up in it whenever you want to "publish". Configure it to hide the contents of the.svn folders if they seem untidy to you (I don't specifically know how to do this, but I assume it can be done). They will already have the filesystem hidden bit, w...
How can I publish a subversion repository to a local IIS? At work, we have a windows server 2003 with IIS and Subversion installed. We use it to publish and test locally our ASP.NET websites. Every programmer has Tortoise installed on his PC and can update/commit content to the server. Hosting the repositories is worki...
TITLE: How can I publish a subversion repository to a local IIS? QUESTION: At work, we have a windows server 2003 with IIS and Subversion installed. We use it to publish and test locally our ASP.NET websites. Every programmer has Tortoise installed on his PC and can update/commit content to the server. Hosting the rep...
[ "windows", "svn", "iis", "tortoisesvn", "continuous-integration" ]
8
12
18,701
4
0
2008-09-22T23:24:23.283000
2008-09-22T23:39:46.147000
118,221
118,227
What's the best dispatcher/callback library in Python?
I need to allow other Python applications to register callback functions for events in my application. These need to have priorities associated with them (so a callback with a priority of 10 runs before a callback with a priority of 1) and callback functions need to be able to signal errors to the dispatcher. These are...
Are these other applications running in another address space? If so, you'll need to use an interprocess communication library like D-BUS. If you're just sending signals in the same process, try PyDispatcher
What's the best dispatcher/callback library in Python? I need to allow other Python applications to register callback functions for events in my application. These need to have priorities associated with them (so a callback with a priority of 10 runs before a callback with a priority of 1) and callback functions need t...
TITLE: What's the best dispatcher/callback library in Python? QUESTION: I need to allow other Python applications to register callback functions for events in my application. These need to have priorities associated with them (so a callback with a priority of 10 runs before a callback with a priority of 1) and callbac...
[ "python" ]
2
1
2,092
4
0
2008-09-22T23:28:37.143000
2008-09-22T23:30:39.320000
118,235
118,465
How do I use SCM with a PHP app such as Wordpress?
I run my blog using Wordpress and all too recently became a big believer in SCM. I really want to put my site into subversion (that's what I'm using right now, maybe git will come later) but I can't think of the correct way to do it yet. Basically, my repository is set up currently with an 'implementation' directory an...
It's actually not that hard to do, but I'll break it down into a few suggestions here. What you're describing is more or less a "vendor drop" directory. This is basically where you maintain the code in SVN, but replace the contents with the newer stuff as it comes out. What you should start with is an empty directory. ...
How do I use SCM with a PHP app such as Wordpress? I run my blog using Wordpress and all too recently became a big believer in SCM. I really want to put my site into subversion (that's what I'm using right now, maybe git will come later) but I can't think of the correct way to do it yet. Basically, my repository is set...
TITLE: How do I use SCM with a PHP app such as Wordpress? QUESTION: I run my blog using Wordpress and all too recently became a big believer in SCM. I really want to put my site into subversion (that's what I'm using right now, maybe git will come later) but I can't think of the correct way to do it yet. Basically, my...
[ "wordpress", "version-control" ]
2
4
1,650
4
0
2008-09-22T23:33:40.530000
2008-09-23T00:45:20.733000
118,241
118,251
Calculate text width with JavaScript
I'd like to use JavaScript to calculate the width of a string. Is this possible without having to use a monospace typeface? If it's not built-in, my only idea is to create a table of widths for each character, but this is pretty unreasonable especially supporting Unicode and different type sizes (and all browsers for t...
Create a DIV styled with the following styles. In your JavaScript, set the font size and attributes that you are trying to measure, put your string in the DIV, then read the current width and height of the DIV. It will stretch to fit the contents and the size will be within a few pixels of the string rendered size. var...
Calculate text width with JavaScript I'd like to use JavaScript to calculate the width of a string. Is this possible without having to use a monospace typeface? If it's not built-in, my only idea is to create a table of widths for each character, but this is pretty unreasonable especially supporting Unicode and differe...
TITLE: Calculate text width with JavaScript QUESTION: I'd like to use JavaScript to calculate the width of a string. Is this possible without having to use a monospace typeface? If it's not built-in, my only idea is to create a table of widths for each character, but this is pretty unreasonable especially supporting U...
[ "javascript", "textbox" ]
616
415
616,389
29
0
2008-09-22T23:37:52.050000
2008-09-22T23:40:58.250000
118,243
118,286
Open multiple Eclipse workspaces on the Mac
How can I open multiple Eclipse workspaces at the same time on the Mac? On other platforms, I can just launch extra Eclipse instances, but the Mac will not let me open the same application twice. Is there a better way than keeping two copies of Eclipse?
EDIT: Milhous's answer seems to be the officially supported way to do this as of 10.5. Earlier version of OS X and even 10.5 and up should still work using the following instructions though. Open the command line (Terminal) Navigate to your Eclipse installation folder, for instance: cd /Applications/eclipse/ cd /Develo...
Open multiple Eclipse workspaces on the Mac How can I open multiple Eclipse workspaces at the same time on the Mac? On other platforms, I can just launch extra Eclipse instances, but the Mac will not let me open the same application twice. Is there a better way than keeping two copies of Eclipse?
TITLE: Open multiple Eclipse workspaces on the Mac QUESTION: How can I open multiple Eclipse workspaces at the same time on the Mac? On other platforms, I can just launch extra Eclipse instances, but the Mac will not let me open the same application twice. Is there a better way than keeping two copies of Eclipse? ANS...
[ "eclipse", "macos" ]
206
179
137,676
20
0
2008-09-22T23:39:24.697000
2008-09-22T23:52:35.463000
118,247
119,125
What's the best way to implement ACLs to a Rails application?
I just wanted to compare different solutions used when implementing ACLs in Rails.
I use the authorization plugin (Created by Bill Katz ): Roles can be authorized for the entire application, a model class, or a specific object. The plugin provides a way of checking authorization at the class or instance method level using permit and permit? methods. It also provides english-like dynamic methods like ...
What's the best way to implement ACLs to a Rails application? I just wanted to compare different solutions used when implementing ACLs in Rails.
TITLE: What's the best way to implement ACLs to a Rails application? QUESTION: I just wanted to compare different solutions used when implementing ACLs in Rails. ANSWER: I use the authorization plugin (Created by Bill Katz ): Roles can be authorized for the entire application, a model class, or a specific object. The...
[ "ruby-on-rails", "ruby", "acl" ]
8
4
10,599
3
0
2008-09-22T23:40:09.610000
2008-09-23T04:25:04.403000
118,248
118,336
Good .NET ORM Framework that supports OleDb and Stored Procedures?
A typical stored procedure in our system accepts around 20 or so parameters. There's no chance of refactoring these stored procedures either. I've basically resorted to writing my own code generator that wraps these SP's into (database provider agnostic) "Command" objects, with their public properties corresponding to ...
I have experience with 3 ORM layers: Subsonic CSLA.NET.NET Tiers All three are free, support OleDb connections, and stored procedures. Subsonic - This one was built specifically for web applications. It mimics a lot of what Ruby On Rails does. They just added migrations. Subsonic is the lightest of the three. It's a ta...
Good .NET ORM Framework that supports OleDb and Stored Procedures? A typical stored procedure in our system accepts around 20 or so parameters. There's no chance of refactoring these stored procedures either. I've basically resorted to writing my own code generator that wraps these SP's into (database provider agnostic...
TITLE: Good .NET ORM Framework that supports OleDb and Stored Procedures? QUESTION: A typical stored procedure in our system accepts around 20 or so parameters. There's no chance of refactoring these stored procedures either. I've basically resorted to writing my own code generator that wraps these SP's into (database...
[ ".net", "orm", "oledb" ]
1
5
2,096
3
0
2008-09-22T23:40:15.103000
2008-09-23T00:05:17.553000
118,260
118,275
How to start IDLE (Python editor) without using the shortcut on Windows Vista?
I'm trying to teach Komodo to fire up IDLE when I hit the right keystrokes. I can use the exact path of the shortcut in start menu in the Windows Explorer location bar to launch IDLE so I was hoping Komodo would be able to use it as well. But, giving this path to Komodo causes it to say that 1 is returned. This appears...
There's a file called idle.py in your Python installation directory in Lib\idlelib\idle.py. If you run that file with Python, then IDLE should start. c:\Python25\pythonw.exe c:\Python25\Lib\idlelib\idle.py
How to start IDLE (Python editor) without using the shortcut on Windows Vista? I'm trying to teach Komodo to fire up IDLE when I hit the right keystrokes. I can use the exact path of the shortcut in start menu in the Windows Explorer location bar to launch IDLE so I was hoping Komodo would be able to use it as well. Bu...
TITLE: How to start IDLE (Python editor) without using the shortcut on Windows Vista? QUESTION: I'm trying to teach Komodo to fire up IDLE when I hit the right keystrokes. I can use the exact path of the shortcut in start menu in the Windows Explorer location bar to launch IDLE so I was hoping Komodo would be able to ...
[ "python", "python-idle", "komodo", "pywin" ]
50
69
182,368
13
0
2008-09-22T23:44:21.877000
2008-09-22T23:49:11.273000
118,270
118,298
Best way to manipulate pages while embedding Webkit?
I'm using Webkit-sharp to embed Webkit into an application and I need to hook certain links to perform actions in my app rather than their normal action. I've considered using Javascript to iterate over the anchor tags and replace the ones that match with the proper link, but I'm wondering if this is the best way. Is t...
jQuery has a lot of useful iteration features that may be able to use for that.:-) I haven't used jQuery, but find and attr look promising for your purposes.
Best way to manipulate pages while embedding Webkit? I'm using Webkit-sharp to embed Webkit into an application and I need to hook certain links to perform actions in my app rather than their normal action. I've considered using Javascript to iterate over the anchor tags and replace the ones that match with the proper ...
TITLE: Best way to manipulate pages while embedding Webkit? QUESTION: I'm using Webkit-sharp to embed Webkit into an application and I need to hook certain links to perform actions in my app rather than their normal action. I've considered using Javascript to iterate over the anchor tags and replace the ones that matc...
[ "c#", "javascript", "html", "dom", "webkit" ]
2
2
1,241
1
0
2008-09-22T23:47:16.317000
2008-09-22T23:53:55.567000
118,272
118,669
How do you resolve a circular dependency with an inner class?
(Java question) If I reference a field in an inner class, does this cause a circular dependency between the enclosing class and the inner class? How can I avoid this? Here is an example: public class Outer { private Other o; private Inner i; public Outer() { o = new Other(); i = new Inner() { public void doSomething...
Static vs instance class: If you declare the inner class as static then the instances of the inner class doesn't have any reference to the outer class. If it's not satic then your inner object efectivelly points to the outer object that created it (it has an implicit reference, in fact, if you use reflection over its c...
How do you resolve a circular dependency with an inner class? (Java question) If I reference a field in an inner class, does this cause a circular dependency between the enclosing class and the inner class? How can I avoid this? Here is an example: public class Outer { private Other o; private Inner i; public Outer()...
TITLE: How do you resolve a circular dependency with an inner class? QUESTION: (Java question) If I reference a field in an inner class, does this cause a circular dependency between the enclosing class and the inner class? How can I avoid this? Here is an example: public class Outer { private Other o; private Inner ...
[ "java", "circular-dependency", "anonymous-inner-class" ]
2
10
4,185
3
0
2008-09-22T23:47:54.380000
2008-09-23T01:42:01.753000
118,280
130,100
Trying to resize a jQuery dialog in IE6?
I thought I had seen a bug report about this on the jQuery site, but now I cannot find it. I'm trying to resize a dialog in IE6. But when the element is resized, the content and title bar don't resize down. They will resize up if the dialog is made larger, however. The result is that the close button ends up being cut ...
I was able to come up with a solution. If you add the style overflow: hidden to the dialog container div element (which has the css class.ui-dialog-container applied to it), then everything resizes correctly. All I did was add a css rule as follows to the flora theme:.ui-dialog.ui-dialog-container { overflow: hidden; }...
Trying to resize a jQuery dialog in IE6? I thought I had seen a bug report about this on the jQuery site, but now I cannot find it. I'm trying to resize a dialog in IE6. But when the element is resized, the content and title bar don't resize down. They will resize up if the dialog is made larger, however. The result is...
TITLE: Trying to resize a jQuery dialog in IE6? QUESTION: I thought I had seen a bug report about this on the jQuery site, but now I cannot find it. I'm trying to resize a dialog in IE6. But when the element is resized, the content and title bar don't resize down. They will resize up if the dialog is made larger, howe...
[ "jquery", "css", "jquery-ui", "modal-dialog", "jquery-ui-dialog" ]
3
2
5,062
2
0
2008-09-22T23:50:32.863000
2008-09-24T21:29:39.393000
118,289
118,365
How do I parse a string with GetOpt::Long::GetOptions?
I have a string with possible command line arguments (using an Read-Eval-Print-Loop program) and I want it to be parsed similar to the command line arguments when passed to Getopt::Long. To elaborate: I have a string $str = '--infile /tmp/infile_location --outfile /tmp/outfile' I want it to be parsed by GetOptions so t...
Check out the section parsing options from an arbitrary string in the man page for Getopt::Long, I think it does exactly what you're looking for.
How do I parse a string with GetOpt::Long::GetOptions? I have a string with possible command line arguments (using an Read-Eval-Print-Loop program) and I want it to be parsed similar to the command line arguments when passed to Getopt::Long. To elaborate: I have a string $str = '--infile /tmp/infile_location --outfile ...
TITLE: How do I parse a string with GetOpt::Long::GetOptions? QUESTION: I have a string with possible command line arguments (using an Read-Eval-Print-Loop program) and I want it to be parsed similar to the command line arguments when passed to Getopt::Long. To elaborate: I have a string $str = '--infile /tmp/infile_l...
[ "perl", "getopt-long" ]
7
16
5,649
5
0
2008-09-22T23:52:56.070000
2008-09-23T00:15:42.287000
118,292
118,306
Alternative to String.Replace
So I was writing some code today that basically looks like this: string returnString = s.Replace("!", " ").Replace("@", " ").Replace("#", " ").Replace("$", " ").Replace("%", " ").Replace("^", " ").Replace("*", " ").Replace("_", " ").Replace("+", " ").Replace("=", " ").Replace("\", " ") Which isn't really nice. I was wo...
You can use Regex.Replace(). All of the characters can be placed between square brackets, which matches any character between the square brackets. Some special characters have to be escaped with backslashes, and I use a @verbatim string here, so I don't have to double-escape them for the C# compiler. The first paramete...
Alternative to String.Replace So I was writing some code today that basically looks like this: string returnString = s.Replace("!", " ").Replace("@", " ").Replace("#", " ").Replace("$", " ").Replace("%", " ").Replace("^", " ").Replace("*", " ").Replace("_", " ").Replace("+", " ").Replace("=", " ").Replace("\", " ") Whi...
TITLE: Alternative to String.Replace QUESTION: So I was writing some code today that basically looks like this: string returnString = s.Replace("!", " ").Replace("@", " ").Replace("#", " ").Replace("$", " ").Replace("%", " ").Replace("^", " ").Replace("*", " ").Replace("_", " ").Replace("+", " ").Replace("=", " ").Rep...
[ "c#", "regex", "string", "replace" ]
18
32
6,760
5
0
2008-09-22T23:53:10.967000
2008-09-22T23:55:23.693000
118,320
118,327
ASP.NET TextBox control with label text in the background
I'm creating a login page. I want to create ASP.NET TextBox controls that have "Username" and "Password" as their Text, but as soon as they receive focus, these words should disappear and whatever the user types should appear, just like normal textbox. If the user leaves it blank and tabs to the next textbox, then thes...
Use the TextBox Watermark Extender that's in Microsoft's AJAX Toolkit.
ASP.NET TextBox control with label text in the background I'm creating a login page. I want to create ASP.NET TextBox controls that have "Username" and "Password" as their Text, but as soon as they receive focus, these words should disappear and whatever the user types should appear, just like normal textbox. If the us...
TITLE: ASP.NET TextBox control with label text in the background QUESTION: I'm creating a login page. I want to create ASP.NET TextBox controls that have "Username" and "Password" as their Text, but as soon as they receive focus, these words should disappear and whatever the user types should appear, just like normal ...
[ "asp.net", "textbox" ]
5
11
3,480
2
0
2008-09-23T00:00:04.493000
2008-09-23T00:02:13.287000
118,341
118,347
How to debug a LINQ Statement
I have a Linq to objects statement var confirm = from l in lines.Lines where (l.LineNumber == startline.LineNumber) || (l.LineNumber == endline.LineNumber) select l; The confirm object is returning an 'Object Null or Not A Reference' at at System.Linq.Enumerable.WhereListIterator`1.MoveNext() If the result of the query...
I'm not sure if it's possible to debug from VS, but I find LINQPad to be quite useful. It'll let you dump the results of each part of the LINQ query.
How to debug a LINQ Statement I have a Linq to objects statement var confirm = from l in lines.Lines where (l.LineNumber == startline.LineNumber) || (l.LineNumber == endline.LineNumber) select l; The confirm object is returning an 'Object Null or Not A Reference' at at System.Linq.Enumerable.WhereListIterator`1.MoveNex...
TITLE: How to debug a LINQ Statement QUESTION: I have a Linq to objects statement var confirm = from l in lines.Lines where (l.LineNumber == startline.LineNumber) || (l.LineNumber == endline.LineNumber) select l; The confirm object is returning an 'Object Null or Not A Reference' at at System.Linq.Enumerable.WhereList...
[ "linq", "debugging", "linq-to-objects" ]
42
30
47,078
10
0
2008-09-23T00:06:17.053000
2008-09-23T00:09:12.177000
118,342
381,972
How to search cvs comment history
I am aware of this command: cvs log -N -w -d"1 day ago" Unfortunately this generates a formatted report with lots of newlines in it, such that the file-path, the file-version, and the comment-text are all on separate lines. Therefore it is difficult to scan it for all occurrences of comment text, (eg, grep), and correl...
The -w options seems to work better with the -S option. Otherwise there are additional results which don't seem related to the userid. Perhaps someone can explain it. cvs log -N -S -w -d"1 day ago" With that I have been getting reasonable success piping it to grep: cvs log -N -S -w -d"1 day ago" | grep -B14 "some text"...
How to search cvs comment history I am aware of this command: cvs log -N -w -d"1 day ago" Unfortunately this generates a formatted report with lots of newlines in it, such that the file-path, the file-version, and the comment-text are all on separate lines. Therefore it is difficult to scan it for all occurrences of co...
TITLE: How to search cvs comment history QUESTION: I am aware of this command: cvs log -N -w -d"1 day ago" Unfortunately this generates a formatted report with lots of newlines in it, such that the file-path, the file-version, and the comment-text are all on separate lines. Therefore it is difficult to scan it for all...
[ "cvs" ]
8
9
20,147
7
0
2008-09-23T00:06:42.340000
2008-12-19T19:32:38.393000
118,343
198,549
How do I automatically update a ModifiedAt field with ADO.NET Entity Framework?
Ruby on Rails has magic timestamping fields that are automatically updated when a record is created or updated. I'm trying to find similar functionality in Entity Framework. I've considered database triggers and a SavingChanges event handler. Is there a more obvious method I'm overlooking?
I resorted to a SavingChanges event handler. Details on my blog.
How do I automatically update a ModifiedAt field with ADO.NET Entity Framework? Ruby on Rails has magic timestamping fields that are automatically updated when a record is created or updated. I'm trying to find similar functionality in Entity Framework. I've considered database triggers and a SavingChanges event handle...
TITLE: How do I automatically update a ModifiedAt field with ADO.NET Entity Framework? QUESTION: Ruby on Rails has magic timestamping fields that are automatically updated when a record is created or updated. I'm trying to find similar functionality in Entity Framework. I've considered database triggers and a SavingCh...
[ "ado.net" ]
0
0
291
2
0
2008-09-23T00:07:05.427000
2008-10-13T18:32:32.917000
118,370
118,395
How do you use the ellipsis slicing syntax in Python?
This came up in Hidden features of Python, but I can't see good documentation or examples that explain how the feature works.
Ellipsis, or... is not a hidden feature, it's just a constant. It's quite different to, say, javascript ES6 where it's a part of the language syntax. No builtin class or Python language constuct makes use of it. So the syntax for it depends entirely on you, or someone else, having written code to understand it. Numpy u...
How do you use the ellipsis slicing syntax in Python? This came up in Hidden features of Python, but I can't see good documentation or examples that explain how the feature works.
TITLE: How do you use the ellipsis slicing syntax in Python? QUESTION: This came up in Hidden features of Python, but I can't see good documentation or examples that explain how the feature works. ANSWER: Ellipsis, or... is not a hidden feature, it's just a constant. It's quite different to, say, javascript ES6 where...
[ "python", "numpy", "subclass", "slice", "ellipsis" ]
210
134
66,802
4
0
2008-09-23T00:17:09.663000
2008-09-23T00:24:21.360000
118,371
118,388
How do you ensure multiple threads can safely access a class field?
When a class field is accessed via a getter method by multiple threads, how do you maintain thread safety? Is the synchronized keyword sufficient? Is this safe: public class SomeClass { private int val; public synchronized int getVal() { return val; } private void setVal(int val) { this.val = val; } } or does the set...
If you use 'synchronized' on the setter here too, this code is threadsafe. However it may not be sufficiently granular; if you have 20 getters and setters and they're all synchronized, you may be creating a synchronization bottleneck. In this specific instance, with a single int variable, then eliminating the 'synchron...
How do you ensure multiple threads can safely access a class field? When a class field is accessed via a getter method by multiple threads, how do you maintain thread safety? Is the synchronized keyword sufficient? Is this safe: public class SomeClass { private int val; public synchronized int getVal() { return val; }...
TITLE: How do you ensure multiple threads can safely access a class field? QUESTION: When a class field is accessed via a getter method by multiple threads, how do you maintain thread safety? Is the synchronized keyword sufficient? Is this safe: public class SomeClass { private int val; public synchronized int getVal...
[ "java", "multithreading", "synchronized" ]
10
17
4,767
6
0
2008-09-23T00:17:29.397000
2008-09-23T00:22:28.010000
118,374
119,101
What techniques do you use when writing your own cryptography methods?
For years, maybe 10, I've been fascinated with cryptography. I read a book about XOR bit-based encryption, and have been hooked ever since thing. I guess it's more fair to say that I'm fascinated by those who can break various encryption methods, but I digress. To the point -- what methods do you use when writing crypt...
To contradict what everyone else has said so far, go for it! Yeah, your code might have buffer overflow vulnerabilities in it, and may be slow, buggy, etc, but you're doing this for FUN! I completely understand the recreational enjoyment found in playing with crypto. That being said, cryptography isn't based on obfusca...
What techniques do you use when writing your own cryptography methods? For years, maybe 10, I've been fascinated with cryptography. I read a book about XOR bit-based encryption, and have been hooked ever since thing. I guess it's more fair to say that I'm fascinated by those who can break various encryption methods, bu...
TITLE: What techniques do you use when writing your own cryptography methods? QUESTION: For years, maybe 10, I've been fascinated with cryptography. I read a book about XOR bit-based encryption, and have been hooked ever since thing. I guess it's more fair to say that I'm fascinated by those who can break various encr...
[ "security", "language-agnostic", "encryption", "cryptography" ]
17
24
5,166
19
0
2008-09-23T00:17:58.303000
2008-09-23T04:17:14.843000
118,391
118,411
Why is my Drupal site logging out users when a Javascript function is called?
I have Drupal 5 site where a button is clicked and it calls a JavaScript function. The function basically builds a string, and then redirects to another page on our site. After clicking the button, sometimes the user gets logged out and sees the "Access Denied" screen, even though they were previously logged in. The pa...
Many things come to mind. Is the page being redirected to on the same domain? domain.com and www.domain.com are NOT the same as far as cookies are concerned (depending on how they are set).. Can you reproduce it 100% reliably in any browser? No offense to your users, but users are liars (or at least bad at reporting te...
Why is my Drupal site logging out users when a Javascript function is called? I have Drupal 5 site where a button is clicked and it calls a JavaScript function. The function basically builds a string, and then redirects to another page on our site. After clicking the button, sometimes the user gets logged out and sees ...
TITLE: Why is my Drupal site logging out users when a Javascript function is called? QUESTION: I have Drupal 5 site where a button is clicked and it calls a JavaScript function. The function basically builds a string, and then redirects to another page on our site. After clicking the button, sometimes the user gets lo...
[ "javascript", "drupal" ]
2
3
1,041
2
0
2008-09-23T00:23:30.927000
2008-09-23T00:29:03.830000
118,401
118,479
How to prevent multiple classes for the same business object?
A lot of the time I will have a Business object that has a property for a user index or a set of indexes for some data. When I display this object in a form or some other view I need the users full name or some of the other properties of the data. Usually I create another class myObjectView or something similar. What i...
The façade pattern. I think your approach, creating a façade pattern to abstract the complexities with multiple datasources is often appropriate, and will make your code easy to understand. Care should be taken to create too many layers of abstractions, because the level of indirection will ruin the initial attempt at ...
How to prevent multiple classes for the same business object? A lot of the time I will have a Business object that has a property for a user index or a set of indexes for some data. When I display this object in a form or some other view I need the users full name or some of the other properties of the data. Usually I ...
TITLE: How to prevent multiple classes for the same business object? QUESTION: A lot of the time I will have a Business object that has a property for a user index or a set of indexes for some data. When I display this object in a form or some other view I need the users full name or some of the other properties of th...
[ "oop", "code-duplication" ]
1
2
205
3
0
2008-09-23T00:25:51.200000
2008-09-23T00:48:29.133000
118,404
118,426
How do I get apache to forward web service requests to tomcat?
I know websphere does it, so there must be something that lets apache figure out what needs to go to the app server and what it can handle itself.
You have two options. You can use mod_jk or mod_proxy_ajp to forward your requests. I generally use mod_proxy_ajp because it is shipped with Apache 2.2 and doesn't require me to install anything extra.
How do I get apache to forward web service requests to tomcat? I know websphere does it, so there must be something that lets apache figure out what needs to go to the app server and what it can handle itself.
TITLE: How do I get apache to forward web service requests to tomcat? QUESTION: I know websphere does it, so there must be something that lets apache figure out what needs to go to the app server and what it can handle itself. ANSWER: You have two options. You can use mod_jk or mod_proxy_ajp to forward your requests....
[ "apache", "tomcat" ]
1
2
376
1
0
2008-09-23T00:26:38.673000
2008-09-23T00:32:47.190000
118,423
118,682
Set up Apache for local development/testing?
I've been impressed by the screencasts for Rails that demonstrate the built-in web server, and database to allow development and testing to occur on the local machine. How can I get an instance of Apache to execute a project directory as its DocumentRoot, and maybe serve up the files on port 8080 (or something similar)...
Your Mac comes with both an Apache Web Server and a build of PHP. It's one of the big reasons the platform is well loved by web developers. Since you're using Code Igniter, you'll want PHP 5, which is the default version of PHP shipped with 10.5. If you're on a previous version of the OS hop on over to entropy.ch and i...
Set up Apache for local development/testing? I've been impressed by the screencasts for Rails that demonstrate the built-in web server, and database to allow development and testing to occur on the local machine. How can I get an instance of Apache to execute a project directory as its DocumentRoot, and maybe serve up ...
TITLE: Set up Apache for local development/testing? QUESTION: I've been impressed by the screencasts for Rails that demonstrate the built-in web server, and database to allow development and testing to occur on the local machine. How can I get an instance of Apache to execute a project directory as its DocumentRoot, a...
[ "php", "codeigniter", "apache" ]
14
28
20,080
8
0
2008-09-23T00:31:59.407000
2008-09-23T01:44:29.077000
118,443
118,457
Selecting values grouped to a specific identifer
I have an application that tracks high scores in a game. I have a user_scores table that maps a user_id to a score. I need to return the 5 highest scores, but only 1 high score for any specific user. So if user X has the 5 highest scores on a purely numerical basis, I simply return the highest one and then the next 4 u...
This should work: SELECT user_id, MAX(score) FROM user_scores GROUP BY user_id ORDER BY MAX(score) DESC LIMIT 5
Selecting values grouped to a specific identifer I have an application that tracks high scores in a game. I have a user_scores table that maps a user_id to a score. I need to return the 5 highest scores, but only 1 high score for any specific user. So if user X has the 5 highest scores on a purely numerical basis, I si...
TITLE: Selecting values grouped to a specific identifer QUESTION: I have an application that tracks high scores in a game. I have a user_scores table that maps a user_id to a score. I need to return the 5 highest scores, but only 1 high score for any specific user. So if user X has the 5 highest scores on a purely num...
[ "mysql", "sql", "database" ]
1
6
177
6
0
2008-09-23T00:36:20.833000
2008-09-23T00:40:22.260000
118,458
118,462
How can I join a list into a string (caveat)?
Along the lines of my previous question, how can i join a list of strings into a string such that values get quoted cleanly. Something like: ['a', 'one "two" three', 'foo, bar', """both"'"""] into: a, 'one "two" three', "foo, bar", "both\"'" I suspect that the csv module will come into play here, but i'm not sure how t...
Using the csv module you can do that way: import csv writer = csv.writer(open("some.csv", "wb")) writer.writerow(the_list) If you need a string just use StringIO instance as a file: f = StringIO.StringIO() writer = csv.writer(f) writer.writerow(the_list) print f.getvalue() The output: a,"one ""two"" three","foo, bar","...
How can I join a list into a string (caveat)? Along the lines of my previous question, how can i join a list of strings into a string such that values get quoted cleanly. Something like: ['a', 'one "two" three', 'foo, bar', """both"'"""] into: a, 'one "two" three', "foo, bar", "both\"'" I suspect that the csv module wi...
TITLE: How can I join a list into a string (caveat)? QUESTION: Along the lines of my previous question, how can i join a list of strings into a string such that values get quoted cleanly. Something like: ['a', 'one "two" three', 'foo, bar', """both"'"""] into: a, 'one "two" three', "foo, bar", "both\"'" I suspect that...
[ "python", "string", "list", "csv" ]
6
7
1,178
3
0
2008-09-23T00:41:25.330000
2008-09-23T00:43:42.593000
118,463
118,503
What is the performance difference of pki to symmetric encryption?
We are looking to do some heavy security requirements on our project, and we need to do a lot of encryption that is highly performant. I think that I know that PKI is much slower and more complex than symmetric encryption, but I can't find the numbers to back up my feelings.
Yes, purely asymmetric encryption is much slower than symmetric cyphers (like DES or AES), which is why real applications use hybrid cryptography: the expensive public-key operations are performed only to encrypt (and exchange) an encryption key for the symmetric algorithm that is going to be used for encrypting the re...
What is the performance difference of pki to symmetric encryption? We are looking to do some heavy security requirements on our project, and we need to do a lot of encryption that is highly performant. I think that I know that PKI is much slower and more complex than symmetric encryption, but I can't find the numbers t...
TITLE: What is the performance difference of pki to symmetric encryption? QUESTION: We are looking to do some heavy security requirements on our project, and we need to do a lot of encryption that is highly performant. I think that I know that PKI is much slower and more complex than symmetric encryption, but I can't ...
[ "performance", "encryption", "encryption-symmetric", "encryption-asymmetric" ]
17
32
19,077
7
0
2008-09-23T00:44:31.860000
2008-09-23T00:54:15.097000
118,467
118,507
How do I create a non-standard type with SOAPpy?
I am calling a WSDL web service from Python using SOAPpy. The call I need to make is to the method Auth_login. This has 2 arguments - the first, a string being the API key; the second, a custom type containing username and password. The custom type is called Auth_credentialsData which contains 2 values as stings - one ...
The better method is to use the ZSI soap module which allows you to take a WDSL file and turn it into classes and methods that you can then use to call it. The online documentation is on their website but the latest documentation is more easily found in the source package. If you install in Debian/Ubuntu (package name ...
How do I create a non-standard type with SOAPpy? I am calling a WSDL web service from Python using SOAPpy. The call I need to make is to the method Auth_login. This has 2 arguments - the first, a string being the API key; the second, a custom type containing username and password. The custom type is called Auth_credent...
TITLE: How do I create a non-standard type with SOAPpy? QUESTION: I am calling a WSDL web service from Python using SOAPpy. The call I need to make is to the method Auth_login. This has 2 arguments - the first, a string being the API key; the second, a custom type containing username and password. The custom type is c...
[ "python", "web-services", "soap" ]
3
0
847
1
0
2008-09-23T00:46:14.833000
2008-09-23T00:54:58.183000
118,474
120,227
Action Naming Convention
Has anybody established a good naming convention for action in MVC? I was specifically looking at ASP.net MVC but it is a general question. For instance I have an action which displays the login screen (Login) and one which process the login request from that page (LoginTest). I'm not keen on the names and I have a lot...
Rob Conery at MS suggested some useful RESTful style naming for actions. * Index - the main "landing" page. This is also the default endpoint. * List - a list of whatever "thing" you're showing them - like a list of Products. * Show - a particular item of whatever "thing" you're showing them (like a Product) * Edit - a...
Action Naming Convention Has anybody established a good naming convention for action in MVC? I was specifically looking at ASP.net MVC but it is a general question. For instance I have an action which displays the login screen (Login) and one which process the login request from that page (LoginTest). I'm not keen on t...
TITLE: Action Naming Convention QUESTION: Has anybody established a good naming convention for action in MVC? I was specifically looking at ASP.net MVC but it is a general question. For instance I have an action which displays the login screen (Login) and one which process the login request from that page (LoginTest)....
[ "asp.net-mvc", "model-view-controller" ]
31
50
16,187
6
0
2008-09-23T00:47:25.410000
2008-09-23T10:27:10.100000
118,487
118,621
MySQL Query: Select most-recent items with a twist
Sorry the title isn't more help. I have a database of media-file URLs that came from two sources: (1) RSS feeds and (2) manual entries. I want to find the ten most-recently added URLs, but a maximum of one from any feed. To simplify, table ' urls ' has columns 'url, feed_id, timestamp'. feed_id='' for any URL that was ...
Assuming feed_id = 0 is the manually entered stuff this does the trick: select p.* from programs p left join ( select max(id) id1 from programs where feed_id <> 0 group by feed_id order by max(id) desc limit 10 ) t on id1 = id where id1 is not null or feed_id = 0 order by id desc limit 10; It works cause the id column ...
MySQL Query: Select most-recent items with a twist Sorry the title isn't more help. I have a database of media-file URLs that came from two sources: (1) RSS feeds and (2) manual entries. I want to find the ten most-recently added URLs, but a maximum of one from any feed. To simplify, table ' urls ' has columns 'url, fe...
TITLE: MySQL Query: Select most-recent items with a twist QUESTION: Sorry the title isn't more help. I have a database of media-file URLs that came from two sources: (1) RSS feeds and (2) manual entries. I want to find the ten most-recently added URLs, but a maximum of one from any feed. To simplify, table ' urls ' ha...
[ "sql", "mysql" ]
3
3
8,535
6
0
2008-09-23T00:50:14.607000
2008-09-23T01:24:17.380000
118,497
118,533
LINQ + type tables best practices
Whats the best design pattern to use for LINQ and type tables that exist in SQL. I have tables in SQL that constrain values to type values, and I want to be able to use this in my C# code as strongly typed values. My current approach for a 'PackageStatus' type is as follows: SQL Table PackageStatusType (int) desc (varc...
Linq to SQL allows you to map a string or int column in a database to an enumeration in your C# code. This allows you to let Linq to SQL to map these values for you when you select from the database. In this case, I would change my package status column to be either an int column with the values from the enumeration or...
LINQ + type tables best practices Whats the best design pattern to use for LINQ and type tables that exist in SQL. I have tables in SQL that constrain values to type values, and I want to be able to use this in my C# code as strongly typed values. My current approach for a 'PackageStatus' type is as follows: SQL Table ...
TITLE: LINQ + type tables best practices QUESTION: Whats the best design pattern to use for LINQ and type tables that exist in SQL. I have tables in SQL that constrain values to type values, and I want to be able to use this in my C# code as strongly typed values. My current approach for a 'PackageStatus' type is as f...
[ "linq-to-sql" ]
3
3
1,364
1
0
2008-09-23T00:52:54.413000
2008-09-23T01:02:18.960000
118,501
118,672
What would a Database Diagram (ER Diagram/Table Layout) look like for measuring distribution of something?
If I was, for example, going to count "activities" across many computers and show a rollup of that activity, what would the database look like to store the data? Simply this? Seems too simple. I'm overthinking this. ACTIVITYID COUNT ---------- -----
If the volume is not going to be ridiculously large, I'd probably create a table that logs each event individually, with a DateTime as @Turnkey suggests, and possibly the machine that logged it, etc. LOGID (PK) ACTIVITYID SOURCE DATELOGGED ---------- ---------- ------ ---------- That would give you the ability to run a...
What would a Database Diagram (ER Diagram/Table Layout) look like for measuring distribution of something? If I was, for example, going to count "activities" across many computers and show a rollup of that activity, what would the database look like to store the data? Simply this? Seems too simple. I'm overthinking thi...
TITLE: What would a Database Diagram (ER Diagram/Table Layout) look like for measuring distribution of something? QUESTION: If I was, for example, going to count "activities" across many computers and show a rollup of that activity, what would the database look like to store the data? Simply this? Seems too simple. I'...
[ "sql-server", "database", "statistics" ]
8
6
1,932
4
0
2008-09-23T00:53:57.500000
2008-09-23T01:43:03.840000
118,506
120,252
Stored Procedures, MySQL and PHP
The question is a fairly open one. I've been using Stored Procs with MS SQLServer for some time with classic ASP and ASP.net and love them, lots. I have a small hobby project I'm working on and for various reasons have gone the LAMP route. Any hints/tricks/traps or good starting points to get into using stored procedur...
Forget about mysqli, it's much harder to use than PDO and should have been already removed. It is true that it introduced huge improvements over mysql, but to achieve the same effect in mysqli sometimes requires enormous effort over PDO i.e. associative fetchAll. Instead, take a look at PDO, specifically prepared state...
Stored Procedures, MySQL and PHP The question is a fairly open one. I've been using Stored Procs with MS SQLServer for some time with classic ASP and ASP.net and love them, lots. I have a small hobby project I'm working on and for various reasons have gone the LAMP route. Any hints/tricks/traps or good starting points ...
TITLE: Stored Procedures, MySQL and PHP QUESTION: The question is a fairly open one. I've been using Stored Procs with MS SQLServer for some time with classic ASP and ASP.net and love them, lots. I have a small hobby project I'm working on and for various reasons have gone the LAMP route. Any hints/tricks/traps or goo...
[ "php", "mysql", "stored-procedures" ]
3
3
13,568
5
0
2008-09-23T00:54:37.653000
2008-09-23T10:36:02.700000
118,512
118,543
Project retirement or archiving
What is the best way to retire a currently active project? I've been working on this one for a while now and I think its time to let go. Without going into too much detail, there are other projects and technologies that are way ahead now and I don't see much value in investing in it any further. What have you done to r...
As operating systems, compilers, etc. change, it can be difficult to rebuild old projects. Consider creating a virtual machine that is configured to build it again, in case you need to update it for some reason in the future. Archive that VM along with the source code, etc.
Project retirement or archiving What is the best way to retire a currently active project? I've been working on this one for a while now and I think its time to let go. Without going into too much detail, there are other projects and technologies that are way ahead now and I don't see much value in investing in it any ...
TITLE: Project retirement or archiving QUESTION: What is the best way to retire a currently active project? I've been working on this one for a while now and I think its time to let go. Without going into too much detail, there are other projects and technologies that are way ahead now and I don't see much value in in...
[ "project-management" ]
2
3
134
3
0
2008-09-23T00:57:18.847000
2008-09-23T01:04:54.463000
118,526
118,539
How do you deal with concurrency in NHibernate?
How do you support optimistic / pessimistic concurrency using NHibernate?
NHibernate, by default, supports optimistic concurrency. Pessimistic concurrency, on the other hand, can be accomplished through the ISession.Lock() method. These issues are discussed in detail in this document.
How do you deal with concurrency in NHibernate? How do you support optimistic / pessimistic concurrency using NHibernate?
TITLE: How do you deal with concurrency in NHibernate? QUESTION: How do you support optimistic / pessimistic concurrency using NHibernate? ANSWER: NHibernate, by default, supports optimistic concurrency. Pessimistic concurrency, on the other hand, can be accomplished through the ISession.Lock() method. These issues a...
[ "nhibernate" ]
19
18
15,557
3
0
2008-09-23T01:00:07.220000
2008-09-23T01:03:59.690000
118,528
157,386
Horrible redraw performance of the DataGridView on one of my two screens
I've actually solved this, but I'm posting it for posterity. I ran into a very odd issue with the DataGridView on my dual-monitor system. The issue manifests itself as an EXTREMELY slow repaint of the control ( like 30 seconds for a full repaint ), but only when it is on one of my screens. When on the other, the repain...
You just need to make a custom class based off of DataGridView so you can enable its DoubleBuffering. That's it! class CustomDataGridView: DataGridView { public CustomDataGridView() { DoubleBuffered = true; } } As long as all of my instances of the grid are using this custom version, all is well. If I ever run into a s...
Horrible redraw performance of the DataGridView on one of my two screens I've actually solved this, but I'm posting it for posterity. I ran into a very odd issue with the DataGridView on my dual-monitor system. The issue manifests itself as an EXTREMELY slow repaint of the control ( like 30 seconds for a full repaint )...
TITLE: Horrible redraw performance of the DataGridView on one of my two screens QUESTION: I've actually solved this, but I'm posting it for posterity. I ran into a very odd issue with the DataGridView on my dual-monitor system. The issue manifests itself as an EXTREMELY slow repaint of the control ( like 30 seconds fo...
[ ".net", "winforms", "performance", "datagridview", "nvidia" ]
85
68
52,137
9
0
2008-09-23T01:01:09.463000
2008-10-01T12:41:14.397000
118,531
118,538
What is the best way to test webforms apps ( ASP.NET )
What is the best way to test my webforms applications? Looks like people are loving Watin, and selenium.
UPDATE: Given WatiN has been stagnant for over a year now, I would direct anyone that needs web ui tests towards selenium, it is in continuous use & development by many contributors, and is actively used by Google. WatiN is the best that I've found. It integrates into Visual Studio unit testing or nunit & you can do pr...
What is the best way to test webforms apps ( ASP.NET ) What is the best way to test my webforms applications? Looks like people are loving Watin, and selenium.
TITLE: What is the best way to test webforms apps ( ASP.NET ) QUESTION: What is the best way to test my webforms applications? Looks like people are loving Watin, and selenium. ANSWER: UPDATE: Given WatiN has been stagnant for over a year now, I would direct anyone that needs web ui tests towards selenium, it is in c...
[ "asp.net", "webforms", "automated-tests" ]
37
19
22,241
8
0
2008-09-23T01:01:46.530000
2008-09-23T01:03:54.213000
118,532
119,952
What is the best way to send a HTML email from Asp.net MVC?
I would like to be able to render a view and send it as an email, similar to what can be done with Ruby on Rails. What is the best way to do this? EDIT: My solution so far is to use a templating engine (NHaml, StringTemplate.net). It works but I would prefer not to have a second template engine in my site.
Once the post mvc-preview-5-rendering-a-view-to-string-for-testing has an answer with a solution in it, that solution applies to this one as well. Once you have a string, you coud mail it using default.net mail options (as indicated by dimarzionist: SendMail / SmtpClient).
What is the best way to send a HTML email from Asp.net MVC? I would like to be able to render a view and send it as an email, similar to what can be done with Ruby on Rails. What is the best way to do this? EDIT: My solution so far is to use a templating engine (NHaml, StringTemplate.net). It works but I would prefer n...
TITLE: What is the best way to send a HTML email from Asp.net MVC? QUESTION: I would like to be able to render a view and send it as an email, similar to what can be done with Ruby on Rails. What is the best way to do this? EDIT: My solution so far is to use a templating engine (NHaml, StringTemplate.net). It works bu...
[ "asp.net-mvc", "email" ]
8
1
1,430
5
0
2008-09-23T01:02:00.693000
2008-09-23T08:58:57.707000
118,540
119,022
What is wrong with my snap to grid code?
First of all, I'm fairly sure snapping to grid is fairly easy, however I've run into some odd trouble in this situation and my maths are too weak to work out specifically what is wrong. Here's the situation I have an abstract concept of a grid, with Y steps exactly Y_STEP apart (the x steps are working fine so ignore t...
Ok, I'm answering my own question here, as alexk mentioned, using int to truncate was my mistake. The behaviour I'm after is best modeled by math.floor(). Apologies, the original question does not contain enough information to really work out what the problem is. I didn't have the extra bit of information at that point...
What is wrong with my snap to grid code? First of all, I'm fairly sure snapping to grid is fairly easy, however I've run into some odd trouble in this situation and my maths are too weak to work out specifically what is wrong. Here's the situation I have an abstract concept of a grid, with Y steps exactly Y_STEP apart ...
TITLE: What is wrong with my snap to grid code? QUESTION: First of all, I'm fairly sure snapping to grid is fairly easy, however I've run into some odd trouble in this situation and my maths are too weak to work out specifically what is wrong. Here's the situation I have an abstract concept of a grid, with Y steps exa...
[ "python", "graphics", "grid" ]
0
1
3,208
3
0
2008-09-23T01:04:10.003000
2008-09-23T03:56:48.403000