PostId
int64 4
11.8M
| PostCreationDate
stringlengths 19
19
| OwnerUserId
int64 1
1.57M
| OwnerCreationDate
stringlengths 10
19
| ReputationAtPostCreation
int64 -55
461k
| OwnerUndeletedAnswerCountAtPostTime
int64 0
21.5k
| Title
stringlengths 3
250
| BodyMarkdown
stringlengths 5
30k
⌀ | Tag1
stringlengths 1
25
⌀ | Tag2
stringlengths 1
25
⌀ | Tag3
stringlengths 1
25
⌀ | Tag4
stringlengths 1
25
⌀ | Tag5
stringlengths 1
25
⌀ | PostClosedDate
stringlengths 19
19
⌀ | OpenStatus
stringclasses 5
values | unified_texts
stringlengths 32
30.1k
| OpenStatus_id
int64 0
4
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9,877 | 08/13/2008 14:22:20 | 572 | 08/06/2008 20:56:54 | 197 | 20 | Personal Website Construction | I'm currently trying to build a personal website to create a presence on the web for myself. My plan is to include content such as my resume, any projects that I have done on my own and links to open source projects that I have contributed to, and so on. However, I'm not sure which approach would be better from a perspective of "advertising" myself, since that what this site does, especially since I am a software developer.
Should I use an out-of-the-box system and extend it as needed, with available modules and custom modules where needed or should I custom build a site and all of its features as I need them? Does a custom site look better in the eyes of a potential employer who might visit my site? | website | content-management-system | personal-website | null | null | null | open | Personal Website Construction
===
I'm currently trying to build a personal website to create a presence on the web for myself. My plan is to include content such as my resume, any projects that I have done on my own and links to open source projects that I have contributed to, and so on. However, I'm not sure which approach would be better from a perspective of "advertising" myself, since that what this site does, especially since I am a software developer.
Should I use an out-of-the-box system and extend it as needed, with available modules and custom modules where needed or should I custom build a site and all of its features as I need them? Does a custom site look better in the eyes of a potential employer who might visit my site? | 0 |
9,905 | 08/13/2008 14:42:52 | 1,185 | 08/13/2008 12:02:03 | 21 | 4 | Check for hung Office process when using Office Automation | Is there a way to check to see if an Microsoft Office process (i.e. Word, Excel) has hung when using Office Automation? Additionally, if the process is hung, is there a way to terminate it? | microsoftoffice | office | automation | null | null | null | open | Check for hung Office process when using Office Automation
===
Is there a way to check to see if an Microsoft Office process (i.e. Word, Excel) has hung when using Office Automation? Additionally, if the process is hung, is there a way to terminate it? | 0 |
9,908 | 08/13/2008 14:44:17 | 1,116 | 08/12/2008 13:25:41 | 16 | 3 | Software for managing multiple projects. | Does anybody have any recommendations on software to use for managing resources on multiple projects?
I work in an internal development department and the team typically has 3 or 4 projects that are live at one time as well as day to day support and ad-hoc requests. I currently schedule them using MS Project but this seems to be designed to manage 1 project at a time. This doesn't seem to suit my needs.
All I want is :
when I get a new request is to be able to schedule it in and * assign a developer to it. * see what I have achieved in a month and what is outstanding
| language-agnostic | project-management | null | null | null | null | open | Software for managing multiple projects.
===
Does anybody have any recommendations on software to use for managing resources on multiple projects?
I work in an internal development department and the team typically has 3 or 4 projects that are live at one time as well as day to day support and ad-hoc requests. I currently schedule them using MS Project but this seems to be designed to manage 1 project at a time. This doesn't seem to suit my needs.
All I want is :
when I get a new request is to be able to schedule it in and * assign a developer to it. * see what I have achieved in a month and what is outstanding
| 0 |
9,913 | 08/13/2008 14:51:00 | 1,161 | 08/13/2008 02:27:48 | 1 | 0 | Java File IO Compendium | I've worked in and around Java for nigh on a decade, but have managed to ever avoid doing serious work with files. Mostly I've written database driven applications, but occasionally, even those require some file io. Since I do it so rarely, I end up googling around for quite some time to figure out the exact incantation that Java requires to read a file into a byte[], char[], String or whatever I need at the time.
For a 'once and for all' list, I'd like to see all of the usual ways to get data from a file into Java, or vice versa. There will be a fair bit of overlap, but the point is to define all of the subtle different variants that are out there.
For example:
1. Read/Write a text file from/to a single String.
2. Read a text file line by line.
3. Read/Write a binary file from/to a single byte[].
4. Read a binary file into a byte[] of size x, one chunk at a time.
The goal is to show concise ways to do each of these. Feel free to suggest more IO tasks that are somewhat common and I have neglected to mention. | java | file-io | null | null | null | null | open | Java File IO Compendium
===
I've worked in and around Java for nigh on a decade, but have managed to ever avoid doing serious work with files. Mostly I've written database driven applications, but occasionally, even those require some file io. Since I do it so rarely, I end up googling around for quite some time to figure out the exact incantation that Java requires to read a file into a byte[], char[], String or whatever I need at the time.
For a 'once and for all' list, I'd like to see all of the usual ways to get data from a file into Java, or vice versa. There will be a fair bit of overlap, but the point is to define all of the subtle different variants that are out there.
For example:
1. Read/Write a text file from/to a single String.
2. Read a text file line by line.
3. Read/Write a binary file from/to a single byte[].
4. Read a binary file into a byte[] of size x, one chunk at a time.
The goal is to show concise ways to do each of these. Feel free to suggest more IO tasks that are somewhat common and I have neglected to mention. | 0 |
9,932 | 08/13/2008 15:16:50 | 1,217 | 08/13/2008 13:40:01 | 1 | 0 | What is a good way to open large files across a WAN? | I have an application deployed into multiple zones and there are some issues with opening larger documents (20-50MB) across the WAN.
Currently the documents are stored in Zone 1 (Americas) and a link stored in the database to the docs.
I have heard some things about blobs in oracle and store binary in sql server 2005. And then perhaps copying the database to other zones.
Any other suggestions or good results with one of the described options? | sql-server | database | bestpractices | oracle | null | null | open | What is a good way to open large files across a WAN?
===
I have an application deployed into multiple zones and there are some issues with opening larger documents (20-50MB) across the WAN.
Currently the documents are stored in Zone 1 (Americas) and a link stored in the database to the docs.
I have heard some things about blobs in oracle and store binary in sql server 2005. And then perhaps copying the database to other zones.
Any other suggestions or good results with one of the described options? | 0 |
9,938 | 08/13/2008 15:22:47 | 263 | 08/04/2008 09:56:55 | 19 | 3 | Generic iterator | I am trying to find a generic way of accessing a set of containers. I have a standard vector and list in addition to another custom list.
The custom list defines an iterator;
class Iterator: public std::iterator<std::forward_iterator_tag, T> {
// ...
}
Iterator begin() {
return (Iterator(root));
}
Iterator end() {
return (Iterator(NULL));
}
with the appropriate operators overloaded.
Ideally, I would like to do this;
class Foo {
public:
Foo() {
std::list<int> x;
std::vector<int> y;
custom_list<int> z;
iter = x.begin(); // OR
iter = y.begin(); // OR
iter = z.begin();
// ...
};
private:
std::iterator<int> iter;
};
But obviously these are all iterators of different types. I can assume all the containers are of the same type however.
Is there an elegant way to solve this problem? | c++ | generics | iteration | containers | null | null | open | Generic iterator
===
I am trying to find a generic way of accessing a set of containers. I have a standard vector and list in addition to another custom list.
The custom list defines an iterator;
class Iterator: public std::iterator<std::forward_iterator_tag, T> {
// ...
}
Iterator begin() {
return (Iterator(root));
}
Iterator end() {
return (Iterator(NULL));
}
with the appropriate operators overloaded.
Ideally, I would like to do this;
class Foo {
public:
Foo() {
std::list<int> x;
std::vector<int> y;
custom_list<int> z;
iter = x.begin(); // OR
iter = y.begin(); // OR
iter = z.begin();
// ...
};
private:
std::iterator<int> iter;
};
But obviously these are all iterators of different types. I can assume all the containers are of the same type however.
Is there an elegant way to solve this problem? | 0 |
9,617,451 | 03/08/2012 12:11:21 | 691,226 | 04/04/2011 13:59:13 | 387 | 3 | Handle or not to handle null parameters with exceptions | I remember reading some exception handling guidance that checking for null parameters was discouraged. The justification for this was, that if you left the code as is, an exception would be raised (NullReferenceExcpetion) when you attempted to use the parameter. The alternative is explicitly checking for null and throwing an ArgumentNullException.
This gives the same effect but you're right extra lines of code. You wouldn't ever write code to handle either exception and thus you'd really encounter these at runtime when testing and then fix the code to stop the exceptions from happening in the first place.
I'm not saying I agree with the guidance but it did make sense when I first read it and still makes sense now.
I generally check for null parameters on non-private methods only but leave private methods to throw a NullReferenceException.
Does anyone know if there is any definitive/de facto best guidance practice on this so I can update my approach if needed? | c# | exception | parameters | null | null | null | open | Handle or not to handle null parameters with exceptions
===
I remember reading some exception handling guidance that checking for null parameters was discouraged. The justification for this was, that if you left the code as is, an exception would be raised (NullReferenceExcpetion) when you attempted to use the parameter. The alternative is explicitly checking for null and throwing an ArgumentNullException.
This gives the same effect but you're right extra lines of code. You wouldn't ever write code to handle either exception and thus you'd really encounter these at runtime when testing and then fix the code to stop the exceptions from happening in the first place.
I'm not saying I agree with the guidance but it did make sense when I first read it and still makes sense now.
I generally check for null parameters on non-private methods only but leave private methods to throw a NullReferenceException.
Does anyone know if there is any definitive/de facto best guidance practice on this so I can update my approach if needed? | 0 |
9,617,453 | 03/08/2012 12:11:27 | 1,113,356 | 12/23/2011 11:45:52 | 1 | 0 | SQL MIN Function with where clause | This is my Project Table
Project Table
JNo Name City
J1 Proj1 London
J2 Proj2 Paris
J3 Proj3 Athens
J4 Proj4 India
And this is my shipment table
Shipment
SNo PNo JNo Qty
S1 P1 J1 50
S1 P1 J2 90
S1 P2 J1 40
S1 P3 J3 20
S2 P1 J3 110
S2 P2 J2 30
S2 P4 J3 10
S2 P3 J1 100
S3 P1 J3 80
S3 P4 J2 70
S3 P4 J2 70
S4 P1 J3 20
S4 P2 J1 60
I want to name of the project having minimum quantity supplied.
I tried. But its return only minimum qty value
this is my code
select min(qty) from shipment where jno IN(select jno from project)
| mysql | sql | phpmyadmin | null | null | null | open | SQL MIN Function with where clause
===
This is my Project Table
Project Table
JNo Name City
J1 Proj1 London
J2 Proj2 Paris
J3 Proj3 Athens
J4 Proj4 India
And this is my shipment table
Shipment
SNo PNo JNo Qty
S1 P1 J1 50
S1 P1 J2 90
S1 P2 J1 40
S1 P3 J3 20
S2 P1 J3 110
S2 P2 J2 30
S2 P4 J3 10
S2 P3 J1 100
S3 P1 J3 80
S3 P4 J2 70
S3 P4 J2 70
S4 P1 J3 20
S4 P2 J1 60
I want to name of the project having minimum quantity supplied.
I tried. But its return only minimum qty value
this is my code
select min(qty) from shipment where jno IN(select jno from project)
| 0 |
9,617,454 | 03/08/2012 12:11:28 | 726,954 | 04/27/2011 09:48:13 | 2,159 | 111 | Caching Bitmaps for use in ListView - Checking current VM Budget | I'm wondering if anyone has any experience in an architecture designed to cache "As many images as possible".
In my situation I receive an Bitmap for a ListView item via the network (Which isn't cheap in terms of processor or network traffic). The user will likely load a few items into the list and then juggle between a "detailed" view of each item. In this situation the following code makes sense, the ***second*** load of a "detailed" view of an item will results in an instant loading of the bitmap:
private Bitmap bitmap = null;
public Bitmap getBitmap(int id) {
if(bitmap == null) bitmap = expensiveNetworkOperationToGetBitmap(id);
return bitmap;
}
(please ignore thread blocking concerns)
However, it's perfectly possible the user will make life difficult and look through many items. Each one slowly taking up a slice of memory, eventually going over budget and crashing the app.
Without knowing the likely behaviour of a user who is making life difficult, is it possible to "Cache until memory is getting scarce" and then start destroying the old images as you add new ones? See below for sample code:
private HashMap<Integer, Bitmap> bitmaps = new HashMap<Integer, Bitmap>();
public Bitmap getBitmap(int id) {
Bitmap bitmap;
if(!bitmaps.contains(id)) {
if(// Bitmap budget close to being exeeded?) {
bitmaps.keyValues().get(0).recycle();
bitmaps.remove(bitmaps.keyValues().get(0));
}
bitmap = expensiveNetworkOperationToGetBitmap(id);
bitmaps.put(id, bitmap);
else {
bitmap = bitmaps.get(id);
}
return bitmap;
}
(Once more, please ignore concerns for the inefficency of popping the first Bitmap from the HashMap.)
So, is it possible to check the current VM budget available and is the above method safe?
*NB. There are a lot of questions regarding the vague "Caching Bitmap's In Android", They usually stem from using Bitmaps in ListViews and "Exceeding VM Budget" errors. Invariably these are answered by people saying "Load less / smaller bitmaps" or "Use lazy loading". I'm hoping for a more complex and complete solution to this problem.* | android | caching | architecture | bitmap | outofmemoryexception | null | open | Caching Bitmaps for use in ListView - Checking current VM Budget
===
I'm wondering if anyone has any experience in an architecture designed to cache "As many images as possible".
In my situation I receive an Bitmap for a ListView item via the network (Which isn't cheap in terms of processor or network traffic). The user will likely load a few items into the list and then juggle between a "detailed" view of each item. In this situation the following code makes sense, the ***second*** load of a "detailed" view of an item will results in an instant loading of the bitmap:
private Bitmap bitmap = null;
public Bitmap getBitmap(int id) {
if(bitmap == null) bitmap = expensiveNetworkOperationToGetBitmap(id);
return bitmap;
}
(please ignore thread blocking concerns)
However, it's perfectly possible the user will make life difficult and look through many items. Each one slowly taking up a slice of memory, eventually going over budget and crashing the app.
Without knowing the likely behaviour of a user who is making life difficult, is it possible to "Cache until memory is getting scarce" and then start destroying the old images as you add new ones? See below for sample code:
private HashMap<Integer, Bitmap> bitmaps = new HashMap<Integer, Bitmap>();
public Bitmap getBitmap(int id) {
Bitmap bitmap;
if(!bitmaps.contains(id)) {
if(// Bitmap budget close to being exeeded?) {
bitmaps.keyValues().get(0).recycle();
bitmaps.remove(bitmaps.keyValues().get(0));
}
bitmap = expensiveNetworkOperationToGetBitmap(id);
bitmaps.put(id, bitmap);
else {
bitmap = bitmaps.get(id);
}
return bitmap;
}
(Once more, please ignore concerns for the inefficency of popping the first Bitmap from the HashMap.)
So, is it possible to check the current VM budget available and is the above method safe?
*NB. There are a lot of questions regarding the vague "Caching Bitmap's In Android", They usually stem from using Bitmaps in ListViews and "Exceeding VM Budget" errors. Invariably these are answered by people saying "Load less / smaller bitmaps" or "Use lazy loading". I'm hoping for a more complex and complete solution to this problem.* | 0 |
9,617,457 | 03/08/2012 12:11:29 | 1,066,357 | 11/25/2011 23:17:41 | 20 | 0 | Multiple files as arguments to make. Is my approach ok? | I'm trying to create a universal makefile for my lab problems. There are five tasks, and each one requires separate C file compiled and ran. As I have to include some additional libraries while using gcc I'd like to just type `make ZAD=first second` and have first.c and second.c compiled. The problem is I don't know how to iterate properly through the `ZAD` list in the makefile. I can separate the tasks in `for` loop, but I can't force a newline char in this loop. This example will explain better (the following is my makefile):
ZAD = first second
main: $(foreach dir, $(ZAD), $(dir).o)
$(foreach dir, $(ZAD), gcc $(dir).o -lgsl -lgslcblas -lm -o $(dir))
$(foreach dir, $(ZAD), rm $(dir).o)
first.o: first.c
gcc -Wall -c first.c
second.o: second.c
gcc -Wall -c second.c
Here's what I get when for instance I try to compile solely second.c:
wojtasskorcz@wojtek-laptop:~/mownit/lab1dom$ make ZAD=second
gcc -Wall -c second.c
gcc second.o -lgsl -lgslcblas -lm -o second
rm second.o
And everything's fine, but when i try to compile first.c and second.c at one go here's what happens:
wojtasskorcz@wojtek-laptop:~/mownit/lab1dom$ make ZAD='first second'
gcc first.o -lgsl -lgslcblas -lm -o first gcc second.o -lgsl -lgslcblas -lm -o second
gcc: error: gcc: No such file or directory
make: *** [main] Error 1
I came to the conclusion, that it's because in the second `foreach` in makefile there's no newline character. But I don't have a clue how to insert it there. Or maybe there's another approach to this problem?
| unix | gcc | makefile | make | null | null | open | Multiple files as arguments to make. Is my approach ok?
===
I'm trying to create a universal makefile for my lab problems. There are five tasks, and each one requires separate C file compiled and ran. As I have to include some additional libraries while using gcc I'd like to just type `make ZAD=first second` and have first.c and second.c compiled. The problem is I don't know how to iterate properly through the `ZAD` list in the makefile. I can separate the tasks in `for` loop, but I can't force a newline char in this loop. This example will explain better (the following is my makefile):
ZAD = first second
main: $(foreach dir, $(ZAD), $(dir).o)
$(foreach dir, $(ZAD), gcc $(dir).o -lgsl -lgslcblas -lm -o $(dir))
$(foreach dir, $(ZAD), rm $(dir).o)
first.o: first.c
gcc -Wall -c first.c
second.o: second.c
gcc -Wall -c second.c
Here's what I get when for instance I try to compile solely second.c:
wojtasskorcz@wojtek-laptop:~/mownit/lab1dom$ make ZAD=second
gcc -Wall -c second.c
gcc second.o -lgsl -lgslcblas -lm -o second
rm second.o
And everything's fine, but when i try to compile first.c and second.c at one go here's what happens:
wojtasskorcz@wojtek-laptop:~/mownit/lab1dom$ make ZAD='first second'
gcc first.o -lgsl -lgslcblas -lm -o first gcc second.o -lgsl -lgslcblas -lm -o second
gcc: error: gcc: No such file or directory
make: *** [main] Error 1
I came to the conclusion, that it's because in the second `foreach` in makefile there's no newline character. But I don't have a clue how to insert it there. Or maybe there's another approach to this problem?
| 0 |
9,614,819 | 03/08/2012 08:37:13 | 84,325 | 03/29/2009 18:16:33 | 1,403 | 6 | About the diagrams in software development life-cycle | 1. why we need diagrams(UML,ER) in software development life-cycle?
2. what the benefit?
2. Is there any alternative mothod ? | database-design | uml | software-engineering | er | null | 03/08/2012 16:15:42 | not constructive | About the diagrams in software development life-cycle
===
1. why we need diagrams(UML,ER) in software development life-cycle?
2. what the benefit?
2. Is there any alternative mothod ? | 4 |
9,617,464 | 03/08/2012 12:11:59 | 456,105 | 09/23/2010 11:38:27 | 3 | 0 | should core data code must be embedded into viewController code | I'm now developing an app with core data on iPhone. After reading many projects about core data, I find that core data code is embedded into viewController code in all of there projects. for example:
@interface MyAppMasterViewController : UITableViewController <NSFetchedResultsControllerDelegate>
@property (strong, nonatomic) MyAppDetailViewController *detailViewController;
@property (strong, nonatomic) NSFetchedResultsController *fetchedResultsController;
@property (strong, nonatomic) NSManagedObjectContext *managedObjectContext;
I want to split all code about core data from viewController, and create a special storage class. what's more, provide some method to package core data api, for example:
@interface MyAppMasterViewController : UITableViewController
...
...
@interface MyAppStorageClass : NSObject <NSFetchedResultsControllerDelegate>
@property (strong, nonatomic) NSFetchedResultsController *fetchedResultsController;
@property (strong, nonatomic) NSManagedObjectContext *managedObjectContext;
(Note *)createNote;
(BOOL)deleteNote;
I think, if one day, I don't want to use core data to store my project, I can replace it with low cost.
All above, is that right? and can I do this? | objective-c | core-data | null | null | null | null | open | should core data code must be embedded into viewController code
===
I'm now developing an app with core data on iPhone. After reading many projects about core data, I find that core data code is embedded into viewController code in all of there projects. for example:
@interface MyAppMasterViewController : UITableViewController <NSFetchedResultsControllerDelegate>
@property (strong, nonatomic) MyAppDetailViewController *detailViewController;
@property (strong, nonatomic) NSFetchedResultsController *fetchedResultsController;
@property (strong, nonatomic) NSManagedObjectContext *managedObjectContext;
I want to split all code about core data from viewController, and create a special storage class. what's more, provide some method to package core data api, for example:
@interface MyAppMasterViewController : UITableViewController
...
...
@interface MyAppStorageClass : NSObject <NSFetchedResultsControllerDelegate>
@property (strong, nonatomic) NSFetchedResultsController *fetchedResultsController;
@property (strong, nonatomic) NSManagedObjectContext *managedObjectContext;
(Note *)createNote;
(BOOL)deleteNote;
I think, if one day, I don't want to use core data to store my project, I can replace it with low cost.
All above, is that right? and can I do this? | 0 |
9,617,469 | 03/08/2012 12:12:33 | 934,846 | 09/08/2011 13:05:14 | 145 | 5 | How to create a proper 503 Maintenance page in MVC? | I want to create a proper maintenance page for my site in MVC. I want it to return status code 503 so google will come back to index it later.
So far, i've created an ActionFilter that checks to see if "MaintenanceMode" is TRUE in the web.config. If it is (and we're not already going to the maintenance page), it does a simple redirect to ~/Maintenance/. Can I do something so 503 is returned during all of this, or is that not possible?
Just to add, I have a secret query string parameter that you can type in and it creates a cookie for 40 minutes that bypasses the maintenance screen. Just mentioning it in case you are wondering why I have this screen to begin with... | mvc | seo | null | null | null | null | open | How to create a proper 503 Maintenance page in MVC?
===
I want to create a proper maintenance page for my site in MVC. I want it to return status code 503 so google will come back to index it later.
So far, i've created an ActionFilter that checks to see if "MaintenanceMode" is TRUE in the web.config. If it is (and we're not already going to the maintenance page), it does a simple redirect to ~/Maintenance/. Can I do something so 503 is returned during all of this, or is that not possible?
Just to add, I have a secret query string parameter that you can type in and it creates a cookie for 40 minutes that bypasses the maintenance screen. Just mentioning it in case you are wondering why I have this screen to begin with... | 0 |
9,974 | 08/13/2008 15:49:41 | 1,219 | 08/13/2008 13:44:47 | 1 | 4 | Query times out from web app but runs fine from management studio | This is a question I asked on another forum which received some decent answers, but I wanted to see if anyone here has more insight.
The problem is that you have one of your pages in a web application timing out when it gets to a stored procedure call, so you use Sql Profiler, or your application trace logs, to find the query and you paste it into management studio to figure our why it's running slow. But you run it from there and it just blazes along, returning in less than a second each time.
My particular case was using ASP.NET 2.0 and Sql Server 2005, but I think the problem could apply to any RDBMS system. | sql | mssql | null | null | null | null | open | Query times out from web app but runs fine from management studio
===
This is a question I asked on another forum which received some decent answers, but I wanted to see if anyone here has more insight.
The problem is that you have one of your pages in a web application timing out when it gets to a stored procedure call, so you use Sql Profiler, or your application trace logs, to find the query and you paste it into management studio to figure our why it's running slow. But you run it from there and it just blazes along, returning in less than a second each time.
My particular case was using ASP.NET 2.0 and Sql Server 2005, but I think the problem could apply to any RDBMS system. | 0 |
9,977 | 08/13/2008 15:50:56 | 1,226 | 08/13/2008 13:55:55 | 11 | 3 | What do you look for from a User Group? | I'm in the process of starting a User Group in my area related to .NET development. The format of the community will be the average free food, presentation, and then maybe free swag giveaway.
What would you, as a member of a user community, look for in order to keep you coming back month to month? | .net | user | community | groups | null | null | open | What do you look for from a User Group?
===
I'm in the process of starting a User Group in my area related to .NET development. The format of the community will be the average free food, presentation, and then maybe free swag giveaway.
What would you, as a member of a user community, look for in order to keep you coming back month to month? | 0 |
10,006 | 08/13/2008 16:08:43 | 313 | 08/04/2008 15:05:26 | 66 | 5 | What is the easiest way to add compression to WCF? | I have a silverlight 2 beta 2 application that accesses a WCF web service. Because of this, it currently can only use basicHttp binding. The webservice will return fairly large amounts of XML data. This seems fairly wasteful from a bandwidth usage standpoint as the response, if zipped, would be smaller by a factor of 5 (I actually pasted the response into a txt file and zipped it.).
The request does have the "Accept-Encoding: gzip, deflate" - Is there any way have the WCF service gzip (or otherwise compress) the response?
| silverlight | wcf | silverlight2beta2 | null | null | null | open | What is the easiest way to add compression to WCF?
===
I have a silverlight 2 beta 2 application that accesses a WCF web service. Because of this, it currently can only use basicHttp binding. The webservice will return fairly large amounts of XML data. This seems fairly wasteful from a bandwidth usage standpoint as the response, if zipped, would be smaller by a factor of 5 (I actually pasted the response into a txt file and zipped it.).
The request does have the "Accept-Encoding: gzip, deflate" - Is there any way have the WCF service gzip (or otherwise compress) the response?
| 0 |
10,038 | 08/13/2008 16:26:10 | 1,384,652 | 08/01/2008 12:01:23 | 875 | 58 | Animation in javascript, a starting point | I understand how JS is run and I think I understand most of the DOM but I've no idea about animation. Does anybody here know of a good guide that can explain to me how it's done in Javascript?
In addition, should I even consider Javascript for animation? Should I instead be looking to learn flash? | javascript | animation | null | null | null | null | open | Animation in javascript, a starting point
===
I understand how JS is run and I think I understand most of the DOM but I've no idea about animation. Does anybody here know of a good guide that can explain to me how it's done in Javascript?
In addition, should I even consider Javascript for animation? Should I instead be looking to learn flash? | 0 |
10,042 | 08/13/2008 16:29:22 | 571 | 08/06/2008 20:19:59 | 533 | 43 | How do I implement a Linked List in Java? | So I got this as a homework question, and I was wondering if you pros could do it for me.
KTHXBYE! | homework | java | linkedlist | null | null | 01/03/2012 20:21:00 | not constructive | How do I implement a Linked List in Java?
===
So I got this as a homework question, and I was wondering if you pros could do it for me.
KTHXBYE! | 4 |
10,043 | 08/13/2008 16:29:56 | 503 | 08/06/2008 12:17:31 | 8 | 1 | .NET: How do I find the Desktop path when Folder Redirection is on? | I have been using **Environment.GetFolderPath(Environment.SpecialFolder.Desktop)** to get the path to the user's desktop for ages now, but since we changed our setup here at work so we use Folder Redirection to map our users' Desktop and My Documents folders to the server, it no-longer works. It still points to the Desktop folder in **C:\Documents and Settings**, which is not where my desktop lives.
Any ideas on how to fix this?
Burns | .net | null | null | null | null | null | open | .NET: How do I find the Desktop path when Folder Redirection is on?
===
I have been using **Environment.GetFolderPath(Environment.SpecialFolder.Desktop)** to get the path to the user's desktop for ages now, but since we changed our setup here at work so we use Folder Redirection to map our users' Desktop and My Documents folders to the server, it no-longer works. It still points to the Desktop folder in **C:\Documents and Settings**, which is not where my desktop lives.
Any ideas on how to fix this?
Burns | 0 |
10,061 | 08/13/2008 16:45:03 | 571 | 08/06/2008 20:19:59 | 527 | 43 | GPS APIs | I'm looking for a GPS with a good API. I would like to be able to send an address to it, and tell it to navigate to that address. I also need to pull the current location from the GPS. I'd like to be able to do this with the GPS hooked up to a laptop by bluetooth or even just a USB cable.
I've looked at the Dash a little, but the monthly subscription is a downside. Also, I would like to keep the location and addresses on our private network.
I'm a .NET programmer, so a .NET friendly API is best for me.
Bonus points if you can show me some examples of using an API to push and pull data to and from the GPS. Thanks. | api | gps | null | null | null | null | open | GPS APIs
===
I'm looking for a GPS with a good API. I would like to be able to send an address to it, and tell it to navigate to that address. I also need to pull the current location from the GPS. I'd like to be able to do this with the GPS hooked up to a laptop by bluetooth or even just a USB cable.
I've looked at the Dash a little, but the monthly subscription is a downside. Also, I would like to keep the location and addresses on our private network.
I'm a .NET programmer, so a .NET friendly API is best for me.
Bonus points if you can show me some examples of using an API to push and pull data to and from the GPS. Thanks. | 0 |
10,066 | 08/13/2008 16:51:28 | 350 | 08/04/2008 23:06:23 | 288 | 11 | SQL Database documentation? | specifically, I use SQL Server 2005, but the solution might be brand independent.
**Need**: You have 40 database tables, in some, you may have a column which is a integer values 1-9 representing some enum. Sure it makes sense in code, but not if you need to SQL the DB in a report getting only rows of type "active" but you have no clue if active is 1,2 or 3...
**my solution**: I have a wiki page and I tell each developer that each table must be there, with the schema and for each column the possible values with explanation.
I also generate the SQL server 2005 database diagram, but that is only marginally helpful since you have so many tables and so many lines connecting them.
Is there a better way do document what a table is, what a column is and publishing it? | database | documentation | null | null | null | null | open | SQL Database documentation?
===
specifically, I use SQL Server 2005, but the solution might be brand independent.
**Need**: You have 40 database tables, in some, you may have a column which is a integer values 1-9 representing some enum. Sure it makes sense in code, but not if you need to SQL the DB in a report getting only rows of type "active" but you have no clue if active is 1,2 or 3...
**my solution**: I have a wiki page and I tell each developer that each table must be there, with the schema and for each column the possible values with explanation.
I also generate the SQL server 2005 database diagram, but that is only marginally helpful since you have so many tables and so many lines connecting them.
Is there a better way do document what a table is, what a column is and publishing it? | 0 |
10,071 | 08/13/2008 16:55:51 | 636 | 08/07/2008 12:32:33 | 134 | 13 | Compact Framework/Threading - MessageBox displays over other controls after option is chosen | I'm working on an app that grabs and installs a bunch of updates off an an external server, and need some help with threading. The user follows this process:
* Clicks button
* Method checks for updates, count is returned.
* If greater than 0, then ask the user if they want to install using MessageBox.Show().
* If yes, it runs through a loop and call BeginInvoke() on the run() method of each update to run it in the background.
* My update class has some events that are used to update a progress bar etc.
The progress bar updates are fine, but the MessageBox is not fully cleared from the screen because the update loop starts right after the user clicks yes (see screenshot below).
* What should I do to make the messagebox disappear instantly before the update loop starts?
* Should I be using Threads instead of BeginInvoke()?
* Should I be doing the initial update check on a separate thread and calling MessageBox.Show() from that thread?
**Code**
// Button clicked event handler code...
DialogResult dlgRes = MessageBox.Show(
string.Format("There are {0} updates available.\n\nInstall these now?",
um2.Updates.Count), "Updates Available",
MessageBoxButtons.YesNo,
MessageBoxIcon.Question,
MessageBoxDefaultButton.Button2
);
if (dlgRes == DialogResult.Yes)
{
ProcessAllUpdates(um2);
}
// Processes a bunch of items in a loop
private void ProcessAllUpdates(UpdateManager2 um2)
{
for (int i = 0; i < um2.Updates.Count; i++)
{
Update2 update = um2.Updates[i];
ProcessSingleUpdate(update);
int percentComplete = Utilities.CalculatePercentCompleted(i, um2.Updates.Count);
UpdateOverallProgress(percentComplete);
}
}
// Process a single update with IAsyncResult
private void ProcessSingleUpdate(Update2 update)
{
update.Action.OnStart += Action_OnStart;
update.Action.OnProgress += Action_OnProgress;
update.Action.OnCompletion += Action_OnCompletion;
//synchronous
//update.Action.Run();
// async
IAsyncResult ar = this.BeginInvoke((MethodInvoker)delegate() { update.Action.Run(); });
}
**Screenshot**
<a href="http://www.flickr.com/photos/brianly/2760435228/" title="Windows Mobile Bug by BrianLy, on Flickr"><img src="http://farm4.static.flickr.com/3043/2760435228_1af7dbf365_o.gif" width="233" height="266" alt="Windows Mobile Bug" /></a> | winforms | threading | multithreaded | compactframework | csharp | null | open | Compact Framework/Threading - MessageBox displays over other controls after option is chosen
===
I'm working on an app that grabs and installs a bunch of updates off an an external server, and need some help with threading. The user follows this process:
* Clicks button
* Method checks for updates, count is returned.
* If greater than 0, then ask the user if they want to install using MessageBox.Show().
* If yes, it runs through a loop and call BeginInvoke() on the run() method of each update to run it in the background.
* My update class has some events that are used to update a progress bar etc.
The progress bar updates are fine, but the MessageBox is not fully cleared from the screen because the update loop starts right after the user clicks yes (see screenshot below).
* What should I do to make the messagebox disappear instantly before the update loop starts?
* Should I be using Threads instead of BeginInvoke()?
* Should I be doing the initial update check on a separate thread and calling MessageBox.Show() from that thread?
**Code**
// Button clicked event handler code...
DialogResult dlgRes = MessageBox.Show(
string.Format("There are {0} updates available.\n\nInstall these now?",
um2.Updates.Count), "Updates Available",
MessageBoxButtons.YesNo,
MessageBoxIcon.Question,
MessageBoxDefaultButton.Button2
);
if (dlgRes == DialogResult.Yes)
{
ProcessAllUpdates(um2);
}
// Processes a bunch of items in a loop
private void ProcessAllUpdates(UpdateManager2 um2)
{
for (int i = 0; i < um2.Updates.Count; i++)
{
Update2 update = um2.Updates[i];
ProcessSingleUpdate(update);
int percentComplete = Utilities.CalculatePercentCompleted(i, um2.Updates.Count);
UpdateOverallProgress(percentComplete);
}
}
// Process a single update with IAsyncResult
private void ProcessSingleUpdate(Update2 update)
{
update.Action.OnStart += Action_OnStart;
update.Action.OnProgress += Action_OnProgress;
update.Action.OnCompletion += Action_OnCompletion;
//synchronous
//update.Action.Run();
// async
IAsyncResult ar = this.BeginInvoke((MethodInvoker)delegate() { update.Action.Run(); });
}
**Screenshot**
<a href="http://www.flickr.com/photos/brianly/2760435228/" title="Windows Mobile Bug by BrianLy, on Flickr"><img src="http://farm4.static.flickr.com/3043/2760435228_1af7dbf365_o.gif" width="233" height="266" alt="Windows Mobile Bug" /></a> | 0 |
10,082 | 08/13/2008 17:05:38 | 1,208 | 08/13/2008 13:11:36 | 1 | 1 | iPhone - Exchange Calendars in Public Folders | I'm trying to get iPhone to play nice with all my work calendars that sync over exchange.
My personal calendar works great with adding/remove events. However, my department calendar which is in a public folder does not show up at all. Anyone know a work around? | iphone | exchange | null | null | null | null | open | iPhone - Exchange Calendars in Public Folders
===
I'm trying to get iPhone to play nice with all my work calendars that sync over exchange.
My personal calendar works great with adding/remove events. However, my department calendar which is in a public folder does not show up at all. Anyone know a work around? | 0 |
10,083 | 08/13/2008 17:06:04 | 1,190 | 08/13/2008 12:15:38 | 55 | 3 | better command for Windows? | While I grew up using Windows, I transitioned to my much-loved Mac years ago. I don't want to start a flame war here on operating systems. I do, however, want a terminal a little closer to what I'm used to.
I'm not asking for full POSIX support - I don't have the patience to install CygWing - but I miss tabbed terminals, being able to easily cut and paste, and my good friends `ls`, `mkdir`, `rm`, et al. (For these last ones, I could always put .bat files on my path, but that's going to get old fast.)
Anybody have a terminal application for XP? | windows | osx | command-line | terminal | null | null | open | better command for Windows?
===
While I grew up using Windows, I transitioned to my much-loved Mac years ago. I don't want to start a flame war here on operating systems. I do, however, want a terminal a little closer to what I'm used to.
I'm not asking for full POSIX support - I don't have the patience to install CygWing - but I miss tabbed terminals, being able to easily cut and paste, and my good friends `ls`, `mkdir`, `rm`, et al. (For these last ones, I could always put .bat files on my path, but that's going to get old fast.)
Anybody have a terminal application for XP? | 0 |
10,088 | 08/13/2008 17:09:26 | 327 | 08/04/2008 17:08:49 | 220 | 11 | Where is TFS work item help text displayed? | I'm creating some custom work items in TFS and the helptext field seems handy but I don't see where it is being displayed in Team Explorer or Team System Web Access. Where is this information displayed? | visual-studio | tfs | null | null | null | null | open | Where is TFS work item help text displayed?
===
I'm creating some custom work items in TFS and the helptext field seems handy but I don't see where it is being displayed in Team Explorer or Team System Web Access. Where is this information displayed? | 0 |
10,098 | 08/13/2008 17:16:33 | 1,220 | 08/13/2008 13:44:48 | 215 | 17 | Best mock framework that can do both WebForms and MVC? | I'm getting into more of a TDD workflow, and have a mix of MVC and asp.net Web Forms apps.
MOQ is recommended for MVC.
I've used Rhino for Web Forms.
Does anyone have a best practice for having 1 framework mock for both? | c# | asp.net | asp.net-mvc | testing | null | null | open | Best mock framework that can do both WebForms and MVC?
===
I'm getting into more of a TDD workflow, and have a mix of MVC and asp.net Web Forms apps.
MOQ is recommended for MVC.
I've used Rhino for Web Forms.
Does anyone have a best practice for having 1 framework mock for both? | 0 |
10,118 | 08/13/2008 17:43:10 | 547 | 08/06/2008 16:09:22 | 177 | 20 | Code Golf: What's the quickest way to determine if i'm using IE? | I run across this constantly, render some HTML if the browser is IE and some other if FFX (or mac, opera, etc).
This is what I use (pardon the missing underscores)
if(ereg("msie", strtolower($SERVER['HTTPUSERAGENT']))) { }
Anyone know a shorter way? (I use PHP but, just for the heck of it, i'd love to see non-PHP code as well who knows maybe there's some lisp "browser ie" syntax)
/mp | code-golf | user-agent | null | null | null | null | open | Code Golf: What's the quickest way to determine if i'm using IE?
===
I run across this constantly, render some HTML if the browser is IE and some other if FFX (or mac, opera, etc).
This is what I use (pardon the missing underscores)
if(ereg("msie", strtolower($SERVER['HTTPUSERAGENT']))) { }
Anyone know a shorter way? (I use PHP but, just for the heck of it, i'd love to see non-PHP code as well who knows maybe there's some lisp "browser ie" syntax)
/mp | 0 |
10,123 | 08/13/2008 17:46:41 | 742 | 08/08/2008 13:33:41 | 8 | 1 | How do I treat an integer as an array of bytes in Python? | I'm trying to decode the result of the Python os.wait() function. This returns, according to the Python docs:
> a tuple containing its pid and exit status indication: a 16-bit number, whose low byte is the signal number that killed the process, and whose high byte is the exit status (if the signal number is zero); the high bit of the low byte is set if a core file was produced.
How do I decode the exit status indication (which is an integer) to obtain the high and low byte? To be specific, how do I implement the decode function used in the following code snippet:
(pid,status) = os.wait()
(exitstatus, signum) = decode(status)
| python | null | null | null | null | null | open | How do I treat an integer as an array of bytes in Python?
===
I'm trying to decode the result of the Python os.wait() function. This returns, according to the Python docs:
> a tuple containing its pid and exit status indication: a 16-bit number, whose low byte is the signal number that killed the process, and whose high byte is the exit status (if the signal number is zero); the high bit of the low byte is set if a core file was produced.
How do I decode the exit status indication (which is an integer) to obtain the high and low byte? To be specific, how do I implement the decode function used in the following code snippet:
(pid,status) = os.wait()
(exitstatus, signum) = decode(status)
| 0 |
10,149 | 08/13/2008 18:15:09 | 92 | 08/01/2008 17:55:41 | 2,050 | 55 | How do I bind a regular expression to a key combination in emacs? | For context, I am something of an emacs newbie. I haven't used it for very long, but have been using it more and more (I like it a lot). Also I'm comfortable with lisp, but not super familiar with elisp.
What I need to do is bind a regular expression to a keyboard combination because I use this particular regex so often.
What I've been doing:
M-C-s ^.*Table\(\(.*\n\)*?GO\)
Note, I used newline above, but I've found that for isearch-forward-regex, you really need to replace the <code>\n</code> in your regex with <code>C-q Q-j</code>, which lets me match my expression across lines.
How can I bind this to a key combination? I vaguely understand that I need to create an elisp function which executes isearch-forward-regex with my expression, but I'm fuzzy on the details. I've searched google and found most documentation to be a tad confusing.
*How can I bind a regular expression to a key combination in emacs?* | emacs | lisp | regex | regular-expression | null | null | open | How do I bind a regular expression to a key combination in emacs?
===
For context, I am something of an emacs newbie. I haven't used it for very long, but have been using it more and more (I like it a lot). Also I'm comfortable with lisp, but not super familiar with elisp.
What I need to do is bind a regular expression to a keyboard combination because I use this particular regex so often.
What I've been doing:
M-C-s ^.*Table\(\(.*\n\)*?GO\)
Note, I used newline above, but I've found that for isearch-forward-regex, you really need to replace the <code>\n</code> in your regex with <code>C-q Q-j</code>, which lets me match my expression across lines.
How can I bind this to a key combination? I vaguely understand that I need to create an elisp function which executes isearch-forward-regex with my expression, but I'm fuzzy on the details. I've searched google and found most documentation to be a tad confusing.
*How can I bind a regular expression to a key combination in emacs?* | 0 |
10,158 | 08/13/2008 18:18:30 | 64 | 08/01/2008 14:27:12 | 1 | 0 | Regex Rejecting matches because of Instr | What's the easiest way to do a "instring" type function with a regex. For example, how could I reject a whole string because of the presence of a single character such as ":" for example:
"this" - okay
"there:is" - not okay because of ":"
More practically, how can I match the following string:
//foo/bar/baz[1]/ns:foo2/@attr/text()
For any node test on the xpath that doesn't include a namespace?
(/)?(/)([^:/]+)
Will match the node tests but includes the namespace prefix which makes it faulty.
| regex | xpath | null | null | null | null | open | Regex Rejecting matches because of Instr
===
What's the easiest way to do a "instring" type function with a regex. For example, how could I reject a whole string because of the presence of a single character such as ":" for example:
"this" - okay
"there:is" - not okay because of ":"
More practically, how can I match the following string:
//foo/bar/baz[1]/ns:foo2/@attr/text()
For any node test on the xpath that doesn't include a namespace?
(/)?(/)([^:/]+)
Will match the node tests but includes the namespace prefix which makes it faulty.
| 0 |
10,190 | 08/13/2008 18:38:02 | 373 | 08/05/2008 09:37:52 | 161 | 18 | How to return a page of results from SQL? | Many applications have grids that display data from a database table one page at a time. Many of them also let the user pick the number of records per page, sort by any column, and navigate back and forth through the results.
What's a good algorithm to implement this pattern without bringing the entire table to the client and then filtering the data on the client. How do you bring just the records you want to display to the user?
Does LINQ simplify the solution?
| .net | sql | linq | pagination | null | null | open | How to return a page of results from SQL?
===
Many applications have grids that display data from a database table one page at a time. Many of them also let the user pick the number of records per page, sort by any column, and navigate back and forth through the results.
What's a good algorithm to implement this pattern without bringing the entire table to the client and then filtering the data on the client. How do you bring just the records you want to display to the user?
Does LINQ simplify the solution?
| 0 |
10,199 | 08/13/2008 18:43:49 | 1,219 | 08/13/2008 13:44:47 | 1 | 6 | How do you mark the maturation point of a programming language? | This is just a food for thought question to help get content into the site for the beta. Hopefully it can spur some interesting discussion.
I have noticed with programming languages and environments that they tend to follow a curve that is in some ways similar to natural selection and evolution in species. Simple things tend to stay simple and have longevity (both bacteria and C have been around forever in basically the same form, and aren't going away anytime soon), whereas complicated things change radically, become useful, but then keep changing, change too much and then die. Or maybe they don't change enough and die. Complicated things tend to have narrow niches.
I'll use the .NET framework, and Microsoft's development environment as an example. I feel like things matured with C# 2.0, Visual Studio 2005, Sql Server 2005. .NET 1.1 was nice, but had some really annoying bugs and shortcomings, which were addressed in 2.0. Whenever I dig into the next release, I feel like it's all just lights and mirrors, and no actual usefulness. Sorry, I'm not a fan of linq. The new AJAX stuff is nice (I think that's ASP.NET 3.5?), but I can do AJAXy things in a million different ways using the current environment.
When do we say "enough is enough" and just stick with a platform that is performing perfectly for us?
Maybe this is just a sign that I'm getting old. | programming-languages | languages | null | null | null | null | open | How do you mark the maturation point of a programming language?
===
This is just a food for thought question to help get content into the site for the beta. Hopefully it can spur some interesting discussion.
I have noticed with programming languages and environments that they tend to follow a curve that is in some ways similar to natural selection and evolution in species. Simple things tend to stay simple and have longevity (both bacteria and C have been around forever in basically the same form, and aren't going away anytime soon), whereas complicated things change radically, become useful, but then keep changing, change too much and then die. Or maybe they don't change enough and die. Complicated things tend to have narrow niches.
I'll use the .NET framework, and Microsoft's development environment as an example. I feel like things matured with C# 2.0, Visual Studio 2005, Sql Server 2005. .NET 1.1 was nice, but had some really annoying bugs and shortcomings, which were addressed in 2.0. Whenever I dig into the next release, I feel like it's all just lights and mirrors, and no actual usefulness. Sorry, I'm not a fan of linq. The new AJAX stuff is nice (I think that's ASP.NET 3.5?), but I can do AJAXy things in a million different ways using the current environment.
When do we say "enough is enough" and just stick with a platform that is performing perfectly for us?
Maybe this is just a sign that I'm getting old. | 0 |
10,205 | 08/13/2008 18:46:44 | 1,228 | 08/13/2008 13:58:55 | 79 | 14 | Delimited string parsing framework | I'm looking at parsing a delimited string, something on the order of
a,b,c
But this is a very simple example, and parsing delimited data can get complex; for instance
1,"Your simple algorithm, it fails",True
would blow your naiive string.Split implementation to bits. Is there anything I can freely use/steal/copy and paste that offers a relatively bulletproof solution to parsing delimited text? .NET, plox. | parsing | null | null | null | null | null | open | Delimited string parsing framework
===
I'm looking at parsing a delimited string, something on the order of
a,b,c
But this is a very simple example, and parsing delimited data can get complex; for instance
1,"Your simple algorithm, it fails",True
would blow your naiive string.Split implementation to bits. Is there anything I can freely use/steal/copy and paste that offers a relatively bulletproof solution to parsing delimited text? .NET, plox. | 0 |
10,216 | 08/13/2008 18:53:24 | 1,190 | 08/13/2008 12:15:38 | 73 | 5 | best language design resources | I've been toying with the idea of building a new general purpose programming language lately, and I was wondering where to go for help. Does anyone have a favorite book? Tutorial? Tools? I see the primary benefit of the project being that I will learn more about language design. I have little hope that it will become the next Ruby or whatever. Still, I'd like to put real thought into it and understand the decisions I'm making.
I'm not looking for advice on the language itself here, although I may ask particular questions along the way. | language | design | compiler | null | null | null | open | best language design resources
===
I've been toying with the idea of building a new general purpose programming language lately, and I was wondering where to go for help. Does anyone have a favorite book? Tutorial? Tools? I see the primary benefit of the project being that I will learn more about language design. I have little hope that it will become the next Ruby or whatever. Still, I'd like to put real thought into it and understand the decisions I'm making.
I'm not looking for advice on the language itself here, although I may ask particular questions along the way. | 0 |
10,228 | 08/13/2008 19:02:23 | 204 | 08/03/2008 13:27:56 | 315 | 22 | Run PHPUnit Tests in Certain Order | Is there a way to get the tests inside of a TestCase to run in a certain order? For example, I want to seperate the lifecycle of an object from creation to use to destruction but need to make sure that the object is set up first before I run the other tests. | php | unittesting | phpunit | null | null | null | open | Run PHPUnit Tests in Certain Order
===
Is there a way to get the tests inside of a TestCase to run in a certain order? For example, I want to seperate the lifecycle of an object from creation to use to destruction but need to make sure that the object is set up first before I run the other tests. | 0 |
10,229 | 08/13/2008 19:03:21 | 380 | 08/05/2008 10:39:18 | 496 | 61 | Multithreading Design Question | Consider this problem: I have a program which should fetch (let's say) a 100 records from the database, and then for each one it needs to get updated information from a web service. There are two ways to introduce parallelism in this scenario:
1. I start of each request to the web service on a new Thread. The number of simultaneous threads is controlled by some external parameter (or dynamically adjusted somehow).
2. I create smaller batches (let's say of 10 records each) and launch each batch on a separate thread (so taking our example, 10 threads).
Which is a better approach, and why do you think so? | .net | multithreading | null | null | null | null | open | Multithreading Design Question
===
Consider this problem: I have a program which should fetch (let's say) a 100 records from the database, and then for each one it needs to get updated information from a web service. There are two ways to introduce parallelism in this scenario:
1. I start of each request to the web service on a new Thread. The number of simultaneous threads is controlled by some external parameter (or dynamically adjusted somehow).
2. I create smaller batches (let's say of 10 records each) and launch each batch on a separate thread (so taking our example, 10 threads).
Which is a better approach, and why do you think so? | 0 |
10,230 | 08/13/2008 19:03:27 | 288 | 08/04/2008 12:50:02 | 13 | 2 | Checking for string contents? string Length Vs Empty String | Which is more efficient for the compiler and the best practice for checking whether a string is blank?
1. Checking whether the length of the string == 0
2. Checking whether the string is empty (strVar == "")
Also, does the answer depend on language? | string | compiler | efficiency | null | null | null | open | Checking for string contents? string Length Vs Empty String
===
Which is more efficient for the compiler and the best practice for checking whether a string is blank?
1. Checking whether the length of the string == 0
2. Checking whether the string is empty (strVar == "")
Also, does the answer depend on language? | 0 |
10,256 | 08/13/2008 19:15:07 | 288 | 08/04/2008 12:50:02 | 13 | 2 | Android Development | I am interested in trying some Android Development and I've not had much luck getting started. I'm not much of a Linux person but I have an Ubuntu box setup that I attempted to install the android SDK and plugins for Eclipse. But I'm not having much luck getting it setup.
I'm looking for some guidance for what would be the best way for me to do this.
- Should I use a different Linux distro?
- Is eclipse the wrong way to go?
- I was hoping this was a way for me to get some Linux exposure too,
so I don't even know if there is a way to accomplish this in Windows,
but I'm sure someone else would be interested to know that info.
I have looked at the instructions at Google, but everything I read assumes a prior knowledge of Linux, Eclipse or both. There also doesn't seem to be many troubleshooting helps. | linux | eclipse | android | null | null | null | open | Android Development
===
I am interested in trying some Android Development and I've not had much luck getting started. I'm not much of a Linux person but I have an Ubuntu box setup that I attempted to install the android SDK and plugins for Eclipse. But I'm not having much luck getting it setup.
I'm looking for some guidance for what would be the best way for me to do this.
- Should I use a different Linux distro?
- Is eclipse the wrong way to go?
- I was hoping this was a way for me to get some Linux exposure too,
so I don't even know if there is a way to accomplish this in Windows,
but I'm sure someone else would be interested to know that info.
I have looked at the instructions at Google, but everything I read assumes a prior knowledge of Linux, Eclipse or both. There also doesn't seem to be many troubleshooting helps. | 0 |
10,260 | 08/13/2008 19:18:07 | 203 | 08/03/2008 13:26:47 | 53 | 2 | What are the useful new ASP.NET features in the .NET Framework 3.5? | I've kept up to date with new features in the C# language as it's moved from version 1 through version 3. I haven't done such a good job keeping up to date with ASP.NET. I feel like some of the post version 1 features are not so good (e.g. the AJAX framework) or are just not that useful to me (e.g. the membership framework). Can anyone recommend any new killer ASP.NET features that might have gone unnoticed? | asp.net | null | null | null | null | null | open | What are the useful new ASP.NET features in the .NET Framework 3.5?
===
I've kept up to date with new features in the C# language as it's moved from version 1 through version 3. I haven't done such a good job keeping up to date with ASP.NET. I feel like some of the post version 1 features are not so good (e.g. the AJAX framework) or are just not that useful to me (e.g. the membership framework). Can anyone recommend any new killer ASP.NET features that might have gone unnoticed? | 0 |
10,274 | 08/13/2008 19:24:22 | 380 | 08/05/2008 10:39:18 | 506 | 67 | When should I not use the ThreadPool in .Net? | When should I not use the ThreadPool in .Net?
it looks like the best option is to use a ThreadPool. In which case, why is it not the only option.
What are your experiences around this? | .net | multithreading | null | null | null | null | open | When should I not use the ThreadPool in .Net?
===
When should I not use the ThreadPool in .Net?
it looks like the best option is to use a ThreadPool. In which case, why is it not the only option.
What are your experiences around this? | 0 |
10,293 | 08/13/2008 19:35:31 | 567 | 08/06/2008 19:14:16 | 175 | 17 | Has anyone used Jaxer in production? | Has anyone used [Jaxer][1] in a production environment, I am curious as to how it holds up compared to something like php, ruby, etc. and if anyone knows of any pitfalls to using it that are well known.
[1]: http://www.aptana.com/jaxer | performance | aptana | jaxer | null | null | null | open | Has anyone used Jaxer in production?
===
Has anyone used [Jaxer][1] in a production environment, I am curious as to how it holds up compared to something like php, ruby, etc. and if anyone knows of any pitfalls to using it that are well known.
[1]: http://www.aptana.com/jaxer | 0 |
10,300 | 08/13/2008 19:45:33 | 203 | 08/03/2008 13:26:47 | 63 | 2 | Validating posted form data in the ASP.NET MVC framework | I've been playing around with the ASP.NET MVC Framework and the one thing that's really confusing me is how I'm meant to do server side validation of posted form data. I presume I don't post back to the same URL, but if I don't how do I redisplay the form with the entered data and error messages? Also, where should the validation logic go? In the model or the controller? This seems to be one of the few areas where web forms are much stronger (I miss the validation controls). | asp.net | mvc | validation | null | null | null | open | Validating posted form data in the ASP.NET MVC framework
===
I've been playing around with the ASP.NET MVC Framework and the one thing that's really confusing me is how I'm meant to do server side validation of posted form data. I presume I don't post back to the same URL, but if I don't how do I redisplay the form with the entered data and error messages? Also, where should the validation logic go? In the model or the controller? This seems to be one of the few areas where web forms are much stronger (I miss the validation controls). | 0 |
10,303 | 08/13/2008 19:51:02 | 571 | 08/06/2008 20:19:59 | 558 | 46 | What FoxPro data tools can I use to find corrupted data? | I have some SQL Server DTS packages that import data from a FoxPro database. This was working fine until recently. Now the script that imports data from one of the FoxPro tables bombs out about 470,000 records into the import. I'm just pulling the data into a table with nullable varchar fields so I'm thinking it must be a weird/corrupt data problem.
What tools would you use to track down a problem like this?
FYI, this is the error I'm getting:
> Data for source column 1 ('field1') is not available. Your provider may require that all Blob columns be rightmost in the source result set.
There should not be any blob columns in this table. | database | foxpro | null | null | null | null | open | What FoxPro data tools can I use to find corrupted data?
===
I have some SQL Server DTS packages that import data from a FoxPro database. This was working fine until recently. Now the script that imports data from one of the FoxPro tables bombs out about 470,000 records into the import. I'm just pulling the data into a table with nullable varchar fields so I'm thinking it must be a weird/corrupt data problem.
What tools would you use to track down a problem like this?
FYI, this is the error I'm getting:
> Data for source column 1 ('field1') is not available. Your provider may require that all Blob columns be rightmost in the source result set.
There should not be any blob columns in this table. | 0 |
10,308 | 08/13/2008 19:55:06 | 763 | 08/08/2008 16:17:13 | 40 | 2 | Graphical representation of SVN branch/merge activity | Are you aware of any tool that creates diagrams showing the branch/merge activity in a SVN repository?
We've all seen [these][1] [diagrams][2] in various [tutorials][3]. Some good, some not so good. Can they be created automatically (or maybe with a little prodding -- you might have to tell it what if your branching philosophy is dev-test-prod, branch-per-release, etc.)
I'm looking at the TortoiseSVN [Revision Graph][4] right now, but it has more detail than I want and the wrong layout. I'm looking for something more like the images in [this article][5].
[1]: http://www.svn-checkout.co.uk/images/10-how-to-create-efficient-branches-using-subversion/single_branch.png
[2]: http://coop.sigkill.com/~preed/people.mozilla.com/~preed/bloggity-blog-blog/release-branch-proposal.jpg
[3]: http://www.grantusmaximus.com/web/wp-content/uploads/2007/09/svn-branch-example.gif
[4]: http://weblogs.asp.net/blogs/bsimser/WindowsLiveWriter/SubversionDaytoday_12266/image_21.png
[5]: http://www.javalinux.it/wordpress/?p=32 | svn | subversion | null | null | null | null | open | Graphical representation of SVN branch/merge activity
===
Are you aware of any tool that creates diagrams showing the branch/merge activity in a SVN repository?
We've all seen [these][1] [diagrams][2] in various [tutorials][3]. Some good, some not so good. Can they be created automatically (or maybe with a little prodding -- you might have to tell it what if your branching philosophy is dev-test-prod, branch-per-release, etc.)
I'm looking at the TortoiseSVN [Revision Graph][4] right now, but it has more detail than I want and the wrong layout. I'm looking for something more like the images in [this article][5].
[1]: http://www.svn-checkout.co.uk/images/10-how-to-create-efficient-branches-using-subversion/single_branch.png
[2]: http://coop.sigkill.com/~preed/people.mozilla.com/~preed/bloggity-blog-blog/release-branch-proposal.jpg
[3]: http://www.grantusmaximus.com/web/wp-content/uploads/2007/09/svn-branch-example.gif
[4]: http://weblogs.asp.net/blogs/bsimser/WindowsLiveWriter/SubversionDaytoday_12266/image_21.png
[5]: http://www.javalinux.it/wordpress/?p=32 | 0 |
10,309 | 08/13/2008 19:56:52 | 1,143 | 08/12/2008 18:58:24 | 11 | 1 | Whats the best way of finding ALL your memory when developing on the Compact Framework? | I've used the CF [Remote Performance Monitor][1], however this seems to only track memory initialised in the managed world as opposed to the unmanaged world. Well, I can only presume this as the numbers listed in the profiler are way short of the maximum allowed (32mb on CE 5). Profiling a particular app with the RPM showed me that the total usage of all the caches only manages to get to about 12mb and then slowly shrinks as (I assume) something unmanaged starts to claim more memory.
The memory slider in System also shows that the device is very short on memory. If I kill the process the slider shows all the memory coming back. So it must (?) be this managed process that is swallowing the memory.
Is there any simple(ish?) fashion how one can track unmanaged memory usage in some way that might enable me to match it up with the corresponding P/Invoke calls?
[1]: http://blogs.msdn.com/stevenpr/archive/2006/04/17/577636.aspx | .net | compactframework | windows-ce | null | null | null | open | Whats the best way of finding ALL your memory when developing on the Compact Framework?
===
I've used the CF [Remote Performance Monitor][1], however this seems to only track memory initialised in the managed world as opposed to the unmanaged world. Well, I can only presume this as the numbers listed in the profiler are way short of the maximum allowed (32mb on CE 5). Profiling a particular app with the RPM showed me that the total usage of all the caches only manages to get to about 12mb and then slowly shrinks as (I assume) something unmanaged starts to claim more memory.
The memory slider in System also shows that the device is very short on memory. If I kill the process the slider shows all the memory coming back. So it must (?) be this managed process that is swallowing the memory.
Is there any simple(ish?) fashion how one can track unmanaged memory usage in some way that might enable me to match it up with the corresponding P/Invoke calls?
[1]: http://blogs.msdn.com/stevenpr/archive/2006/04/17/577636.aspx | 0 |
10,313 | 08/13/2008 20:02:06 | 1,245 | 08/13/2008 18:09:30 | 1 | 0 | Can I copy files to a Network Place from a script or the command line? | Is it possible, in Windows XP, to copy files to a Network Place from the command line, a batch file or, even better, a PowerShell script?
What sent me down this road of research was trying to publish files to a WSS 3.0 document library from a user's machine. I can't map a drive to the library in question because the WSS site is only available to authenticate via NTLM on a port other than 80 or 443. I suppose I could alternately use the WSS web services to push the files out, but I'm really curious about the answer to this question now. | sharepoint | command-line | scripting | powershell | moss | null | open | Can I copy files to a Network Place from a script or the command line?
===
Is it possible, in Windows XP, to copy files to a Network Place from the command line, a batch file or, even better, a PowerShell script?
What sent me down this road of research was trying to publish files to a WSS 3.0 document library from a user's machine. I can't map a drive to the library in question because the WSS site is only available to authenticate via NTLM on a port other than 80 or 443. I suppose I could alternately use the WSS web services to push the files out, but I'm really curious about the answer to this question now. | 0 |
10,314 | 08/13/2008 20:03:53 | 1,043 | 08/11/2008 18:08:32 | 91 | 7 | How do you name your instance/param values? | Being new to Objective-C (but a long term C/++) programmer I'm looking for advice/recommendations on naming conventions for variables.
My personal preference would be to utilize a prefix for instance variables both for clarity within functions and to prevent shadowing of function parameters. However I'm a fan of properties which rules out prefixes (unless you also prefix your property names, which doesn't work too well and looks daft). Similarly I could use the "self.variable" convention, but only if I make EVERYTHING a property.
So given the code below what's your preferred naming style for instance/function variables? And if you don't bother, how do you deal with shadowing on function params?
@interface GridItem : NSObject
{
CGRect _rect;
...
}
@end
-(void) initFromRect:(CGRect)rect
{
_rect = rect;
...
}
Cheers! | objectivec | cocoa | null | null | null | null | open | How do you name your instance/param values?
===
Being new to Objective-C (but a long term C/++) programmer I'm looking for advice/recommendations on naming conventions for variables.
My personal preference would be to utilize a prefix for instance variables both for clarity within functions and to prevent shadowing of function parameters. However I'm a fan of properties which rules out prefixes (unless you also prefix your property names, which doesn't work too well and looks daft). Similarly I could use the "self.variable" convention, but only if I make EVERYTHING a property.
So given the code below what's your preferred naming style for instance/function variables? And if you don't bother, how do you deal with shadowing on function params?
@interface GridItem : NSObject
{
CGRect _rect;
...
}
@end
-(void) initFromRect:(CGRect)rect
{
_rect = rect;
...
}
Cheers! | 0 |
10,323 | 08/13/2008 20:19:09 | 1,190 | 08/13/2008 12:15:38 | 93 | 5 | why doesn't Ruby have a real StringBuffer or StringIO | I recently read a nice [post][1] on using `StringIO` in Ruby. What the author doesn't mention, though, is that `StringIO` is just an "I." There's no "O." You _can't_ do this, for example:
s = StringIO.new
s << 'foo'
s << 'bar'
s.tos # I mean with an underscore, but Markdown hates that
# => should be "foo\nbar"
# => really is ''`
Ruby really needs a StringBuffer just like the one Java has. StringBuffers serve two important purposes. First, they let you test the output half of what Ruby's StringIO does. Second, they are useful for building up long strings from small parts -- something that Joel reminds us over and over again is otherwise very very slow.
Is there a good replacement?
[1]: http://macdevelopertips.com/ruby/using-a-string-as-a-file-in-ruby.html | ruby | io | string | buffer | null | null | open | why doesn't Ruby have a real StringBuffer or StringIO
===
I recently read a nice [post][1] on using `StringIO` in Ruby. What the author doesn't mention, though, is that `StringIO` is just an "I." There's no "O." You _can't_ do this, for example:
s = StringIO.new
s << 'foo'
s << 'bar'
s.tos # I mean with an underscore, but Markdown hates that
# => should be "foo\nbar"
# => really is ''`
Ruby really needs a StringBuffer just like the one Java has. StringBuffers serve two important purposes. First, they let you test the output half of what Ruby's StringIO does. Second, they are useful for building up long strings from small parts -- something that Joel reminds us over and over again is otherwise very very slow.
Is there a good replacement?
[1]: http://macdevelopertips.com/ruby/using-a-string-as-a-file-in-ruby.html | 0 |
10,349 | 08/13/2008 20:41:24 | 337 | 08/04/2008 18:11:42 | 1 | 0 | In WinForms, why can't you update UI controls from other threads? | I'm sure there is a good (or at least decent) reason for this. What is it? | winforms | multithreading | null | null | null | null | open | In WinForms, why can't you update UI controls from other threads?
===
I'm sure there is a good (or at least decent) reason for this. What is it? | 0 |
10,366 | 08/13/2008 20:59:54 | 521 | 08/06/2008 14:16:34 | 401 | 24 | style.display not working in Firefox, Opera, Safari - IE7 OK | I have an absolutely positioned div that I want to show when the user clicks a link. The onclick of the link calls a js function that sets the display of the div to block (also tried: "", inline, table-cell, inline-table, etc). This works great in IE7, not at all in every other browser I've tried (FF2, FF3, Opera 9.5, Safari).
I've tried adding alerts before and after the call, and they show that the display has changed from "none" to "block" but the div does not display.
I can get the div to display in FF3 if I change the display value using Firebug's HTML inspector (but not by running javascript through Firebug's console) - so I know it's not just showing up off screen, etc.
I've tried everything I can think of, including:
- Using a different doctype (XHTML 1, HTML 4, etc)
- Using visibility visible/hidden instead of display block/none
- Using inline javascript instead of a function call
- Testing from different machines
Any ideas about what could cause this? | javascript | html | css | null | null | null | open | style.display not working in Firefox, Opera, Safari - IE7 OK
===
I have an absolutely positioned div that I want to show when the user clicks a link. The onclick of the link calls a js function that sets the display of the div to block (also tried: "", inline, table-cell, inline-table, etc). This works great in IE7, not at all in every other browser I've tried (FF2, FF3, Opera 9.5, Safari).
I've tried adding alerts before and after the call, and they show that the display has changed from "none" to "block" but the div does not display.
I can get the div to display in FF3 if I change the display value using Firebug's HTML inspector (but not by running javascript through Firebug's console) - so I know it's not just showing up off screen, etc.
I've tried everything I can think of, including:
- Using a different doctype (XHTML 1, HTML 4, etc)
- Using visibility visible/hidden instead of display block/none
- Using inline javascript instead of a function call
- Testing from different machines
Any ideas about what could cause this? | 0 |
10,412 | 08/13/2008 22:07:45 | 354 | 08/05/2008 00:31:33 | 1 | 1 | Creating a Word doc in C#.NET | I have a project where I would like to generate a report export in MS Word format. The report will include images/graphs, tables, and text. What is the best way to do this? Third party tools? What are your experiences? | c# | .net | word | null | null | null | open | Creating a Word doc in C#.NET
===
I have a project where I would like to generate a report export in MS Word format. The report will include images/graphs, tables, and text. What is the best way to do this? Third party tools? What are your experiences? | 0 |
10,425 | 08/13/2008 22:23:01 | 633 | 08/07/2008 12:15:28 | 21 | 2 | MVC Learning Resources | Can someone recommend some good resources for learning about MVC? I've been doing ASP.Net since it came out, but I've never gotten into MVC at all. I want to understand how it works, why it's better (if it is), when to use it, and so on. It doesn't have to be specific to ASP.Net MVC, though anything about that would be great. I'm open to books, websites, etc.
Corey
| mvc | null | null | null | null | null | open | MVC Learning Resources
===
Can someone recommend some good resources for learning about MVC? I've been doing ASP.Net since it came out, but I've never gotten into MVC at all. I want to understand how it works, why it's better (if it is), when to use it, and so on. It doesn't have to be specific to ASP.Net MVC, though anything about that would be great. I'm open to books, websites, etc.
Corey
| 0 |
10,426 | 08/13/2008 22:24:28 | 287 | 08/04/2008 12:43:38 | 113 | 11 | What is a good Windows hex editor / viewer? | I am in need of a hex editor / viewer (viewer is more important than editing, but a plus if it can edit) for Windows.
See [KHexedit][1]
Requirements:
- Free is best
- View data at cursor as: byte, short, int, long, float, double (signed/unsiged where applicable)
- Configure the endiance for multi-byte decoding
"Nice to have" features:
- String decoding, null-term or selection based, ASCII/UTF-8/16
- Create user defined "structures" to overlay and view fields
[1]: http://home.online.no/~espensa/khexedit/documentation/khexedit.png | windows | editor | hex | endiance | null | 09/10/2011 19:15:31 | not constructive | What is a good Windows hex editor / viewer?
===
I am in need of a hex editor / viewer (viewer is more important than editing, but a plus if it can edit) for Windows.
See [KHexedit][1]
Requirements:
- Free is best
- View data at cursor as: byte, short, int, long, float, double (signed/unsiged where applicable)
- Configure the endiance for multi-byte decoding
"Nice to have" features:
- String decoding, null-term or selection based, ASCII/UTF-8/16
- Create user defined "structures" to overlay and view fields
[1]: http://home.online.no/~espensa/khexedit/documentation/khexedit.png | 4 |
10,435 | 08/13/2008 22:31:17 | 781 | 08/08/2008 21:28:19 | 53 | 7 | Impersonation in IIS 7.0 | I have a website that works correctly under IIS 6.0: It authenticates users with windows credentials, and then when talking to the service that hits the DB, it passes the credentials.
In IIS 7.0, the same config settings do not pass the credentials, and the DB gets hit with NT AUTHORITY\ANONYMOUS.
Is there something I'm missing? I've turned ANONYMOUS access off in my IIS 7.0 website, but I can't get the thing to work.
These are the settings that I'm using on both IIS 6.0 and 7.0:
> authentication mode="Windows"
> identity impersonate="true"
What changed from 6.0 to 7.0? | iis7 | null | null | null | null | null | open | Impersonation in IIS 7.0
===
I have a website that works correctly under IIS 6.0: It authenticates users with windows credentials, and then when talking to the service that hits the DB, it passes the credentials.
In IIS 7.0, the same config settings do not pass the credentials, and the DB gets hit with NT AUTHORITY\ANONYMOUS.
Is there something I'm missing? I've turned ANONYMOUS access off in my IIS 7.0 website, but I can't get the thing to work.
These are the settings that I'm using on both IIS 6.0 and 7.0:
> authentication mode="Windows"
> identity impersonate="true"
What changed from 6.0 to 7.0? | 0 |
10,443 | 08/13/2008 22:40:57 | 432 | 08/05/2008 17:18:46 | 638 | 37 | Send messages to program through command line | I have this program, we'll call it Host. Host does all kinds of good stuff, but it needs to be able to accept input through the command line. For example, I need to be able to do this:
./Host --blahblah 3 6 3 5
This should somehow end up calling some function in Host called
handleBlahBlah(int x1, int y1, int x2, int y2){
//do some more sweet stuff
}
Host is a C program, and does not need to support multiple instances.
What is the cleanest way to implement this? | c | command-line | io | architecture | null | null | open | Send messages to program through command line
===
I have this program, we'll call it Host. Host does all kinds of good stuff, but it needs to be able to accept input through the command line. For example, I need to be able to do this:
./Host --blahblah 3 6 3 5
This should somehow end up calling some function in Host called
handleBlahBlah(int x1, int y1, int x2, int y2){
//do some more sweet stuff
}
Host is a C program, and does not need to support multiple instances.
What is the cleanest way to implement this? | 0 |
10,456 | 08/13/2008 23:01:01 | 1,147 | 08/12/2008 19:29:43 | 21 | 3 | HowTo Disable WebBrowser 'Click Sound' in your app only. | Originally, I wanted to ask this question here on stackoverflow, but I was not yet in the beta. So, after googling for the answer and finding only a little bit of information on it I came up with the following and decided to post it here now that I'm in the beta.
The 'click sound' in question is actually a system wide preference, so I only want it to be disabled when my application has focus and then re-enable when the application closes/loses focus.
using System;
using Microsoft.Win32;
namespace HowTo
{
class WebClickSound
{
/// <summary>
/// Enables or disables the web browser navigating click sound.
/// </summary>
public static bool Enabled
{
get
{
RegistryKey key = Registry.CurrentUser.OpenSubKey(@"AppEvents\Schemes\Apps\Explorer\Navigating\.Current");
string keyValue = (string)key.GetValue(null);
return String.IsNullOrEmpty(keyValue) == false && keyValue != "\"\"";
}
set
{
string keyValue;
if (value)
{
keyValue = "%SystemRoot%\\Media\\";
if (Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor > 0)
{
// XP
keyValue += "Windows XP Start.wav";
}
else if (Environment.OSVersion.Version.Major == 6)
{
// Vista
keyValue += "Windows Navigation Start.wav";
}
else
{
// Don't know the file name so I won't be able to re-enable it
return;
}
}
else
{
keyValue = "\"\"";
}
// Open and set the key that points to the file
RegistryKey key = Registry.CurrentUser.OpenSubKey(@"AppEvents\Schemes\Apps\Explorer\Navigating\.Current", true);
key.SetValue(null, keyValue, RegistryValueKind.ExpandString);
isEnabled = value;
}
}
}
}
Then in the main form we use the above code in these 3 events:
* Activated
* Deactivated
* FormClosing
private void Form1_Activated(object sender, EventArgs e)
{
// Disable the sound when the program has focus
WebClickSound.Enabled = false;
}
private void Form1_Deactivate(object sender, EventArgs e)
{
// Enable the sound when the program is out of focus
WebClickSound.Enabled = true;
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
// Enable the sound on app exit
WebClickSound.Enabled = true;
}
The one problem I see currently is if the program crashes they won't have the click sound until they re-launch my application, but they wouldn't know to do that.
What do you guys think? Is this a good solution? What improvements can be made? | howto | c# | .net | null | null | null | open | HowTo Disable WebBrowser 'Click Sound' in your app only.
===
Originally, I wanted to ask this question here on stackoverflow, but I was not yet in the beta. So, after googling for the answer and finding only a little bit of information on it I came up with the following and decided to post it here now that I'm in the beta.
The 'click sound' in question is actually a system wide preference, so I only want it to be disabled when my application has focus and then re-enable when the application closes/loses focus.
using System;
using Microsoft.Win32;
namespace HowTo
{
class WebClickSound
{
/// <summary>
/// Enables or disables the web browser navigating click sound.
/// </summary>
public static bool Enabled
{
get
{
RegistryKey key = Registry.CurrentUser.OpenSubKey(@"AppEvents\Schemes\Apps\Explorer\Navigating\.Current");
string keyValue = (string)key.GetValue(null);
return String.IsNullOrEmpty(keyValue) == false && keyValue != "\"\"";
}
set
{
string keyValue;
if (value)
{
keyValue = "%SystemRoot%\\Media\\";
if (Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor > 0)
{
// XP
keyValue += "Windows XP Start.wav";
}
else if (Environment.OSVersion.Version.Major == 6)
{
// Vista
keyValue += "Windows Navigation Start.wav";
}
else
{
// Don't know the file name so I won't be able to re-enable it
return;
}
}
else
{
keyValue = "\"\"";
}
// Open and set the key that points to the file
RegistryKey key = Registry.CurrentUser.OpenSubKey(@"AppEvents\Schemes\Apps\Explorer\Navigating\.Current", true);
key.SetValue(null, keyValue, RegistryValueKind.ExpandString);
isEnabled = value;
}
}
}
}
Then in the main form we use the above code in these 3 events:
* Activated
* Deactivated
* FormClosing
private void Form1_Activated(object sender, EventArgs e)
{
// Disable the sound when the program has focus
WebClickSound.Enabled = false;
}
private void Form1_Deactivate(object sender, EventArgs e)
{
// Enable the sound when the program is out of focus
WebClickSound.Enabled = true;
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
// Enable the sound on app exit
WebClickSound.Enabled = true;
}
The one problem I see currently is if the program crashes they won't have the click sound until they re-launch my application, but they wouldn't know to do that.
What do you guys think? Is this a good solution? What improvements can be made? | 0 |
10,475 | 08/13/2008 23:29:38 | 841 | 08/09/2008 09:37:17 | 18 | 3 | Touch Typing Software recommendations | Since the keyboard is **the** interface we use to the computer, I've always thought touch typing should be something I should learn, but I've always been, well, lazy is the word. So, anyone recommend any good touch typing software?
It's easy enough to google, but I'ld like to hear recommendations. | editor | touch-typing | null | null | null | 03/01/2012 06:12:03 | off topic | Touch Typing Software recommendations
===
Since the keyboard is **the** interface we use to the computer, I've always thought touch typing should be something I should learn, but I've always been, well, lazy is the word. So, anyone recommend any good touch typing software?
It's easy enough to google, but I'ld like to hear recommendations. | 2 |
10,477 | 08/13/2008 23:31:32 | 1,256 | 08/13/2008 23:17:37 | 1 | 0 | Equidistant points across Bezier curves | Currently, I'm attempting to make multiple beziers have equidistant points. I'm currently using cubic interpolation to find the points, but because the way beziers work some areas are more dense than others and proving gross for texture mapping because of the variable distance. **Is there a way to find points on a bezier by distance rather than by percentage? Furthermore, is it possible to extend this to multiple connected curves?** | graphics | bezier | curve | interpolation | null | null | open | Equidistant points across Bezier curves
===
Currently, I'm attempting to make multiple beziers have equidistant points. I'm currently using cubic interpolation to find the points, but because the way beziers work some areas are more dense than others and proving gross for texture mapping because of the variable distance. **Is there a way to find points on a bezier by distance rather than by percentage? Furthermore, is it possible to extend this to multiple connected curves?** | 0 |
10,478 | 08/13/2008 23:32:09 | 722 | 08/08/2008 11:37:05 | 216 | 21 | Getting selected text in a browser, cross-platform. | One of the things I'd like to do in my browser-based application is allow the user to select some text (not in a <textarea>, just plain ol' text!), and have my application pop up a small toolbar that then can interact with the next (in my case, add annotations).
I've found a lot of stuff on google that seems to be focused on writing WYSIWYG editors, **but that isn't what I want**, and most of it worked in IE but not in FF2 or 3. Ideally, I'd like some function that can return the currently selected text in the browser window that works in **IE7 (and 6 if possible), FireFox 2 & 3 and Safari 2**. If it works in Opera, that'd be a bonus, but it's not a requirement.
Anyone have a function that does this? Or an idea of where to start? | javascript | browser | selected-text | null | null | null | open | Getting selected text in a browser, cross-platform.
===
One of the things I'd like to do in my browser-based application is allow the user to select some text (not in a <textarea>, just plain ol' text!), and have my application pop up a small toolbar that then can interact with the next (in my case, add annotations).
I've found a lot of stuff on google that seems to be focused on writing WYSIWYG editors, **but that isn't what I want**, and most of it worked in IE but not in FF2 or 3. Ideally, I'd like some function that can return the currently selected text in the browser window that works in **IE7 (and 6 if possible), FireFox 2 & 3 and Safari 2**. If it works in Opera, that'd be a bonus, but it's not a requirement.
Anyone have a function that does this? Or an idea of where to start? | 0 |
10,486 | 08/13/2008 23:36:28 | 906 | 08/10/2008 09:40:59 | 11 | 1 | Unit test execution speed (how many tests per second?) | What kind of execution rate do you aim for with your unit tests (# test per second)? How long is too long for an individual unit test?
I'd be interested in knowing if people have any specific thresholds for determining whether their tests are too slow, or is it just when the friction of a long running test suite gets the better of you?
Finally, when you do decide the tests need to run faster, what techniques do you use to speed up your tests?
*Note: integration tests are obviously a different matter again. We are strictly talking unit tests that need to be run as frequently as possible.* | unit-testing | null | null | null | null | null | open | Unit test execution speed (how many tests per second?)
===
What kind of execution rate do you aim for with your unit tests (# test per second)? How long is too long for an individual unit test?
I'd be interested in knowing if people have any specific thresholds for determining whether their tests are too slow, or is it just when the friction of a long running test suite gets the better of you?
Finally, when you do decide the tests need to run faster, what techniques do you use to speed up your tests?
*Note: integration tests are obviously a different matter again. We are strictly talking unit tests that need to be run as frequently as possible.* | 0 |
10,499 | 08/13/2008 23:49:15 | 116 | 08/02/2008 05:51:57 | 1,995 | 123 | Oracle - What TNS Names file am I using? | Sometimes I get Oracle connection problems because I can't figure out which tnsnames.ora file my database client is using.
What's the best way to figure this out? ++happy for various platform solutions.
| oracle | connection | tns | tnsnames | null | null | open | Oracle - What TNS Names file am I using?
===
Sometimes I get Oracle connection problems because I can't figure out which tnsnames.ora file my database client is using.
What's the best way to figure this out? ++happy for various platform solutions.
| 0 |
10,506 | 08/13/2008 23:57:01 | 122 | 08/02/2008 07:56:07 | 2,496 | 128 | Weird DB2 issue with DBUnit | I am having a strange DB2 issue when I run DBUnit tests. My DBUnit tests are highly customized, but I don't think it is the issue. When I run the tests, I get a failure SQLCODE: -1084, SQLSTATE: 57019, [which translates to][1] "SQL1084C Shared memory segments cannot be allocated."
It sounds like a weird memory issue, though here's the big strange thing. If I ssh to the test database server, then go in to db2 and do "connect to MY_DB", the tests start succeeding! This seems to have no relation to the supposed memory error that is being reported.
I have 2 tests, and the first one actually succeeds, the second one is the one that fails. However, it fails in the DBUnit setup code, when it is obtaining the connection to the DB server to load my xml dataset.
Any ideas what might be going on?
[1]: https://www1.columbia.edu/sec/acis/db2/db2m0/sql1000.htm | java | db2 | dbunit | null | null | null | open | Weird DB2 issue with DBUnit
===
I am having a strange DB2 issue when I run DBUnit tests. My DBUnit tests are highly customized, but I don't think it is the issue. When I run the tests, I get a failure SQLCODE: -1084, SQLSTATE: 57019, [which translates to][1] "SQL1084C Shared memory segments cannot be allocated."
It sounds like a weird memory issue, though here's the big strange thing. If I ssh to the test database server, then go in to db2 and do "connect to MY_DB", the tests start succeeding! This seems to have no relation to the supposed memory error that is being reported.
I have 2 tests, and the first one actually succeeds, the second one is the one that fails. However, it fails in the DBUnit setup code, when it is obtaining the connection to the DB server to load my xml dataset.
Any ideas what might be going on?
[1]: https://www1.columbia.edu/sec/acis/db2/db2m0/sql1000.htm | 0 |
10,515 | 08/14/2008 00:12:18 | 115 | 08/02/2008 05:44:40 | 149 | 25 | PHP on IIS | Having been a PHP developer on LAMP servers for quite a while, is there anything that I will need to take into consideration while preparing an application for IIS on windows. | php | iis | windows | lamp | portability | null | open | PHP on IIS
===
Having been a PHP developer on LAMP servers for quite a while, is there anything that I will need to take into consideration while preparing an application for IIS on windows. | 0 |
10,524 | 08/14/2008 00:24:43 | 708 | 08/08/2008 06:10:02 | 15 | 7 | Expression.Invoke in Entity Framework? | The Entity Framework does not support the Expression.Invoke operator (You receive the following exception when trying to use it: "The LINQ expression node type 'Invoke' is not supported in LINQ to Entities.)
Has anyone got a workaround for this missing functionality? I would like to use the PredicateBuilder detailed [here][1] in an Entity Framework context.
[1]: http://www.albahari.com/nutshell/predicatebuilder.html | linq | entityframework | linq-to-entities | null | null | null | open | Expression.Invoke in Entity Framework?
===
The Entity Framework does not support the Expression.Invoke operator (You receive the following exception when trying to use it: "The LINQ expression node type 'Invoke' is not supported in LINQ to Entities.)
Has anyone got a workaround for this missing functionality? I would like to use the PredicateBuilder detailed [here][1] in an Entity Framework context.
[1]: http://www.albahari.com/nutshell/predicatebuilder.html | 0 |
10,531 | 08/14/2008 00:36:01 | 859 | 08/09/2008 18:03:12 | 1 | 0 | Using c# with OpenOffice through reflection | I'm working on some code to paste into the currently active OpenOffice document directly from c#. I can't include any of the OpenOffice libraries, because we don't want to package them, so we're using reflection to get access to the OpenOffice api.
My question involves using a dispatcher through reflection. I can't figure out the correct parameters to pass to it, giving me a lovely "TargetInvocationException" due to mismatched types.
object objframe = GetProperty<object>(objcontroller, "frame");
if (objframe != null)
{
object[] paramlist = new object[2] {".uno:Paste", objframe};
InvokeMethod<object>(objdispatcher, "executeDispatch", paramlist);
}
Any help? | c# | reflection | null | null | null | null | open | Using c# with OpenOffice through reflection
===
I'm working on some code to paste into the currently active OpenOffice document directly from c#. I can't include any of the OpenOffice libraries, because we don't want to package them, so we're using reflection to get access to the OpenOffice api.
My question involves using a dispatcher through reflection. I can't figure out the correct parameters to pass to it, giving me a lovely "TargetInvocationException" due to mismatched types.
object objframe = GetProperty<object>(objcontroller, "frame");
if (objframe != null)
{
object[] paramlist = new object[2] {".uno:Paste", objframe};
InvokeMethod<object>(objdispatcher, "executeDispatch", paramlist);
}
Any help? | 0 |
10,532 | 08/14/2008 00:36:20 | 305 | 08/04/2008 14:04:19 | 178 | 18 | What's the preferred way to connect to a postgresql database from PHP? | I've been using PHP+MySQL for ages and am about to start using postgresql instead.
What's the preferred method?
Is it via the PDO objects or is there something better? | php | postgresql | null | null | null | null | open | What's the preferred way to connect to a postgresql database from PHP?
===
I've been using PHP+MySQL for ages and am about to start using postgresql instead.
What's the preferred method?
Is it via the PDO objects or is there something better? | 0 |
10,533 | 08/14/2008 00:40:26 | 872 | 08/09/2008 23:52:40 | 1,696 | 133 | Parsing attributes with regex in Perl | Here's a problem I ran into recently. I have attributes strings of the form
"x=1 and y=abc and z=c4g and ..."
Some attributes have numeric values, some have alpha values, some have mixed, some have dates, etc.
Every string is *supposed* to have "`x=someval and y=anotherval`" at the beginning, but some don't. I have three things I need to do.
1. Validate the strings to be certain that they have `x` and `y`.
2. Actually parse the values for `x` and `y`.
3. Get the rest of the string.
Given the example at the top, this would result in the following variables:
$x = 1;
$y = "abc";
$remainder = "z=c4g and ..."
My question is: Is there a (reasonably) simple way to parse these *and* validate with a single regular expression? i.e.:
if ($str =~ /someexpression/)
{
$x = $1;
$y = $2;
$remainder = $3;
}
Note that the string may consist of *only* `x` and `y` attributes. This is a valid string.
I'll post my solution as an answer, but it doesn't meet my single-regex preference. | regex | perl | null | null | null | null | open | Parsing attributes with regex in Perl
===
Here's a problem I ran into recently. I have attributes strings of the form
"x=1 and y=abc and z=c4g and ..."
Some attributes have numeric values, some have alpha values, some have mixed, some have dates, etc.
Every string is *supposed* to have "`x=someval and y=anotherval`" at the beginning, but some don't. I have three things I need to do.
1. Validate the strings to be certain that they have `x` and `y`.
2. Actually parse the values for `x` and `y`.
3. Get the rest of the string.
Given the example at the top, this would result in the following variables:
$x = 1;
$y = "abc";
$remainder = "z=c4g and ..."
My question is: Is there a (reasonably) simple way to parse these *and* validate with a single regular expression? i.e.:
if ($str =~ /someexpression/)
{
$x = $1;
$y = $2;
$remainder = $3;
}
Note that the string may consist of *only* `x` and `y` attributes. This is a valid string.
I'll post my solution as an answer, but it doesn't meet my single-regex preference. | 0 |
10,564 | 08/14/2008 01:43:04 | 437 | 08/05/2008 18:13:45 | 604 | 17 | How can I set up an editor to work with Git on Windows? | I'm trying out Git on Windows. I got to the point of trying "git commit" and I got this error:
> Terminal is dumb but no VISUAL nor
> EDITOR defined. Please supply the
> message using either -m or -F option.
So I figured out I need to have an environment variable called EDITOR. No problem. I set it to point to Notepad.
That worked, almost. The default commit message opens in Notepad. But Notepad doesn't support bare line feeds.
I went out and got [Notepad++][notepad++]. But I can't figure out how to get Notepad++ set up as the %EDITOR% in such a way that it works with Git as expected.
[notepad++]: http://notepad-plus.sourceforge.net/uk/site.htm
I'm not married to Notepad++. At this point I couldn't care less what editor I use. I just want to be able to type my commit messages without using -m.
**So, for those of you using Git on Windows: What (free) tool do you use to edit your commit message, and what do you get when you type echo %EDITOR% at the command prompt?**
| git | editor | windows | null | null | null | open | How can I set up an editor to work with Git on Windows?
===
I'm trying out Git on Windows. I got to the point of trying "git commit" and I got this error:
> Terminal is dumb but no VISUAL nor
> EDITOR defined. Please supply the
> message using either -m or -F option.
So I figured out I need to have an environment variable called EDITOR. No problem. I set it to point to Notepad.
That worked, almost. The default commit message opens in Notepad. But Notepad doesn't support bare line feeds.
I went out and got [Notepad++][notepad++]. But I can't figure out how to get Notepad++ set up as the %EDITOR% in such a way that it works with Git as expected.
[notepad++]: http://notepad-plus.sourceforge.net/uk/site.htm
I'm not married to Notepad++. At this point I couldn't care less what editor I use. I just want to be able to type my commit messages without using -m.
**So, for those of you using Git on Windows: What (free) tool do you use to edit your commit message, and what do you get when you type echo %EDITOR% at the command prompt?**
| 0 |
10,575 | 08/14/2008 02:01:02 | 1,219 | 08/13/2008 13:44:47 | 16 | 15 | What's your Interactive Voice Response Platform? | For those of you working in the voice space, what are you using as your IVR platform? I am using Microsoft Speech Server 2007. What are some equivalent packages? Is anyone using open source software for handling inbound or outbound calls? Note that I'm not just talking about speech recognition, which is one component of a comprehensive package. An IVR platform would consist of speech recognition, text-to-speech, a VUI technology such as VoiceXML, and call termination via SIP or telephony hardware. | ivr | voip | telephony | voice | null | null | open | What's your Interactive Voice Response Platform?
===
For those of you working in the voice space, what are you using as your IVR platform? I am using Microsoft Speech Server 2007. What are some equivalent packages? Is anyone using open source software for handling inbound or outbound calls? Note that I'm not just talking about speech recognition, which is one component of a comprehensive package. An IVR platform would consist of speech recognition, text-to-speech, a VUI technology such as VoiceXML, and call termination via SIP or telephony hardware. | 0 |
10,580 | 08/14/2008 02:10:53 | 1,190 | 08/13/2008 12:15:38 | 180 | 12 | What are Early and Late Binding? | In the spirit of asking the questions that need to be asked . . . what is the difference between early and late binding? | binding | cs101 | null | null | null | null | open | What are Early and Late Binding?
===
In the spirit of asking the questions that need to be asked . . . what is the difference between early and late binding? | 0 |
10,583 | 08/14/2008 02:20:10 | 784 | 08/08/2008 22:02:14 | 153 | 7 | What do you do when you're learning a new programming language? | When you decide to learn a new language what do you do?
I tend to do a small amount of reading about said language then write a few simple "standard" programs -- typically raytracers and parsers because they're what i'm conceptually familiar with -- so that a can get a feel for the language and learn to use it without having to think about how to do the task at hand.
Once I've got to that point it just degenerates into the more boring process of just using it on a regular basis for whatever I need to do. | language-agnostic | null | null | null | null | 10/29/2010 21:43:01 | not constructive | What do you do when you're learning a new programming language?
===
When you decide to learn a new language what do you do?
I tend to do a small amount of reading about said language then write a few simple "standard" programs -- typically raytracers and parsers because they're what i'm conceptually familiar with -- so that a can get a feel for the language and learn to use it without having to think about how to do the task at hand.
Once I've got to that point it just degenerates into the more boring process of just using it on a regular basis for whatever I need to do. | 4 |
10,586 | 08/14/2008 02:22:37 | 797 | 08/09/2008 02:14:04 | 170 | 5 | Small modification to an XML document using StAX | I'm currently trying to read in an XML file, make some minor changes (alter the value of some attributes), and write it back out again.
I have intended to use a StAX parser (javax.xml.stream.XMLStreamReader) to read in each event, see if it was one I wanted to change, and then pass it straight on to the StAX writer (javax.xml.stream.XMLStreamReader) if no changes were required.
Unfortunately, that doesn't look to be so simple - The writer has no way to take an event type and a parser object, only methods like writeAttribute and writeStartElement. Obviously I could write a big switch statement with a case for every possible type of element which can occur in an XML document, and just write it back out again, but it seems like a lot of trouble for something which seems like it should be simple.
Is there something I'm missing that makes it easy to write out a very similar XML document to the one you read in with StAX? | java | stax | null | null | null | null | open | Small modification to an XML document using StAX
===
I'm currently trying to read in an XML file, make some minor changes (alter the value of some attributes), and write it back out again.
I have intended to use a StAX parser (javax.xml.stream.XMLStreamReader) to read in each event, see if it was one I wanted to change, and then pass it straight on to the StAX writer (javax.xml.stream.XMLStreamReader) if no changes were required.
Unfortunately, that doesn't look to be so simple - The writer has no way to take an event type and a parser object, only methods like writeAttribute and writeStartElement. Obviously I could write a big switch statement with a case for every possible type of element which can occur in an XML document, and just write it back out again, but it seems like a lot of trouble for something which seems like it should be simple.
Is there something I'm missing that makes it easy to write out a very similar XML document to the one you read in with StAX? | 0 |
10,595 | 08/14/2008 02:39:38 | 1,263 | 08/14/2008 02:39:38 | 1 | 0 | How do I write those cool command line code generators (rails, sproutcore, webgen) | I've grokked the code for all the aforementioned apps and I still can't find a straightforward way to create a static directory structure from a single command... | ruby | null | null | null | null | null | open | How do I write those cool command line code generators (rails, sproutcore, webgen)
===
I've grokked the code for all the aforementioned apps and I still can't find a straightforward way to create a static directory structure from a single command... | 0 |
10,599 | 08/14/2008 02:50:26 | 730 | 08/08/2008 12:40:04 | 6 | 8 | Web page field validation | I need to validate a date/time field on a webpage but want it to do it without reloading the page and would like 'instant' feedback for the users.
What's the best/easiest solution.
BTW: easiest scores 65% of total points
| webpage | fieldvalidation | null | null | null | null | open | Web page field validation
===
I need to validate a date/time field on a webpage but want it to do it without reloading the page and would like 'instant' feedback for the users.
What's the best/easiest solution.
BTW: easiest scores 65% of total points
| 0 |
10,600 | 08/14/2008 02:52:28 | 1,219 | 08/13/2008 13:44:47 | 16 | 16 | What's the best database storage device? | So, the answer should probably be presented in tiers for the size of the application, but I'm wondering about people's experience with choosing where the disk drives used by the database should reside.
Here are some of the options:
- Old fashioned internal disks - fast but not very expandable
- NAS - Slow but cheap and expandable, probably best for backups
- DAS - A decent compromise, but generally accessible from only one or two machines
- SAN - Expensive but very good
How much should you worry about choosing a 15k drive over a 10k or 7200RPM?
What's your favorite RAID level? | database | storage | raid | disk | null | null | open | What's the best database storage device?
===
So, the answer should probably be presented in tiers for the size of the application, but I'm wondering about people's experience with choosing where the disk drives used by the database should reside.
Here are some of the options:
- Old fashioned internal disks - fast but not very expandable
- NAS - Slow but cheap and expandable, probably best for backups
- DAS - A decent compromise, but generally accessible from only one or two machines
- SAN - Expensive but very good
How much should you worry about choosing a 15k drive over a 10k or 7200RPM?
What's your favorite RAID level? | 0 |
10,601 | 08/14/2008 02:56:31 | 718 | 08/08/2008 07:07:38 | 174 | 7 | What are you doing to become a better developer? | These are the things which I do regularly:
- Read other people's code
- Read blogs
- Listen to podcasts
- Posting to my blog
- Read books (mostly technical)
I'm curious if there's something which does not seem to be programming related but helps you to become better. | self-improvement | null | null | null | null | null | open | What are you doing to become a better developer?
===
These are the things which I do regularly:
- Read other people's code
- Read blogs
- Listen to podcasts
- Posting to my blog
- Read books (mostly technical)
I'm curious if there's something which does not seem to be programming related but helps you to become better. | 0 |
10,604 | 08/14/2008 02:57:18 | 150 | 08/02/2008 16:09:34 | 129 | 4 | Automatically measure all SQL queries | In [Maybe Normalizing Isn't Normal](http://www.codinghorror.com/blog/archives/001152.html) Jeff Atwood says, "You're automatically measuring all the queries that flow through your software, right?" I'm not but I'd like to. What's the best way to do this with an ASP.NET + MS SQL Server application?
| mssql | optimization | null | null | null | null | open | Automatically measure all SQL queries
===
In [Maybe Normalizing Isn't Normal](http://www.codinghorror.com/blog/archives/001152.html) Jeff Atwood says, "You're automatically measuring all the queries that flow through your software, right?" I'm not but I'd like to. What's the best way to do this with an ASP.NET + MS SQL Server application?
| 0 |
10,610 | 08/14/2008 03:04:16 | 805 | 08/09/2008 03:27:03 | 1 | 0 | Regex Library | Does anyone use have a good regex library that they like to use? Most of the regexes that you find online either contain bugs or are so focused on the edge cases that it turns into a competition to validate whatever spec 100%. Of course you can write your own, but when you are billing by the hour its handy to have a library around. | regex | null | null | null | null | null | open | Regex Library
===
Does anyone use have a good regex library that they like to use? Most of the regexes that you find online either contain bugs or are so focused on the edge cases that it turns into a competition to validate whatever spec 100%. Of course you can write your own, but when you are billing by the hour its handy to have a library around. | 0 |
10,634 | 08/14/2008 03:36:54 | 1,220 | 08/13/2008 13:44:48 | 339 | 19 | Is msbuild worth looking at? | I currently use nant, ccnet, svn, mbunit. I use msbuild to do my sln build just because it was simpler to shell out.
Are there any merits to switching my whole build script to MSBuild? I need to be able to run tests, watir style tests, xcopy deploy. Is this easier? | nant | msbuild | buildprocess | build-automation | null | null | open | Is msbuild worth looking at?
===
I currently use nant, ccnet, svn, mbunit. I use msbuild to do my sln build just because it was simpler to shell out.
Are there any merits to switching my whole build script to MSBuild? I need to be able to run tests, watir style tests, xcopy deploy. Is this easier? | 0 |
10,635 | 08/14/2008 03:39:17 | 1,220 | 08/13/2008 13:44:48 | 339 | 19 | Why don't my powershell scripts run? | I wrote a simple batch file as a powershell script, getting errors when they run.
its in a scripts directory in my path. Don't have the error handy, but its something about signatures.
| powershell | null | null | null | null | null | open | Why don't my powershell scripts run?
===
I wrote a simple batch file as a powershell script, getting errors when they run.
its in a scripts directory in my path. Don't have the error handy, but its something about signatures.
| 0 |
10,644 | 08/14/2008 03:52:55 | 147 | 08/02/2008 14:57:08 | 172 | 8 | Any decent C# profilers out there? | I urgently need a C# profiler.
Although I'm not averse to paying for one, something which is free or at least with a trial version would be ideal since it takes time to raise a purchase order.
Any recommendations? | c# | .net | profiler | null | null | null | open | Any decent C# profilers out there?
===
I urgently need a C# profiler.
Although I'm not averse to paying for one, something which is free or at least with a trial version would be ideal since it takes time to raise a purchase order.
Any recommendations? | 0 |
10,658 | 08/14/2008 04:07:36 | 519 | 08/06/2008 14:09:46 | 122 | 6 | Creating iCal Files in c# | I'm looking for a good method of generating an iCalendar file (*.ics) in c# (asp.net). I've found a couple resources, but one thing that has been lacking is their support for **quoted-printable** fields - fields that have carriage returns and line feeds.
For example, if the **description** field isn't encoded properly, only the first line will display and possibly corrupting the rest of the information in the *.ics file.
I'm looking for existing classes that can generate *.ics files and/or a class that can generate **quoted-printable** fields. | c# | asp.net | asp | ical | icalendar | null | open | Creating iCal Files in c#
===
I'm looking for a good method of generating an iCalendar file (*.ics) in c# (asp.net). I've found a couple resources, but one thing that has been lacking is their support for **quoted-printable** fields - fields that have carriage returns and line feeds.
For example, if the **description** field isn't encoded properly, only the first line will display and possibly corrupting the rest of the information in the *.ics file.
I'm looking for existing classes that can generate *.ics files and/or a class that can generate **quoted-printable** fields. | 0 |
10,661 | 08/14/2008 04:16:18 | 209 | 08/03/2008 13:54:19 | 16 | 2 | Does the OutputCacheFilter in the Microsoft MVC Preview 4 actually save on action invocations? | We deployed a live, fresh, swanky site using preview 3 including rigorous stress testing.
Page Output caching was our saviour and afforded us the ability to meet our performance contractual requirements.
My question is, is there a difference between action OutputCacheFilter and page output caching?
Is the action output caching faster than page output caching?
| mvc | aspnetmvc | aspnet | asp | c# | null | open | Does the OutputCacheFilter in the Microsoft MVC Preview 4 actually save on action invocations?
===
We deployed a live, fresh, swanky site using preview 3 including rigorous stress testing.
Page Output caching was our saviour and afforded us the ability to meet our performance contractual requirements.
My question is, is there a difference between action OutputCacheFilter and page output caching?
Is the action output caching faster than page output caching?
| 0 |
10,668 | 08/14/2008 04:31:32 | 1,114 | 08/12/2008 12:54:42 | 1 | 0 | Reading Other Process' Memory in Mac OS / BSD | I've been attempting to understand how to read the memory of other processes on Mac OS, but I'm not having much luck. I've seen many examples online using `ptrace` with `PEEKDATA` and such, however it doesn't have that option on BSD ([man page](http://developer.apple.com/documentation/Darwin/Reference/ManPages/man2/ptrace.2.html)).
Does anyone know how I might do this?
Thank you. | memory | ptrace | macos | bsd | null | null | open | Reading Other Process' Memory in Mac OS / BSD
===
I've been attempting to understand how to read the memory of other processes on Mac OS, but I'm not having much luck. I've seen many examples online using `ptrace` with `PEEKDATA` and such, however it doesn't have that option on BSD ([man page](http://developer.apple.com/documentation/Darwin/Reference/ManPages/man2/ptrace.2.html)).
Does anyone know how I might do this?
Thank you. | 0 |
10,670 | 08/14/2008 04:35:16 | 209 | 08/03/2008 13:54:19 | 16 | 2 | Asynchronous Remoting calls | We have a remoting singleton server running in a separate windows service (let's call her RemotingService). The clients of the RemotingService are ASP.NET instances (many many).
Currently, the clients remoting call RemotingService and blocks while the RemotingService call is serviced. However, the remoting service is getting complicated enough (with more RPC calls and complex algorithms) that the asp.net worker threads are blocked for a significantly long time (4-5 seconds).
According to [this msdn article][1], doing this will not scale well because an asp.net worker thread is blocked for each remoting RPC. It advises switching to async handlers to free up asp.net worker threads.
> The purpose of an asynchronous handler
> is to free up an ASP.NET thread pool
> thread to service additional requests
> while the handler is processing the
> original request.
This seems fine, except the remoting call still takes up a thread from the thread pool.
Is this the same thread pool as the asp.net worker threads?
**How should I go about turning my remoting singleton server into an async system such that I free up my asp.net worker threads?**
I've probably missed out some important information, please let me know if there is anything else you need to know to answer the question.
[1]: http://msdn.microsoft.com/en-us/magazine/cc164128.aspx | c# | .net-3.5 | .net-2.0 | remoting | rpc | null | open | Asynchronous Remoting calls
===
We have a remoting singleton server running in a separate windows service (let's call her RemotingService). The clients of the RemotingService are ASP.NET instances (many many).
Currently, the clients remoting call RemotingService and blocks while the RemotingService call is serviced. However, the remoting service is getting complicated enough (with more RPC calls and complex algorithms) that the asp.net worker threads are blocked for a significantly long time (4-5 seconds).
According to [this msdn article][1], doing this will not scale well because an asp.net worker thread is blocked for each remoting RPC. It advises switching to async handlers to free up asp.net worker threads.
> The purpose of an asynchronous handler
> is to free up an ASP.NET thread pool
> thread to service additional requests
> while the handler is processing the
> original request.
This seems fine, except the remoting call still takes up a thread from the thread pool.
Is this the same thread pool as the asp.net worker threads?
**How should I go about turning my remoting singleton server into an async system such that I free up my asp.net worker threads?**
I've probably missed out some important information, please let me know if there is anything else you need to know to answer the question.
[1]: http://msdn.microsoft.com/en-us/magazine/cc164128.aspx | 0 |
10,680 | 08/14/2008 04:53:45 | 1,084 | 08/12/2008 11:01:49 | 19 | 6 | onexit() vs atexit() | Is there any difference between
int on_exit(void (*function)(int , void *), void *arg);
and
int atexit(void (*function)(void));
other than the fact that the function used by on_exit gets the exit status?
That is, if I don't care about the exit status, is there any reason to use one or the other? | c | linux | null | null | null | null | open | onexit() vs atexit()
===
Is there any difference between
int on_exit(void (*function)(int , void *), void *arg);
and
int atexit(void (*function)(void));
other than the fact that the function used by on_exit gets the exit status?
That is, if I don't care about the exit status, is there any reason to use one or the other? | 0 |
10,688 | 08/14/2008 05:10:36 | 372 | 08/05/2008 09:16:41 | 589 | 55 | Best tool for auto-generating SQL change scripts | I'm doing a survey for the best SQL change script generators out there, specifically for MS SQL Server.
I do know of [Redgate SQL Compare][1], but I'd like to know what others use, and if there are free versions of such software that I could try.
Any suggestions?
[1]: http://www.red-gate.com/products/SQL_Compare/index.htm | sql | database | server | null | null | null | open | Best tool for auto-generating SQL change scripts
===
I'm doing a survey for the best SQL change script generators out there, specifically for MS SQL Server.
I do know of [Redgate SQL Compare][1], but I'd like to know what others use, and if there are free versions of such software that I could try.
Any suggestions?
[1]: http://www.red-gate.com/products/SQL_Compare/index.htm | 0 |
10,715 | 08/14/2008 05:55:56 | 528 | 08/06/2008 14:45:05 | 56 | 3 | What types of software testing are there? | What are all the types of software testing that you can put in front of the word "Testing"?
Here are some examples:
- Unit Testing
- Functional Testing
- Integration Testing
- Performance Testing
- Stress and Volume Testing
- White Box Testing
- Black Box Testing
- User Testing
- Automated Testing
- Regression Testing
Let's see if we can come up with good, concise, distinguishing definitions for these.
How about 40 words or fewer for each of these (and others)?
| testing | null | null | null | null | null | open | What types of software testing are there?
===
What are all the types of software testing that you can put in front of the word "Testing"?
Here are some examples:
- Unit Testing
- Functional Testing
- Integration Testing
- Performance Testing
- Stress and Volume Testing
- White Box Testing
- Black Box Testing
- User Testing
- Automated Testing
- Regression Testing
Let's see if we can come up with good, concise, distinguishing definitions for these.
How about 40 words or fewer for each of these (and others)?
| 0 |
10,727 | 08/14/2008 06:07:53 | 116 | 08/02/2008 05:51:57 | 2,071 | 130 | What is a "reasonable" length of time to keep a SQL cursor open? | In your applications, what's a "long time" to keep a transaction open before committing or rolling back? Minutes? Seconds? Hours?
and on which database? | sql | cursor | null | null | null | null | open | What is a "reasonable" length of time to keep a SQL cursor open?
===
In your applications, what's a "long time" to keep a transaction open before committing or rolling back? Minutes? Seconds? Hours?
and on which database? | 0 |
10,731 | 08/14/2008 06:10:25 | 116 | 08/02/2008 05:51:57 | 2,071 | 130 | Best way to store a database password in a startup script / config file? | So our web server apps need to connect to the database, and some other apps have startup scripts that execute at boot time.
What's the best way to store the name/password for these applications? | server | sql | password | security | null | null | open | Best way to store a database password in a startup script / config file?
===
So our web server apps need to connect to the database, and some other apps have startup scripts that execute at boot time.
What's the best way to store the name/password for these applications? | 0 |
10,752 | 08/14/2008 06:27:57 | 122 | 08/02/2008 07:56:07 | 2,601 | 139 | What is the difference between integration and unit tests? | I know the so-called textbook definition of unit tests and integration tests. What I am curious about is when it is time to write unit tests... I will write them to cover as many sets of classes as possible.
For example, if I have a Word class, I will write some unit tests for the Word class. Then, I begin writing my Sentence class, and when it needs to interact with the Word class, I will often write my unit tests such that they test both Sentence and Word... at least in the places where they interact.
Have these tests essentially become integration tests because they now test the integration of these 2 classes? Or is it just a unit test that spans 2 classes?
In general, because of this uncertain line, I will rarely actually write integration tests... or is my using the finished product to see if all the pieces work properly the actual integration tests, even though they are manual and rarely repeated beyond the scope of each individual feature?
Am I misunderstanding integration tests, or is there really just very little difference between integration and unit tests? | integration-testing | unit-testing | null | null | null | null | open | What is the difference between integration and unit tests?
===
I know the so-called textbook definition of unit tests and integration tests. What I am curious about is when it is time to write unit tests... I will write them to cover as many sets of classes as possible.
For example, if I have a Word class, I will write some unit tests for the Word class. Then, I begin writing my Sentence class, and when it needs to interact with the Word class, I will often write my unit tests such that they test both Sentence and Word... at least in the places where they interact.
Have these tests essentially become integration tests because they now test the integration of these 2 classes? Or is it just a unit test that spans 2 classes?
In general, because of this uncertain line, I will rarely actually write integration tests... or is my using the finished product to see if all the pieces work properly the actual integration tests, even though they are manual and rarely repeated beyond the scope of each individual feature?
Am I misunderstanding integration tests, or is there really just very little difference between integration and unit tests? | 0 |
10,782 | 08/14/2008 07:21:12 | 481 | 08/06/2008 08:40:41 | 26 | 5 | convert asp.net application to iis7 integrated mode | What steps I need to perform in order to convert asp.net 2 application from iis7 classic to integrated mode? | asp.net | iis7 | classic | integrated | null | null | open | convert asp.net application to iis7 integrated mode
===
What steps I need to perform in order to convert asp.net 2 application from iis7 classic to integrated mode? | 0 |
10,793 | 08/14/2008 08:06:59 | 1,269 | 08/14/2008 08:00:22 | 1 | 0 | Catching unhandled exceptions in ASP.NET UserControls | I'm dynamically loading user controls adding them to the Controls collection of the web form.
I'd like to hide user controls if they cause a unhandled exception while rendering.
So, I tried hooking to the Error event of each UserControl but it seems that this event never fires for the UserControls as it does for Page class.
Did some googling around and it doesn't seem promising. Any ideas here? | asp.net | exception | usercontrols | null | null | null | open | Catching unhandled exceptions in ASP.NET UserControls
===
I'm dynamically loading user controls adding them to the Controls collection of the web form.
I'd like to hide user controls if they cause a unhandled exception while rendering.
So, I tried hooking to the Error event of each UserControl but it seems that this event never fires for the UserControls as it does for Page class.
Did some googling around and it doesn't seem promising. Any ideas here? | 0 |
10,808 | 08/14/2008 08:30:27 | 841 | 08/09/2008 09:37:17 | 23 | 3 | Ruby mixins and calling super methods | Ok, so I've been refactoring my code in my little Rails app in an effort to remove duplication, and in general make my life easier (as I like an easy life). Part of this refactoring, has been to move code that's common to two of my models to a module that I can include where I need it.
So far, so good. Looks like it's going to work out, but I've just hit a problem that I'm not sure how to get around. The module (which I've called sendable), is just going to be the code that handles faxing, e-mailing, or printing a PDF of the document. So, for example, I have a purchase order, and I have Internal Sales Orders (imaginatively abbreviated to ISO).
The problem I've struck, is that I want some variables initialised (initialized for people who don't spell correctly :P ) after the object is loaded, so I've been using the **after_initialize** hook. No problem... until I start adding some more mixins.
The problem I have, is that I can have an **`after_initialize`** in any one of my mixins, so I need to include a **super** call at the start to make sure the other mixin **`after_initialize`** calls get called. Which is great, until I end up calling super and I get an error because there is no super to call.
Here's a little example, in case I haven't been confusing enough:
class Iso < ActiveRecord::Base
include Shared::TracksSerialNumberExtension
include Shared::OrderLines
extend Shared::Filtered
include Sendable::Model
validates_presence_of :customer
validates_associated :lines
owned_by :customer
order_lines :despatched # Mixin
tracks_serial_numbers :items # Mixin
sendable :customer # Mixin
attr_accessor :address
def initialize( params = nil )
super
self.created_at ||= Time.now.to_date
end
end
So, if each one of the mixins have an after_initialize call, with a **super** call, how can I stop that last **super** call from raising the error? How can I test that the super method exists before I call it? | ruby | ruby-on-rails | null | null | null | null | open | Ruby mixins and calling super methods
===
Ok, so I've been refactoring my code in my little Rails app in an effort to remove duplication, and in general make my life easier (as I like an easy life). Part of this refactoring, has been to move code that's common to two of my models to a module that I can include where I need it.
So far, so good. Looks like it's going to work out, but I've just hit a problem that I'm not sure how to get around. The module (which I've called sendable), is just going to be the code that handles faxing, e-mailing, or printing a PDF of the document. So, for example, I have a purchase order, and I have Internal Sales Orders (imaginatively abbreviated to ISO).
The problem I've struck, is that I want some variables initialised (initialized for people who don't spell correctly :P ) after the object is loaded, so I've been using the **after_initialize** hook. No problem... until I start adding some more mixins.
The problem I have, is that I can have an **`after_initialize`** in any one of my mixins, so I need to include a **super** call at the start to make sure the other mixin **`after_initialize`** calls get called. Which is great, until I end up calling super and I get an error because there is no super to call.
Here's a little example, in case I haven't been confusing enough:
class Iso < ActiveRecord::Base
include Shared::TracksSerialNumberExtension
include Shared::OrderLines
extend Shared::Filtered
include Sendable::Model
validates_presence_of :customer
validates_associated :lines
owned_by :customer
order_lines :despatched # Mixin
tracks_serial_numbers :items # Mixin
sendable :customer # Mixin
attr_accessor :address
def initialize( params = nil )
super
self.created_at ||= Time.now.to_date
end
end
So, if each one of the mixins have an after_initialize call, with a **super** call, how can I stop that last **super** call from raising the error? How can I test that the super method exists before I call it? | 0 |
10,810 | 08/14/2008 08:38:24 | 966 | 08/11/2008 07:35:55 | 1 | 0 | Why do I get the error "Unable to update the password" when calling AzMan? | I'm doing a authorization check from a WinForms application with the help of the AzMan authorization provider from Enterprise Library and I'm receiving the the following error:
> Unable to update the password. The value provided as the current password is incorrect. (Exception from HRESULT: 0x8007052B) (Microsoft.Practices.EnterpriseLibrary.Security.AzMan)
>
> ------------------------------
>
> Unable to update the password. The value provided as the current password is incorrect. (Exception from HRESULT: 0x8007052B) (Microsoft.Interop.Security.AzRoles)
The AzMan store is hosted in ADAM on another computer in the same domain. Other computers and users do not have this problem. The user making the call have read access to both ADAM and the AzMan store. The computer running the WinForms app and the running ADAM are both on Windows XP SP2.
I've had access problems with AzMan before that I've resolved but this was a new one... What am I missing? | winxp | c# | azman | winforms | adam | null | open | Why do I get the error "Unable to update the password" when calling AzMan?
===
I'm doing a authorization check from a WinForms application with the help of the AzMan authorization provider from Enterprise Library and I'm receiving the the following error:
> Unable to update the password. The value provided as the current password is incorrect. (Exception from HRESULT: 0x8007052B) (Microsoft.Practices.EnterpriseLibrary.Security.AzMan)
>
> ------------------------------
>
> Unable to update the password. The value provided as the current password is incorrect. (Exception from HRESULT: 0x8007052B) (Microsoft.Interop.Security.AzRoles)
The AzMan store is hosted in ADAM on another computer in the same domain. Other computers and users do not have this problem. The user making the call have read access to both ADAM and the AzMan store. The computer running the WinForms app and the running ADAM are both on Windows XP SP2.
I've had access problems with AzMan before that I've resolved but this was a new one... What am I missing? | 0 |
10,819 | 08/14/2008 09:01:37 | 224 | 08/03/2008 17:17:37 | 266 | 11 | SQL, Auxiliary table of numbers | For certain types of sql queries, an auxiliary table of numbers can be very useful. It may be created as a table with as many rows as you need for a particular task or as a user defined function that returns the number of rows required in each query.
What is the optimal way to create such a function? | sql-server | sql | query | number | null | null | open | SQL, Auxiliary table of numbers
===
For certain types of sql queries, an auxiliary table of numbers can be very useful. It may be created as a table with as many rows as you need for a particular task or as a user defined function that returns the number of rows required in each query.
What is the optimal way to create such a function? | 0 |
10,822 | 08/14/2008 09:09:52 | 1,271 | 08/14/2008 09:09:52 | 1 | 0 | Fast database access test from .Net | What would be a very fast way to determine if your connectionstring lets you connect to a database? Normally a connection attempt keeps the user waiting a long time before notifying the attempt was futile anyway... | .net | database | connectionstring | connection | null | null | open | Fast database access test from .Net
===
What would be a very fast way to determine if your connectionstring lets you connect to a database? Normally a connection attempt keeps the user waiting a long time before notifying the attempt was futile anyway... | 0 |
10,825 | 08/14/2008 09:14:07 | 993 | 08/11/2008 12:24:17 | 96 | 12 | Compare a date string to datetime in SQL Server | In SQL Server I have a DATETIME column which includes a time element.
Example:
'14 AUG 2008 14:23:019'
What is the best method to select the records for a particular day, ignoring the time part?
Example: (Not safe, as it does not match the time part and returns no rows)
SELECT *
FROM table1
WHERE column_datetime = '14 AUG 2008'
*Note: Given this site is also about jotting down notes and techniques you pick up and then forget, I'm going to post my own answer to this question as DATETIME stuff in MSSQL is probably the topic I lookup most in SQLBOL.* | database | mssql | tsql | datetime | null | null | open | Compare a date string to datetime in SQL Server
===
In SQL Server I have a DATETIME column which includes a time element.
Example:
'14 AUG 2008 14:23:019'
What is the best method to select the records for a particular day, ignoring the time part?
Example: (Not safe, as it does not match the time part and returns no rows)
SELECT *
FROM table1
WHERE column_datetime = '14 AUG 2008'
*Note: Given this site is also about jotting down notes and techniques you pick up and then forget, I'm going to post my own answer to this question as DATETIME stuff in MSSQL is probably the topic I lookup most in SQLBOL.* | 0 |
10,836 | 08/14/2008 09:24:32 | 380 | 08/05/2008 10:39:18 | 520 | 69 | Your experience with .Net based CMS | Which is a good .Net based CMS out there (for creating a corporate website). I have used Kentico CMS for some time, and am moderately happy with it.
However, is there anything better out there. I would like the ability to develop my own custom asp.net templates for various page types and install them. | .net | content-management-system | null | null | null | 03/06/2012 02:24:56 | not constructive | Your experience with .Net based CMS
===
Which is a good .Net based CMS out there (for creating a corporate website). I have used Kentico CMS for some time, and am moderately happy with it.
However, is there anything better out there. I would like the ability to develop my own custom asp.net templates for various page types and install them. | 4 |
10,855 | 08/14/2008 10:08:27 | 445 | 08/05/2008 19:37:25 | 73 | 5 | LINQ query on a DataTable | I'm trying to perform a LINQ query on a DataTable object and bizarrely I am finding that performing such queries on DataTables is not straightforward. For example:
var results = from myRow in myDataTable
where results.Field("RowNo") == 1
select results;
is not allowed. Any ideas how to get something like this working? I'm amazed that LINQ queries are not allowed on DatTables! | c# | .net | ado.net | linq | null | null | open | LINQ query on a DataTable
===
I'm trying to perform a LINQ query on a DataTable object and bizarrely I am finding that performing such queries on DataTables is not straightforward. For example:
var results = from myRow in myDataTable
where results.Field("RowNo") == 1
select results;
is not allowed. Any ideas how to get something like this working? I'm amazed that LINQ queries are not allowed on DatTables! | 0 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.