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
144,453
144,461
How to get create/last modified dates of a file in Delphi?
I want to get a files these attributes as integer values.
Delphians tend to like the FindFirst approach (the SearchRec structure has some of those), but I'd suggest the Win32 API function GetFileAttributesEx.
How to get create/last modified dates of a file in Delphi? I want to get a files these attributes as integer values.
TITLE: How to get create/last modified dates of a file in Delphi? QUESTION: I want to get a files these attributes as integer values. ANSWER: Delphians tend to like the FindFirst approach (the SearchRec structure has some of those), but I'd suggest the Win32 API function GetFileAttributesEx.
[ "windows", "delphi", "file" ]
12
13
31,506
7
0
2008-09-27T20:57:18.670000
2008-09-27T20:59:59.973000
144,466
144,498
How do I convert an M4A file to an MP3 or WMA file programmatically?
Greetings, I'm trying to find either a free.NET library or a command-line executable that lets me convert M4A files to either MP3s or WMA files. Please help:).
Found it! http://pieter.wigleven.com/it/archives/3 There may be other solutions, but this is gold for what I was looking for. P.S. I've written a.NET DLL which handles this behind-the-scenes. It's pretty terrible code, but it gets the job done.
How do I convert an M4A file to an MP3 or WMA file programmatically? Greetings, I'm trying to find either a free.NET library or a command-line executable that lets me convert M4A files to either MP3s or WMA files. Please help:).
TITLE: How do I convert an M4A file to an MP3 or WMA file programmatically? QUESTION: Greetings, I'm trying to find either a free.NET library or a command-line executable that lets me convert M4A files to either MP3s or WMA files. Please help:). ANSWER: Found it! http://pieter.wigleven.com/it/archives/3 There may be ...
[ "c#", ".net", "mp3" ]
6
4
12,851
5
0
2008-09-27T21:00:44.373000
2008-09-27T21:14:44.697000
144,474
144,499
Java: Arrays & Vectors
I'm used to working with PHP but lately I've been working with Java and I'm having a headache trying to figure this out. I want to save this representation in Java: Array ( ["col_name_1"] => Array ( 1 => ["col_value_1"], 2 => ["col_value_2"],..., n => ["col_value_n"] ), ["col_name_n"] => Array ( 1 => ["col_value_1"], 2...
You can use a Map and a List (these both are interfaces implemented in more than one way for you to choose the most adequate in your case). For more information check the tutorials for Map and List and maybe you should start with the Collections tutorial. An example: import java.util.*; public class Foo { public stati...
Java: Arrays & Vectors I'm used to working with PHP but lately I've been working with Java and I'm having a headache trying to figure this out. I want to save this representation in Java: Array ( ["col_name_1"] => Array ( 1 => ["col_value_1"], 2 => ["col_value_2"],..., n => ["col_value_n"] ), ["col_name_n"] => Array ( ...
TITLE: Java: Arrays & Vectors QUESTION: I'm used to working with PHP but lately I've been working with Java and I'm having a headache trying to figure this out. I want to save this representation in Java: Array ( ["col_name_1"] => Array ( 1 => ["col_value_1"], 2 => ["col_value_2"],..., n => ["col_value_n"] ), ["col_na...
[ "java", "arrays", "data-structures", "hashmap" ]
7
12
1,151
4
0
2008-09-27T21:03:06.363000
2008-09-27T21:15:19.487000
144,477
144,493
How do I inject a form value with jQuery?
I am working with jQuery Form and ASP.NET MVC. Preview 5 of ASP.NET MVC has an Extension Method on HttpRequest called IsAjaxMvcRequest that detects if the POST was an Ajax request. This Extension Method basically "sniffs" for a form value called __MVCASYNCPOST and (basically) returns true if it sees this element. What ...
ajaxSubmit() accepts a data parameter with additional key-value pairs to send. Additionally, there is a better way to test server-side if the request is an AJAX request. jQuery sets the HTTP header X-Requested-With to XMLHttpRequest. You can change your extension method to test for that instead of a custom field.
How do I inject a form value with jQuery? I am working with jQuery Form and ASP.NET MVC. Preview 5 of ASP.NET MVC has an Extension Method on HttpRequest called IsAjaxMvcRequest that detects if the POST was an Ajax request. This Extension Method basically "sniffs" for a form value called __MVCASYNCPOST and (basically) r...
TITLE: How do I inject a form value with jQuery? QUESTION: I am working with jQuery Form and ASP.NET MVC. Preview 5 of ASP.NET MVC has an Extension Method on HttpRequest called IsAjaxMvcRequest that detects if the POST was an Ajax request. This Extension Method basically "sniffs" for a form value called __MVCASYNCPOST...
[ "jquery", "asp.net-mvc" ]
4
8
991
1
0
2008-09-27T21:04:42.943000
2008-09-27T21:11:51.630000
144,487
156,501
Can you recommend a PostgreSQL Visual Database Designer for Linux?
When I'm in Windows, I use the excellent MicroOLAP Database Designer for PostgreSQL, but its not open source or multiplataform. Do you know or can recommend me an alternative to this software, that I can use in Linux? EDIT: Just to clarify, I don't want to use wine to emulate MicroOlap for PostgreSQL, it doesn't work t...
pgDesigner is a database design application for PostgreSQL, for versions 7.x and 8.x. pgDesigner provides the following features: Complete datamodel editor Support for PostgreSQL objects: tables, views, relations, tablespaces, procedures, triggers, types, domains and sequences Automatic updating of relations between ta...
Can you recommend a PostgreSQL Visual Database Designer for Linux? When I'm in Windows, I use the excellent MicroOLAP Database Designer for PostgreSQL, but its not open source or multiplataform. Do you know or can recommend me an alternative to this software, that I can use in Linux? EDIT: Just to clarify, I don't want...
TITLE: Can you recommend a PostgreSQL Visual Database Designer for Linux? QUESTION: When I'm in Windows, I use the excellent MicroOLAP Database Designer for PostgreSQL, but its not open source or multiplataform. Do you know or can recommend me an alternative to this software, that I can use in Linux? EDIT: Just to cla...
[ "linux", "database-design", "postgresql", "olap" ]
7
8
14,192
5
0
2008-09-27T21:08:34.947000
2008-10-01T06:55:50.483000
144,503
236,673
How should the Data Access Layer be structured?
I initially designed my system following the s# architecture example outlined in this codeproject article (Unfortunately, I am not using NHibernate). The basic idea is that for each domain object that would need to communicate with the persistence layer you would have a corresponding Data Access Object in a different l...
I recommend against the simple approach other than in simple systems, usually I think your better creating a custom repository for each aggregate and encapsulating as much suitable logic as you can within it. So my approach would to have a repository for each aggregate that needs it, such as CustomerRepository. This wo...
How should the Data Access Layer be structured? I initially designed my system following the s# architecture example outlined in this codeproject article (Unfortunately, I am not using NHibernate). The basic idea is that for each domain object that would need to communicate with the persistence layer you would have a c...
TITLE: How should the Data Access Layer be structured? QUESTION: I initially designed my system following the s# architecture example outlined in this codeproject article (Unfortunately, I am not using NHibernate). The basic idea is that for each domain object that would need to communicate with the persistence layer ...
[ "architecture", "data-access-layer" ]
10
3
4,543
5
0
2008-09-27T21:16:55.160000
2008-10-25T16:46:10.827000
144,516
144,518
IDictionary<string, string> or NameValueCollection
I'm currently writing an interface to allow applications to send exception data to a central repository for support purposes. I'm at a quandary about how to pass extra contextual data: public interface IExceptionNotifier { void Notify(Exception ex, NameValueCollection context); //this void Notify(Exception ex, IDiction...
If the context is a throw-away value and (here comes the important part) will not be serialized, e.g. for sending the data to another system, I'd go with the IDictionary because it makes using your interface more flexible. If, on the other hand, the context is kept all the time or the context will be serialized, use Na...
IDictionary<string, string> or NameValueCollection I'm currently writing an interface to allow applications to send exception data to a central repository for support purposes. I'm at a quandary about how to pass extra contextual data: public interface IExceptionNotifier { void Notify(Exception ex, NameValueCollection ...
TITLE: IDictionary<string, string> or NameValueCollection QUESTION: I'm currently writing an interface to allow applications to send exception data to a central repository for support purposes. I'm at a quandary about how to pass extra contextual data: public interface IExceptionNotifier { void Notify(Exception ex, Na...
[ "c#" ]
6
1
2,103
2
0
2008-09-27T21:26:43.873000
2008-09-27T21:30:46.577000
144,530
144,535
== or .Equals()
Why use one over the other?
== is the identity test. It will return true if the two objects being tested are in fact the same object. Equals() performs an equality test, and will return true if the two objects consider themselves equal. Identity testing is faster, so you can use it when there's no need for more expensive equality tests. For examp...
== or .Equals() Why use one over the other?
TITLE: == or .Equals() QUESTION: Why use one over the other? ANSWER: == is the identity test. It will return true if the two objects being tested are in fact the same object. Equals() performs an equality test, and will return true if the two objects consider themselves equal. Identity testing is faster, so you can u...
[ "c#" ]
79
66
28,240
12
0
2008-09-27T21:36:37.360000
2008-09-27T21:39:40.067000
144,533
144,549
StringCollection or an Object container?
I recently built an API and was often asked to replace the StringCollections I was returning by objects containing a single property, The reason being that it was easier to bind with a listview or other controls in ASP.Net. Since the API was used by the web application, the Web service and the dataloader I decided on k...
I don't think you should make your API more complicated than needed just to satisfy the limitations a data binding module. But you could perhaps provide a wrapper class for a StringCollection that adapted it to the demands of the data binding module? Edit: This wrapper should be considered part of the data-binding laye...
StringCollection or an Object container? I recently built an API and was often asked to replace the StringCollections I was returning by objects containing a single property, The reason being that it was easier to bind with a listview or other controls in ASP.Net. Since the API was used by the web application, the Web ...
TITLE: StringCollection or an Object container? QUESTION: I recently built an API and was often asked to replace the StringCollections I was returning by objects containing a single property, The reason being that it was easier to bind with a listview or other controls in ASP.Net. Since the API was used by the web app...
[ ".net" ]
2
3
165
1
0
2008-09-27T21:38:34.810000
2008-09-27T21:47:31.263000
144,537
144,582
What are some good WPF grid controls?
We use a grid control from Infragistics at work. Are there others? Pay or free?
I'd second Telerik, which is what MS used for office, IIRC. I don't know if they have gone WPF though, but they have a good track record. I am also a fan of DevExpress, and their support is great, but the wpf grid is still in beta. The regular one is great, though. Both of them are pay, though, but worth it. I have nev...
What are some good WPF grid controls? We use a grid control from Infragistics at work. Are there others? Pay or free?
TITLE: What are some good WPF grid controls? QUESTION: We use a grid control from Infragistics at work. Are there others? Pay or free? ANSWER: I'd second Telerik, which is what MS used for office, IIRC. I don't know if they have gone WPF though, but they have a good track record. I am also a fan of DevExpress, and th...
[ "wpf" ]
5
7
9,000
8
0
2008-09-27T21:40:35.493000
2008-09-27T22:03:16.657000
144,542
145,797
What are your strategies to keep the memory usage low?
Ruby is truly memory-hungry - but also worth every single bit. What do you do to keep the memory usage low? Do you avoid big strings and use smaller arrays/hashes instead or is it no problem to concern about for you and let the garbage collector do the job? Edit: I found a nice article about this topic here - old but s...
Choose date structures that are efficient representations, scale well, and do what you need. Use algorithms that work using efficient data structures rather than bloated, but easier ones. Look else where. Ruby has a C bridge and its much easier to be memory conscious in C than in Ruby.
What are your strategies to keep the memory usage low? Ruby is truly memory-hungry - but also worth every single bit. What do you do to keep the memory usage low? Do you avoid big strings and use smaller arrays/hashes instead or is it no problem to concern about for you and let the garbage collector do the job? Edit: I...
TITLE: What are your strategies to keep the memory usage low? QUESTION: Ruby is truly memory-hungry - but also worth every single bit. What do you do to keep the memory usage low? Do you avoid big strings and use smaller arrays/hashes instead or is it no problem to concern about for you and let the garbage collector d...
[ "ruby", "memory-management", "garbage-collection" ]
30
6
5,466
17
0
2008-09-27T21:41:33.183000
2008-09-28T13:00:10.337000
144,550
144,602
SQL Server: Dynamic where-clause
Problem: Ajax suggest-search on [ n ] ingredients in recipes. That is: match recipes against multiple ingredients. For instance: SELECT Recipes using "flower", "salt" would produce: "Pizza", "Bread", "Saltwater" and so forth. Tables: Ingredients [ IngredientsID INT [PK], IngredientsName VARCHAR ] Recipes [ RecipesID I...
You have two options. If you're using SQL Server 2008 (or Oracle) you can pass in a table value parameter. If you're using SQL Server 2005, you can use XML to simulate this capability If you're using something earlier than 2005, you need to concatenate the ids in a single string and create a UDF to parse them.
SQL Server: Dynamic where-clause Problem: Ajax suggest-search on [ n ] ingredients in recipes. That is: match recipes against multiple ingredients. For instance: SELECT Recipes using "flower", "salt" would produce: "Pizza", "Bread", "Saltwater" and so forth. Tables: Ingredients [ IngredientsID INT [PK], IngredientsName...
TITLE: SQL Server: Dynamic where-clause QUESTION: Problem: Ajax suggest-search on [ n ] ingredients in recipes. That is: match recipes against multiple ingredients. For instance: SELECT Recipes using "flower", "salt" would produce: "Pizza", "Bread", "Saltwater" and so forth. Tables: Ingredients [ IngredientsID INT [PK...
[ "c#", "sql-server", "performance" ]
5
7
5,369
3
0
2008-09-27T21:47:31.280000
2008-09-27T22:14:03.697000
144,555
144,578
What are the techniques for word recognition in a sound stream?
I'm quite curious about this. In a broad way, how does one go about doing the following: Detection of word separations. Detection of syllables. Compensate for normal speech word connections.
This is subject of extensive research until these days. One usually starts building a model based on linguistic analysis of the language you'll do recognition in and detect all the cases for word separations and syllables. Then recognition is mainly done using Hidden Markov Models over the signal. Here are some referen...
What are the techniques for word recognition in a sound stream? I'm quite curious about this. In a broad way, how does one go about doing the following: Detection of word separations. Detection of syllables. Compensate for normal speech word connections.
TITLE: What are the techniques for word recognition in a sound stream? QUESTION: I'm quite curious about this. In a broad way, how does one go about doing the following: Detection of word separations. Detection of syllables. Compensate for normal speech word connections. ANSWER: This is subject of extensive research ...
[ "computer-science", "theory", "speech-recognition" ]
3
3
285
1
0
2008-09-27T21:53:05.557000
2008-09-27T22:02:25.767000
144,570
144,575
Specifying the type of ArrayList's elements
I thought that there was some way in.net 3.0 to give an array list a type so that it didnt just return Object's but I'm having trouble doing so. Is it possible? If so, how?
List was introduced with generics in.NET 2.0: using System.Collections.Generic; var list = new List (); list.Add(1); list.Add("string"); //compile-time error! int i = list[0];
Specifying the type of ArrayList's elements I thought that there was some way in.net 3.0 to give an array list a type so that it didnt just return Object's but I'm having trouble doing so. Is it possible? If so, how?
TITLE: Specifying the type of ArrayList's elements QUESTION: I thought that there was some way in.net 3.0 to give an array list a type so that it didnt just return Object's but I'm having trouble doing so. Is it possible? If so, how? ANSWER: List was introduced with generics in.NET 2.0: using System.Collections.Gener...
[ "c#", ".net", "generics" ]
4
14
5,275
3
0
2008-09-27T21:59:14.170000
2008-09-27T22:00:51.093000
144,583
144,655
Windows C++ dialog resizer class
I'm looking for a really good dialog resizer class that will stretch and shrink individual items as needed as the screen is resized. Stephan Keil has a good one (DlgResizeHelper) which basically resizes everything by a set ratio, but I'm looking for something smarter. For example: Icons should not resize Single-line te...
You can use wxWidgets. It completely replaces MFC, is multi-platform, and gives you a layout-based dialog mechanism.
Windows C++ dialog resizer class I'm looking for a really good dialog resizer class that will stretch and shrink individual items as needed as the screen is resized. Stephan Keil has a good one (DlgResizeHelper) which basically resizes everything by a set ratio, but I'm looking for something smarter. For example: Icons...
TITLE: Windows C++ dialog resizer class QUESTION: I'm looking for a really good dialog resizer class that will stretch and shrink individual items as needed as the screen is resized. Stephan Keil has a good one (DlgResizeHelper) which basically resizes everything by a set ratio, but I'm looking for something smarter. ...
[ "c++", "windows", "mfc", "dialog", "resize" ]
7
2
4,675
7
0
2008-09-27T22:03:22.723000
2008-09-27T22:45:57.927000
144,600
145,059
Robust and easy to implement serial bus (automotive application)
What serial communication bus would you use in a automotive embedded system if your main selection criteria were: Electrically robust Slow speed (32 kb/s) Easy to program Easy to interface with microcontrollers It won't be transferring much data, but it will need to be transferred periodically at high speed (100 - 500 ...
You've already chosen the AT90CAN128, whose standout feature compared to other AVR processors is support for the CAN bus. There really is not a better choice than CAN for an automotive application with your data rate and noise immunity requirements. If you march in to an automotive customer with anything other than CAN...
Robust and easy to implement serial bus (automotive application) What serial communication bus would you use in a automotive embedded system if your main selection criteria were: Electrically robust Slow speed (32 kb/s) Easy to program Easy to interface with microcontrollers It won't be transferring much data, but it w...
TITLE: Robust and easy to implement serial bus (automotive application) QUESTION: What serial communication bus would you use in a automotive embedded system if your main selection criteria were: Electrically robust Slow speed (32 kb/s) Easy to program Easy to interface with microcontrollers It won't be transferring m...
[ "serial-port", "microcontroller", "can-bus" ]
3
9
1,697
5
0
2008-09-27T22:10:30.570000
2008-09-28T02:43:54.127000
144,619
145,094
What are good application servers for LAMP stacks?
I need recommendations for good application servers for monitoring and debugging PHP and Mysql running on linux. It should have a GUI, query profiling (log slow queries etc.) and capture PHP errors with environment coniditions. I am aware only of the Zend Platform that provides those features and I'm looking for altern...
I don't have a good answer for you, but as far as I know Zend Platform really is the only PHP app server that does everything you list, with an integrated reporting GUI. My background is doing pretty serious enterprise PHP stuff (clustered app and DB stacks) for nearly a decade, following the space closely, and running...
What are good application servers for LAMP stacks? I need recommendations for good application servers for monitoring and debugging PHP and Mysql running on linux. It should have a GUI, query profiling (log slow queries etc.) and capture PHP errors with environment coniditions. I am aware only of the Zend Platform that...
TITLE: What are good application servers for LAMP stacks? QUESTION: I need recommendations for good application servers for monitoring and debugging PHP and Mysql running on linux. It should have a GUI, query profiling (log slow queries etc.) and capture PHP errors with environment coniditions. I am aware only of the ...
[ "monitoring", "lamp" ]
4
4
950
1
0
2008-09-27T22:23:45.250000
2008-09-28T03:07:17.533000
144,630
145,544
How do I allow a user to use their own domain name for a hosted service?
I am working on an ASP.NET MVC web app that allows people to publish content, but other than publish the content to a remote server, I want to allow people to use their domain name directly. For example, the user "Tom" can have his domain name TomSite.com point to http://www.mywebapp.com/user/tom, but the sub path will...
This require multiple steps. First you have to find out how your users will configure their domain to have a CNAME record for you site. You can archieve this in a number of ways where the best is education. Making partnerships with hosting providers requires a great deal of volume. In IIS this will require you to eithe...
How do I allow a user to use their own domain name for a hosted service? I am working on an ASP.NET MVC web app that allows people to publish content, but other than publish the content to a remote server, I want to allow people to use their domain name directly. For example, the user "Tom" can have his domain name Tom...
TITLE: How do I allow a user to use their own domain name for a hosted service? QUESTION: I am working on an ASP.NET MVC web app that allows people to publish content, but other than publish the content to a remote server, I want to allow people to use their domain name directly. For example, the user "Tom" can have h...
[ "asp.net", "asp.net-mvc", "domain-name" ]
4
2
1,107
4
0
2008-09-27T22:30:31.270000
2008-09-28T09:18:47.810000
144,639
145,207
How to order citations by appearance using BibTeX?
By default (using the plain style) BibTeX orders citations alphabetically. How to order the citations by order of appearance in the document?
There are three good answers to this question. Use the unsrt bibliography style, if you're happy with its formatting otherwise Use the makebst (link) tool to design your own bibliography style And my personal recommendation: Use the biblatex package (link). It's the most complete and flexible bibliography tool in the L...
How to order citations by appearance using BibTeX? By default (using the plain style) BibTeX orders citations alphabetically. How to order the citations by order of appearance in the document?
TITLE: How to order citations by appearance using BibTeX? QUESTION: By default (using the plain style) BibTeX orders citations alphabetically. How to order the citations by order of appearance in the document? ANSWER: There are three good answers to this question. Use the unsrt bibliography style, if you're happy wit...
[ "latex", "bibtex" ]
393
306
546,888
13
0
2008-09-27T22:34:06.923000
2008-09-28T04:21:43.237000
144,642
144,652
Tree (directed acyclic graph) implementation
I require a tree / directed acyclic graph implementation something like this: public class TreeNode { private K key; // 'key' for this node, always present private V value; // 'value' for this node, doesn't have to be set private TreeNode parent; private Set > children; } There is no sorting of any kind. The TreeNode ...
There doesn't seem to be anything of the kind. I asked a similar question last week and ended up implementing my own tree. My implementation was very similar to what you're proposing: public class TreeNode { private LinkedList > children = new LinkedList >(); public T value { get; set; } public TreeNode(T value) { thi...
Tree (directed acyclic graph) implementation I require a tree / directed acyclic graph implementation something like this: public class TreeNode { private K key; // 'key' for this node, always present private V value; // 'value' for this node, doesn't have to be set private TreeNode parent; private Set > children; } T...
TITLE: Tree (directed acyclic graph) implementation QUESTION: I require a tree / directed acyclic graph implementation something like this: public class TreeNode { private K key; // 'key' for this node, always present private V value; // 'value' for this node, doesn't have to be set private TreeNode parent; private S...
[ "java", "data-structures", "tree", "graph-theory" ]
12
11
16,481
4
0
2008-09-27T22:37:14.110000
2008-09-27T22:42:17.577000
144,659
882,989
jQuery jWYSIWYG inside jquery.ui.tab
So I managed to get a page with Ajax ui.tab and in one of the tab I put jWYSIWYG textarea plugin. Unfortunately, I can only see normal textarea. However, accessing the page directly (ie. not using the ajax tab) works. What happened? p/s: I'm new to jQuery / JavaScript / AJAX / CSS (if that even matter)
I expect the problem is that the new html is being inserted into the DOM when the ajax call completes, but isn't being hooked up to anything with jQuery. Normally you attach all your jquery goodness in a document ready or onload event, when the page initially loads. However, your textarea is not on the page when the pa...
jQuery jWYSIWYG inside jquery.ui.tab So I managed to get a page with Ajax ui.tab and in one of the tab I put jWYSIWYG textarea plugin. Unfortunately, I can only see normal textarea. However, accessing the page directly (ie. not using the ajax tab) works. What happened? p/s: I'm new to jQuery / JavaScript / AJAX / CSS (...
TITLE: jQuery jWYSIWYG inside jquery.ui.tab QUESTION: So I managed to get a page with Ajax ui.tab and in one of the tab I put jWYSIWYG textarea plugin. Unfortunately, I can only see normal textarea. However, accessing the page directly (ie. not using the ajax tab) works. What happened? p/s: I'm new to jQuery / JavaScr...
[ "jquery" ]
1
2
3,355
4
0
2008-09-27T22:49:34.127000
2009-05-19T14:05:22.413000
144,661
144,864
Python vs. Ruby for metaprogramming
I'm currently primarily a D programmer and am looking to add another language to my toolbox, preferably one that supports the metaprogramming hacks that just can't be done in a statically compiled language like D. I've read up on Lisp a little and I would love to find a language that allows some of the cool stuff that ...
There's not really a huge difference between python and ruby at least at an ideological level. For the most part, they're just different flavors of the same thing. Thus, I would recommend seeing which one matches your programming style more.
Python vs. Ruby for metaprogramming I'm currently primarily a D programmer and am looking to add another language to my toolbox, preferably one that supports the metaprogramming hacks that just can't be done in a statically compiled language like D. I've read up on Lisp a little and I would love to find a language that...
TITLE: Python vs. Ruby for metaprogramming QUESTION: I'm currently primarily a D programmer and am looking to add another language to my toolbox, preferably one that supports the metaprogramming hacks that just can't be done in a statically compiled language like D. I've read up on Lisp a little and I would love to fi...
[ "python", "ruby", "lisp", "metaprogramming" ]
90
15
34,574
31
0
2008-09-27T22:50:15.950000
2008-09-28T00:31:09.827000
144,669
144,672
How do I restore a deleted file in CVS?
I've removed a checked in file from the CVS branch, i.e.: cvs remove -f file.txt cvs commit How do I restore the file?
I believe that: cvs add file.txt cvs commit file.txt... will resurrect it from the attic.
How do I restore a deleted file in CVS? I've removed a checked in file from the CVS branch, i.e.: cvs remove -f file.txt cvs commit How do I restore the file?
TITLE: How do I restore a deleted file in CVS? QUESTION: I've removed a checked in file from the CVS branch, i.e.: cvs remove -f file.txt cvs commit How do I restore the file? ANSWER: I believe that: cvs add file.txt cvs commit file.txt... will resurrect it from the attic.
[ "cvs" ]
42
43
43,326
8
0
2008-09-27T22:55:19.870000
2008-09-27T22:56:30.803000
144,671
146,532
Problem with update site categories in Eclipse 3.4
I am using Eclipse 3.4 (ganymede official, not the service pack). I have an update site that organizes features into categories; everything looks great in the editor and in the XML. Once the site is online, accessing it in the usual manner tells me that all the features are "uncategorized". I've tried from multiple com...
It appears to be a known problem, due to the new 'p2' provisioning system. See this discussion, and this bug. What it seems to say is... "stay put until 3.5M3, and then try it again".
Problem with update site categories in Eclipse 3.4 I am using Eclipse 3.4 (ganymede official, not the service pack). I have an update site that organizes features into categories; everything looks great in the editor and in the XML. Once the site is online, accessing it in the usual manner tells me that all the feature...
TITLE: Problem with update site categories in Eclipse 3.4 QUESTION: I am using Eclipse 3.4 (ganymede official, not the service pack). I have an update site that organizes features into categories; everything looks great in the editor and in the XML. Once the site is online, accessing it in the usual manner tells me th...
[ "eclipse", "eclipse-3.4", "ganymede" ]
5
4
2,147
4
0
2008-09-27T22:55:59.027000
2008-09-28T19:22:15.443000
144,675
145,539
How to capture an anchor value from url in Ruby on Rails?
After updating or creating a record I use url helper to redirect to the part on the page where the record happened to be located: if record.save.... redirect_to records_url,:anchor => "record_" + record_id.to_s end the resulting url will be something like http://localhost:3000/records#record_343242 I want to highlight ...
I presume you're trying to capture it in JavaScript? var record_id = window.location.href.hash.split("_")[1]; In Prototype you could write: var record_id = window.location.href.hash.split("_").last;
How to capture an anchor value from url in Ruby on Rails? After updating or creating a record I use url helper to redirect to the part on the page where the record happened to be located: if record.save.... redirect_to records_url,:anchor => "record_" + record_id.to_s end the resulting url will be something like http:/...
TITLE: How to capture an anchor value from url in Ruby on Rails? QUESTION: After updating or creating a record I use url helper to redirect to the part on the page where the record happened to be located: if record.save.... redirect_to records_url,:anchor => "record_" + record_id.to_s end the resulting url will be som...
[ "javascript", "ruby-on-rails", "anchor" ]
3
1
2,729
1
0
2008-09-27T22:59:14.273000
2008-09-28T09:16:13.480000
144,682
144,885
What is the point of using a Logging framework?
I think I might be missing the point of having a logging framework for your application. In all the small apps I've always written a small "Logging" class and just pass log messages to a method in it which is written to a file. What is the purpose of a 3rd party logging framework like log4net? Is it thread safety with ...
That's an excellent question. The first reason is "why not?" If you are using a logging framework, then you'll reap the maintainability benefits of using something already packaged. The second reason is that logging is subtle. Different threads, sessions, classes and object instances may all come into play in logging, ...
What is the point of using a Logging framework? I think I might be missing the point of having a logging framework for your application. In all the small apps I've always written a small "Logging" class and just pass log messages to a method in it which is written to a file. What is the purpose of a 3rd party logging f...
TITLE: What is the point of using a Logging framework? QUESTION: I think I might be missing the point of having a logging framework for your application. In all the small apps I've always written a small "Logging" class and just pass log messages to a method in it which is written to a file. What is the purpose of a 3...
[ "c#", ".net", "logging" ]
21
24
3,048
7
0
2008-09-27T23:02:12.473000
2008-09-28T00:43:31.793000
144,696
144,956
Is exposing a session's CSRF-protection token safe?
Django comes with CSRF protection middleware, which generates a unique per-session token for use in forms. It scans all incoming POST requests for the correct token, and rejects the request if the token is missing or invalid. I'd like to use AJAX for some POST requests, but said requests don't have the CSRF token avail...
If you know you're going to need the CSRF token for AJAX requests, you can always embed it in the HTML somewhere; then you can find it through Javascript by traversing the DOM. This way, you'll still have access to the token, but you're not exposing it via an API. To put it another way: do it through Django's templates...
Is exposing a session's CSRF-protection token safe? Django comes with CSRF protection middleware, which generates a unique per-session token for use in forms. It scans all incoming POST requests for the correct token, and rejects the request if the token is missing or invalid. I'd like to use AJAX for some POST request...
TITLE: Is exposing a session's CSRF-protection token safe? QUESTION: Django comes with CSRF protection middleware, which generates a unique per-session token for use in forms. It scans all incoming POST requests for the correct token, and rejects the request if the token is missing or invalid. I'd like to use AJAX for...
[ "ajax", "django", "security", "csrf" ]
19
15
10,315
3
0
2008-09-27T23:11:05.930000
2008-09-28T01:36:36.050000
144,700
144,719
Teaching: Field, Class & Package Relationships
In general I think I can convey most programming related concepts quite well. Yet, I still find it hard to summarise the relationship between Fields, Classes and Packages. How do You summarise "Fields", "Classes" and "Packages" and "Their Relationship"?
I've faced a similar problem since I taught C, C++, and Java. Here is what I do: First, I keep packages separately and explain them in the end. Ideally, in my opinion, students should first learn about ADTs, preferably in C. They have the struct, they have the separate operations on it. Fields are then simply the "slot...
Teaching: Field, Class & Package Relationships In general I think I can convey most programming related concepts quite well. Yet, I still find it hard to summarise the relationship between Fields, Classes and Packages. How do You summarise "Fields", "Classes" and "Packages" and "Their Relationship"?
TITLE: Teaching: Field, Class & Package Relationships QUESTION: In general I think I can convey most programming related concepts quite well. Yet, I still find it hard to summarise the relationship between Fields, Classes and Packages. How do You summarise "Fields", "Classes" and "Packages" and "Their Relationship"? ...
[ "theory" ]
2
2
217
5
0
2008-09-27T23:11:58.597000
2008-09-27T23:20:51.867000
144,701
144,720
How do I convert a .NET console application to a Winforms or WPF application
I frequently start with a simple console application to try out an idea, then create a new GUI based project and copy the code in. Is there a better way? Can I convert my existing console application easily?
Just add a new Winform, add the following code to your Main: Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); Also, be sure the [STAThread] attribute is declared above your Main function to indicate the COM threading model your Windows application wil...
How do I convert a .NET console application to a Winforms or WPF application I frequently start with a simple console application to try out an idea, then create a new GUI based project and copy the code in. Is there a better way? Can I convert my existing console application easily?
TITLE: How do I convert a .NET console application to a Winforms or WPF application QUESTION: I frequently start with a simple console application to try out an idea, then create a new GUI based project and copy the code in. Is there a better way? Can I convert my existing console application easily? ANSWER: Just add...
[ ".net", "winforms", "console" ]
50
82
38,871
2
0
2008-09-27T23:13:24.130000
2008-09-27T23:21:25.313000
144,713
144,775
Add a namespace to elements
I have an XML document with un-namespaced elements, and I want to use XSLT to add namespaces to them. Most elements will be in namespace A; a few will be in namespace B. How do I do this?
With foo.xml and foo.xsl I get Is that what you’re looking for?
Add a namespace to elements I have an XML document with un-namespaced elements, and I want to use XSLT to add namespaces to them. Most elements will be in namespace A; a few will be in namespace B. How do I do this?
TITLE: Add a namespace to elements QUESTION: I have an XML document with un-namespaced elements, and I want to use XSLT to add namespaces to them. Most elements will be in namespace A; a few will be in namespace B. How do I do this? ANSWER: With foo.xml and foo.xsl I get Is that what you’re looking for?
[ "xml", "xslt", "namespaces" ]
12
15
29,002
3
0
2008-09-27T23:19:01.420000
2008-09-27T23:46:14.660000
144,716
144,723
With what GUI framework is the Mono .NET Windows.Forms implemented?
With what GUI framework is the Mono.NET Windows.Forms implemented? Example: KDE, Gnome, X11 itself?
Mono does not use Qt (KDE) or GTK+ (GNOME) widgets because they don't match up with the Winforms API. Mono implements Winforms on top of their System.Drawing implementation, which in turn uses Cairo. Cairo deals with the native graphics implementation, such as X11 in Linux or Quartz in OS X.
With what GUI framework is the Mono .NET Windows.Forms implemented? With what GUI framework is the Mono.NET Windows.Forms implemented? Example: KDE, Gnome, X11 itself?
TITLE: With what GUI framework is the Mono .NET Windows.Forms implemented? QUESTION: With what GUI framework is the Mono.NET Windows.Forms implemented? Example: KDE, Gnome, X11 itself? ANSWER: Mono does not use Qt (KDE) or GTK+ (GNOME) widgets because they don't match up with the Winforms API. Mono implements Winform...
[ ".net", "winforms", "mono" ]
3
4
843
1
0
2008-09-27T23:19:41.887000
2008-09-27T23:22:16.857000
144,726
145,033
ASP.NET MVC and...YUI? jQuery? Other
After the last project I've done using WebForms, I've decided to pass on using that framework in the future. It's great for getting your basic features out there...not so great when you have more complex UI logic. I'm looking at ASP.NET MVC, and like what I see so far. Of course the issue is that you lose the server si...
I have written an ASP.NET MVC application and I incorporated jQuery into it. I found that jQuery helped me manipulate things that would have overcomplicated my View... such as adding alternating styles to my grids, etc... There are many plugins for jQuery that fill in a lot of the gaps that other libraries may have. Fo...
ASP.NET MVC and...YUI? jQuery? Other After the last project I've done using WebForms, I've decided to pass on using that framework in the future. It's great for getting your basic features out there...not so great when you have more complex UI logic. I'm looking at ASP.NET MVC, and like what I see so far. Of course the...
TITLE: ASP.NET MVC and...YUI? jQuery? Other QUESTION: After the last project I've done using WebForms, I've decided to pass on using that framework in the future. It's great for getting your basic features out there...not so great when you have more complex UI logic. I'm looking at ASP.NET MVC, and like what I see so ...
[ "jquery", "asp.net-mvc", "ajax", "yui" ]
3
5
2,791
4
0
2008-09-27T23:23:27.367000
2008-09-28T02:35:12.650000
144,730
144,837
Things to consider when writing for touch screen?
I'm starting a new project which involves developing an interface for a machine that measures wedge and roundness of lenses and stores the information in a database and reports on it. There's a decent chance we're going to be putting a touch screen on this machine so that it doesn't need to have a mouse or keyboard... ...
A few things to consider: You need to account for parallax error when touching controls. Basically, the user may touch the screen above or below your actual control and therefore miss the control. This is a combination of the size of the control (eg you can have the active area larger than visual control to allow the u...
Things to consider when writing for touch screen? I'm starting a new project which involves developing an interface for a machine that measures wedge and roundness of lenses and stores the information in a database and reports on it. There's a decent chance we're going to be putting a touch screen on this machine so th...
TITLE: Things to consider when writing for touch screen? QUESTION: I'm starting a new project which involves developing an interface for a machine that measures wedge and roundness of lenses and stores the information in a database and reports on it. There's a decent chance we're going to be putting a touch screen on ...
[ "interface", "touchscreen" ]
12
25
2,892
10
0
2008-09-27T23:27:43.863000
2008-09-28T00:18:22.383000
144,731
177,089
How do you store request URL's in Javascript to satisfy the DRY principal?
Are there any commonly used patterns in Javascript for storing the URL's of endpoints that will be requested in an AJAX application? For example would you create a "Service" class to abstract the URL's away?
I've used something like this (used in Rails): NAMESPACE.categories.baseUri = '/categories'; NAMESPACE.categories.getUri = function(options) { options = options || {}; var uri = [NAMESPACE.categories.baseUri]; if(options.id) { uri.push(options.id); } if(options.action) { uri.push(options.action); } if(options.format) ...
How do you store request URL's in Javascript to satisfy the DRY principal? Are there any commonly used patterns in Javascript for storing the URL's of endpoints that will be requested in an AJAX application? For example would you create a "Service" class to abstract the URL's away?
TITLE: How do you store request URL's in Javascript to satisfy the DRY principal? QUESTION: Are there any commonly used patterns in Javascript for storing the URL's of endpoints that will be requested in an AJAX application? For example would you create a "Service" class to abstract the URL's away? ANSWER: I've used ...
[ "javascript", "ajax", "web-services", "design-patterns" ]
2
0
1,771
4
0
2008-09-27T23:27:48.933000
2008-10-07T03:01:38.507000
144,735
144,748
Best way to get started with programming other things than your computer?
What is the best way to get started with programming things outside of your computer? I don't mean mainstream things like cell phones with APIs. Please assume working knowledge of C/C++
Brian, you might find the Arduino interesting. It is inexpensive and pretty popular. I started playing around with micro controller boards and such a few years back and that lead to an interest in robots. Kind of interesting, at least to me. If one is interested in a.NET-flavored development environment, there is an an...
Best way to get started with programming other things than your computer? What is the best way to get started with programming things outside of your computer? I don't mean mainstream things like cell phones with APIs. Please assume working knowledge of C/C++
TITLE: Best way to get started with programming other things than your computer? QUESTION: What is the best way to get started with programming things outside of your computer? I don't mean mainstream things like cell phones with APIs. Please assume working knowledge of C/C++ ANSWER: Brian, you might find the Arduino...
[ "c", "embedded", "microcontroller", "device" ]
25
16
3,204
19
0
2008-09-27T23:30:06.260000
2008-09-27T23:35:25.390000
144,739
144,766
How to install/register more than one instances in SqlServer
Is it possible to install/register another local server instance in any SqlServer version, besides the default local instance, where only one SqlServer version is installed?
Yes, it's possible. I have several combinations in my servers. I have one server that has both SQL Server 2000 and 2005 installed side by side. My desktop at work is a Windows 2003 Server, and I have SQL Server 2005 and 2008 installed side by side. What you want is called a named instance. There will be a screen during...
How to install/register more than one instances in SqlServer Is it possible to install/register another local server instance in any SqlServer version, besides the default local instance, where only one SqlServer version is installed?
TITLE: How to install/register more than one instances in SqlServer QUESTION: Is it possible to install/register another local server instance in any SqlServer version, besides the default local instance, where only one SqlServer version is installed? ANSWER: Yes, it's possible. I have several combinations in my serv...
[ "sql-server" ]
1
4
509
2
0
2008-09-27T23:32:12.057000
2008-09-27T23:43:19.363000
144,745
144,867
How do I install the D programming language into C:\Program Files?
The prompt says that if I install the software into a directory with spaces: the rebuild build tool used by the D Shared Source System will fail to build and that I will be forced to reinstall in a different location However, I don't like random things in my C:\ drive. D, IMO, belongs in Program Files with PHP and MinG...
You can also use NTFS Link to create junction points (symlinks for all intents and purposes) and hard links on NTFS file systems. The functionality is built into the NTFS drivers, but an interface was never implemented for it, presumably to avoid things like recursive directory structures (endless virus scan loops anyo...
How do I install the D programming language into C:\Program Files? The prompt says that if I install the software into a directory with spaces: the rebuild build tool used by the D Shared Source System will fail to build and that I will be forced to reinstall in a different location However, I don't like random things ...
TITLE: How do I install the D programming language into C:\Program Files? QUESTION: The prompt says that if I install the software into a directory with spaces: the rebuild build tool used by the D Shared Source System will fail to build and that I will be forced to reinstall in a different location However, I don't l...
[ "windows", "installation", "d" ]
2
5
690
5
0
2008-09-27T23:34:32.287000
2008-09-28T00:32:47.933000
144,761
144,804
How to remove accents and tilde in a C++ std::string
I have a problem with a string in C++ which has several words in Spanish. This means that I have a lot of words with accents and tildes. I want to replace them for their not accented counterparts. Example: I want to replace this word: "había" for habia. I tried replace it directly but with replace method of string clas...
First, this is a really bad idea: you’re mangling somebody’s language by removing letters. Although the extra dots in words like “naïve” seem superfluous to people who only speak English, there are literally thousands of writing systems in the world in which such distinctions are very important. Writing software to mut...
How to remove accents and tilde in a C++ std::string I have a problem with a string in C++ which has several words in Spanish. This means that I have a lot of words with accents and tildes. I want to replace them for their not accented counterparts. Example: I want to replace this word: "había" for habia. I tried repla...
TITLE: How to remove accents and tilde in a C++ std::string QUESTION: I have a problem with a string in C++ which has several words in Spanish. This means that I have a lot of words with accents and tildes. I want to replace them for their not accented counterparts. Example: I want to replace this word: "había" for ha...
[ "c++", "string", "text", "str-replace" ]
19
22
27,088
8
0
2008-09-27T23:42:17.307000
2008-09-28T00:02:25.137000
144,774
144,856
Why does GetWindowRgn fail on Vista?
I'm writing a program that uses SetWindowRgn to make transparent holes in a window that belongs to another process. (This is done only when the user explicitly requests it.) The program has to assume that the target window may already have holes which need to be preserved, so before it calls SetWindowRgn, it calls GetW...
Are you sure your window has a region? Most top-level windows in XP do, simply because the default theme uses them for round corners... but this is still a bad assumption to be making, and may very well not hold once you get to Vista. If you haven't set a region yet, and the call fails, use a sensible default (the wind...
Why does GetWindowRgn fail on Vista? I'm writing a program that uses SetWindowRgn to make transparent holes in a window that belongs to another process. (This is done only when the user explicitly requests it.) The program has to assume that the target window may already have holes which need to be preserved, so before...
TITLE: Why does GetWindowRgn fail on Vista? QUESTION: I'm writing a program that uses SetWindowRgn to make transparent holes in a window that belongs to another process. (This is done only when the user explicitly requests it.) The program has to assume that the target window may already have holes which need to be pr...
[ "winapi", "windows-vista" ]
2
12
1,905
4
0
2008-09-27T23:46:00.667000
2008-09-28T00:28:08.273000
144,783
144,791
C# classes in separate files?
Should each class in my C# project get its own file (in your opinion)?
While the one class per file policy is strictly enforced in Java, it's not required by C#. However, it's generally a good idea. I typically break this rule if I have a very small helper class that is only used by the main class, but I prefer to do that as a nested inner class for clarity's sake. You can however, split ...
C# classes in separate files? Should each class in my C# project get its own file (in your opinion)?
TITLE: C# classes in separate files? QUESTION: Should each class in my C# project get its own file (in your opinion)? ANSWER: While the one class per file policy is strictly enforced in Java, it's not required by C#. However, it's generally a good idea. I typically break this rule if I have a very small helper class ...
[ "c#" ]
64
96
68,886
11
0
2008-09-27T23:52:19.107000
2008-09-27T23:55:55.073000
144,807
144,905
Java Log Viewer
Unfortunately, sometimes the only way to debug a program is by going through its long log files. I searched for a decent log viewer for a while now, and haven't found a real solution. The only program that seemed to be most appropriate was Chainsaw with its Socket connector but after a few short uses the program proved...
You didn't mention an OS, so I'll mention this though it is only on Windows. Bare Metal Software makes a product called BareTail that has a nice interface and works well. They have a free version with a startup nag screen, a licensed version with no nag, and a pro version with additional features. It has configurable h...
Java Log Viewer Unfortunately, sometimes the only way to debug a program is by going through its long log files. I searched for a decent log viewer for a while now, and haven't found a real solution. The only program that seemed to be most appropriate was Chainsaw with its Socket connector but after a few short uses th...
TITLE: Java Log Viewer QUESTION: Unfortunately, sometimes the only way to debug a program is by going through its long log files. I searched for a decent log viewer for a while now, and haven't found a real solution. The only program that seemed to be most appropriate was Chainsaw with its Socket connector but after a...
[ "java", "log4j", "viewer" ]
81
17
91,972
18
0
2008-09-28T00:02:33.327000
2008-09-28T00:57:18.547000
144,810
144,836
jQuery get textarea text
Recently I have started playing with jQuery, and have been following a couple of tutorials. Now I feel slightly competent with using it (it's pretty easy), and I thought it would be cool if I were able to make a 'console' on my webpage (as in, you press the ` key like you do in FPS games, etc.), and then have it Ajax i...
Why would you want to convert key strokes to text? Add a button that sends the text inside the textarea to the server when clicked. You can get the text using the value attribute as the poster before has pointed out, or using jQuery's API: $('input#mybutton').click(function() { var text = $('textarea#mytextarea').val()...
jQuery get textarea text Recently I have started playing with jQuery, and have been following a couple of tutorials. Now I feel slightly competent with using it (it's pretty easy), and I thought it would be cool if I were able to make a 'console' on my webpage (as in, you press the ` key like you do in FPS games, etc.)...
TITLE: jQuery get textarea text QUESTION: Recently I have started playing with jQuery, and have been following a couple of tutorials. Now I feel slightly competent with using it (it's pretty easy), and I thought it would be cool if I were able to make a 'console' on my webpage (as in, you press the ` key like you do i...
[ "javascript", "jquery", "ajax" ]
527
762
813,784
9
0
2008-09-28T00:05:56.907000
2008-09-28T00:17:47.783000
144,824
144,838
is bash getopts function destructive to the command-line options?
Can you use the bash "getopts" function twice in the same script? I have a set of options that would mean different things depending on the value of a specific option. Since I can't guarantee that getopts will evaluate that specific option first, I would like to run getopts one time, using only that specific option, th...
Yes, just reset OPTIND afterwards. #!/bin/bash set -- -1 while getopts 1 opt; do case "${opt}" in 1) echo "Worked!";; *) exit 1; esac done OPTIND=1 set -- -2 while getopts 2 opt; do case "${opt}" in 2) echo "Worked!";; *) exit 1; esac done
is bash getopts function destructive to the command-line options? Can you use the bash "getopts" function twice in the same script? I have a set of options that would mean different things depending on the value of a specific option. Since I can't guarantee that getopts will evaluate that specific option first, I would...
TITLE: is bash getopts function destructive to the command-line options? QUESTION: Can you use the bash "getopts" function twice in the same script? I have a set of options that would mean different things depending on the value of a specific option. Since I can't guarantee that getopts will evaluate that specific opt...
[ "bash", "shell" ]
4
5
2,403
2
0
2008-09-28T00:12:17.640000
2008-09-28T00:18:43.663000
144,862
144,948
Bluetooth APIs in Windows/.Net?
I am in the process of writing a Bluetooth scanner that locates and identifies mobile devices in the local vicinity. Is this something that I can accomplish using C#, or do I need to drop down into the C/C++ APIs? My application is targeting Windows XP and Vista. Pointers are appreciated. Thanks!
One problem with Bluetooth on the PC is that there are several BT stacks in use and you can never quite know which one is available on a given machine. The most common ones are Widcomm (now Broadcom) and Microsoft (appeared in XP, maybe one of the service packs). However, some BT hardware vendors package BlueSoleil and...
Bluetooth APIs in Windows/.Net? I am in the process of writing a Bluetooth scanner that locates and identifies mobile devices in the local vicinity. Is this something that I can accomplish using C#, or do I need to drop down into the C/C++ APIs? My application is targeting Windows XP and Vista. Pointers are appreciated...
TITLE: Bluetooth APIs in Windows/.Net? QUESTION: I am in the process of writing a Bluetooth scanner that locates and identifies mobile devices in the local vicinity. Is this something that I can accomplish using C#, or do I need to drop down into the C/C++ APIs? My application is targeting Windows XP and Vista. Pointe...
[ "c#", ".net", "windows", "windows-xp", "bluetooth" ]
32
25
64,636
3
0
2008-09-28T00:30:33.213000
2008-09-28T01:30:15.207000
144,872
145,857
JFreeChart XYPlot with labels
I'm using an XYPlot in JFreeChart. All the lines on it are XYSeries objects. Both axes are NumberAxis objects. The Y-Axis range is from 0-1, with ticks every.1. Along with displaying the numbers though, I'd like to display text on the Y-Axis, like High/Medium/Low. High would cover.7-1, etc. What is the best way to go a...
I have some JFreeChart experience, and after a little research I don't have an answer for adding the three labels to the axis. However, as an alternative approach, you should be able to delineate these three areas on the plot with colors by setting a MarkerAxisBand for the NumberAxis (using this method ). You could the...
JFreeChart XYPlot with labels I'm using an XYPlot in JFreeChart. All the lines on it are XYSeries objects. Both axes are NumberAxis objects. The Y-Axis range is from 0-1, with ticks every.1. Along with displaying the numbers though, I'd like to display text on the Y-Axis, like High/Medium/Low. High would cover.7-1, etc...
TITLE: JFreeChart XYPlot with labels QUESTION: I'm using an XYPlot in JFreeChart. All the lines on it are XYSeries objects. Both axes are NumberAxis objects. The Y-Axis range is from 0-1, with ticks every.1. Along with displaying the numbers though, I'd like to display text on the Y-Axis, like High/Medium/Low. High wo...
[ "java", "jfreechart" ]
4
1
3,625
2
0
2008-09-28T00:35:24.793000
2008-09-28T13:43:31.590000
144,888
145,003
Reading call history in iPhone OS
I'm doing some research on the feasibility of an iPhone application, and can't find any indication in Apple's documentation that an iPhone app can read the call history of the phone, specifically the number/address book entry called, when, and the duration. Does anyone know if this is possible, and how? Note: The purpo...
Unfortunately you can't access the call history. The only User Data you have API access to is the address book. You can also access photos/pictures but only by starting an iPhone-controlled dialog that allows the user to choose a single image. It's a bit sucky, hopefully this will be expanded in future versions.
Reading call history in iPhone OS I'm doing some research on the feasibility of an iPhone application, and can't find any indication in Apple's documentation that an iPhone app can read the call history of the phone, specifically the number/address book entry called, when, and the duration. Does anyone know if this is ...
TITLE: Reading call history in iPhone OS QUESTION: I'm doing some research on the feasibility of an iPhone application, and can't find any indication in Apple's documentation that an iPhone app can read the call history of the phone, specifically the number/address book entry called, when, and the duration. Does anyon...
[ "iphone" ]
12
10
42,821
5
0
2008-09-28T00:45:06.127000
2008-09-28T02:17:34.267000
144,892
144,893
How to center a Window in Java?
What's the easiest way to centre a java.awt.Window, such as a JFrame or a JDialog?
From this link If you are using Java 1.4 or newer, you can use the simple method setLocationRelativeTo(null) on the dialog box, frame, or window to center it.
How to center a Window in Java? What's the easiest way to centre a java.awt.Window, such as a JFrame or a JDialog?
TITLE: How to center a Window in Java? QUESTION: What's the easiest way to centre a java.awt.Window, such as a JFrame or a JDialog? ANSWER: From this link If you are using Java 1.4 or newer, you can use the simple method setLocationRelativeTo(null) on the dialog box, frame, or window to center it.
[ "java", "swing", "user-interface", "awt" ]
138
278
240,335
21
0
2008-09-28T00:48:52.903000
2008-09-28T00:49:52.450000
144,898
297,987
How to detect design time in a VS.NET 2003 control library project
Code below is not working as expected to detect if it is in design mode (VS.Net 2003 - Control Library): if (this.Site!= null && this.Site.DesignMode == true) { // Design Mode } else { // Run-time } It is used in a complex user control, deriving from another user control and including other user controls on it. Is ther...
DesignMode won't work from inside a constructor. Some alternatives (not sure if they work in 1.1) are if (System.ComponentModel.LicenseManager.UsageMode == System.ComponentModel.LicenseUsageMode.Designtime) or call GetService(typeof(IDesignerHost)) and see if it returns something. I've had better luck with the first op...
How to detect design time in a VS.NET 2003 control library project Code below is not working as expected to detect if it is in design mode (VS.Net 2003 - Control Library): if (this.Site!= null && this.Site.DesignMode == true) { // Design Mode } else { // Run-time } It is used in a complex user control, deriving from an...
TITLE: How to detect design time in a VS.NET 2003 control library project QUESTION: Code below is not working as expected to detect if it is in design mode (VS.Net 2003 - Control Library): if (this.Site!= null && this.Site.DesignMode == true) { // Design Mode } else { // Run-time } It is used in a complex user control...
[ "visual-studio-2003", "design-time" ]
3
6
983
2
0
2008-09-28T00:53:02.457000
2008-11-18T06:19:23.190000
144,901
144,946
system wide keyboard hook on X under linux
What would be the best approach to install a keyboard hook on Linux (X-windows) in order to trigger some application when some key-combo is pressed?? Is there a way to do this regardless of which window manager is running? The idea is to have an application being called ( or brought to foreground ) when some key is pre...
XGrabKey on the root window is how xbindkey does it. Be careful about having some alternative method of killing the grab though, it's very annoying to have to go somewhere to ssh into your own box just to kill that process... And that's why, if it was me, xbindkeys +"echo 'moo' > /tmp/moo-fifo" would be the way to do i...
system wide keyboard hook on X under linux What would be the best approach to install a keyboard hook on Linux (X-windows) in order to trigger some application when some key-combo is pressed?? Is there a way to do this regardless of which window manager is running? The idea is to have an application being called ( or b...
TITLE: system wide keyboard hook on X under linux QUESTION: What would be the best approach to install a keyboard hook on Linux (X-windows) in order to trigger some application when some key-combo is pressed?? Is there a way to do this regardless of which window manager is running? The idea is to have an application b...
[ "linux" ]
9
5
8,070
1
0
2008-09-28T00:54:51.877000
2008-09-28T01:29:58.517000
144,902
247,878
Speed of DataSet row/column lookups?
Recently I had to do some very processing heavy stuff with data stored in a DataSet. It was heavy enough that I ended up using a tool to help identify some bottlenecks in my code. When I was analyzing the bottlenecks, I noticed that although DataSet lookups were not terribly slow (they weren't the bottleneck), it was s...
Via Reflector the steps for DataRow["ColumnName"] are: Get the DataColumn from ColumnName. Uses the row's DataColumnCollection["ColumnName"]. Internally, DataColumnCollection stores its DataColumns in a Hastable. O(1) Get the DataRow's row index. The index is stored in an internal member. O(1) Get the DataColumn's valu...
Speed of DataSet row/column lookups? Recently I had to do some very processing heavy stuff with data stored in a DataSet. It was heavy enough that I ended up using a tool to help identify some bottlenecks in my code. When I was analyzing the bottlenecks, I noticed that although DataSet lookups were not terribly slow (t...
TITLE: Speed of DataSet row/column lookups? QUESTION: Recently I had to do some very processing heavy stuff with data stored in a DataSet. It was heavy enough that I ended up using a tool to help identify some bottlenecks in my code. When I was analyzing the bottlenecks, I noticed that although DataSet lookups were no...
[ "c#", ".net", "optimization", "datatable" ]
6
2
3,942
4
0
2008-09-28T00:55:43.840000
2008-10-29T18:28:58.057000
144,936
145,716
When Using Dynamic Proxies, how do I access the underlying object's Annotations?
When Using Dynamic Proxies, how do I access the underlying object's Annotations? Specifically I'm annotating settings of a ORM object with @Column("client_id") and then making a Dynamic Proxy keep track of when the annotated setters are called, but... It doesn't seem that the annotated proxy keeps any of the underlying...
AFAIK, it depends on your bytecode injection lib. Also, remember that typically annotations are not inherited (imposed by the Java spec). If you want to access the original class, and are using CGLIB, you can use this snippet: if (Enhancer.isEnhanced(getClass())) { currClass = UnEnhancer.unenhance(getClass()); } else {...
When Using Dynamic Proxies, how do I access the underlying object's Annotations? When Using Dynamic Proxies, how do I access the underlying object's Annotations? Specifically I'm annotating settings of a ORM object with @Column("client_id") and then making a Dynamic Proxy keep track of when the annotated setters are ca...
TITLE: When Using Dynamic Proxies, how do I access the underlying object's Annotations? QUESTION: When Using Dynamic Proxies, how do I access the underlying object's Annotations? Specifically I'm annotating settings of a ORM object with @Column("client_id") and then making a Dynamic Proxy keep track of when the annota...
[ "java", "proxy", "annotations" ]
4
4
1,475
1
0
2008-09-28T01:21:06.850000
2008-09-28T11:46:41.060000
144,957
145,093
Using Exception.Data
How have you used the Exception.Data property in C# projects that you've worked on? I'd like answers that suggest a pattern, rather than those that are very specific to your app.
The exception logger I use has been tweaked to write out all the items in the Data collection. Then for every exception we encounter that we cannot diagnose from the exception stack, we add in all the data in that function's scope, send out a new build, and wait for it to reoccur. I guess we're optimists in that we don...
Using Exception.Data How have you used the Exception.Data property in C# projects that you've worked on? I'd like answers that suggest a pattern, rather than those that are very specific to your app.
TITLE: Using Exception.Data QUESTION: How have you used the Exception.Data property in C# projects that you've worked on? I'd like answers that suggest a pattern, rather than those that are very specific to your app. ANSWER: The exception logger I use has been tweaked to write out all the items in the Data collection...
[ "c#", "exception" ]
59
30
24,994
5
0
2008-09-28T01:38:08.683000
2008-09-28T03:07:17.190000
144,959
144,967
Ruby. How can I copy and paste in irb on Windows?
How can I copy and paste in irb (Interactive Ruby Shell) on Windows?
To avoid having to open the drop-down menu and clicking, you need to change the command window settings. To do this, right-click the title bar, choose Properties, turn on "QuickEdit Mode" under the Properties tab (and keep "Insert Mode" on), then OK. Now, to copy: drag to select, right-click to copy. To paste: right-cl...
Ruby. How can I copy and paste in irb on Windows? How can I copy and paste in irb (Interactive Ruby Shell) on Windows?
TITLE: Ruby. How can I copy and paste in irb on Windows? QUESTION: How can I copy and paste in irb (Interactive Ruby Shell) on Windows? ANSWER: To avoid having to open the drop-down menu and clicking, you need to change the command window settings. To do this, right-click the title bar, choose Properties, turn on "Qu...
[ "windows", "ruby", "console", "copy-paste", "irb" ]
10
26
5,063
5
0
2008-09-28T01:38:49.680000
2008-09-28T01:45:38.150000
144,983
144,984
How do I make Emacs start without so much fanfare?
Every time I start Emacs I see a page of help text and a bunch of messages suggesting that I try the tutorial. How do I stop this from happening?
Put the following in your.emacs: (setq inhibit-startup-message t) (setq inhibit-startup-echo-area-message t)
How do I make Emacs start without so much fanfare? Every time I start Emacs I see a page of help text and a bunch of messages suggesting that I try the tutorial. How do I stop this from happening?
TITLE: How do I make Emacs start without so much fanfare? QUESTION: Every time I start Emacs I see a page of help text and a bunch of messages suggesting that I try the tutorial. How do I stop this from happening? ANSWER: Put the following in your.emacs: (setq inhibit-startup-message t) (setq inhibit-startup-echo-are...
[ "emacs" ]
26
10
7,621
6
0
2008-09-28T02:02:31.573000
2008-09-28T02:02:44.647000
144,985
158,909
Programming on a Nintendo DS
I was reading this answer previously and it got me interested in purchasing a Nintendo DS Lite for learning to program embedded devices. Before I go out and splurge on a DS I had a few questions: Are there any restrictions on what you can program? The post I indicated earlier seemed to say there weren't, but clarificat...
No, there really isn't much of a limitation beyond that of the hardware, and even that can be overcome with enough effort. Quake has been ported to DS, for example, and particle games that utilize both processors have been made. There has also been discussion on how to make higher quality 3D scenes using a double pass ...
Programming on a Nintendo DS I was reading this answer previously and it got me interested in purchasing a Nintendo DS Lite for learning to program embedded devices. Before I go out and splurge on a DS I had a few questions: Are there any restrictions on what you can program? The post I indicated earlier seemed to say ...
TITLE: Programming on a Nintendo DS QUESTION: I was reading this answer previously and it got me interested in purchasing a Nintendo DS Lite for learning to program embedded devices. Before I go out and splurge on a DS I had a few questions: Are there any restrictions on what you can program? The post I indicated earl...
[ "c", "embedded", "nintendo-ds", "homebrew" ]
28
21
17,465
8
0
2008-09-28T02:02:49.980000
2008-10-01T18:03:25.030000
145,000
145,016
What's the future of the web? XHTML 2, HTML 5, or something else?
I'm confused by the discussion and advancement both of a new version of HTML and a new version of XHTML. Are they competitors? If so, what is likeliest to be the adopted future of the web? If not, what is the differing non-competing purpose for each? Are we due to have a BluRay/HDVD battle here? Is there ultimately any...
HTML 5 is meant for web applications whereas XHTML2 is meant for documents. From the HTML 5 working draft: XHTML2 defines a new HTML vocabulary with better features for hyperlinks, multimedia content, annotating document edits, rich metadata, declarative interactive forms, and describing the semantics of human literary...
What's the future of the web? XHTML 2, HTML 5, or something else? I'm confused by the discussion and advancement both of a new version of HTML and a new version of XHTML. Are they competitors? If so, what is likeliest to be the adopted future of the web? If not, what is the differing non-competing purpose for each? Are...
TITLE: What's the future of the web? XHTML 2, HTML 5, or something else? QUESTION: I'm confused by the discussion and advancement both of a new version of HTML and a new version of XHTML. Are they competitors? If so, what is likeliest to be the adopted future of the web? If not, what is the differing non-competing pur...
[ "html", "xhtml" ]
4
5
813
7
0
2008-09-28T02:15:43.193000
2008-09-28T02:25:30.910000
145,006
145,013
End of FILE* pointer is not equal to size of written data
Very simply put, I have the following code snippet: FILE* test = fopen("C:\\core.u", "w"); printf("Filepointer at: %d\n", ftell(test)); fwrite(data, size, 1, test); printf("Written: %d bytes.\n", size); fseek(test, 0, SEEK_END); printf("Filepointer is now at %d.\n", ftell(test)); fclose(test); and it outputs: Filepoint...
Since you're opening the file in text mode, it will convert end-of-line markers, such as LF, into CR/LF. This is likely if you're running on Windows (and you probably are, given that your file name starts with "c:\" ). If you open the file in "wb" mode, I suspect you'll find the numbers are identical: FILE* test = fope...
End of FILE* pointer is not equal to size of written data Very simply put, I have the following code snippet: FILE* test = fopen("C:\\core.u", "w"); printf("Filepointer at: %d\n", ftell(test)); fwrite(data, size, 1, test); printf("Written: %d bytes.\n", size); fseek(test, 0, SEEK_END); printf("Filepointer is now at %d....
TITLE: End of FILE* pointer is not equal to size of written data QUESTION: Very simply put, I have the following code snippet: FILE* test = fopen("C:\\core.u", "w"); printf("Filepointer at: %d\n", ftell(test)); fwrite(data, size, 1, test); printf("Written: %d bytes.\n", size); fseek(test, 0, SEEK_END); printf("Filepoi...
[ "c", "fopen", "fwrite", "ftell" ]
8
19
3,805
4
0
2008-09-28T02:20:34.447000
2008-09-28T02:23:13.240000
145,017
145,075
What web server should I use with NetBeans?
I haven't been around Java development for 8 years, but am starting to build a NetBeans Web Application. When I walk through the Web Application wizard, it asks for the server I'm going to be using. What would be the best and simplest server for me to start using with NetBeans?
Since the NetBeans IDE is a Sun product, I would assume that the Glassfish application server would be a natural fit. That said, one of the pluses of developing a web application in Java is that the interface for working with the http is standardized (i.e. the Servlet specification), so that you can pick any servlet co...
What web server should I use with NetBeans? I haven't been around Java development for 8 years, but am starting to build a NetBeans Web Application. When I walk through the Web Application wizard, it asks for the server I'm going to be using. What would be the best and simplest server for me to start using with NetBean...
TITLE: What web server should I use with NetBeans? QUESTION: I haven't been around Java development for 8 years, but am starting to build a NetBeans Web Application. When I walk through the Web Application wizard, it asks for the server I'm going to be using. What would be the best and simplest server for me to start ...
[ "java", "netbeans", "webserver" ]
4
4
8,079
3
0
2008-09-28T02:26:03.980000
2008-09-28T02:53:54.337000
145,025
146,615
WCF Service authorization patterns
I'm implementing a secure WCF service. Authentication is done using username / password or Windows credentials. The service is hosted in a Windows Service process. Now, I'm trying to find out the best way to implement authorization for each service operation. For example, consider the following method: public EntityInf...
For question 1, absolutely do authorization first. No code (within your control) should execute before authorization to maintain the tightest security. Paul's example above is excellent. For question 2, you could handle this by subclassing your concrete service implementation. Make the true business logic implementatio...
WCF Service authorization patterns I'm implementing a secure WCF service. Authentication is done using username / password or Windows credentials. The service is hosted in a Windows Service process. Now, I'm trying to find out the best way to implement authorization for each service operation. For example, consider the...
TITLE: WCF Service authorization patterns QUESTION: I'm implementing a secure WCF service. Authentication is done using username / password or Windows credentials. The service is hosted in a Windows Service process. Now, I'm trying to find out the best way to implement authorization for each service operation. For exa...
[ "c#", ".net", "wcf", "authorization" ]
7
3
10,974
3
0
2008-09-28T02:31:21.737000
2008-09-28T20:06:03.107000
145,026
145,036
Are there any considerations needed to be taken running your .net program on x64 vs x86?
I believe the architecture type (x86 vs x64) is abstracted away for you when making.Net programs, but are there any other considerations that can cause problems?
Beware of third-party COM libraries or third party.NET libraries that secretly make win32 calls. That's where we had our biggest headaches.
Are there any considerations needed to be taken running your .net program on x64 vs x86? I believe the architecture type (x86 vs x64) is abstracted away for you when making.Net programs, but are there any other considerations that can cause problems?
TITLE: Are there any considerations needed to be taken running your .net program on x64 vs x86? QUESTION: I believe the architecture type (x86 vs x64) is abstracted away for you when making.Net programs, but are there any other considerations that can cause problems? ANSWER: Beware of third-party COM libraries or thi...
[ ".net", "x86", "64-bit" ]
14
19
1,109
7
0
2008-09-28T02:31:26.980000
2008-09-28T02:35:41.790000
145,027
145,034
192.168.0.71... What is this special address used for?
I have some accesses from 192.168.0.71 on my apache logs. I looked up this IP (because my server almost exclusively takes requests from 127.0.0.1, and I saw that it's reserved for "special purposes." What types of purposes might those be? Edit: I didn't tell you, typing 192.168.0.71 brings me straight to my site, just ...
RFC 1918 reserves addresses starting with 192.168 for private networks. This most likely means that some computer on your local network is accessing the server.
192.168.0.71... What is this special address used for? I have some accesses from 192.168.0.71 on my apache logs. I looked up this IP (because my server almost exclusively takes requests from 127.0.0.1, and I saw that it's reserved for "special purposes." What types of purposes might those be? Edit: I didn't tell you, t...
TITLE: 192.168.0.71... What is this special address used for? QUESTION: I have some accesses from 192.168.0.71 on my apache logs. I looked up this IP (because my server almost exclusively takes requests from 127.0.0.1, and I saw that it's reserved for "special purposes." What types of purposes might those be? Edit: I ...
[ "apache", "ip" ]
2
11
3,537
9
0
2008-09-28T02:31:27.807000
2008-09-28T02:35:20.293000
145,043
145,045
How do I stop Emacs from automatically editing my startup file?
Emacs edits my.emacs file whenever I use the customization facility, or when I type a command that is disabled by default. Any automatic editing of my configuration makes me nervous. How can I stop Emacs from ever editing my.emacs. file?
The first thing to do is to stop that silly "disabled command" feature from ever doing anything. If you care this much about your.emacs file, you certainly don't need novice.el bossing you around. (setq disabled-command-function nil) The customization facility can be made to stuff all your customizations in a separate ...
How do I stop Emacs from automatically editing my startup file? Emacs edits my.emacs file whenever I use the customization facility, or when I type a command that is disabled by default. Any automatic editing of my configuration makes me nervous. How can I stop Emacs from ever editing my.emacs. file?
TITLE: How do I stop Emacs from automatically editing my startup file? QUESTION: Emacs edits my.emacs file whenever I use the customization facility, or when I type a command that is disabled by default. Any automatic editing of my configuration makes me nervous. How can I stop Emacs from ever editing my.emacs. file? ...
[ "emacs" ]
6
12
352
1
0
2008-09-28T02:36:33.783000
2008-09-28T02:36:42.770000
145,052
145,173
Simplest way to use "BeanUtils alike" replace
Is there any libraries that would allow me to use the same known notation as we use in BeanUtils for extracting POJO parameters, but for easily replacing placeholders in a string? I know it would be possible to roll my own, using BeanUtils itself or other libraries with similar features, but I didn't want to reinvent t...
Rolling your own using BeanUtils wouldn't take too much wheel reinvention (assuming you want it to be as basic as asked for). This implementation takes a Map for replacement context, where the map key should correspond to the first portion of the variable lookup paths given for replacement. import java.lang.reflect.Inv...
Simplest way to use "BeanUtils alike" replace Is there any libraries that would allow me to use the same known notation as we use in BeanUtils for extracting POJO parameters, but for easily replacing placeholders in a string? I know it would be possible to roll my own, using BeanUtils itself or other libraries with sim...
TITLE: Simplest way to use "BeanUtils alike" replace QUESTION: Is there any libraries that would allow me to use the same known notation as we use in BeanUtils for extracting POJO parameters, but for easily replacing placeholders in a string? I know it would be possible to roll my own, using BeanUtils itself or other ...
[ "java", "string", "replace", "placeholder" ]
2
2
1,886
3
0
2008-09-28T02:41:41.573000
2008-09-28T03:55:47.493000
145,053
145,067
Javascript as a functional language
I am looking get to grips with functional programming concepts. I've used Javascript for many years for client side scripting in web applications and apart from using prototypes it was all simple DOM manipulation, input validation etc. Of late, I have often read that Javascript is one of the languages that supports fun...
JavaScript supports first class functions. See Use functional programming techniques to write elegant JavaScript.
Javascript as a functional language I am looking get to grips with functional programming concepts. I've used Javascript for many years for client side scripting in web applications and apart from using prototypes it was all simple DOM manipulation, input validation etc. Of late, I have often read that Javascript is on...
TITLE: Javascript as a functional language QUESTION: I am looking get to grips with functional programming concepts. I've used Javascript for many years for client side scripting in web applications and apart from using prototypes it was all simple DOM manipulation, input validation etc. Of late, I have often read tha...
[ "javascript", "functional-programming", "language-features" ]
62
44
18,436
8
0
2008-09-28T02:41:51.260000
2008-09-28T02:49:15.377000
145,056
146,000
Is this a reasonable implementation of the quadratic Bézier function in OCaml?
A friend came across a quadratic Bézier curve function in his codebase that used a gigantic rats nest of a switch table to perform the computation. He challenged me to find a single, short expression that would allow him to replace the gigantic block of code. In attempting to satisfy two different curiosities, I though...
b2 isn't recursive, so no need for [let rec b2 n =]. Since n never changes, no need to have it as argument to b2i, just use n from the enclosing scope. Your inner function should depend on p0, p1 and p2, but I see it depending on -10., n**2 and 10. The function also has the form of a map from [ 0.0; 1.0; 2.0;...; n.0] ...
Is this a reasonable implementation of the quadratic Bézier function in OCaml? A friend came across a quadratic Bézier curve function in his codebase that used a gigantic rats nest of a switch table to perform the computation. He challenged me to find a single, short expression that would allow him to replace the gigan...
TITLE: Is this a reasonable implementation of the quadratic Bézier function in OCaml? QUESTION: A friend came across a quadratic Bézier curve function in his codebase that used a gigantic rats nest of a switch table to perform the computation. He challenged me to find a single, short expression that would allow him to...
[ "ocaml", "bezier" ]
0
3
555
2
0
2008-09-28T02:42:54.080000
2008-09-28T14:49:45.083000
145,064
183,397
YUV Conversion via a fragment shader
I have implemented a YUV to RGB conversion via a fragment shader written in Nvidia's shader language. (Y, U and V are stored in separate textures that are combined via multi texturing in my fragment shader). It works great under OpenGL, but under Direct3D I just can't get the output image to look right. I'm starting to...
We figured it out.:) Basically the problem was that while our YUV to RGB equations were correct, we weren't properly sampling the V data! So no amount of futzing with the equations would have helped! In the end, I would recommend the following strategy for anyone attempting to do this: 1) Set R, G, and B to the value f...
YUV Conversion via a fragment shader I have implemented a YUV to RGB conversion via a fragment shader written in Nvidia's shader language. (Y, U and V are stored in separate textures that are combined via multi texturing in my fragment shader). It works great under OpenGL, but under Direct3D I just can't get the output...
TITLE: YUV Conversion via a fragment shader QUESTION: I have implemented a YUV to RGB conversion via a fragment shader written in Nvidia's shader language. (Y, U and V are stored in separate textures that are combined via multi texturing in my fragment shader). It works great under OpenGL, but under Direct3D I just ca...
[ "video", "direct3d", "rgb", "yuv" ]
2
2
5,898
2
0
2008-09-28T02:47:43.820000
2008-10-08T15:31:01.283000
145,080
145,378
Distributing iPhone applications 2.1 vs 2.0
Can iPhone applications compiled against 2.1 be successfully installed via iTunes on a 2.0 device? I know iPhone applications compiled with 2.1 can run on a 2.0 device (assuming they're not using anything new from 2.1). But am not sure if iTunes will let the install take place. Does anyone have concrete information on ...
I believe apps that are compiled against 2.1 will be marked as "Requires iPhone 2.1 Softwar Update" when viewed through iTunes. (but not when viewed from an iPhone - the iPhone's App Store app only displays a subset of an app's metadata.) One example: Caliper (it's under "Application Description->Requirements") I don't...
Distributing iPhone applications 2.1 vs 2.0 Can iPhone applications compiled against 2.1 be successfully installed via iTunes on a 2.0 device? I know iPhone applications compiled with 2.1 can run on a 2.0 device (assuming they're not using anything new from 2.1). But am not sure if iTunes will let the install take plac...
TITLE: Distributing iPhone applications 2.1 vs 2.0 QUESTION: Can iPhone applications compiled against 2.1 be successfully installed via iTunes on a 2.0 device? I know iPhone applications compiled with 2.1 can run on a 2.0 device (assuming they're not using anything new from 2.1). But am not sure if iTunes will let the...
[ "iphone", "app-store" ]
3
5
875
3
0
2008-09-28T02:57:31.440000
2008-09-28T06:50:56.433000
145,096
145,098
Is it true that there is no need to learn C because C++ contains everything?
I am taking a class in C++ programming and the professor told us that there is no need to learn C because C++ contains everything in C plus object-oriented features. However, some others have told me that this is not necessarily true. Can anyone shed some light on this?
Overview: It is almost true that C++ is a superset of C, and your professor is correct in that there is no need to learn C separately. C++ adds the whole object oriented aspect, generic programming aspect, as well as having less strict rules (like variables needing to be declared at the top of each function). C++ does ...
Is it true that there is no need to learn C because C++ contains everything? I am taking a class in C++ programming and the professor told us that there is no need to learn C because C++ contains everything in C plus object-oriented features. However, some others have told me that this is not necessarily true. Can anyo...
TITLE: Is it true that there is no need to learn C because C++ contains everything? QUESTION: I am taking a class in C++ programming and the professor told us that there is no need to learn C because C++ contains everything in C plus object-oriented features. However, some others have told me that this is not necessar...
[ "c++", "c" ]
44
87
16,512
11
0
2008-09-28T03:08:02.693000
2008-09-28T03:09:47.777000
145,103
146,495
What's the best way to benchmark programs in Windows?
I need to do some performance benchmarks on.NET programs (C#) in Windows, but I haven't done benchmarking much in the Windows world. I've looked into using the Windows 2000/XP Performance monitor with custom counters for this, but I don't think this is quite what I want. Are there any good system facilities for this in...
For micro-benchmarking I really like MeasureIt (can be downloaded from http://msdn.microsoft.com/en-us/magazine/cc500596.aspx ). It is a test project written by Vance Morrison a Performance Architect on the CLR. It currently has a good set of benchmarks for a number of.Net/CLR core methods. The best part of it is that ...
What's the best way to benchmark programs in Windows? I need to do some performance benchmarks on.NET programs (C#) in Windows, but I haven't done benchmarking much in the Windows world. I've looked into using the Windows 2000/XP Performance monitor with custom counters for this, but I don't think this is quite what I ...
TITLE: What's the best way to benchmark programs in Windows? QUESTION: I need to do some performance benchmarks on.NET programs (C#) in Windows, but I haven't done benchmarking much in the Windows world. I've looked into using the Windows 2000/XP Performance monitor with custom counters for this, but I don't think thi...
[ "c#", ".net", "windows", "performance", "benchmarking" ]
6
5
6,919
6
0
2008-09-28T03:14:36.673000
2008-09-28T18:58:07.153000
145,110
145,122
C++ performance vs. Java/C#
My understanding is that C/C++ produces native code to run on a particular machine architecture. Conversely, languages like Java and C# run on top of a virtual machine which abstracts away the native architecture. Logically it would seem impossible for Java or C# to match the speed of C++ because of this intermediate s...
Generally, C# and Java can be just as fast or faster because the JIT compiler -- a compiler that compiles your IL the first time it's executed -- can make optimizations that a C++ compiled program cannot because it can query the machine. It can determine if the machine is Intel or AMD; Pentium 4, Core Solo, or Core Duo...
C++ performance vs. Java/C# My understanding is that C/C++ produces native code to run on a particular machine architecture. Conversely, languages like Java and C# run on top of a virtual machine which abstracts away the native architecture. Logically it would seem impossible for Java or C# to match the speed of C++ be...
TITLE: C++ performance vs. Java/C# QUESTION: My understanding is that C/C++ produces native code to run on a particular machine architecture. Conversely, languages like Java and C# run on top of a virtual machine which abstracts away the native architecture. Logically it would seem impossible for Java or C# to match t...
[ "c#", "java", "c++", "performance", "bytecode" ]
119
178
444,101
31
0
2008-09-28T03:16:54.077000
2008-09-28T03:21:49.930000
145,131
145,163
What's the best strategy for unit-testing database-driven applications?
I work with a lot of web applications that are driven by databases of varying complexity on the backend. Typically, there's an ORM layer separate from the business and presentation logic. This makes unit-testing the business logic fairly straightforward; things can be implemented in discrete modules and any data needed...
I've actually used your first approach with quite some success, but in slightly different ways that I think would solve some of your problems: Keep the entire schema and scripts for creating it in source control so that anyone can create the current database schema after a check out. In addition, keep sample data in da...
What's the best strategy for unit-testing database-driven applications? I work with a lot of web applications that are driven by databases of varying complexity on the backend. Typically, there's an ORM layer separate from the business and presentation logic. This makes unit-testing the business logic fairly straightfo...
TITLE: What's the best strategy for unit-testing database-driven applications? QUESTION: I work with a lot of web applications that are driven by databases of varying complexity on the backend. Typically, there's an ORM layer separate from the business and presentation logic. This makes unit-testing the business logic...
[ "database", "unit-testing", "orm", "mocking" ]
409
172
136,407
7
0
2008-09-28T03:26:42.120000
2008-09-28T03:45:30.500000
145,154
343,191
What should my Objective-C singleton look like?
My singleton accessor method is usually some variant of: static MyClass *gInstance = NULL; + (MyClass *)instance { @synchronized(self) { if (gInstance == NULL) gInstance = [[self alloc] init]; } return(gInstance); } What could I be doing to improve this?
Another option is to use the +(void)initialize method. From the documentation: The runtime sends initialize to each class in a program exactly one time just before the class, or any class that inherits from it, is sent its first message from within the program. (Thus the method may never be invoked if the class is not ...
What should my Objective-C singleton look like? My singleton accessor method is usually some variant of: static MyClass *gInstance = NULL; + (MyClass *)instance { @synchronized(self) { if (gInstance == NULL) gInstance = [[self alloc] init]; } return(gInstance); } What could I be doing to improve this?
TITLE: What should my Objective-C singleton look like? QUESTION: My singleton accessor method is usually some variant of: static MyClass *gInstance = NULL; + (MyClass *)instance { @synchronized(self) { if (gInstance == NULL) gInstance = [[self alloc] init]; } return(gInstance); } What could I be doing to improve thi...
[ "objective-c", "design-patterns", "singleton", "object-initializers" ]
333
207
185,100
26
0
2008-09-28T03:38:53.743000
2008-12-05T08:24:30.407000
145,155
145,162
Something like Explorer's icon grid view in a Python GUI
I am making a Python gui project that needs to duplicate the look of a Windows gui environment (ie Explorer). I have my own custom icons to draw but they should be selectable by the same methods as usual; click, ctrl-click, drag box etc. Are any of the gui toolkits going to help with this or will I have to implement it...
Python has extensions for accessing the Win32 API, but good luck trying to re-write explorer in that by yourself. Your best bet is to use a toolkit like Qt, but you'll still have to write the vast majority of the application from scratch. Is there any way you can re-use explorer itself in your project? Updated for edit...
Something like Explorer's icon grid view in a Python GUI I am making a Python gui project that needs to duplicate the look of a Windows gui environment (ie Explorer). I have my own custom icons to draw but they should be selectable by the same methods as usual; click, ctrl-click, drag box etc. Are any of the gui toolki...
TITLE: Something like Explorer's icon grid view in a Python GUI QUESTION: I am making a Python gui project that needs to duplicate the look of a Windows gui environment (ie Explorer). I have my own custom icons to draw but they should be selectable by the same methods as usual; click, ctrl-click, drag box etc. Are any...
[ "python", "user-interface" ]
1
3
569
3
0
2008-09-28T03:39:35.473000
2008-09-28T03:45:09.203000
145,169
185,821
Inadvertent Session Hijacking Issue With Restful Authentication
I'm using the current version of restful_authentication that is found on github and I'm having a bunch of strange session issues. The server seems to be somehow assigning sessions to users it shouldn't be. This only happens when crossing the logged out/logged in barrier. Here's an example. With no sessions active on th...
I don't know if this is so much of an answer as it is a work around. All I did was switch over to cookie based sessions and everything is working smoothly.
Inadvertent Session Hijacking Issue With Restful Authentication I'm using the current version of restful_authentication that is found on github and I'm having a bunch of strange session issues. The server seems to be somehow assigning sessions to users it shouldn't be. This only happens when crossing the logged out/log...
TITLE: Inadvertent Session Hijacking Issue With Restful Authentication QUESTION: I'm using the current version of restful_authentication that is found on github and I'm having a bunch of strange session issues. The server seems to be somehow assigning sessions to users it shouldn't be. This only happens when crossing ...
[ "ruby-on-rails", "ruby", "rest", "restful-authentication" ]
10
2
1,273
3
0
2008-09-28T03:50:53.573000
2008-10-09T03:21:32.100000
145,175
146,251
How to invoke an interactive elisp interpreter in Emacs?
Right now I write expressions in the *scratch* buffer and test them by evaluating with C-x C-e. I would really appreciate having an interactive interpreter like SLIME or irb, in which I could test Emacs Lisp expressions.
It's easy to evaluate Lisp expressions in Inferior Emacs-Lisp Mode: M-x ielm You can read more about this feature in the Emacs manual section on "Lisp Interaction"
How to invoke an interactive elisp interpreter in Emacs? Right now I write expressions in the *scratch* buffer and test them by evaluating with C-x C-e. I would really appreciate having an interactive interpreter like SLIME or irb, in which I could test Emacs Lisp expressions.
TITLE: How to invoke an interactive elisp interpreter in Emacs? QUESTION: Right now I write expressions in the *scratch* buffer and test them by evaluating with C-x C-e. I would really appreciate having an interactive interpreter like SLIME or irb, in which I could test Emacs Lisp expressions. ANSWER: It's easy to ev...
[ "emacs", "elisp", "interpreter" ]
41
68
12,152
6
0
2008-09-28T03:59:52.290000
2008-09-28T16:59:20.793000
145,185
145,198
Best way to store tags in a sql server table?
What's the best way to store tags for a record? Just use a varchar field? What about when selecting rows that contains tag x? Use the like operator? thanks!
Depends on two things: 1) The amount of tags/tagged records 2) Whether or not you have a religious opinion on normalization:-) Unless dealing with very large volumes of data, I'd suggest having a 'Tags' table mapping varchar values to integer identifiers then second table mapping tagged records to their tag ids. I'd su...
Best way to store tags in a sql server table? What's the best way to store tags for a record? Just use a varchar field? What about when selecting rows that contains tag x? Use the like operator? thanks!
TITLE: Best way to store tags in a sql server table? QUESTION: What's the best way to store tags for a record? Just use a varchar field? What about when selecting rows that contains tag x? Use the like operator? thanks! ANSWER: Depends on two things: 1) The amount of tags/tagged records 2) Whether or not you have a r...
[ "sql-server", "tags" ]
18
16
21,369
3
0
2008-09-28T04:03:05.603000
2008-09-28T04:11:18.657000
145,190
146,427
Algorithm to estimate number of English translation words from Japanese source
I'm trying to come up with a way to estimate the number of English words a translation from Japanese will turn into. Japanese has three main scripts -- Kanji, Hiragana, and Katakana -- and each has a different average character-to-word ratio (Kanji being the lowest, Katakana the highest). Examples: computer: コンピュータ (Ka...
I would start with linear approximation: approx_english_words = a1*no_characters_in_script1 + a2 * no_chars_in_script2 + a3 * no_chars_in_script3, with the coefficients a1, a2, a3 fit from your data using linear least squares. If this doesn't approximate very well, then look at the worst cases for the reasons they don'...
Algorithm to estimate number of English translation words from Japanese source I'm trying to come up with a way to estimate the number of English words a translation from Japanese will turn into. Japanese has three main scripts -- Kanji, Hiragana, and Katakana -- and each has a different average character-to-word ratio...
TITLE: Algorithm to estimate number of English translation words from Japanese source QUESTION: I'm trying to come up with a way to estimate the number of English words a translation from Japanese will turn into. Japanese has three main scripts -- Kanji, Hiragana, and Katakana -- and each has a different average chara...
[ "algorithm", "internationalization", "translation", "text-processing" ]
4
1
6,926
7
0
2008-09-28T04:06:50.417000
2008-09-28T18:26:47.027000
145,191
145,195
Dynamic .NET language performance?
I understand that IronPython is an implementation of Python on the.NET platform just like IronRuby is an implementation of Ruby and F# is more or less OCaml. What I can't seem to grasp is whether these languages perform closer to their "ancestors" or closer to something like C# in terms of speed. For example, is IronPy...
IronPython and IronRuby are built on top of the DLR -- dynamic language runtime -- and are compiled to CIL (the bytecode used by.NET) on the fly. They're slower than C# but faaaaaaar faster than their non-.NET counterparts. There aren't any decent benchmarks out there, to my knowledge, but you'll see the difference.
Dynamic .NET language performance? I understand that IronPython is an implementation of Python on the.NET platform just like IronRuby is an implementation of Ruby and F# is more or less OCaml. What I can't seem to grasp is whether these languages perform closer to their "ancestors" or closer to something like C# in ter...
TITLE: Dynamic .NET language performance? QUESTION: I understand that IronPython is an implementation of Python on the.NET platform just like IronRuby is an implementation of Ruby and F# is more or less OCaml. What I can't seem to grasp is whether these languages perform closer to their "ancestors" or closer to someth...
[ ".net", "performance", "ironpython" ]
8
9
1,735
4
0
2008-09-28T04:06:52.880000
2008-09-28T04:10:34.323000
145,209
145,237
Mounting NTFS filesystem on CentOS 5.2
I want to mount some internal and external NTFS drives in CentOS 5.2, preferably automatically upon boot-up. Doesn't matter if it's read/write or read-only, but read/write would be preferred, if it's safe. Edit: Thanks for all answers, I summarized them below =)
To answer my own question: PostMan and mgb led me to the right path, but their answers did not contain complete solution. Note: A short manual/wiki on this question is here: http://wiki.centos.org/TipsAndTricks/NTFSPartitions So, I am using a fresh, bare install of CentOS 5.2 with latest updates. First of all, I ran th...
Mounting NTFS filesystem on CentOS 5.2 I want to mount some internal and external NTFS drives in CentOS 5.2, preferably automatically upon boot-up. Doesn't matter if it's read/write or read-only, but read/write would be preferred, if it's safe. Edit: Thanks for all answers, I summarized them below =)
TITLE: Mounting NTFS filesystem on CentOS 5.2 QUESTION: I want to mount some internal and external NTFS drives in CentOS 5.2, preferably automatically upon boot-up. Doesn't matter if it's read/write or read-only, but read/write would be preferred, if it's safe. Edit: Thanks for all answers, I summarized them below =) ...
[ "filesystems", "centos", "ntfs" ]
1
6
34,994
6
0
2008-09-28T04:23:12.733000
2008-09-28T05:03:58.390000
145,236
145,242
How do small software patches correct big software?
One thing I've always wondered about is how software patches work. A lot of software seems to just release new versions on their binaries that need to be installed over older versions, but some software (operating systems like Windows in particular) seem to be able to release very small patches that correct bugs or add...
This is usually implemented using binary diff algorithms -- diff the most recently released version against the new code. If the user's running the most recent version, you only need to apply the diff. Works particularly well against software, because compiled code is usually pretty similar between versions. Of course,...
How do small software patches correct big software? One thing I've always wondered about is how software patches work. A lot of software seems to just release new versions on their binaries that need to be installed over older versions, but some software (operating systems like Windows in particular) seem to be able to...
TITLE: How do small software patches correct big software? QUESTION: One thing I've always wondered about is how software patches work. A lot of software seems to just release new versions on their binaries that need to be installed over older versions, but some software (operating systems like Windows in particular) ...
[ "patch", "software-distribution" ]
9
14
2,043
2
0
2008-09-28T05:02:28.817000
2008-09-28T05:07:16.137000
145,241
145,388
Change the value of a text box to its current order in a sortable tab
Edit: I have solved this by myself. See my answer below I have set up a nice sortable table with jQuery and it is quite nice. But now i want to extend it. Each table row has a text box, and i want i am after is to, every time a row is dropped, the text boxes update to reflect the order of the text boxes. E.g. The text ...
Hardnrg in #jquery ended up solving it for me. It involved adding an id="" to each input: Product Order Pol Evo Kal Lok And add this js to the OnDrop event: for (var i=0; i < rows.length; i++) { $('#' + rows[i].id + "_field").val(i+1); } Easy peasy!
Change the value of a text box to its current order in a sortable tab Edit: I have solved this by myself. See my answer below I have set up a nice sortable table with jQuery and it is quite nice. But now i want to extend it. Each table row has a text box, and i want i am after is to, every time a row is dropped, the te...
TITLE: Change the value of a text box to its current order in a sortable tab QUESTION: Edit: I have solved this by myself. See my answer below I have set up a nice sortable table with jQuery and it is quite nice. But now i want to extend it. Each table row has a text box, and i want i am after is to, every time a row ...
[ "javascript", "jquery", "html" ]
2
1
1,445
2
0
2008-09-28T05:05:49.213000
2008-09-28T06:56:28.497000
145,246
145,268
Collaboration desktop sharing - Multiple Mouse
I'm using Windows Xp and i'm looking for a software where I can see the screen of a remote desktop and be able to show a second mouse (or pointer of any sort) that I can mouse to just show something. I want to work with a peer over the net, pretty much like the XP programming method. I find it useful, but it's pretty h...
You're after something like Microsoft SharedView. It allows sharing applications etc with multiple pointers.
Collaboration desktop sharing - Multiple Mouse I'm using Windows Xp and i'm looking for a software where I can see the screen of a remote desktop and be able to show a second mouse (or pointer of any sort) that I can mouse to just show something. I want to work with a peer over the net, pretty much like the XP programm...
TITLE: Collaboration desktop sharing - Multiple Mouse QUESTION: I'm using Windows Xp and i'm looking for a software where I can see the screen of a remote desktop and be able to show a second mouse (or pointer of any sort) that I can mouse to just show something. I want to work with a peer over the net, pretty much li...
[ "mouse", "remote-desktop", "collaboration" ]
1
1
1,050
2
0
2008-09-28T05:11:49.027000
2008-09-28T05:31:37.653000
145,247
145,251
Is there a free software for creating windows help files for your program?
Is there a free software for creating windows help files for your program? I would like something that allows an output of both CHM and HTML files.
Yes. HelpMaker from sourceforge (The original site www.vizacc.com is down). Best free help utility ever.
Is there a free software for creating windows help files for your program? Is there a free software for creating windows help files for your program? I would like something that allows an output of both CHM and HTML files.
TITLE: Is there a free software for creating windows help files for your program? QUESTION: Is there a free software for creating windows help files for your program? I would like something that allows an output of both CHM and HTML files. ANSWER: Yes. HelpMaker from sourceforge (The original site www.vizacc.com is d...
[ "helpfile" ]
25
14
29,767
8
0
2008-09-28T05:12:03.457000
2008-09-28T05:17:22.960000
145,263
145,318
What is "Total Functional Programming"?
Wikipedia has this to say: Total functional programming (also known as strong functional programming, to be contrasted with ordinary, or weak functional programming) is a programming paradigm which restricts the range of programs to those which are provably terminating. and These restrictions mean that total functional...
If I understood that correctly, Total Functional Programming means just that: Programming with Total Functions. If I remember my math courses correctly, a Total Function is a function which is defined over its entire domain, a Partial Function is one which has "holes" in its definition. Now, if you have a function whic...
What is "Total Functional Programming"? Wikipedia has this to say: Total functional programming (also known as strong functional programming, to be contrasted with ordinary, or weak functional programming) is a programming paradigm which restricts the range of programs to those which are provably terminating. and These...
TITLE: What is "Total Functional Programming"? QUESTION: Wikipedia has this to say: Total functional programming (also known as strong functional programming, to be contrasted with ordinary, or weak functional programming) is a programming paradigm which restricts the range of programs to those which are provably term...
[ "programming-languages", "functional-programming" ]
21
27
4,428
3
0
2008-09-28T05:27:49.910000
2008-09-28T06:10:07.483000
145,264
145,292
HTTP communication monitoring on OS X
What application do you use to monitor HTTP communication on OS X?
Charles Proxy Charles is an HTTP proxy / HTTP monitor / Reverse Proxy that enables a developer to view all of the HTTP traffic between their machine and the Internet. This includes requests, responses and the HTTP headers (which contain the cookies and caching information). Runs on JAVA. Available on OSX, Linux and Win...
HTTP communication monitoring on OS X What application do you use to monitor HTTP communication on OS X?
TITLE: HTTP communication monitoring on OS X QUESTION: What application do you use to monitor HTTP communication on OS X? ANSWER: Charles Proxy Charles is an HTTP proxy / HTTP monitor / Reverse Proxy that enables a developer to view all of the HTTP traffic between their machine and the Internet. This includes request...
[ "http", "macos", "monitoring" ]
10
7
14,713
7
0
2008-09-28T05:28:25.837000
2008-09-28T05:50:54.020000
145,270
145,436
Calling C/C++ from Python?
What would be the quickest way to construct a Python binding to a C or C++ library? (I am using Windows if this matters.)
You should have a look at Boost.Python. Here is the short introduction taken from their website: The Boost Python Library is a framework for interfacing Python and C++. It allows you to quickly and seamlessly expose C++ classes functions and objects to Python, and vice-versa, using no special tools -- just your C++ com...
Calling C/C++ from Python? What would be the quickest way to construct a Python binding to a C or C++ library? (I am using Windows if this matters.)
TITLE: Calling C/C++ from Python? QUESTION: What would be the quickest way to construct a Python binding to a C or C++ library? (I am using Windows if this matters.) ANSWER: You should have a look at Boost.Python. Here is the short introduction taken from their website: The Boost Python Library is a framework for int...
[ "c++", "python", "c" ]
607
200
555,185
12
0
2008-09-28T05:34:20.177000
2008-09-28T07:51:37.660000
145,272
212,871
Is Lambda Probe dead?
Does anyone know where to get the source code for LambdaProbe? Alternatively, does anyone know if the project could be moved to a community repository? Besides the tool not being updated for over a year, the LambdaProbe website has been down since late September 2008. Background: Lambda Probe is a useful tool for viewi...
The site still seems to be pretty dead. However, I've done some looking into available source code and release notes and here's everything I've found in regards to lambda probe. I hope it helps! Google cache search: site:www.lambdaprobe.org Release notes: http://209.85.173.104/search?q=cache:HB0527hDa5AJ:www.lambdaprob...
Is Lambda Probe dead? Does anyone know where to get the source code for LambdaProbe? Alternatively, does anyone know if the project could be moved to a community repository? Besides the tool not being updated for over a year, the LambdaProbe website has been down since late September 2008. Background: Lambda Probe is a...
TITLE: Is Lambda Probe dead? QUESTION: Does anyone know where to get the source code for LambdaProbe? Alternatively, does anyone know if the project could be moved to a community repository? Besides the tool not being updated for over a year, the LambdaProbe website has been down since late September 2008. Background:...
[ "java", "memory", "tomcat", "garbage-collection" ]
11
3
12,642
7
0
2008-09-28T05:35:25.727000
2008-10-17T16:30:10.743000
145,291
145,359
Smart home in Emacs
Can you have smart behavior for the home key in Emacs? By smart I mean that instead of going to the character number 0, it should go to the first non-blank character, and go to 0 on a second pressing, and back to the first non-blank in a third and so on. Having smart end would be nice as well.
(defun smart-beginning-of-line () "Move point to first non-whitespace character or beginning-of-line. Move point to the first non-whitespace character on this line. If point was already at that position, move point to beginning of line." (interactive "^"); Use (interactive) in Emacs 22 or older (let ((oldpos (point)))...
Smart home in Emacs Can you have smart behavior for the home key in Emacs? By smart I mean that instead of going to the character number 0, it should go to the first non-blank character, and go to 0 on a second pressing, and back to the first non-blank in a third and so on. Having smart end would be nice as well.
TITLE: Smart home in Emacs QUESTION: Can you have smart behavior for the home key in Emacs? By smart I mean that instead of going to the character number 0, it should go to the first non-blank character, and go to 0 on a second pressing, and back to the first non-blank in a third and so on. Having smart end would be n...
[ "emacs" ]
41
65
3,684
7
0
2008-09-28T05:50:36.330000
2008-09-28T06:36:27.700000
145,304
145,316
When to use thread pool in C#?
I have been trying to learn multi-threaded programming in C# and I am confused about when it is best to use a thread pool vs. create my own threads. One book recommends using a thread pool for small tasks only (whatever that means), but I can't seem to find any real guidelines. What are some pros and cons of thread poo...
If you have lots of logical tasks that require constant processing and you want that to be done in parallel use the pool+scheduler. If you need to make your IO related tasks concurrently such as downloading stuff from remote servers or disk access, but need to do this say once every few minutes, then make your own thre...
When to use thread pool in C#? I have been trying to learn multi-threaded programming in C# and I am confused about when it is best to use a thread pool vs. create my own threads. One book recommends using a thread pool for small tasks only (whatever that means), but I can't seem to find any real guidelines. What are s...
TITLE: When to use thread pool in C#? QUESTION: I have been trying to learn multi-threaded programming in C# and I am confused about when it is best to use a thread pool vs. create my own threads. One book recommends using a thread pool for small tasks only (whatever that means), but I can't seem to find any real guid...
[ "c#", "multithreading", "threadpool" ]
127
49
70,132
15
0
2008-09-28T06:00:10.627000
2008-09-28T06:09:17.423000
145,312
145,323
Maximum number of threads in a .NET app?
What is the maximum number of threads you can create in a C# application? And what happens when you reach this limit? Is an exception of some kind thrown?
There is no inherent limit. The maximum number of threads is determined by the amount of physical resources available. See this article by Raymond Chen for specifics. If you need to ask what the maximum number of threads is, you are probably doing something wrong. [ Update: Just out of interest:.NET Thread Pool default...
Maximum number of threads in a .NET app? What is the maximum number of threads you can create in a C# application? And what happens when you reach this limit? Is an exception of some kind thrown?
TITLE: Maximum number of threads in a .NET app? QUESTION: What is the maximum number of threads you can create in a C# application? And what happens when you reach this limit? Is an exception of some kind thrown? ANSWER: There is no inherent limit. The maximum number of threads is determined by the amount of physical...
[ "c#", ".net", "multithreading" ]
172
170
178,985
7
0
2008-09-28T06:05:50.740000
2008-09-28T06:13:26.167000
145,321
145,330
How to set OS X Terminal's default home?
For some reason after I installed Boot Camp, my os x terminal started to point to the Boot Camp drive instead of my os x home directory by default! Once in the terminal I know how to switch back an forth and am able to do that, but I was wondering how to make my terminal default back to my os x home folder? I've checke...
You probably want these instructions for how to use the command line: https://superuser.com/questions/154193/setting-a-users-home-directory-on-mac-os-x-server-from-the-command-line Basically, use the dscl command line tool to see what the system thinks your home directory is set to, or to try and reset it....
How to set OS X Terminal's default home? For some reason after I installed Boot Camp, my os x terminal started to point to the Boot Camp drive instead of my os x home directory by default! Once in the terminal I know how to switch back an forth and am able to do that, but I was wondering how to make my terminal default...
TITLE: How to set OS X Terminal's default home? QUESTION: For some reason after I installed Boot Camp, my os x terminal started to point to the Boot Camp drive instead of my os x home directory by default! Once in the terminal I know how to switch back an forth and am able to do that, but I was wondering how to make m...
[ "macos", "terminal", "bootcamp" ]
9
4
23,171
2
0
2008-09-28T06:12:01.083000
2008-09-28T06:18:08.790000
145,322
219,400
WebFocus - is there a free/open source alternative?
What is a good free/open source alternative to WebFOCUS? Is there an ASP.NET way of getting info from an OLAP cube? Update: I chose Magnus Smith's answer as the correct one, but Alexmac's answer was also very good!
Watch out, MDX is horrible - nothing like SQL even though it looks like it is. You can get a.NET control to show OLAP data on a web page. Our company tested one from Dundas that was OK. I never got involved though so I don't know if it was brilliant or merely serviceable. http://www.dundas.com/Gallery/Chart/NET/index.a...
WebFocus - is there a free/open source alternative? What is a good free/open source alternative to WebFOCUS? Is there an ASP.NET way of getting info from an OLAP cube? Update: I chose Magnus Smith's answer as the correct one, but Alexmac's answer was also very good!
TITLE: WebFocus - is there a free/open source alternative? QUESTION: What is a good free/open source alternative to WebFOCUS? Is there an ASP.NET way of getting info from an OLAP cube? Update: I chose Magnus Smith's answer as the correct one, but Alexmac's answer was also very good! ANSWER: Watch out, MDX is horrible...
[ "asp.net", "olap" ]
0
1
1,870
2
0
2008-09-28T06:13:00.643000
2008-10-20T18:31:48.530000
145,335
145,444
How do I brighten the colors in the rxvt family of terminals?
I know how to lighten the colors for certain commands, however I'd like to lighten the standard ansi colors across all commands.
I found instructions for doing it for Xterm and aterm here: http://gentoo-wiki.com/TIP_Linux_Colors_in_Aterm/rxvt From those I was able to get brighter colors by adding: rxvt*background: #000000 rxvt*foreground: #7f7f7f rxvt*color0: #000000 rxvt*color1: #9e1828 rxvt*color2: #aece92 rxvt*color3: #968a38 rxvt*color4: #41...
How do I brighten the colors in the rxvt family of terminals? I know how to lighten the colors for certain commands, however I'd like to lighten the standard ansi colors across all commands.
TITLE: How do I brighten the colors in the rxvt family of terminals? QUESTION: I know how to lighten the colors for certain commands, however I'd like to lighten the standard ansi colors across all commands. ANSWER: I found instructions for doing it for Xterm and aterm here: http://gentoo-wiki.com/TIP_Linux_Colors_in...
[ "terminal", "colors", "rxvt" ]
0
6
2,936
2
0
2008-09-28T06:22:30.217000
2008-09-28T08:00:05.537000
145,337
145,348
Checking if array is multidimensional or not?
What is the most efficient way to check if an array is a flat array of primitive values or if it is a multidimensional array? Is there any way to do this without actually looping through an array and running is_array() on each of its elements?
The short answer is no you can't do it without at least looping implicitly if the 'second dimension' could be anywhere. If it has to be in the first item, you'd just do is_array($arr[0]); But, the most efficient general way I could find is to use a foreach loop on the array, shortcircuiting whenever a hit is found (at ...
Checking if array is multidimensional or not? What is the most efficient way to check if an array is a flat array of primitive values or if it is a multidimensional array? Is there any way to do this without actually looping through an array and running is_array() on each of its elements?
TITLE: Checking if array is multidimensional or not? QUESTION: What is the most efficient way to check if an array is a flat array of primitive values or if it is a multidimensional array? Is there any way to do this without actually looping through an array and running is_array() on each of its elements? ANSWER: The...
[ "php", "arrays", "loops", "multidimensional-array", "element" ]
165
152
130,168
16
0
2008-09-28T06:23:12.897000
2008-09-28T06:29:31.087000
145,361
145,365
Debugging SharePoint 2007 Code
How do you debug your SharePoint 2007 code? Since SharePoint runs on a remote server, and I'm developing on a windows xp machine (with the necessary.dll files copied into my GAC), I haven't had much luck with finding easy ways to debug. Breakpoints don't work, etc. The best way I've come up with is to enable page traci...
From Andrew Connell's blog post on the subject: Attaching the debugger to GAC'd assemblies: "Why aren't my breakpoints being hit?!?!" Ever been there? Me too... what a PITA that is! What's going on? Well, the assemblies are in the GAC and the Visual Studio debugger can't see the debugging symbols (aka: *.pdb). Unless y...
Debugging SharePoint 2007 Code How do you debug your SharePoint 2007 code? Since SharePoint runs on a remote server, and I'm developing on a windows xp machine (with the necessary.dll files copied into my GAC), I haven't had much luck with finding easy ways to debug. Breakpoints don't work, etc. The best way I've come ...
TITLE: Debugging SharePoint 2007 Code QUESTION: How do you debug your SharePoint 2007 code? Since SharePoint runs on a remote server, and I'm developing on a windows xp machine (with the necessary.dll files copied into my GAC), I haven't had much luck with finding easy ways to debug. Breakpoints don't work, etc. The b...
[ "sharepoint", "debugging", "moss" ]
5
3
2,773
5
0
2008-09-28T06:38:45.963000
2008-09-28T06:42:46.143000
145,371
145,372
What's the default intellisense shortcut in vs2008?
I'd like to open the intelligence window without typing a character and then backspacing it. I can't seem to remember the shortcut for this. What is it?
Ctrl + Space? Also, go to Tools -> Options -> Environment -> Keyboard or Default Keyboard Shortcuts in Visual Studio, you can then search for commands and see what is assigned to that (and remap).
What's the default intellisense shortcut in vs2008? I'd like to open the intelligence window without typing a character and then backspacing it. I can't seem to remember the shortcut for this. What is it?
TITLE: What's the default intellisense shortcut in vs2008? QUESTION: I'd like to open the intelligence window without typing a character and then backspacing it. I can't seem to remember the shortcut for this. What is it? ANSWER: Ctrl + Space? Also, go to Tools -> Options -> Environment -> Keyboard or Default Keyboar...
[ "c#", "visual-studio", "visual-studio-2008", "keyboard-shortcuts" ]
15
15
6,873
4
0
2008-09-28T06:46:57.350000
2008-09-28T06:47:30.560000
145,376
145,428
PHP's SPL: Do its interfaces involving arrays cover all array properties?
Would it be possible to write a class that is virtually indistinguishable from an actual PHP array by implementing all the necessary SPL interfaces? Are they missing anything that would be critical? I'd like to build a more advanced Array object, but I want to make sure I wouldn't break an existing app that uses arrays...
The only problems i can think of are the gettype() and the is_array() functions. Check your code for gettype($FakeArray) == 'array' is_array($FakeArray) Because although you can use the object just like an array, it will still be identified as an object.
PHP's SPL: Do its interfaces involving arrays cover all array properties? Would it be possible to write a class that is virtually indistinguishable from an actual PHP array by implementing all the necessary SPL interfaces? Are they missing anything that would be critical? I'd like to build a more advanced Array object,...
TITLE: PHP's SPL: Do its interfaces involving arrays cover all array properties? QUESTION: Would it be possible to write a class that is virtually indistinguishable from an actual PHP array by implementing all the necessary SPL interfaces? Are they missing anything that would be critical? I'd like to build a more adva...
[ "php", "arrays", "spl" ]
6
7
616
3
0
2008-09-28T06:49:12.960000
2008-09-28T07:38:55.010000
145,383
145,404
How do I connect & administer an SQL Server database remotely over the Internet?
How do I connect to an SQL Server remotely and administer my database objects? I need to connect to my database located on the web hosting company's server. I have the server name, IP address, my database username & password. I have an installation of SQL Server 2000 in my machine. Can I use SQL Server Enterprise Manag...
Yes, you can use Enterprise Manager (or SQL Server Management Studio, even if it's an Express version) to connect to any SQL Server (of the same or lower version as the tool you're using) you have TCP/IP connectivity to. Just launch it, enter the DNS host name or IP address in the 'Server Name' box and hit Connect. Two...
How do I connect & administer an SQL Server database remotely over the Internet? How do I connect to an SQL Server remotely and administer my database objects? I need to connect to my database located on the web hosting company's server. I have the server name, IP address, my database username & password. I have an ins...
TITLE: How do I connect & administer an SQL Server database remotely over the Internet? QUESTION: How do I connect to an SQL Server remotely and administer my database objects? I need to connect to my database located on the web hosting company's server. I have the server name, IP address, my database username & passw...
[ "sql-server", "database-connectivity", "remote-administration" ]
5
9
44,329
3
0
2008-09-28T06:53:03.917000
2008-09-28T07:10:10.710000
145,389
284,915
for-loop mechanism efficiency tips
As I am using for-loops on large multi-dim arrays, any saving on the for-loop mechanism itself is meaningful. Accordingly, I am looking for any tips on how to reduce this overhead. e.g.: counting down using uint instead of int and!= 0 as stop instead of >0 allows the CPU to do less work (heard it once, not sure it is a...
First, don't sweat the small stuff. Details like counting up versus counting down are usually completely irrelevant in running time. Humans are notoriously bad at spotting areas in code that need to be sped up. Use a profiler. Pay little or no attention to any part of the loop that is not repeated, unless the profiler ...
for-loop mechanism efficiency tips As I am using for-loops on large multi-dim arrays, any saving on the for-loop mechanism itself is meaningful. Accordingly, I am looking for any tips on how to reduce this overhead. e.g.: counting down using uint instead of int and!= 0 as stop instead of >0 allows the CPU to do less wo...
TITLE: for-loop mechanism efficiency tips QUESTION: As I am using for-loops on large multi-dim arrays, any saving on the for-loop mechanism itself is meaningful. Accordingly, I am looking for any tips on how to reduce this overhead. e.g.: counting down using uint instead of int and!= 0 as stop instead of >0 allows the...
[ "language-agnostic" ]
5
4
2,138
13
0
2008-09-28T07:00:21.873000
2008-11-12T18:43:56.160000
145,400
145,422
How do I dictate the destination folder of a clickOnce application?
How do I dictate the destination folder of a clickOnce application?
This is not possible with ClickOnce. ClickOnce applications are always installed in the Apps subdirectory of local application data.
How do I dictate the destination folder of a clickOnce application? How do I dictate the destination folder of a clickOnce application?
TITLE: How do I dictate the destination folder of a clickOnce application? QUESTION: How do I dictate the destination folder of a clickOnce application? ANSWER: This is not possible with ClickOnce. ClickOnce applications are always installed in the Apps subdirectory of local application data.
[ "c#", "deployment", "installation", "clickonce" ]
9
12
7,280
3
0
2008-09-28T07:07:28.953000
2008-09-28T07:29:39.773000