question_id int64 4 6.31M | answer_id int64 7 6.31M | title stringlengths 9 150 | question_body stringlengths 0 28.8k | answer_body stringlengths 60 27.2k | question_text stringlengths 40 28.9k | combined_text stringlengths 124 39.6k | tags listlengths 1 6 | question_score int64 0 26.3k | answer_score int64 0 28.8k | view_count int64 15 14M | answer_count int64 0 182 | favorite_count int64 0 32 | question_creation_date stringdate 2008-07-31 21:42:52 2011-06-10 18:12:18 | answer_creation_date stringdate 2008-07-31 22:17:57 2011-06-10 18:14:17 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
90,411 | 90,720 | How can I make a systray (notification area) icon receive WM_MOUSEWHEEL messages? | I want to extend an existing application I made to make it set mixer volume by wheel-scrolling over it's notification area icon. As far as I know, the notification area doesn't receive any WM_MOUSEWHEEL messages, but still I found an application that does exactly what I want to achieve ( http://www.actualsolution.com/p... | If you want to capture mouse/keyboard events outside of your application you will need Low-level Hooks. A nice beginners article about installing a mouse hook in Delphi is How to Hook the Mouse to Catch Events Outside of your application on About.com written by Zarko Gajic. The user which starts your application will n... | How can I make a systray (notification area) icon receive WM_MOUSEWHEEL messages? I want to extend an existing application I made to make it set mixer volume by wheel-scrolling over it's notification area icon. As far as I know, the notification area doesn't receive any WM_MOUSEWHEEL messages, but still I found an appl... | TITLE:
How can I make a systray (notification area) icon receive WM_MOUSEWHEEL messages?
QUESTION:
I want to extend an existing application I made to make it set mixer volume by wheel-scrolling over it's notification area icon. As far as I know, the notification area doesn't receive any WM_MOUSEWHEEL messages, but sti... | [
"winapi"
] | 3 | 2 | 1,368 | 5 | 0 | 2008-09-18T06:01:06.690000 | 2008-09-18T07:30:18.317000 |
90,418 | 90,435 | Exit Shell Script Based on Process Exit Code | I have a shell script that executes a number of commands. How do I make the shell script exit if any of the commands exit with a non-zero exit code? | After each command, the exit code can be found in the $? variable so you would have something like: ls -al file.ext rc=$?; if [[ $rc!= 0 ]]; then exit $rc; fi You need to be careful of piped commands since the $? only gives you the return code of the last element in the pipe so, in the code: ls -al file.ext | sed 's/^/... | Exit Shell Script Based on Process Exit Code I have a shell script that executes a number of commands. How do I make the shell script exit if any of the commands exit with a non-zero exit code? | TITLE:
Exit Shell Script Based on Process Exit Code
QUESTION:
I have a shell script that executes a number of commands. How do I make the shell script exit if any of the commands exit with a non-zero exit code?
ANSWER:
After each command, the exit code can be found in the $? variable so you would have something like:... | [
"bash",
"shell"
] | 388 | 504 | 431,977 | 9 | 0 | 2008-09-18T06:03:48.070000 | 2008-09-18T06:08:52.677000 |
90,423 | 90,797 | What kind of issues are there in implementing realtime multiplayer games | I have some experience making multiplayer turn-based games using sockets, but I've never attempted a realtime action game. What kind of extra issues would I have to deal with? Do I need to keep a history of player actions in case lagged players do something in the past? Do I really need to use UDP packets or will TCP s... | 'client server' or 'peer to peer' or something in between: which computer has authority over which game actions. With turn based games, normally it's very easy to just say 'the server has ultimate authority and we're done'. With real time games, often that design is a great place to start, but as soon as you add latenc... | What kind of issues are there in implementing realtime multiplayer games I have some experience making multiplayer turn-based games using sockets, but I've never attempted a realtime action game. What kind of extra issues would I have to deal with? Do I need to keep a history of player actions in case lagged players do... | TITLE:
What kind of issues are there in implementing realtime multiplayer games
QUESTION:
I have some experience making multiplayer turn-based games using sockets, but I've never attempted a realtime action game. What kind of extra issues would I have to deal with? Do I need to keep a history of player actions in case... | [
"sockets",
"networking",
"tcp",
"udp",
"multiplayer"
] | 16 | 20 | 4,328 | 5 | 0 | 2008-09-18T06:05:14.370000 | 2008-09-18T07:51:00.980000 |
90,433 | 90,436 | How can I know why one of my vxWorks task is pended? | In vxWorks, I can issue the "i" command in the shell, and I get the list of tasks in my system along with some information like the following example: NAME ENTRY TID PRI STATUS PC SP ERRNO DELAY ---------- ------------ -------- --- ---------- -------- -------- ------- ----- tJobTask 1005a6e0 103bae00 0 PEND 100e5860 10... | The "w" command will do exactly what you want: NAME ENTRY TID STATUS DELAY OBJ_TYPE OBJ_ID OBJ_NAME ---------- ---------- ---------- ---------- ----- ---------- ---------- -------- tJobTask 0x1005a6e0 0x103bae00 PEND 0 SEM_B 0x10184088 N/A tExcTask 0x10059960 0x10197cbc PEND 0 SEM_B 0x10183ff8 N/A tLogTask logTask 0x10... | How can I know why one of my vxWorks task is pended? In vxWorks, I can issue the "i" command in the shell, and I get the list of tasks in my system along with some information like the following example: NAME ENTRY TID PRI STATUS PC SP ERRNO DELAY ---------- ------------ -------- --- ---------- -------- -------- ------... | TITLE:
How can I know why one of my vxWorks task is pended?
QUESTION:
In vxWorks, I can issue the "i" command in the shell, and I get the list of tasks in my system along with some information like the following example: NAME ENTRY TID PRI STATUS PC SP ERRNO DELAY ---------- ------------ -------- --- ---------- ------... | [
"vxworks"
] | 4 | 6 | 3,012 | 1 | 0 | 2008-09-18T06:08:20.727000 | 2008-09-18T06:09:15.670000 |
90,451 | 90,473 | Why would one use REST instead of SOAP based services? | Attended an interesting demo on REST today, however, I couldn't think of a single reason (nor was one presented) why REST is in anyway better or simpler to use and implement than a SOAP based Services stack. What are some of the reasons Why anyone in the "real world" use REST instead of the SOAP based Services? | Less overhead (no SOAP envelope to wrap every call in) Less duplication (HTTP already represents operations like DELETE, PUT, GET, etc. that have to otherwise be represented in a SOAP envelope). More standardized - HTTP operations are well understood and operate consistently. Some SOAP implementations can get finicky. ... | Why would one use REST instead of SOAP based services? Attended an interesting demo on REST today, however, I couldn't think of a single reason (nor was one presented) why REST is in anyway better or simpler to use and implement than a SOAP based Services stack. What are some of the reasons Why anyone in the "real worl... | TITLE:
Why would one use REST instead of SOAP based services?
QUESTION:
Attended an interesting demo on REST today, however, I couldn't think of a single reason (nor was one presented) why REST is in anyway better or simpler to use and implement than a SOAP based Services stack. What are some of the reasons Why anyone... | [
"web-services",
"rest"
] | 153 | 160 | 77,166 | 11 | 0 | 2008-09-18T06:12:21.543000 | 2008-09-18T06:18:19.737000 |
90,476 | 90,558 | Loading .Net Fx query | I have built a simple C#.Net app on a M/C with only.Net FX 1.1 present. Now when I execute this app on a M/C where there is: Case 1) Only.Net fx 2.0 is installed Case 2) Both.Net Fx 1.1 amd 2.0 are installed How is it determined to load the appropriate.Net framework in the above cases. | The behavior as I understand it is your 1.1. app will use the 1.1 Framework unless it's unavailable, in which case it will use the 2.0 Framework, this is how an application can be compiled against the 1.1 Framework but can often still work on Vista, where only the 2.0 framework is available. Some handy resources I've u... | Loading .Net Fx query I have built a simple C#.Net app on a M/C with only.Net FX 1.1 present. Now when I execute this app on a M/C where there is: Case 1) Only.Net fx 2.0 is installed Case 2) Both.Net Fx 1.1 amd 2.0 are installed How is it determined to load the appropriate.Net framework in the above cases. | TITLE:
Loading .Net Fx query
QUESTION:
I have built a simple C#.Net app on a M/C with only.Net FX 1.1 present. Now when I execute this app on a M/C where there is: Case 1) Only.Net fx 2.0 is installed Case 2) Both.Net Fx 1.1 amd 2.0 are installed How is it determined to load the appropriate.Net framework in the above ... | [
".net"
] | 0 | 0 | 122 | 1 | 0 | 2008-09-18T06:19:22.963000 | 2008-09-18T06:43:23.560000 |
90,493 | 90,533 | long to HWND (VS8 C++) | How can I cast long to HWND (C++ visual studio 8)? Long lWindowHandler; HWND oHwnd = (HWND)lWindowHandler; But I got the following warning: warning C4312: 'type cast': conversion from 'LONG' to 'HWND' of greater size Thanks. | HWND is a handle to a window. This type is declared in WinDef.h as follows: typedef HANDLE HWND; HANDLE is handle to an object. This type is declared in WinNT.h as follows: typedef PVOID HANDLE; Finally, PVOID is a pointer to any type. This type is declared in WinNT.h as follows: typedef void *PVOID; So, HWND is actual... | long to HWND (VS8 C++) How can I cast long to HWND (C++ visual studio 8)? Long lWindowHandler; HWND oHwnd = (HWND)lWindowHandler; But I got the following warning: warning C4312: 'type cast': conversion from 'LONG' to 'HWND' of greater size Thanks. | TITLE:
long to HWND (VS8 C++)
QUESTION:
How can I cast long to HWND (C++ visual studio 8)? Long lWindowHandler; HWND oHwnd = (HWND)lWindowHandler; But I got the following warning: warning C4312: 'type cast': conversion from 'LONG' to 'HWND' of greater size Thanks.
ANSWER:
HWND is a handle to a window. This type is de... | [
"casting",
"long-integer",
"hwnd"
] | 7 | 8 | 18,827 | 3 | 0 | 2008-09-18T06:24:52.467000 | 2008-09-18T06:37:55.150000 |
90,503 | 90,592 | Game Development Sound Frameworks | I'm working with a team that's building an engine for a variety of 2D and eventually 3D mini-games. The problem we're facing is a solid, cross-platform, sound API. Obviously, DirectX is out of the question due to our needs for cross-platform capabilities. SDL is nice, and works great, but let's face it SDL_Mixer is a b... | (note: I have experience with FMOD, BASS, OpenAL and DirectSound; and while I list other libraries below, I haven't used them). BASS and FMOD are both good (and actually I liked FMOD's documentation a lot; why would you say it's "non existing"?). There are also Miles Sound System, Wwise, irrKlang and some more middlewa... | Game Development Sound Frameworks I'm working with a team that's building an engine for a variety of 2D and eventually 3D mini-games. The problem we're facing is a solid, cross-platform, sound API. Obviously, DirectX is out of the question due to our needs for cross-platform capabilities. SDL is nice, and works great, ... | TITLE:
Game Development Sound Frameworks
QUESTION:
I'm working with a team that's building an engine for a variety of 2D and eventually 3D mini-games. The problem we're facing is a solid, cross-platform, sound API. Obviously, DirectX is out of the question due to our needs for cross-platform capabilities. SDL is nice,... | [
"c++",
"openal",
"audio"
] | 12 | 12 | 9,292 | 7 | 0 | 2008-09-18T06:28:16.513000 | 2008-09-18T06:52:46.067000 |
90,511 | 90,529 | How do I access a database in C# | Basically, I would like a brief explanation of how I can access a SQL database in C# code. I gather that a connection and a command is required, but what's going on? I guess what I'm asking is for someone to de-mystify the process a bit. Thanks. For clarity, in my case I'm doing web apps, e-commerce stuff. It's all ASP... | Reads like a beginner question. That calls for beginner video demos. http://www.asp.net/learn/data-videos/ They are ASP.NET focused, but pay attention to the database aspects. | How do I access a database in C# Basically, I would like a brief explanation of how I can access a SQL database in C# code. I gather that a connection and a command is required, but what's going on? I guess what I'm asking is for someone to de-mystify the process a bit. Thanks. For clarity, in my case I'm doing web app... | TITLE:
How do I access a database in C#
QUESTION:
Basically, I would like a brief explanation of how I can access a SQL database in C# code. I gather that a connection and a command is required, but what's going on? I guess what I'm asking is for someone to de-mystify the process a bit. Thanks. For clarity, in my case... | [
"c#",
"asp.net",
"sql"
] | 6 | 3 | 3,851 | 10 | 0 | 2008-09-18T06:31:38.533000 | 2008-09-18T06:36:57.540000 |
90,517 | 90,609 | Should I mysql_real_escape_string all the cookies I get from the user to avoid mysql injection in php? | When a user goes to my site, my script checks for 2 cookies which store the user id + part of the password, to automatically log them in. It's possible to edit the contents of cookies via a cookie editor, so I guess it's possible to add some malicious content to a written cookie? Should I add mysql_real_escape_string (... | What you really need to do is not send these cookie values that are hackable in the first place. Instead, why not hash the username and password and a (secret) salt and set that as the cookie value? i.e.: define('COOKIE_SALT', 'secretblahblahlkdsfklj'); $cookie_value = sha1($username.$password.COOKIE_SALT); Then you kn... | Should I mysql_real_escape_string all the cookies I get from the user to avoid mysql injection in php? When a user goes to my site, my script checks for 2 cookies which store the user id + part of the password, to automatically log them in. It's possible to edit the contents of cookies via a cookie editor, so I guess i... | TITLE:
Should I mysql_real_escape_string all the cookies I get from the user to avoid mysql injection in php?
QUESTION:
When a user goes to my site, my script checks for 2 cookies which store the user id + part of the password, to automatically log them in. It's possible to edit the contents of cookies via a cookie ed... | [
"php",
"validation"
] | 2 | 8 | 696 | 9 | 0 | 2008-09-18T06:34:12.897000 | 2008-09-18T06:57:18.393000 |
90,530 | 90,551 | What is your session management strategy for NHibernate in desktop applications? | I find it much more difficult to manage your session in a desktop application, because you cannot take advantage of such a clear bondary like HttpContext. So how do you manage your session lifetime to take advantage of lazy loading but without having one session open for the entire application? | I think it boils down to the design of your objects. Because lazy-loading can be enforced in the per-object level, you can take advantage of that fact when you think about session management. For example, I have a bunch of objects which are data-rich and lazy loaded, and I have a grid/summary view, and a details view f... | What is your session management strategy for NHibernate in desktop applications? I find it much more difficult to manage your session in a desktop application, because you cannot take advantage of such a clear bondary like HttpContext. So how do you manage your session lifetime to take advantage of lazy loading but wit... | TITLE:
What is your session management strategy for NHibernate in desktop applications?
QUESTION:
I find it much more difficult to manage your session in a desktop application, because you cannot take advantage of such a clear bondary like HttpContext. So how do you manage your session lifetime to take advantage of la... | [
".net",
"nhibernate",
"desktop-application"
] | 12 | 3 | 5,215 | 4 | 0 | 2008-09-18T06:37:16.227000 | 2008-09-18T06:42:05.903000 |
90,553 | 90,606 | Inheriting Event Handlers in C# | I've kind of backed myself into a corner here. I have a series of UserControls that inherit from a parent, which contains a couple of methods and events to simplify things so I don't have to write lines and lines of near-identical code. As you do. The parent contains no other controls. What I want to do is just have on... | Declare the parent method virtual, override it in the child classes and call base.checkReadyness(sender, e); (or derevation thereof) from within the child class. This allows for future design evolution say if you want to do some specific error checking code before calling the parent event handler. You might not need to... | Inheriting Event Handlers in C# I've kind of backed myself into a corner here. I have a series of UserControls that inherit from a parent, which contains a couple of methods and events to simplify things so I don't have to write lines and lines of near-identical code. As you do. The parent contains no other controls. W... | TITLE:
Inheriting Event Handlers in C#
QUESTION:
I've kind of backed myself into a corner here. I have a series of UserControls that inherit from a parent, which contains a couple of methods and events to simplify things so I don't have to write lines and lines of near-identical code. As you do. The parent contains no... | [
"c#",
"events",
"inheritance"
] | 12 | 7 | 17,469 | 9 | 0 | 2008-09-18T06:42:42.750000 | 2008-09-18T06:57:10.687000 |
90,560 | 90,844 | Good asp.net (C#) apps? | Any suggestions for good open source asp.net (C#) apps out there which meet as many of the following:? Designed well and multi tiered Clean & commented code Good use of several design patterns Web pages display properly in all common browsers Produces valid html and has good use of css Use of css themes. Prefer usage o... | I would have to agree with BlogEngine. It implements a ton of different abilities and common needs in asp.net as well as allowing it to be fully customizable and very easy to understand. It can work with XML or SQL (your choice) and has a huge community behind it. As for your requests ( bold means yes): Designed well a... | Good asp.net (C#) apps? Any suggestions for good open source asp.net (C#) apps out there which meet as many of the following:? Designed well and multi tiered Clean & commented code Good use of several design patterns Web pages display properly in all common browsers Produces valid html and has good use of css Use of cs... | TITLE:
Good asp.net (C#) apps?
QUESTION:
Any suggestions for good open source asp.net (C#) apps out there which meet as many of the following:? Designed well and multi tiered Clean & commented code Good use of several design patterns Web pages display properly in all common browsers Produces valid html and has good us... | [
"c#",
"asp.net",
"css",
"design-patterns"
] | 7 | 3 | 1,439 | 12 | 0 | 2008-09-18T06:43:41.173000 | 2008-09-18T08:04:01.183000 |
90,565 | 90,618 | Lightweight alternatives to NHibernate | NHibernate is not really a good fit for our environment due to all the dependencies. (Castle, log4net etc.) Is there a good lightweight alternative? Support for simple file based databases such as Access/SQLite/VistaDB is essential. Ideally, something contained in a single assembly that only references.NET assemblies. ... | Generally speaking, for your database backend to work with.net you need an ADO.Net provider for it. For MS Access (Jet), the Provider is shipped with.net. For SQLite, there is a selfcontained ADO.Net Provider. As for the data access layer lib, if you want some abstraction over ADO.Net: MS Data Access Application Block,... | Lightweight alternatives to NHibernate NHibernate is not really a good fit for our environment due to all the dependencies. (Castle, log4net etc.) Is there a good lightweight alternative? Support for simple file based databases such as Access/SQLite/VistaDB is essential. Ideally, something contained in a single assembl... | TITLE:
Lightweight alternatives to NHibernate
QUESTION:
NHibernate is not really a good fit for our environment due to all the dependencies. (Castle, log4net etc.) Is there a good lightweight alternative? Support for simple file based databases such as Access/SQLite/VistaDB is essential. Ideally, something contained i... | [
".net",
"nhibernate",
"orm"
] | 16 | 2 | 15,283 | 8 | 0 | 2008-09-18T06:45:53.010000 | 2008-09-18T06:59:49.527000 |
90,572 | 90,633 | How to get AD User Groups for user in Asp.Net? | I need to be able to get a list of the groups a user is in, but I need to have one/some/all of the following properties visible: distinguishedname name cn samaccountname What I have right now returns some sort of name, but not any of the ones above (the names seem close, but don't all match correctly. This is what I am... | You cannot do this in one step, as groups are also separate AD entries with properties. So in the first run you should get the group names a user is in and fill them in a list of some kind. The second step is to go through all of the group names and query them one by one to get the group properties (like distinguishedn... | How to get AD User Groups for user in Asp.Net? I need to be able to get a list of the groups a user is in, but I need to have one/some/all of the following properties visible: distinguishedname name cn samaccountname What I have right now returns some sort of name, but not any of the ones above (the names seem close, b... | TITLE:
How to get AD User Groups for user in Asp.Net?
QUESTION:
I need to be able to get a list of the groups a user is in, but I need to have one/some/all of the following properties visible: distinguishedname name cn samaccountname What I have right now returns some sort of name, but not any of the ones above (the n... | [
"c#",
"asp.net",
"active-directory"
] | 3 | 3 | 6,956 | 1 | 0 | 2008-09-18T06:47:44.253000 | 2008-09-18T07:04:48.907000 |
90,578 | 90,655 | Best way to really grok Java-ME for a C# guy | I've recently started developing applications for the Blackberry. Consequently, I've had to jump to Java-ME and learn that and its associated tools. The syntax is easy, but I keep having issues with various gotchas and the environment. For instance, something that surprised me and wasted a lot of time is absence of rea... | This guy here had to make the inverse transition. So he listed the top 10 differences of Java and C#. I'll take his topics and show how it is made in Java: Gotcha #10 - Give me my standard output! To print to the standard output in Java: System.out.println("Hello"); Gotcha #9 - Namespaces == Freedom In Java you don't h... | Best way to really grok Java-ME for a C# guy I've recently started developing applications for the Blackberry. Consequently, I've had to jump to Java-ME and learn that and its associated tools. The syntax is easy, but I keep having issues with various gotchas and the environment. For instance, something that surprised ... | TITLE:
Best way to really grok Java-ME for a C# guy
QUESTION:
I've recently started developing applications for the Blackberry. Consequently, I've had to jump to Java-ME and learn that and its associated tools. The syntax is easy, but I keep having issues with various gotchas and the environment. For instance, somethi... | [
"c#",
"blackberry",
"java-me",
"migration"
] | 28 | 52 | 5,181 | 3 | 0 | 2008-09-18T06:49:23.327000 | 2008-09-18T07:12:42.617000 |
90,579 | 90,596 | How to center text over an image in a table using javascript, css, and/or html? | How to center text over an image in a table cell using javascript, css, and/or html? I have an HTML table containing images - all the same size - and I want to center a text label over each image. The text in the labels may vary in size. Horizontal centering is not difficult, but vertical centering is. ADDENDUM: i did ... | you could try putting the images in the background. Here is my text You'll just need to set the height and width on the cell and that should be it. | How to center text over an image in a table using javascript, css, and/or html? How to center text over an image in a table cell using javascript, css, and/or html? I have an HTML table containing images - all the same size - and I want to center a text label over each image. The text in the labels may vary in size. Ho... | TITLE:
How to center text over an image in a table using javascript, css, and/or html?
QUESTION:
How to center text over an image in a table cell using javascript, css, and/or html? I have an HTML table containing images - all the same size - and I want to center a text label over each image. The text in the labels ma... | [
"javascript",
"html",
"css"
] | 1 | 11 | 25,595 | 5 | 0 | 2008-09-18T06:49:24.730000 | 2008-09-18T06:54:03.143000 |
90,580 | 90,846 | Word frequency algorithm for natural language processing | Without getting a degree in information retrieval, I'd like to know if there exists any algorithms for counting the frequency that words occur in a given body of text. The goal is to get a "general feel" of what people are saying over a set of textual comments. Along the lines of Wordle. What I'd like: ignore articles,... | You'll need not one, but several nice algorithms, along the lines of the following. ignoring pronouns is done via a stoplist. preserving proper nouns? You mean, detecting named entities, like Hoover Dam and saying "it's one word" or compound nouns, like programming language? I'll give you a hint: that's tough one, but ... | Word frequency algorithm for natural language processing Without getting a degree in information retrieval, I'd like to know if there exists any algorithms for counting the frequency that words occur in a given body of text. The goal is to get a "general feel" of what people are saying over a set of textual comments. A... | TITLE:
Word frequency algorithm for natural language processing
QUESTION:
Without getting a degree in information retrieval, I'd like to know if there exists any algorithms for counting the frequency that words occur in a given body of text. The goal is to get a "general feel" of what people are saying over a set of t... | [
"algorithm",
"nlp",
"word-frequency"
] | 33 | 69 | 22,114 | 8 | 0 | 2008-09-18T06:49:26.900000 | 2008-09-18T08:04:19.263000 |
90,595 | 90,603 | How to implement a web page that scales when the browser window is resized? | How to implement a web page that scales when the browser window is resized? I can lay out the elements of the page using either a table or CSS float sections, but i want the display to rescale when the browser window is resized i have a working solution using AJAX PRO and DIVs with overflow:auto and an onwindowresize h... | instead of using in css say "width: 200px", use stuff like "width: 50%" This makes it use 50% of whatever it's in, so in the case of: The div will now always take up half the window horizontaly. | How to implement a web page that scales when the browser window is resized? How to implement a web page that scales when the browser window is resized? I can lay out the elements of the page using either a table or CSS float sections, but i want the display to rescale when the browser window is resized i have a working... | TITLE:
How to implement a web page that scales when the browser window is resized?
QUESTION:
How to implement a web page that scales when the browser window is resized? I can lay out the elements of the page using either a table or CSS float sections, but i want the display to rescale when the browser window is resize... | [
"javascript",
"html",
"css",
"ajax"
] | 6 | 14 | 47,515 | 11 | 0 | 2008-09-18T06:53:01.103000 | 2008-09-18T06:56:31.017000 |
90,652 | 90,668 | Can I get more than 1000 records from a DirectorySearcher? | I just noticed that the return list for results is limited to 1000. I have more than 1000 groups in my domain (HUGE domain). How can I get more than 1000 records? Can I start at a later record? Can I cut it up into multiple searches? Here is my query: DirectoryEntry dirEnt = new DirectoryEntry("LDAP://dhuba1kwtn004"); ... | You need to set DirectorySearcher.PageSize to a non-zero value to get all results. BTW you should also dispose DirectorySearcher when you're finished with it using(var srch = new DirectorySearcher(dirEnt, "(objectClass=Group)", loadProps)) { srch.PageSize = 1000; var results = srch.FindAll(); } The API documentation is... | Can I get more than 1000 records from a DirectorySearcher? I just noticed that the return list for results is limited to 1000. I have more than 1000 groups in my domain (HUGE domain). How can I get more than 1000 records? Can I start at a later record? Can I cut it up into multiple searches? Here is my query: Directory... | TITLE:
Can I get more than 1000 records from a DirectorySearcher?
QUESTION:
I just noticed that the return list for results is limited to 1000. I have more than 1000 groups in my domain (HUGE domain). How can I get more than 1000 records? Can I start at a later record? Can I cut it up into multiple searches? Here is m... | [
"c#",
"asp.net",
"active-directory"
] | 78 | 190 | 71,634 | 1 | 0 | 2008-09-18T07:11:25.943000 | 2008-09-18T07:15:45.060000 |
90,657 | 90,672 | Mocking method results | I'm trying to find a way to fake the result of a method called from within another method. I have a "LoadData" method which calls a separate helper to get some data and then it will transform it (I'm interested in testing the transformed result). So I have code like this: public class MyClass(){ public void LoadData(){... | As far as I know, you should create an interface or a base abstract class for the Helper object. With Rhino Mocks you can then return the value you want. Alternatively, you can add an overload for LoadData that accepts as parameters the data that you normally retrieve from the Helper object. This might even be easier. | Mocking method results I'm trying to find a way to fake the result of a method called from within another method. I have a "LoadData" method which calls a separate helper to get some data and then it will transform it (I'm interested in testing the transformed result). So I have code like this: public class MyClass(){ ... | TITLE:
Mocking method results
QUESTION:
I'm trying to find a way to fake the result of a method called from within another method. I have a "LoadData" method which calls a separate helper to get some data and then it will transform it (I'm interested in testing the transformed result). So I have code like this: public... | [
"c#",
"mocking",
"rhino-mocks"
] | 9 | 2 | 4,929 | 6 | 0 | 2008-09-18T07:12:55.970000 | 2008-09-18T07:16:10.347000 |
90,658 | 97,088 | Compiling on multiple hosts | Say that you're developing code which needs to compile and run on multiple hosts (say Linux and Windows), how would you go about doing that in the most efficient manner given that: You have full access to hardware for each host you're compiling for (in my case a Linux host and a Windows host standing on my desk) Buildi... | Most of the build servers mentioned in the other answers check out your changes from a version control system. Given your "No commits to a central repository should be required" requirement, I'd suggest that you try Jetbrains TeamCity CI server. It has plugins fro Visual Studio and Eclipse and allows you to request a "... | Compiling on multiple hosts Say that you're developing code which needs to compile and run on multiple hosts (say Linux and Windows), how would you go about doing that in the most efficient manner given that: You have full access to hardware for each host you're compiling for (in my case a Linux host and a Windows host... | TITLE:
Compiling on multiple hosts
QUESTION:
Say that you're developing code which needs to compile and run on multiple hosts (say Linux and Windows), how would you go about doing that in the most efficient manner given that: You have full access to hardware for each host you're compiling for (in my case a Linux host ... | [
"build-process",
"build-automation"
] | 2 | 1 | 641 | 9 | 0 | 2008-09-18T07:12:57.717000 | 2008-09-18T21:18:54.407000 |
90,662 | 93,204 | How to prevent the ObjectDisposedException in C# when drawing and application exits | I'm a CompSci student, and fairly new at C#, and I was doing a "Josephus Problem" program for a class, and I created an Exit button that calls Application.Exit() to exit at anytime, but if C# is still working on painting and the button is pressed it throws an ObjectDisposedExeception for the Graphics object. Is there a... | It shouldn't be possible for this to happen. If the button is created on the same thread as the window, they share a message pump and the Paint handler cannot be interrupted to handle the exit button. The message that the button has been clicked will be queued up on the thread's message queue until the Paint handler re... | How to prevent the ObjectDisposedException in C# when drawing and application exits I'm a CompSci student, and fairly new at C#, and I was doing a "Josephus Problem" program for a class, and I created an Exit button that calls Application.Exit() to exit at anytime, but if C# is still working on painting and the button ... | TITLE:
How to prevent the ObjectDisposedException in C# when drawing and application exits
QUESTION:
I'm a CompSci student, and fairly new at C#, and I was doing a "Josephus Problem" program for a class, and I created an Exit button that calls Application.Exit() to exit at anytime, but if C# is still working on painti... | [
"c#",
"graphics",
"exception"
] | 1 | 1 | 3,765 | 2 | 0 | 2008-09-18T07:14:00.053000 | 2008-09-18T14:44:55.853000 |
90,674 | 860,277 | How does a program ask for administrator privileges? | I am developing an application using vb.net. For performing some tasks the application needs administrator privileges in the machine. How to ask for the privileges during the execution of the program? What is the general method of switching user accounts for executing an application? In other words, is there some way f... | You can edit the UAC Settings (in VB 2008) which is located in the Project Settings. Look for the line that says Change level="asInvoker" to level="asInvoker" (same access token as the parent process) level="requireAdministrator (require full administrator) level="highestAvailable" (highest privileges available to the ... | How does a program ask for administrator privileges? I am developing an application using vb.net. For performing some tasks the application needs administrator privileges in the machine. How to ask for the privileges during the execution of the program? What is the general method of switching user accounts for executin... | TITLE:
How does a program ask for administrator privileges?
QUESTION:
I am developing an application using vb.net. For performing some tasks the application needs administrator privileges in the machine. How to ask for the privileges during the execution of the program? What is the general method of switching user acc... | [
"vb.net",
"privileges"
] | 8 | 8 | 24,277 | 5 | 0 | 2008-09-18T07:17:23.027000 | 2009-05-13T20:36:35.527000 |
90,682 | 91,097 | How do I create a thread dump of a Java Web Start application | Is it possible to get a thread dump of a Java Web Start application? And if so, how? It would be nice if there were a simple solution, which would enable a non-developer (customer) to create a thread dump. Alternatively, is it possible to create a thread dump programmatically? In the Java Web Start Console I can get a ... | In the console, press V rather than T: t: dump thread list v: dump thread stack This works under JDK6. Don't know about others. Alternative, under JDK5 (and possibly earlier) you can send a full stack trace of all threads to standard out: Under Windows: type ctrl-break in the Java console. Under Unix: kill -3 (e.g. kil... | How do I create a thread dump of a Java Web Start application Is it possible to get a thread dump of a Java Web Start application? And if so, how? It would be nice if there were a simple solution, which would enable a non-developer (customer) to create a thread dump. Alternatively, is it possible to create a thread dum... | TITLE:
How do I create a thread dump of a Java Web Start application
QUESTION:
Is it possible to get a thread dump of a Java Web Start application? And if so, how? It would be nice if there were a simple solution, which would enable a non-developer (customer) to create a thread dump. Alternatively, is it possible to c... | [
"java",
"multithreading",
"debugging",
"java-web-start",
"thread-dump"
] | 5 | 6 | 8,211 | 5 | 0 | 2008-09-18T07:18:54.177000 | 2008-09-18T09:09:10.713000 |
90,693 | 90,773 | Problem with TVN_SELCHANGED on CTreeCtrl object | I have tree control object created using CTreeCtrl MFC class. The tree control needs to support rename. When I left click on any of item in Tree the TVN_SELCHANGED event is called from which I can get the selected item of the tree as below: HTREEITEM h = m_moveListTree.GetSelectedItem(); CString s = m_moveListTree.GetI... | I created my own MFC like home grown C++ GUI library on top of the Win32 API and looking at my code, this is how it handles that situation: LRESULT xTreeCtrl::onRightClick(NMHDR *) { xPoint pt;
//-- get the cursor at the time the mesage was posted DWORD dwPos =::GetMessagePos();
pt.x = GET_X_LPARAM(dwPos); pt.y = GET... | Problem with TVN_SELCHANGED on CTreeCtrl object I have tree control object created using CTreeCtrl MFC class. The tree control needs to support rename. When I left click on any of item in Tree the TVN_SELCHANGED event is called from which I can get the selected item of the tree as below: HTREEITEM h = m_moveListTree.Ge... | TITLE:
Problem with TVN_SELCHANGED on CTreeCtrl object
QUESTION:
I have tree control object created using CTreeCtrl MFC class. The tree control needs to support rename. When I left click on any of item in Tree the TVN_SELCHANGED event is called from which I can get the selected item of the tree as below: HTREEITEM h =... | [
"visual-c++",
"mfc",
"treeview"
] | 1 | 0 | 4,222 | 3 | 0 | 2008-09-18T07:20:54.563000 | 2008-09-18T07:46:33.440000 |
90,697 | 90,699 | How to create and use resources in .NET | How do I create a resource that I can reference and use in various parts of my program easily? My specific problem is that I have a NotifyIcon that I want to change the icon of depending on the state of the program. A common problem, but one I've been struggling with for a long time. | Well, after searching around and cobbling together various points from around StackOverflow (gee, I love this place already), most of the problems were already past this stage. I did manage to work out an answer to my problem though. How to create a resource: In my case, I want to create an icon. It's a similar process... | How to create and use resources in .NET How do I create a resource that I can reference and use in various parts of my program easily? My specific problem is that I have a NotifyIcon that I want to change the icon of depending on the state of the program. A common problem, but one I've been struggling with for a long t... | TITLE:
How to create and use resources in .NET
QUESTION:
How do I create a resource that I can reference and use in various parts of my program easily? My specific problem is that I have a NotifyIcon that I want to change the icon of depending on the state of the program. A common problem, but one I've been struggling... | [
"c#",
"visual-studio",
"resources",
"icons"
] | 223 | 368 | 335,711 | 4 | 0 | 2008-09-18T07:21:24.407000 | 2008-09-18T07:21:43.547000 |
90,702 | 90,718 | How does a program ask for administrator privileges? | I am working on a small application in VB.NET. The program needs administrator privilege for doing some tasks. Is there a way to ask for administrator privileges during the execution if the program? What is the general way of changing the user account under which the application is running? | There are a number of methods depending on your needs. Some details are given in the application developer requirements for UAC. Include a UAC manifest that causes your program to require administrator privileges at startup. Use one of the suggested methods for invoking an elevation to run out of process. One of the ni... | How does a program ask for administrator privileges? I am working on a small application in VB.NET. The program needs administrator privilege for doing some tasks. Is there a way to ask for administrator privileges during the execution if the program? What is the general way of changing the user account under which the... | TITLE:
How does a program ask for administrator privileges?
QUESTION:
I am working on a small application in VB.NET. The program needs administrator privilege for doing some tasks. Is there a way to ask for administrator privileges during the execution if the program? What is the general way of changing the user accou... | [
"windows",
"vb.net",
"privileges"
] | 3 | 3 | 9,504 | 4 | 0 | 2008-09-18T07:23:40.110000 | 2008-09-18T07:29:52.310000 |
90,751 | 90,835 | Float/double precision in debug/release modes | Do C#/.NET floating point operations differ in precision between debug mode and release mode? | They can indeed be different. According to the CLR ECMA specification: Storage locations for floating-point numbers (statics, array elements, and fields of classes) are of fixed size. The supported storage sizes are float32 and float64. Everywhere else (on the evaluation stack, as arguments, as return types, and as loc... | Float/double precision in debug/release modes Do C#/.NET floating point operations differ in precision between debug mode and release mode? | TITLE:
Float/double precision in debug/release modes
QUESTION:
Do C#/.NET floating point operations differ in precision between debug mode and release mode?
ANSWER:
They can indeed be different. According to the CLR ECMA specification: Storage locations for floating-point numbers (statics, array elements, and fields ... | [
"c#",
".net",
"floating-point"
] | 14 | 22 | 7,409 | 5 | 0 | 2008-09-18T07:41:14.577000 | 2008-09-18T08:01:46.570000 |
90,755 | 90,854 | How do I get a list of the active IP-addresses, MAC-addresses and NetBIOS names on the LAN? | How do I get a list of the active IP-addresses, MAC-addresses and NetBIOS names on the LAN? I'd like to get NetBIOS name, IP and MAC addresses for every host on the LAN, preferably not having to walk to every single PC and take note of the stuff myself. How to do that with Windows Script Host /PowerShell/whatever? | As Daren Thomas said, use nmap. nmap -sP 192.168.1.1/24 to scan the network 192.168.1.* nmap -O 192.168.1.1/24 to get the operating system of the user. For more information, read the manpage man nmap regards | How do I get a list of the active IP-addresses, MAC-addresses and NetBIOS names on the LAN? How do I get a list of the active IP-addresses, MAC-addresses and NetBIOS names on the LAN? I'd like to get NetBIOS name, IP and MAC addresses for every host on the LAN, preferably not having to walk to every single PC and take ... | TITLE:
How do I get a list of the active IP-addresses, MAC-addresses and NetBIOS names on the LAN?
QUESTION:
How do I get a list of the active IP-addresses, MAC-addresses and NetBIOS names on the LAN? I'd like to get NetBIOS name, IP and MAC addresses for every host on the LAN, preferably not having to walk to every s... | [
"windows",
"networking",
"powershell",
"system-administration",
"wsh"
] | 5 | 10 | 40,907 | 5 | 0 | 2008-09-18T07:42:38.100000 | 2008-09-18T08:07:38.210000 |
90,758 | 91,034 | Fastest way to determine image resolution and file type in PHP or Unix command line? | I'm currently using ImageMagick to determine the size of images uploaded to the website. By calling ImageMagick's "identify" on the command line it takes about 0.42 seconds to determine a 1MB JPEG's dimensions along with the fact that it's a JPEG. I find that a bit slow. Using the Imagick PHP library is even slower as ... | Sorry I can't add this as a comment to a previous answer but I don't have the rep. Doing some quick and dirty testing I also found that exec("identify -ping... is about 20 times faster than without the -ping. But getimagesize() appears to be about 200 times faster still. So I would say getimagesize() is the faster meth... | Fastest way to determine image resolution and file type in PHP or Unix command line? I'm currently using ImageMagick to determine the size of images uploaded to the website. By calling ImageMagick's "identify" on the command line it takes about 0.42 seconds to determine a 1MB JPEG's dimensions along with the fact that ... | TITLE:
Fastest way to determine image resolution and file type in PHP or Unix command line?
QUESTION:
I'm currently using ImageMagick to determine the size of images uploaded to the website. By calling ImageMagick's "identify" on the command line it takes about 0.42 seconds to determine a 1MB JPEG's dimensions along w... | [
"php",
"image",
"png",
"imagemagick",
"jpeg"
] | 5 | 3 | 10,370 | 7 | 0 | 2008-09-18T07:43:10.313000 | 2008-09-18T08:53:01.237000 |
90,764 | 91,184 | SharePoint Event when Permissions of ListItems have been changed? | i need to fire an event (or start a workflow) when the permissions of a List-Element (ListItem) have been changed. "ItemUpdating" / "ItemUpdated" won't fire (since the ListItem itself is not updated, i suppose), so how can it be done? | I'm afraid that is not possible. Maybe you can take another approach: build an alternate way for users to change the permissions of an item. When the user applies the permissions (using the UI you've built), you can trigger an event, or start a workflow. Going further, you could replace the default "Manage permissions"... | SharePoint Event when Permissions of ListItems have been changed? i need to fire an event (or start a workflow) when the permissions of a List-Element (ListItem) have been changed. "ItemUpdating" / "ItemUpdated" won't fire (since the ListItem itself is not updated, i suppose), so how can it be done? | TITLE:
SharePoint Event when Permissions of ListItems have been changed?
QUESTION:
i need to fire an event (or start a workflow) when the permissions of a List-Element (ListItem) have been changed. "ItemUpdating" / "ItemUpdated" won't fire (since the ListItem itself is not updated, i suppose), so how can it be done?
... | [
"sharepoint"
] | 3 | 3 | 2,236 | 1 | 0 | 2008-09-18T07:44:24.023000 | 2008-09-18T09:25:37.010000 |
90,775 | 110,777 | How do you load an embedded icon from an exe file with PyWin32? | I have an exe file generated with py2exe. In the setup.py I specify an icon to be embedded in the exe: windows=[{'script': 'my_script.py','icon_resources': [(0, 'my_icon.ico')],... I tried loading the icon using: hinst = win32api.GetModuleHandle(None) hicon = win32gui.LoadImage(hinst, 0, win32con.IMAGE_ICON, 0, 0, win3... | @efotinis: You're right. Here is a workaround until py2exe gets fixed and you don't want to include the same icon twice: hicon = win32gui.CreateIconFromResource(win32api.LoadResource(None, win32con.RT_ICON, 1), True) Be aware that 1 is not the ID you gave the icon in setup.py (which is the icon group ID), but the resou... | How do you load an embedded icon from an exe file with PyWin32? I have an exe file generated with py2exe. In the setup.py I specify an icon to be embedded in the exe: windows=[{'script': 'my_script.py','icon_resources': [(0, 'my_icon.ico')],... I tried loading the icon using: hinst = win32api.GetModuleHandle(None) hico... | TITLE:
How do you load an embedded icon from an exe file with PyWin32?
QUESTION:
I have an exe file generated with py2exe. In the setup.py I specify an icon to be embedded in the exe: windows=[{'script': 'my_script.py','icon_resources': [(0, 'my_icon.ico')],... I tried loading the icon using: hinst = win32api.GetModul... | [
"python",
"icons",
"exe",
"pywin32"
] | 7 | 5 | 4,440 | 4 | 0 | 2008-09-18T07:46:43.750000 | 2008-09-21T11:07:16.027000 |
90,798 | 90,931 | How do you place EXIF tags into a JPG, having the raw jpeg buffer in C++? | I am having a bit of a problem. I get a RAW char* buffer from a camera and I need to add this tags before I can save it to disk. Writing the file to disk and reading it back again is not an option, as this will happen thousands of times. The buffer data I receive from the camera does not contain any EXIF information, a... | Look at this PDF, on page 20 you have a diagram showing you were to place or modify your exif information. What is the difference with a file on disk? Does the JPEG buffer of your camera contain an EXIF section already? | How do you place EXIF tags into a JPG, having the raw jpeg buffer in C++? I am having a bit of a problem. I get a RAW char* buffer from a camera and I need to add this tags before I can save it to disk. Writing the file to disk and reading it back again is not an option, as this will happen thousands of times. The buff... | TITLE:
How do you place EXIF tags into a JPG, having the raw jpeg buffer in C++?
QUESTION:
I am having a bit of a problem. I get a RAW char* buffer from a camera and I need to add this tags before I can save it to disk. Writing the file to disk and reading it back again is not an option, as this will happen thousands ... | [
"c++",
"jpeg",
"exif"
] | 5 | 4 | 2,814 | 4 | 0 | 2008-09-18T07:51:09.310000 | 2008-09-18T08:25:27.950000 |
90,802 | 90,805 | Simple, free PHP blog engine easy to redesign? | I am looking for a PHP blog engine which needs to be easy to redesign (CSS, HTML). It also needs to be free and have simple user interface so that the client doesn't struggle to add posts. Any suggestions? | Wordpress - I keep trying other blogs and I keep going back to wordpress. It's definitely the easiest I've used for customizing templates, and the admin UI is very nice. | Simple, free PHP blog engine easy to redesign? I am looking for a PHP blog engine which needs to be easy to redesign (CSS, HTML). It also needs to be free and have simple user interface so that the client doesn't struggle to add posts. Any suggestions? | TITLE:
Simple, free PHP blog engine easy to redesign?
QUESTION:
I am looking for a PHP blog engine which needs to be easy to redesign (CSS, HTML). It also needs to be free and have simple user interface so that the client doesn't struggle to add posts. Any suggestions?
ANSWER:
Wordpress - I keep trying other blogs an... | [
"php",
"blog-engine"
] | 14 | 19 | 23,483 | 11 | 0 | 2008-09-18T07:51:44.677000 | 2008-09-18T07:53:14.580000 |
90,803 | 90,877 | Convert C# 2.0 System.Data.SqlTypes.SqlXml object into a System.Xml.XmlNode | I seem to always have problems with converting data to and from XML in C#. It always wants you to create a full XMLDocument object even when you think you shouldn't have to. In this case I have a SQLXML column in a MS SQL 2005 server that I am trying to pull out and push into a function that requires an XMLNode as a pa... | I ended up not having to use it, but I found what I think is the best answer. Basically you load an XmlReader, create an XmlDocument from the reader, then select a list of nodes from the document into an XmnLodeList, which you can use in a ForEach statement. Here is some sample code: System.Xml.XmlReader sqlXMLReader =... | Convert C# 2.0 System.Data.SqlTypes.SqlXml object into a System.Xml.XmlNode I seem to always have problems with converting data to and from XML in C#. It always wants you to create a full XMLDocument object even when you think you shouldn't have to. In this case I have a SQLXML column in a MS SQL 2005 server that I am ... | TITLE:
Convert C# 2.0 System.Data.SqlTypes.SqlXml object into a System.Xml.XmlNode
QUESTION:
I seem to always have problems with converting data to and from XML in C#. It always wants you to create a full XMLDocument object even when you think you shouldn't have to. In this case I have a SQLXML column in a MS SQL 2005... | [
"c#",
"sqldatareader",
"sqlxml",
"xmlnode"
] | 2 | 5 | 5,518 | 1 | 0 | 2008-09-18T07:51:51.150000 | 2008-09-18T08:15:20.203000 |
90,812 | 90,814 | Querying Active Directory with "SQL"? | I just wonder if anyone knows or made a wrapper around Active Directory to be able to easily query it in.net? Kind of like "LINQ-to-ActiveDirectory" or some SQL Dialect, i.e. to be able to do "SELECT DISTINCT(DEPARTMENT) FROM /Users/SomeOU/AnotherOU" or "SELECT user FROM domain" or whatever. As far as I know, it is pos... | LINQ to Active Directory implements a custom LINQ query provider that allows querying objects in Active Directory. Internally, queries are translated into LDAP filters which are sent to the server using the System.DirectoryServices.NET Framework library. http://www.codeplex.com/LINQtoAD Sample (from the site): // NOTE:... | Querying Active Directory with "SQL"? I just wonder if anyone knows or made a wrapper around Active Directory to be able to easily query it in.net? Kind of like "LINQ-to-ActiveDirectory" or some SQL Dialect, i.e. to be able to do "SELECT DISTINCT(DEPARTMENT) FROM /Users/SomeOU/AnotherOU" or "SELECT user FROM domain" or... | TITLE:
Querying Active Directory with "SQL"?
QUESTION:
I just wonder if anyone knows or made a wrapper around Active Directory to be able to easily query it in.net? Kind of like "LINQ-to-ActiveDirectory" or some SQL Dialect, i.e. to be able to do "SELECT DISTINCT(DEPARTMENT) FROM /Users/SomeOU/AnotherOU" or "SELECT us... | [
".net",
"active-directory",
"ldap",
"ldap-query"
] | 6 | 13 | 1,371 | 1 | 0 | 2008-09-18T07:57:05.520000 | 2008-09-18T07:57:40.230000 |
90,813 | 90,881 | Best Practices & Principles for GUI design | What is your best practical user-friendly user-interface design or principle? Please submit those practices that you find actually makes things really useful - no matter what - if it works for your users, share it! Summary/Collation Principles KISS. Be clear and specific in what an option will achieve: for example, use... | Try to use verbs in your dialog boxes. It means use instead of | Best Practices & Principles for GUI design What is your best practical user-friendly user-interface design or principle? Please submit those practices that you find actually makes things really useful - no matter what - if it works for your users, share it! Summary/Collation Principles KISS. Be clear and specific in wh... | TITLE:
Best Practices & Principles for GUI design
QUESTION:
What is your best practical user-friendly user-interface design or principle? Please submit those practices that you find actually makes things really useful - no matter what - if it works for your users, share it! Summary/Collation Principles KISS. Be clear ... | [
"user-interface",
"principles"
] | 63 | 53 | 55,155 | 19 | 0 | 2008-09-18T07:57:15.770000 | 2008-09-18T08:15:43.760000 |
90,838 | 90,956 | How can I detect the encoding/codepage of a text file? | In our application, we receive text files (.txt,.csv, etc.) from diverse sources. When reading, these files sometimes contain garbage, because the files where created in a different/unknown codepage. Is there a way to (automatically) detect the codepage of a text file? The detectEncodingFromByteOrderMarks, on the Strea... | You can't detect the codepage, you need to be told it. You can analyse the bytes and guess it, but that can give some bizarre (sometimes amusing) results. I can't find it now, but I'm sure Notepad can be tricked into displaying English text in Chinese. Anyway, this is what you need to read: The Absolute Minimum Every S... | How can I detect the encoding/codepage of a text file? In our application, we receive text files (.txt,.csv, etc.) from diverse sources. When reading, these files sometimes contain garbage, because the files where created in a different/unknown codepage. Is there a way to (automatically) detect the codepage of a text f... | TITLE:
How can I detect the encoding/codepage of a text file?
QUESTION:
In our application, we receive text files (.txt,.csv, etc.) from diverse sources. When reading, these files sometimes contain garbage, because the files where created in a different/unknown codepage. Is there a way to (automatically) detect the co... | [
"c#",
".net",
"text",
"encoding",
"globalization"
] | 312 | 268 | 323,526 | 21 | 0 | 2008-09-18T08:02:35.710000 | 2008-09-18T08:30:29.777000 |
90,855 | 1,881,323 | How can I tell whether I am on x64 or x86 using .NET? | I'd like to offer my users correct links to an upgraded version of my program based on what platform they're running on, so I need to know whether I'm currently running on an x86 OS or an x64 OS. The best I've found is using Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE"), but I would think there would be ... | Environment.Is64BitOperatingSystem and Environment.Is64BitProcess are being introduced in.NET 4. For.NET 2 you'll need to try out some of the other answers. | How can I tell whether I am on x64 or x86 using .NET? I'd like to offer my users correct links to an upgraded version of my program based on what platform they're running on, so I need to know whether I'm currently running on an x86 OS or an x64 OS. The best I've found is using Environment.GetEnvironmentVariable("PROCE... | TITLE:
How can I tell whether I am on x64 or x86 using .NET?
QUESTION:
I'd like to offer my users correct links to an upgraded version of my program based on what platform they're running on, so I need to know whether I'm currently running on an x86 OS or an x64 OS. The best I've found is using Environment.GetEnvironm... | [
".net",
"x86",
"64-bit"
] | 5 | 5 | 2,243 | 5 | 0 | 2008-09-18T08:07:51.673000 | 2009-12-10T14:26:07.430000 |
90,871 | 91,342 | Debug vs. release in .NET | Continuing from my previous question, is there a comprehensive document that lists all available differences between debug and release modes in a C# application, and particularly in a web application? What differences are there? | "Debug" and "Release" are just names for predefined project configurations defined by Visual Studio. To see the differences, look at the Build Tab in Project Properties in Visual Studio. The differences in VS2005 include: DEBUG constant defined in Debug configuration Optimize code enabled in Release configuration as we... | Debug vs. release in .NET Continuing from my previous question, is there a comprehensive document that lists all available differences between debug and release modes in a C# application, and particularly in a web application? What differences are there? | TITLE:
Debug vs. release in .NET
QUESTION:
Continuing from my previous question, is there a comprehensive document that lists all available differences between debug and release modes in a C# application, and particularly in a web application? What differences are there?
ANSWER:
"Debug" and "Release" are just names f... | [
"c#",
".net",
"asp.net"
] | 65 | 55 | 38,711 | 9 | 0 | 2008-09-18T08:13:42.797000 | 2008-09-18T10:01:24.693000 |
90,878 | 90,954 | How to dynamically generate combination of ASP.NET user controls? | I have several user controls, let's say A, B, C and D. Based on some random input, I need to generate a combination of these. For e.g. if input is 2a3d1a2c I need to show two of the A's, 3 D's after that, an A again, etc. I will also need to stabilize clientid's in order for them to work correctly. Because each of thes... | To add controls dynamically, you can use a panel as a place holder, say Then, on the server side, you can add objects to it like so: int controlCount = 0;...
TextBox newTextBox = TextBox(); newTextBox.ID = "ctl_" + controlCount++; ControlPlaceholder.Controls.Add(newTextBox); If you add the controls to it during your P... | How to dynamically generate combination of ASP.NET user controls? I have several user controls, let's say A, B, C and D. Based on some random input, I need to generate a combination of these. For e.g. if input is 2a3d1a2c I need to show two of the A's, 3 D's after that, an A again, etc. I will also need to stabilize cl... | TITLE:
How to dynamically generate combination of ASP.NET user controls?
QUESTION:
I have several user controls, let's say A, B, C and D. Based on some random input, I need to generate a combination of these. For e.g. if input is 2a3d1a2c I need to show two of the A's, 3 D's after that, an A again, etc. I will also ne... | [
"asp.net",
"user-controls"
] | 0 | 0 | 606 | 1 | 0 | 2008-09-18T08:15:26.850000 | 2008-09-18T08:29:13.417000 |
90,885 | 90,960 | Compound keys in JPA | I want to make an entity that has an autogenerated primary key, but also a unique compound key made up of two other fields. How do I do this in JPA? I want to do this because the primary key should be used as foreign key in another table and making it compound would not be good. In the following snippet, I need the com... | You can use @UniqueConstraint something like this: @Entity @Table(name = "dm_action_plan", uniqueConstraints={ @UniqueConstraint(columnNames= "command","model") } ) public class ActionPlan { @Id private int pk;
@Column(name = "command", nullable = false) private String command;
@Column(name = "model", nullable = fals... | Compound keys in JPA I want to make an entity that has an autogenerated primary key, but also a unique compound key made up of two other fields. How do I do this in JPA? I want to do this because the primary key should be used as foreign key in another table and making it compound would not be good. In the following sn... | TITLE:
Compound keys in JPA
QUESTION:
I want to make an entity that has an autogenerated primary key, but also a unique compound key made up of two other fields. How do I do this in JPA? I want to do this because the primary key should be used as foreign key in another table and making it compound would not be good. I... | [
"java",
"jpa",
"annotations",
"compound-key"
] | 9 | 19 | 8,354 | 2 | 0 | 2008-09-18T08:16:07.410000 | 2008-09-18T08:30:55.643000 |
90,889 | 91,658 | WCF REST Caching - Client Side & Server Side | I have wirtten a RESTful WCF Service. Incorporating E-Tags, expires headers. The caching works great when using it from a browser. However how does the caching work when calling it from a WCF Channel Factory or.NET Web Request Objects? So in the scenario where I have my website calling the WCF restful service when a 30... | Yes, you're going to have to handle that yourself, same as that you're responsbile for sending the datetime in the request, so the server can determine if there was a change. I would look at the RSS Bandit source for a sample implementation. | WCF REST Caching - Client Side & Server Side I have wirtten a RESTful WCF Service. Incorporating E-Tags, expires headers. The caching works great when using it from a browser. However how does the caching work when calling it from a WCF Channel Factory or.NET Web Request Objects? So in the scenario where I have my webs... | TITLE:
WCF REST Caching - Client Side & Server Side
QUESTION:
I have wirtten a RESTful WCF Service. Incorporating E-Tags, expires headers. The caching works great when using it from a browser. However how does the caching work when calling it from a WCF Channel Factory or.NET Web Request Objects? So in the scenario wh... | [
"wcf",
"rest"
] | 4 | 3 | 2,984 | 2 | 0 | 2008-09-18T08:17:31.727000 | 2008-09-18T11:08:47.183000 |
90,899 | 91,652 | .NET: Get all Outlook calendar items | How can I get all items from a specific calendar (for a specific date). Lets say for instance that I have a calendar with a recurring item every Monday evening. When I request all items like this: CalendarItems = CalendarFolder.Items; CalendarItems.IncludeRecurrences = true; I only get 1 item... Is there an easy way to... | I believe that you must Restrict or Find in order to get recurring appointments, otherwise Outlook won't expand them. Also, you must Sort by Start before setting IncludeRecurrences. | .NET: Get all Outlook calendar items How can I get all items from a specific calendar (for a specific date). Lets say for instance that I have a calendar with a recurring item every Monday evening. When I request all items like this: CalendarItems = CalendarFolder.Items; CalendarItems.IncludeRecurrences = true; I only ... | TITLE:
.NET: Get all Outlook calendar items
QUESTION:
How can I get all items from a specific calendar (for a specific date). Lets say for instance that I have a calendar with a recurring item every Monday evening. When I request all items like this: CalendarItems = CalendarFolder.Items; CalendarItems.IncludeRecurrenc... | [
"c#",
".net",
"outlook",
"calendar",
"recurring"
] | 33 | 14 | 77,934 | 12 | 0 | 2008-09-18T08:19:35.420000 | 2008-09-18T11:08:05.437000 |
90,907 | 90,914 | Unit testing a Java Servlet | I would like to know what would be the best way to do unit testing of a servlet. Testing internal methods is not a problem as long as they don't refer to the servlet context, but what about testing the doGet/doPost methods as well as the internal method that refer to the context or make use of session parameters? Is th... | Try HttpUnit, although you are likely to end up writing automated tests that are more 'integration tests' (of a module) than 'unit tests' (of a single class). | Unit testing a Java Servlet I would like to know what would be the best way to do unit testing of a servlet. Testing internal methods is not a problem as long as they don't refer to the servlet context, but what about testing the doGet/doPost methods as well as the internal method that refer to the context or make use ... | TITLE:
Unit testing a Java Servlet
QUESTION:
I would like to know what would be the best way to do unit testing of a servlet. Testing internal methods is not a problem as long as they don't refer to the servlet context, but what about testing the doGet/doPost methods as well as the internal method that refer to the co... | [
"java",
"unit-testing",
"servlets"
] | 56 | 13 | 55,338 | 8 | 0 | 2008-09-18T08:21:21.017000 | 2008-09-18T08:22:57.270000 |
90,920 | 90,981 | Benefits of SQL Server 2005 over 2000 | Could somebody please name a few. I could given time, but this is for somebody else, and I'd also like some community input. | Some differences: CLR (.NET) stored procedures SSIS instead of DTS Management Studio instead of Enterprise Manager, with more functions (2008 version is even better) VS integration better replication SMO and AMO (extensions to handle the server from applications) table and index partitioning XML as data type XQuery to ... | Benefits of SQL Server 2005 over 2000 Could somebody please name a few. I could given time, but this is for somebody else, and I'd also like some community input. | TITLE:
Benefits of SQL Server 2005 over 2000
QUESTION:
Could somebody please name a few. I could given time, but this is for somebody else, and I'd also like some community input.
ANSWER:
Some differences: CLR (.NET) stored procedures SSIS instead of DTS Management Studio instead of Enterprise Manager, with more func... | [
"sql-server",
"sql-server-2005",
"sql-server-2000"
] | 3 | 5 | 1,659 | 12 | 0 | 2008-09-18T08:24:12.040000 | 2008-09-18T08:40:16.260000 |
90,940 | 91,054 | How can I find out how much of address space the application is consuming and report this to user? | I'm writing the memory manager for an application, as part of a team of twenty-odd coders. We're running out of memory quota and we need to be able to see what's going on, since we only appear to be using about 700Mb. I need to be able to report where it's all going - fragmentation etc. Any ideas? | You can use existing memory debugging tools for this, I found Memory Validator 1 quite useful, it is able to track both API level (heap, new...) and OS level (Virtual Memory) allocations and show virtual memory maps. The other option which I also found very usefull is to be able to dump a map of the whole virtual space... | How can I find out how much of address space the application is consuming and report this to user? I'm writing the memory manager for an application, as part of a team of twenty-odd coders. We're running out of memory quota and we need to be able to see what's going on, since we only appear to be using about 700Mb. I n... | TITLE:
How can I find out how much of address space the application is consuming and report this to user?
QUESTION:
I'm writing the memory manager for an application, as part of a team of twenty-odd coders. We're running out of memory quota and we need to be able to see what's going on, since we only appear to be usin... | [
"winapi",
"memory",
"memory-management",
"memory-dump"
] | 2 | 3 | 301 | 3 | 0 | 2008-09-18T08:26:37.370000 | 2008-09-18T08:58:41.410000 |
90,949 | 100,658 | How do I use the TranslateBehavior in CakePHP? | There is no documentation on cakephp.org and I am unable to find one on google. Please link me some documentation or supply one! | The translate behavior is another of CakePHP's very useful but poorly documented features. I've implemented it a couple of times with reasonable success in multi-lingual websites along the following lines. Firstly, the translate behavior will only internationalize the database content of your site. If you've any more s... | How do I use the TranslateBehavior in CakePHP? There is no documentation on cakephp.org and I am unable to find one on google. Please link me some documentation or supply one! | TITLE:
How do I use the TranslateBehavior in CakePHP?
QUESTION:
There is no documentation on cakephp.org and I am unable to find one on google. Please link me some documentation or supply one!
ANSWER:
The translate behavior is another of CakePHP's very useful but poorly documented features. I've implemented it a coup... | [
"cakephp",
"behavior"
] | 4 | 13 | 7,264 | 2 | 0 | 2008-09-18T08:28:29.610000 | 2008-09-19T09:11:39.687000 |
90,971 | 91,083 | How do I use INotifyPropertyChanged to update an array binding? | Let's say I have a class: class Foo { public string Bar { get {... } }
public string this[int index] { get {... } } } I can bind to these two properties using "{Binding Path=Bar}" and "{Binding Path=[x]}". Fine. Now let's say I want to implement INotifyPropertyChanged: class Foo: INotifyPropertyChanged { public string... | Thanks to Cameron's suggestion, I've found the correct syntax, which is: Item[] Which updates everything (all index values) bound to that indexed property. | How do I use INotifyPropertyChanged to update an array binding? Let's say I have a class: class Foo { public string Bar { get {... } }
public string this[int index] { get {... } } } I can bind to these two properties using "{Binding Path=Bar}" and "{Binding Path=[x]}". Fine. Now let's say I want to implement INotifyPr... | TITLE:
How do I use INotifyPropertyChanged to update an array binding?
QUESTION:
Let's say I have a class: class Foo { public string Bar { get {... } }
public string this[int index] { get {... } } } I can bind to these two properties using "{Binding Path=Bar}" and "{Binding Path=[x]}". Fine. Now let's say I want to i... | [
"wpf"
] | 14 | 13 | 7,667 | 4 | 0 | 2008-09-18T08:36:28.093000 | 2008-09-18T09:06:09.940000 |
90,976 | 91,018 | Can you register an existing instance of a type in the Windsor Container? | In the Windsor IOC container is it possible to register a type that I've already got an instance for, instead of having the container create it? | There is a AddComponentInstance method on the Container's Kernel property. From the Unit Tests: [Test] public void AddComponentInstance() { CustomerImpl customer = new CustomerImpl();
kernel.AddComponentInstance("key", typeof(ICustomer), customer); Assert.IsTrue(kernel.HasComponent("key"));
CustomerImpl customer2 = k... | Can you register an existing instance of a type in the Windsor Container? In the Windsor IOC container is it possible to register a type that I've already got an instance for, instead of having the container create it? | TITLE:
Can you register an existing instance of a type in the Windsor Container?
QUESTION:
In the Windsor IOC container is it possible to register a type that I've already got an instance for, instead of having the container create it?
ANSWER:
There is a AddComponentInstance method on the Container's Kernel property.... | [
"c#",
".net",
"vb.net",
"inversion-of-control",
"castle-windsor"
] | 12 | 13 | 3,014 | 1 | 0 | 2008-09-18T08:38:21.663000 | 2008-09-18T08:49:34.333000 |
90,977 | 97,261 | replace-char in Emacs Lisp ? | Emacs Lisp has replace-string but has no replace-char. I want to replace "typographic" curly quotes (Emacs code for this character is hexadecimal 53979) with regular ASCII quotes, and I can do so with: (replace-string (make-string 1?\x53979) "'") I think it would be better with replace-char. What is the best way to do ... | Why not just use (replace-string "\x53979" "'") or (while (search-forward "\x53979" nil t) (replace-match "'" nil t)) as recommended in the documentation for replace-string? | replace-char in Emacs Lisp ? Emacs Lisp has replace-string but has no replace-char. I want to replace "typographic" curly quotes (Emacs code for this character is hexadecimal 53979) with regular ASCII quotes, and I can do so with: (replace-string (make-string 1?\x53979) "'") I think it would be better with replace-char... | TITLE:
replace-char in Emacs Lisp ?
QUESTION:
Emacs Lisp has replace-string but has no replace-char. I want to replace "typographic" curly quotes (Emacs code for this character is hexadecimal 53979) with regular ASCII quotes, and I can do so with: (replace-string (make-string 1?\x53979) "'") I think it would be better... | [
"emacs",
"elisp"
] | 7 | 8 | 7,028 | 4 | 0 | 2008-09-18T08:38:40.990000 | 2008-09-18T21:37:44.690000 |
90,982 | 91,303 | Multiple Inheritance in PHP | I'm looking for a good, clean way to go around the fact that PHP5 still doesn't support multiple inheritance. Here's the class hierarchy: Message -- TextMessage -------- InvitationTextMessage -- EmailMessage -------- InvitationEmailMessage The two types of Invitation* classes have a lot in common; i'd love to have a co... | Alex, most of the times you need multiple inheritance is a signal your object structure is somewhat incorrect. In situation you outlined I see you have class responsibility simply too broad. If Message is part of application business model, it should not take care about rendering output. Instead, you could split respon... | Multiple Inheritance in PHP I'm looking for a good, clean way to go around the fact that PHP5 still doesn't support multiple inheritance. Here's the class hierarchy: Message -- TextMessage -------- InvitationTextMessage -- EmailMessage -------- InvitationEmailMessage The two types of Invitation* classes have a lot in c... | TITLE:
Multiple Inheritance in PHP
QUESTION:
I'm looking for a good, clean way to go around the fact that PHP5 still doesn't support multiple inheritance. Here's the class hierarchy: Message -- TextMessage -------- InvitationTextMessage -- EmailMessage -------- InvitationEmailMessage The two types of Invitation* class... | [
"php",
"oop",
"inheritance"
] | 99 | 144 | 103,127 | 11 | 0 | 2008-09-18T08:40:19.317000 | 2008-09-18T09:53:48.843000 |
90,996 | 91,044 | How do I iterate a .Net IList collection in the reverse order? | I have an IList that contains items ( parent first ), they need to be added to a Diagram Document in the reverse order so that the parent is added last, drawn on top so that it is the first thing to be selected by the user. What's the best way to do it? Something better/more elegant than what I am doing currently which... | If you have.NET 3.5 you could use LINQ's Reverse? foreach(var item in obEvtArgs.NewItems.Reverse()) {... } (Assuming you're talking about the generic IList) | How do I iterate a .Net IList collection in the reverse order? I have an IList that contains items ( parent first ), they need to be added to a Diagram Document in the reverse order so that the parent is added last, drawn on top so that it is the first thing to be selected by the user. What's the best way to do it? Som... | TITLE:
How do I iterate a .Net IList collection in the reverse order?
QUESTION:
I have an IList that contains items ( parent first ), they need to be added to a Diagram Document in the reverse order so that the parent is added last, drawn on top so that it is the first thing to be selected by the user. What's the best... | [
".net",
"collections",
"iteration"
] | 5 | 7 | 5,072 | 4 | 0 | 2008-09-18T08:44:15.953000 | 2008-09-18T08:55:07.567000 |
91,061 | 91,149 | Java EE App Server Hello World | I am fairly comfortable with standalone Java app development, but will soon be working on a project using a Java EE application server. Does anyone know of a straightforward how-to tutorial to getting a hello-world type application working in an application server? I'm (perhaps naievly) assuming that the overall approa... | I would choose JBoss AS or GlassFish for a start. However I'm not sure what you mean by Java EE "Hello World". If you just want to deploy some JSP you could use this tutorial (for JBoss): http://www.centerkey.com/jboss/ If you want to get further and do the EJB stack and/or deploy an ear-file, you could read the very g... | Java EE App Server Hello World I am fairly comfortable with standalone Java app development, but will soon be working on a project using a Java EE application server. Does anyone know of a straightforward how-to tutorial to getting a hello-world type application working in an application server? I'm (perhaps naievly) a... | TITLE:
Java EE App Server Hello World
QUESTION:
I am fairly comfortable with standalone Java app development, but will soon be working on a project using a Java EE application server. Does anyone know of a straightforward how-to tutorial to getting a hello-world type application working in an application server? I'm (... | [
"java",
"jakarta-ee"
] | 3 | 6 | 7,790 | 5 | 0 | 2008-09-18T09:00:12.827000 | 2008-09-18T09:19:03.937000 |
91,071 | 91,078 | Emacs, switch to previous window | In Emacs, C-x o takes me to the next window. What keyboard macro takes me to the previous window in Emacs? | That'd be C-- C-x o In other words, C-x o with an argument of -1. You can specify how many windows to move by inserting a numeric argument between C-u and the command, as in C-u 2 C-x o. ( C-- is a shortcut for C-u - 1 ) | Emacs, switch to previous window In Emacs, C-x o takes me to the next window. What keyboard macro takes me to the previous window in Emacs? | TITLE:
Emacs, switch to previous window
QUESTION:
In Emacs, C-x o takes me to the next window. What keyboard macro takes me to the previous window in Emacs?
ANSWER:
That'd be C-- C-x o In other words, C-x o with an argument of -1. You can specify how many windows to move by inserting a numeric argument between C-u an... | [
"emacs"
] | 99 | 94 | 35,303 | 13 | 0 | 2008-09-18T09:02:41.527000 | 2008-09-18T09:05:05.327000 |
91,086 | 92,210 | Why easyphp stop all apache processes on severals PC? | on some Windows PC, when I have both easyPHP and a standalone apache service configured on another network port and with a specific service name, I have a problem: when I stop easyphp, the other apache is stopped too. The problem do not occur on all PC I have, but seems very strange to me. Any idea? more information af... | Maybe how it's killing it is that it's finding all processes called "apache" or similar and just killing them, regardless of if it 'owns' it or not. | Why easyphp stop all apache processes on severals PC? on some Windows PC, when I have both easyPHP and a standalone apache service configured on another network port and with a specific service name, I have a problem: when I stop easyphp, the other apache is stopped too. The problem do not occur on all PC I have, but s... | TITLE:
Why easyphp stop all apache processes on severals PC?
QUESTION:
on some Windows PC, when I have both easyPHP and a standalone apache service configured on another network port and with a specific service name, I have a problem: when I stop easyphp, the other apache is stopped too. The problem do not occur on al... | [
"windows",
"apache",
"process",
"easyphp"
] | 0 | 1 | 1,000 | 2 | 0 | 2008-09-18T09:06:54.433000 | 2008-09-18T12:46:50.723000 |
91,108 | 91,119 | How do I get my C# program to sleep for 50 milliseconds? | How do I get my C# program to sleep (pause execution) for 50 milliseconds? | System.Threading.Thread.Sleep(50); Remember though, that doing this in the main GUI thread will block your GUI from updating (it will feel "sluggish") Just remove the; to make it work for VB.net as well. | How do I get my C# program to sleep for 50 milliseconds? How do I get my C# program to sleep (pause execution) for 50 milliseconds? | TITLE:
How do I get my C# program to sleep for 50 milliseconds?
QUESTION:
How do I get my C# program to sleep (pause execution) for 50 milliseconds?
ANSWER:
System.Threading.Thread.Sleep(50); Remember though, that doing this in the main GUI thread will block your GUI from updating (it will feel "sluggish") Just remov... | [
"c#",
"vb.net"
] | 337 | 418 | 483,821 | 10 | 0 | 2008-09-18T09:11:49.727000 | 2008-09-18T09:14:16.817000 |
91,110 | 91,176 | How to match a single quote in sed | How to match a single quote in sed if the expression is enclosed in single quotes: sed -e '...' For example need to match this text: 'foo' | You can either use: "texta'textb" (APOSTROPHE inside QUOTATION MARKs) or 'texta'\''textb' (APOSTROPHE text APOSTROPHE, then REVERSE SOLIDUS, APOSTROPHE, then APOSTROPHE more text APOSTROPHE) I used unicode character names. REVERSE SOLIDUS is more commonly known as backslash. In the latter case, you close your apostroph... | How to match a single quote in sed How to match a single quote in sed if the expression is enclosed in single quotes: sed -e '...' For example need to match this text: 'foo' | TITLE:
How to match a single quote in sed
QUESTION:
How to match a single quote in sed if the expression is enclosed in single quotes: sed -e '...' For example need to match this text: 'foo'
ANSWER:
You can either use: "texta'textb" (APOSTROPHE inside QUOTATION MARKs) or 'texta'\''textb' (APOSTROPHE text APOSTROPHE, ... | [
"bash",
"shell",
"sed",
"escaping"
] | 47 | 58 | 46,590 | 4 | 0 | 2008-09-18T09:12:09.570000 | 2008-09-18T09:24:12.817000 |
91,124 | 91,145 | How do I best convert a string representation into a DbType? | Suppose I have a string 'nvarchar(50)', which is for example the T-SQL string segment used in creating a table of that type. How do I best convert that to an enum representation of System.Data.DbType? Could it handle the many different possible ways of writing the type in T-SQL, such as: [nvarchar](50) nvarchar 50 @Jor... | Hope this mapping table do the job. http://www.carlprothman.net/Default.aspx?tabid=97 | How do I best convert a string representation into a DbType? Suppose I have a string 'nvarchar(50)', which is for example the T-SQL string segment used in creating a table of that type. How do I best convert that to an enum representation of System.Data.DbType? Could it handle the many different possible ways of writin... | TITLE:
How do I best convert a string representation into a DbType?
QUESTION:
Suppose I have a string 'nvarchar(50)', which is for example the T-SQL string segment used in creating a table of that type. How do I best convert that to an enum representation of System.Data.DbType? Could it handle the many different possi... | [
".net",
"database",
"converters"
] | 0 | 1 | 955 | 2 | 0 | 2008-09-18T09:14:55.053000 | 2008-09-18T09:18:21.957000 |
91,127 | 91,995 | Best way to validate drag/drop operations for a TreeView in C# | I want to verify a drag & drop operation is allowed. A valid item can come from another one of our "controls", or internally from within the custom treeview. Currently I have this: bool CanDrop(DragEventArgs e) { bool allow = false; Point point = tree.PointToClient(new Point(e.X, e.Y)); TreeNode target = tree.GetNodeAt... | I use the TreeNode.Tag property to store small "controller" objects that makes up the logic. E.g.: class TreeNodeController { Entity data;
virtual bool IsReadOnly { get; } virtual bool CanDrop(TreeNodeController source, DragDropEffects effect); virtual bool CanDrop(DataInfoObject info, DragDropEffects effect); virtual... | Best way to validate drag/drop operations for a TreeView in C# I want to verify a drag & drop operation is allowed. A valid item can come from another one of our "controls", or internally from within the custom treeview. Currently I have this: bool CanDrop(DragEventArgs e) { bool allow = false; Point point = tree.Point... | TITLE:
Best way to validate drag/drop operations for a TreeView in C#
QUESTION:
I want to verify a drag & drop operation is allowed. A valid item can come from another one of our "controls", or internally from within the custom treeview. Currently I have this: bool CanDrop(DragEventArgs e) { bool allow = false; Point ... | [
"c#",
"validation",
"user-controls",
"treeview"
] | 2 | 3 | 2,403 | 2 | 0 | 2008-09-18T09:15:10.467000 | 2008-09-18T12:18:01.540000 |
91,137 | 91,163 | OO Design, open/closed principle question | I've been thinking about this object oriented design question for a while now and have unable to come up with a satisfactory solution, so thought I'd throw it open to the crowds here for some opinions. I have a Game class that represents a turn based board game, we can assume it's similar to Monopoly for the purposes o... | I think you should not let the Game class handle IO. this way, the (blocking) TakeTurn method will hide from the game board the means of implementation. it can use other objects to communicate with the user. All the Game class should concern itself with is the state of the board and the turn. the players should all imp... | OO Design, open/closed principle question I've been thinking about this object oriented design question for a while now and have unable to come up with a satisfactory solution, so thought I'd throw it open to the crowds here for some opinions. I have a Game class that represents a turn based board game, we can assume i... | TITLE:
OO Design, open/closed principle question
QUESTION:
I've been thinking about this object oriented design question for a while now and have unable to come up with a satisfactory solution, so thought I'd throw it open to the crowds here for some opinions. I have a Game class that represents a turn based board gam... | [
"language-agnostic",
"oop",
"ooad",
"open-closed-principle"
] | 7 | 7 | 949 | 9 | 0 | 2008-09-18T09:17:30.053000 | 2008-09-18T09:21:29.937000 |
91,143 | 91,162 | Hosting a WCF endpoint with programatic settings in IIS | I need to host a WCF service in IIS that exposes a wsHttpBinding. That part is working nicely using the settings of system.serviceModel in my web.config. What i need now is to setup the configuration (like maxReceivedMessageSize and other options) through a configuration assembly that is also used by the client(s). How... | You're missing something:) Create a custom ServiceHost and use that in the.svc file; in the custom service host do all your configuration | Hosting a WCF endpoint with programatic settings in IIS I need to host a WCF service in IIS that exposes a wsHttpBinding. That part is working nicely using the settings of system.serviceModel in my web.config. What i need now is to setup the configuration (like maxReceivedMessageSize and other options) through a config... | TITLE:
Hosting a WCF endpoint with programatic settings in IIS
QUESTION:
I need to host a WCF service in IIS that exposes a wsHttpBinding. That part is working nicely using the settings of system.serviceModel in my web.config. What i need now is to setup the configuration (like maxReceivedMessageSize and other options... | [
"wcf",
"iis"
] | 3 | 5 | 1,347 | 1 | 0 | 2008-09-18T09:18:08.807000 | 2008-09-18T09:21:28.203000 |
91,158 | 93,001 | XMLSockets in Flash Lite? | Are XMLSockets available in Flash Lite, and if yes in which versions, and are there differences between the regular and the lite objects? | I don't know enough to tell you the exact difference(s) between XML sockets in Flash and Flash Lite, but they are definitely supported in Flash Lite versions 2.1 and later. See the Flash Mobile Blog for an example. | XMLSockets in Flash Lite? Are XMLSockets available in Flash Lite, and if yes in which versions, and are there differences between the regular and the lite objects? | TITLE:
XMLSockets in Flash Lite?
QUESTION:
Are XMLSockets available in Flash Lite, and if yes in which versions, and are there differences between the regular and the lite objects?
ANSWER:
I don't know enough to tell you the exact difference(s) between XML sockets in Flash and Flash Lite, but they are definitely supp... | [
"flashlite",
"xmlsocket"
] | 0 | 1 | 336 | 2 | 0 | 2008-09-18T09:21:15.427000 | 2008-09-18T14:25:06.430000 |
91,160 | 91,177 | How do I best convert a DbType to System.Type? | How do I best convert a System.Data.DbType enumeration value to the corresponding (or at least one of the possible corresponding) System.Type values? For example: DbType.StringFixedLength -> System.String DbType.String -> System.String DbType.Int32 -> System.Int32 I've only seen very "dirty" solutions but nothing reall... | AFAIK there is no built-in converter in.NET for converting a SqlDbType to a System.Type. But knowing the mapping you can easily roll your own converter ranging from a simple dictionary to more advanced (XML based for extensability) solutions. The mapping can be found here: http://www.carlprothman.net/Default.aspx?tabid... | How do I best convert a DbType to System.Type? How do I best convert a System.Data.DbType enumeration value to the corresponding (or at least one of the possible corresponding) System.Type values? For example: DbType.StringFixedLength -> System.String DbType.String -> System.String DbType.Int32 -> System.Int32 I've onl... | TITLE:
How do I best convert a DbType to System.Type?
QUESTION:
How do I best convert a System.Data.DbType enumeration value to the corresponding (or at least one of the possible corresponding) System.Type values? For example: DbType.StringFixedLength -> System.String DbType.String -> System.String DbType.Int32 -> Sys... | [
".net",
"converters"
] | 9 | 6 | 12,420 | 2 | 0 | 2008-09-18T09:21:24.633000 | 2008-09-18T09:24:53.907000 |
91,170 | 91,187 | Make Web Application Accessible | What things have to be done before I can honestly tell myself my web application is accessible by anyone? Or even better, convince Joe Clark. I don't have any video or audio to worry about, so I know I won't need transcripts. What else do I have to check? | Your question is very vague, but in short, you need to ensure that your site meets one of the three levels (A, AA, or AAA) of the Web Content Accessibility Guidelines. FWIW, in my experience, if you are providing anything other than a purely static HTML site, aim for AA. Trying to follow the WCAG guidelines stringently... | Make Web Application Accessible What things have to be done before I can honestly tell myself my web application is accessible by anyone? Or even better, convince Joe Clark. I don't have any video or audio to worry about, so I know I won't need transcripts. What else do I have to check? | TITLE:
Make Web Application Accessible
QUESTION:
What things have to be done before I can honestly tell myself my web application is accessible by anyone? Or even better, convince Joe Clark. I don't have any video or audio to worry about, so I know I won't need transcripts. What else do I have to check?
ANSWER:
Your ... | [
"javascript",
"html",
"usability",
"accessibility"
] | 0 | 1 | 298 | 5 | 0 | 2008-09-18T09:23:10.680000 | 2008-09-18T09:25:51.220000 |
91,181 | 144,403 | Cruise Control and Obfuscation, How? | this is my first question to stackoverflow so here it goes... I use cruise control for my continuous integration scheme, i want to use obfuscation in order to add another protection layer to my assemblies. The thing is that i don't know how to go about it since i couldn't find articles describing about this. Suggestion... | @konstantinos.konstantinidis.myopenid.com: your problem seems to be with the setup project not the continuous integration server. You have the setup project picking up the primary outputs for the project. Change it to use file references to the outputs. It's a little more configuration in the setup project but I think ... | Cruise Control and Obfuscation, How? this is my first question to stackoverflow so here it goes... I use cruise control for my continuous integration scheme, i want to use obfuscation in order to add another protection layer to my assemblies. The thing is that i don't know how to go about it since i couldn't find artic... | TITLE:
Cruise Control and Obfuscation, How?
QUESTION:
this is my first question to stackoverflow so here it goes... I use cruise control for my continuous integration scheme, i want to use obfuscation in order to add another protection layer to my assemblies. The thing is that i don't know how to go about it since i c... | [
".net",
"continuous-integration",
"cruisecontrol.net",
"obfuscation"
] | 0 | 1 | 701 | 2 | 0 | 2008-09-18T09:25:22.703000 | 2008-09-27T20:30:45.770000 |
91,196 | 91,251 | Delete DataGridView line | How can I delete a line form a bound DataGridView when pressing the Delete key? | If you're on framework 3.5, it looks like there's a method on the DataGridView to process the delete key. http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.processdeletekey.aspx Otherwise, I would suggest capturing the form keypress event and working backwards to get the active/selected DataGrid... | Delete DataGridView line How can I delete a line form a bound DataGridView when pressing the Delete key? | TITLE:
Delete DataGridView line
QUESTION:
How can I delete a line form a bound DataGridView when pressing the Delete key?
ANSWER:
If you're on framework 3.5, it looks like there's a method on the DataGridView to process the delete key. http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.processd... | [
".net",
"winforms"
] | 0 | 1 | 1,099 | 1 | 0 | 2008-09-18T09:28:00.327000 | 2008-09-18T09:42:12.913000 |
91,198 | 91,580 | How can you tell programmatically if a Flex App is running in debug mode? | Is it possible to write code in a Flex application that will only be run in a debug build, or when running through the debugger? Does Flex provide a way to actually remove code entirely from release builds, like C-style #defines? The app is not necessarily running in a web page. | You can do conditional compilation like this: CONFIG::debugging { // this will be removed if CONFIG::debugging resolves to false at compile time } And then add this to the compiler flags: -define+=CONFIG::debugging,true for debug builds, and -define+=CONFIG::debugging,false for release builds. CONFIG and debugging can ... | How can you tell programmatically if a Flex App is running in debug mode? Is it possible to write code in a Flex application that will only be run in a debug build, or when running through the debugger? Does Flex provide a way to actually remove code entirely from release builds, like C-style #defines? The app is not n... | TITLE:
How can you tell programmatically if a Flex App is running in debug mode?
QUESTION:
Is it possible to write code in a Flex application that will only be run in a debug build, or when running through the debugger? Does Flex provide a way to actually remove code entirely from release builds, like C-style #defines... | [
"apache-flex",
"flash",
"actionscript-3",
"debugging"
] | 6 | 10 | 1,246 | 1 | 0 | 2008-09-18T09:28:04.383000 | 2008-09-18T10:51:19.080000 |
91,202 | 91,227 | Is there an efficient\easy way to draw a concave polygon in Direct3d | I'm trying to draw a polygon using c# and directx All I get is an ordered list of points from a file and I need to draw the flat polygon in a 3d world. I can load the points and draw a convex shape using a trianglefan and drawuserprimitives. This obviously leads to incorrect results when the polygon is very concave (wh... | Direct3D can only draw triangles (well, it can draw lines and points as well, but that's besides the point). So if you want to draw any shape that is more complex than a triangle, you have to draw a bunch of touching triangles that equal to that shape. In your case, it's a concave polygon triangulation problem. Given a... | Is there an efficient\easy way to draw a concave polygon in Direct3d I'm trying to draw a polygon using c# and directx All I get is an ordered list of points from a file and I need to draw the flat polygon in a 3d world. I can load the points and draw a convex shape using a trianglefan and drawuserprimitives. This obvi... | TITLE:
Is there an efficient\easy way to draw a concave polygon in Direct3d
QUESTION:
I'm trying to draw a polygon using c# and directx All I get is an ordered list of points from a file and I need to draw the flat polygon in a 3d world. I can load the points and draw a convex shape using a trianglefan and drawuserpri... | [
"c#",
"directx",
"polygon",
"concave"
] | 5 | 5 | 6,646 | 4 | 0 | 2008-09-18T09:29:05.457000 | 2008-09-18T09:35:01.463000 |
91,205 | 91,301 | Will everything in the standard library treat strings as unicode in Python 3.0? | I'm a little confused about how the standard library will behave now that Python (from 3.0) is unicode-based. Will modules such as CGI and urllib use unicode strings or will they use the new 'bytes' type and just provide encoded data? | Logically a lot of things like MIME-encoded mail messages, URLs, XML documents, and so on should be returned as bytes not strings. This could cause some consternation as the libraries start to be nailed down for Python 3 and people discover that they have to be more aware of the bytes / string conversions than they wer... | Will everything in the standard library treat strings as unicode in Python 3.0? I'm a little confused about how the standard library will behave now that Python (from 3.0) is unicode-based. Will modules such as CGI and urllib use unicode strings or will they use the new 'bytes' type and just provide encoded data? | TITLE:
Will everything in the standard library treat strings as unicode in Python 3.0?
QUESTION:
I'm a little confused about how the standard library will behave now that Python (from 3.0) is unicode-based. Will modules such as CGI and urllib use unicode strings or will they use the new 'bytes' type and just provide e... | [
"python",
"unicode",
"string",
"cgi",
"python-3.x"
] | 12 | 12 | 489 | 3 | 0 | 2008-09-18T09:29:23.100000 | 2008-09-18T09:52:48.190000 |
91,211 | 91,446 | Beginning Web Development on Plan 9 | I've been wanting to program for the Plan 9 operating system for a while. I'd really like to play around with a web app there. Of course, the only language I know for Plan 9 is C, and that doesn't seem ideal for web development. I also understand that it doesn't run apache or mysql either. What is the best way to start... | Check out Kenji Arisawa's Pegasus ( paper ) webserver for Plan 9. Plan 9 may have a reputation for being C-only, but several langauges, including Scheme, Ruby, Python, and Perl have been ported. Check out the Contrib Index for the code. Finally, start reading the Plan 9 white papers so that you can understand its philo... | Beginning Web Development on Plan 9 I've been wanting to program for the Plan 9 operating system for a while. I'd really like to play around with a web app there. Of course, the only language I know for Plan 9 is C, and that doesn't seem ideal for web development. I also understand that it doesn't run apache or mysql e... | TITLE:
Beginning Web Development on Plan 9
QUESTION:
I've been wanting to program for the Plan 9 operating system for a while. I'd really like to play around with a web app there. Of course, the only language I know for Plan 9 is C, and that doesn't seem ideal for web development. I also understand that it doesn't run... | [
"html",
"web-applications",
"plan-9"
] | 6 | 6 | 2,768 | 2 | 0 | 2008-09-18T09:30:28.027000 | 2008-09-18T10:20:02.043000 |
91,214 | 91,265 | Serialize Java objects into Java code | Does somebody know a Java library which serializes a Java object hierarchy into Java code which generates this object hierarchy? Like Object/XML serialization, only that the output format is not binary/XML but Java code. | I am not aware of any libraries that will do this out of the box but you should be able to take one of the many object to XML serialisation libraries and customise the backend code to generate Java. Would probably not be much code. For example a quick google turned up XStream. I've never used it but is seems to support... | Serialize Java objects into Java code Does somebody know a Java library which serializes a Java object hierarchy into Java code which generates this object hierarchy? Like Object/XML serialization, only that the output format is not binary/XML but Java code. | TITLE:
Serialize Java objects into Java code
QUESTION:
Does somebody know a Java library which serializes a Java object hierarchy into Java code which generates this object hierarchy? Like Object/XML serialization, only that the output format is not binary/XML but Java code.
ANSWER:
I am not aware of any libraries th... | [
"java"
] | 9 | 1 | 951 | 4 | 0 | 2008-09-18T09:31:28.133000 | 2008-09-18T09:44:07.697000 |
91,216 | 91,255 | What is the difference between mysql_real_escape_string and addslashes? | mysql_real_escape_string and addslashes are both used to escape data before the database query, so what's the difference? (This question is not about parametrized queries/PDO/mysqli) | string mysql_real_escape_string ( string $unescaped_string [, resource $link_identifier ] ) mysql_real_escape_string() calls MySQL's library function mysql_real_escape_string, which prepends backslashes to the following characters: \x00, \n, \r, \, ', " and \x1a. string addslashes ( string $str ) Returns a string with ... | What is the difference between mysql_real_escape_string and addslashes? mysql_real_escape_string and addslashes are both used to escape data before the database query, so what's the difference? (This question is not about parametrized queries/PDO/mysqli) | TITLE:
What is the difference between mysql_real_escape_string and addslashes?
QUESTION:
mysql_real_escape_string and addslashes are both used to escape data before the database query, so what's the difference? (This question is not about parametrized queries/PDO/mysqli)
ANSWER:
string mysql_real_escape_string ( stri... | [
"php"
] | 10 | 15 | 8,588 | 5 | 0 | 2008-09-18T09:32:48.160000 | 2008-09-18T09:42:41.930000 |
91,223 | 91,488 | Checking if another web server is listening from asp | I'm using Microsoft.XMLHTTP to get some information from another server from an old ASP/VBScript site. But that other server is restarted fairly often, so I want to check that it's up and running before trying to pull information from it (or avoid my page from giving an HTTP 500 by detecting the problem some other way)... | All you need to do is have the code continue on error, then post to the other server and read the status from the post. Something like this: PostURL = homelink & "CustID.aspx?SearchFlag=PO" set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP.3.0") on error resume next xmlhttp.open "POST", PostURL, false xmlhttp.send "" st... | Checking if another web server is listening from asp I'm using Microsoft.XMLHTTP to get some information from another server from an old ASP/VBScript site. But that other server is restarted fairly often, so I want to check that it's up and running before trying to pull information from it (or avoid my page from giving... | TITLE:
Checking if another web server is listening from asp
QUESTION:
I'm using Microsoft.XMLHTTP to get some information from another server from an old ASP/VBScript site. But that other server is restarted fairly often, so I want to check that it's up and running before trying to pull information from it (or avoid m... | [
"asp-classic"
] | 0 | 1 | 595 | 2 | 0 | 2008-09-18T09:34:00.453000 | 2008-09-18T10:27:48.980000 |
91,232 | 91,248 | List the names of all the classes within a VS2008 project | Is there a quick & dirty way of obtaining a list of all the classes within a Visual Studio 2008 (c#) project? There are quite a lot of them and Im just lazy enough not to want to do it manually. | If you open the "Class View" dialogue (View -> Class View or Ctrl+W, C) you can get a list of all of the classes in your project which you can then select and copy to the clipboard. The copy will send the fully qualified (i.e. with complete namespace) names of all classes that you have selected. | List the names of all the classes within a VS2008 project Is there a quick & dirty way of obtaining a list of all the classes within a Visual Studio 2008 (c#) project? There are quite a lot of them and Im just lazy enough not to want to do it manually. | TITLE:
List the names of all the classes within a VS2008 project
QUESTION:
Is there a quick & dirty way of obtaining a list of all the classes within a Visual Studio 2008 (c#) project? There are quite a lot of them and Im just lazy enough not to want to do it manually.
ANSWER:
If you open the "Class View" dialogue (V... | [
"c#",
"visual-studio-2008",
"class",
"list"
] | 0 | 5 | 405 | 4 | 0 | 2008-09-18T09:36:26.920000 | 2008-09-18T09:41:47.423000 |
91,234 | 92,946 | Multiple keyboards and low-level hooks | I have a system where I have multiple keyboards and really need to know which keyboard the key stroke is coming from. To explain the set up: I have a normal PC and USB keyboard I have an external VGA screen with some hard-keys The hard keys are mapped as a standard USB keyboard, sending a limited number of key-codes (F... | Yes I stand corrected, my bad, learning something new every day. Here's my attempt at making up for it:): Register the devices you want to use for raw input (the two keyboards) with::RegisterRawInputDevices(). You can get these devices from GetRawInputDeviceList() After you've registered your devices, you will start ge... | Multiple keyboards and low-level hooks I have a system where I have multiple keyboards and really need to know which keyboard the key stroke is coming from. To explain the set up: I have a normal PC and USB keyboard I have an external VGA screen with some hard-keys The hard keys are mapped as a standard USB keyboard, s... | TITLE:
Multiple keyboards and low-level hooks
QUESTION:
I have a system where I have multiple keyboards and really need to know which keyboard the key stroke is coming from. To explain the set up: I have a normal PC and USB keyboard I have an external VGA screen with some hard-keys The hard keys are mapped as a standa... | [
"c#",
"winapi",
"keyboard",
"hardware",
"hook"
] | 16 | 16 | 18,281 | 2 | 0 | 2008-09-18T09:37:51.333000 | 2008-09-18T14:18:25.167000 |
91,246 | 91,261 | VS: Attribute for ignoring missing XML comments when building | I have a VS2008 solution using xml documentation, and we have warnings as errors turned on for release mode (a nice feature IMHO); this results, however, in long lists of 'missing xml comment' errors for such things as every element of a (self describing) enum. Does anyone know of an attribute or similar which switches... | Use #pragma warning disable. More info here: http://msdn.microsoft.com/en-us/library/441722ys(VS.80).aspx | VS: Attribute for ignoring missing XML comments when building I have a VS2008 solution using xml documentation, and we have warnings as errors turned on for release mode (a nice feature IMHO); this results, however, in long lists of 'missing xml comment' errors for such things as every element of a (self describing) en... | TITLE:
VS: Attribute for ignoring missing XML comments when building
QUESTION:
I have a VS2008 solution using xml documentation, and we have warnings as errors turned on for release mode (a nice feature IMHO); this results, however, in long lists of 'missing xml comment' errors for such things as every element of a (s... | [
".net",
"visual-studio-2008",
"attributes",
"xml-comments"
] | 2 | 5 | 705 | 1 | 0 | 2008-09-18T09:41:17.783000 | 2008-09-18T09:43:45.640000 |
91,257 | 97,869 | Scrum Burndown issues | We have been using Scrum for around 9 months and it has largely been successful. However our burndown charts rarely look like the 'model' charts, instead resembling more of a terrifying rollercoaster ride with some vomit inducing climbs and drops. To try and combat this we are spending more time before the sprint proto... | Some tips on smoothing things out. 1) As others have said - try and break down the tasks into smaller chunks. The more obvious way of doing this is to try and break down the technical tasks in greater detail. Where possible I'd encourage you to talk to the product owner and see if you can reduce scope or "thin" the sto... | Scrum Burndown issues We have been using Scrum for around 9 months and it has largely been successful. However our burndown charts rarely look like the 'model' charts, instead resembling more of a terrifying rollercoaster ride with some vomit inducing climbs and drops. To try and combat this we are spending more time b... | TITLE:
Scrum Burndown issues
QUESTION:
We have been using Scrum for around 9 months and it has largely been successful. However our burndown charts rarely look like the 'model' charts, instead resembling more of a terrifying rollercoaster ride with some vomit inducing climbs and drops. To try and combat this we are sp... | [
"agile",
"scrum"
] | 19 | 24 | 3,915 | 11 | 0 | 2008-09-18T09:42:53.660000 | 2008-09-18T23:07:50.917000 |
91,263 | 91,273 | Pause GNU Make in a Windows console if an error occurs | Part of the install for an app I am responsible for, compiles some C code libraries. This is done in a console using GNU Make. So, as part of the install, a console window pops open, you see the make file output wiz by as it compiles and links, when finished the console window closes and the installer continues. All go... | this should do the trick: if not ERRORLEVEL 0 pause type help if in DOS for more info on errorlevel usage. | Pause GNU Make in a Windows console if an error occurs Part of the install for an app I am responsible for, compiles some C code libraries. This is done in a console using GNU Make. So, as part of the install, a console window pops open, you see the make file output wiz by as it compiles and links, when finished the co... | TITLE:
Pause GNU Make in a Windows console if an error occurs
QUESTION:
Part of the install for an app I am responsible for, compiles some C code libraries. This is done in a console using GNU Make. So, as part of the install, a console window pops open, you see the make file output wiz by as it compiles and links, wh... | [
"windows",
"makefile",
"gnu"
] | 5 | 9 | 5,815 | 4 | 0 | 2008-09-18T09:43:52.037000 | 2008-09-18T09:45:43.683000 |
91,270 | 91,285 | Statistically removing erroneous values | We have an application where users enter prices all day. These prices are recorded in a table with a timestamp and then used for producing charts of how the price has moved. Every now and then, the user enters a price wrongly (e.g. puts in a zero too many or too few) which somewhat ruins the chart (you get big spikes).... | Calculate and track the standard deviation for a while. After you have a decent backlog, you can disregard the outliers by seeing how many standard deviations away they are from the mean. Even better, if you've got the time, you could use the info to do some naive Bayesian classification. | Statistically removing erroneous values We have an application where users enter prices all day. These prices are recorded in a table with a timestamp and then used for producing charts of how the price has moved. Every now and then, the user enters a price wrongly (e.g. puts in a zero too many or too few) which somewh... | TITLE:
Statistically removing erroneous values
QUESTION:
We have an application where users enter prices all day. These prices are recorded in a table with a timestamp and then used for producing charts of how the price has moved. Every now and then, the user enters a price wrongly (e.g. puts in a zero too many or too... | [
"statistics"
] | 2 | 1 | 1,064 | 6 | 0 | 2008-09-18T09:44:52.937000 | 2008-09-18T09:48:14.740000 |
91,275 | 91,326 | Is WebRequest The Right C# Tool For Interacting With Websites? | I'm writing a small tool in C# which will need to send and receive data to/from a website using POST and json formatting. I've never done anything like this before in C# (or any language really) so I'm struggling to find some useful information to get me started. I've found some information on the WebRequest class in C... | WebRequest and more specifically the HttpWebRequest class is a good starting point for what you want to achieve. To create the request you will use the WebRequest.Create and cast the created request to an HttpWebRequest to actually use it. You will then create your post data and send it to the stream like: HttpWebReque... | Is WebRequest The Right C# Tool For Interacting With Websites? I'm writing a small tool in C# which will need to send and receive data to/from a website using POST and json formatting. I've never done anything like this before in C# (or any language really) so I'm struggling to find some useful information to get me st... | TITLE:
Is WebRequest The Right C# Tool For Interacting With Websites?
QUESTION:
I'm writing a small tool in C# which will need to send and receive data to/from a website using POST and json formatting. I've never done anything like this before in C# (or any language really) so I'm struggling to find some useful inform... | [
"c#",
".net",
"webrequest"
] | 35 | 27 | 36,867 | 7 | 0 | 2008-09-18T09:46:29.597000 | 2008-09-18T09:58:32.547000 |
91,280 | 91,337 | Best solution for using EJBs from Excel | We would like to give access to some of our EJBs from Excel. The goal is to give an API usable from VBA. Our EJBs are mostly Stateless Session Beans that do simple CRUD operations with POJOs. Some possible solutions: Exposing the EJBs as WebServices and create a VB/C# dll wrapping them, Using Corba to access the EJBs f... | You could take a look at IIOP.NET, which addresses this issue. | Best solution for using EJBs from Excel We would like to give access to some of our EJBs from Excel. The goal is to give an API usable from VBA. Our EJBs are mostly Stateless Session Beans that do simple CRUD operations with POJOs. Some possible solutions: Exposing the EJBs as WebServices and create a VB/C# dll wrappin... | TITLE:
Best solution for using EJBs from Excel
QUESTION:
We would like to give access to some of our EJBs from Excel. The goal is to give an API usable from VBA. Our EJBs are mostly Stateless Session Beans that do simple CRUD operations with POJOs. Some possible solutions: Exposing the EJBs as WebServices and create a... | [
"java",
"excel",
"ejb",
"corba",
"vba"
] | 1 | 3 | 979 | 6 | 0 | 2008-09-18T09:47:13.727000 | 2008-09-18T09:59:58.283000 |
91,282 | 91,330 | How to Programmatically Build a TemplateColumn | How does one go about programatically building a TemplateColumn object and adding it to a DataGrid. I know how to add it, but not how to build the contents of the TemplateColumn. There are no useful looking methods on the ITemplate the column class exposes. | You can use the CompiledTemplateBuilder Class. Here is an example: http://iridescence.no/post/Using-Templated-Controls-Programmatically.aspx | How to Programmatically Build a TemplateColumn How does one go about programatically building a TemplateColumn object and adding it to a DataGrid. I know how to add it, but not how to build the contents of the TemplateColumn. There are no useful looking methods on the ITemplate the column class exposes. | TITLE:
How to Programmatically Build a TemplateColumn
QUESTION:
How does one go about programatically building a TemplateColumn object and adding it to a DataGrid. I know how to add it, but not how to build the contents of the TemplateColumn. There are no useful looking methods on the ITemplate the column class expose... | [
"asp.net"
] | 1 | 1 | 537 | 1 | 0 | 2008-09-18T09:47:38.453000 | 2008-09-18T09:58:56.413000 |
91,289 | 91,603 | Ruby on Rails Migration - Create New Database Schema | I have a migration that runs an SQL script to create a new Postgres schema. When creating a new database in Postgres by default it creates a schema called 'public', which is the main schema we use. The migration to create the new database schema seems to be working fine, however the problem occurs after the migration h... | Well that depends what your migration looks like, what your database.yml looks like and what exactly you are trying to attempt. Anyway more information is needed change the names if you have to and post an example database.yml and the migration. does the migration change the search_path for the adapter for example? But... | Ruby on Rails Migration - Create New Database Schema I have a migration that runs an SQL script to create a new Postgres schema. When creating a new database in Postgres by default it creates a schema called 'public', which is the main schema we use. The migration to create the new database schema seems to be working f... | TITLE:
Ruby on Rails Migration - Create New Database Schema
QUESTION:
I have a migration that runs an SQL script to create a new Postgres schema. When creating a new database in Postgres by default it creates a schema called 'public', which is the main schema we use. The migration to create the new database schema see... | [
"ruby-on-rails",
"ruby",
"postgresql",
"schema",
"migration"
] | 4 | 5 | 13,595 | 3 | 0 | 2008-09-18T09:49:20.273000 | 2008-09-18T10:56:14.747000 |
91,304 | 1,754,807 | .NET's SslStream is always negotiating to the least secure cipher I have. How can I change this? | SslStream is supposed to negotiate the cipher type, key length, hash algorithm, etc. with its peer SSL stack. When using it in my code, I find that the negotiation always defaults to RC4 & MD5. I would like to use 3DES or AES for some added security. Looking around the web I find only a few references to this problem a... | You can select which protocols are available for selection by making some simple registry changes. We remove the ability to select RC4, for example. You only need to make the change at one end of the connection (eg server) because the client and server negotiate to find commonly supported algorithm http://msdn.microsof... | .NET's SslStream is always negotiating to the least secure cipher I have. How can I change this? SslStream is supposed to negotiate the cipher type, key length, hash algorithm, etc. with its peer SSL stack. When using it in my code, I find that the negotiation always defaults to RC4 & MD5. I would like to use 3DES or A... | TITLE:
.NET's SslStream is always negotiating to the least secure cipher I have. How can I change this?
QUESTION:
SslStream is supposed to negotiate the cipher type, key length, hash algorithm, etc. with its peer SSL stack. When using it in my code, I find that the negotiation always defaults to RC4 & MD5. I would lik... | [
".net",
"encryption",
"ssl",
"aes"
] | 5 | 1 | 4,171 | 5 | 0 | 2008-09-18T09:54:24.817000 | 2009-11-18T09:44:46.100000 |
91,305 | 91,952 | Change value of attribute on an XML object in AS3 | Is there a easy way to do this? Or do I have to parse the file and do some search/replacing on my own? The ideal would be something like: var myXML: XML =???; //... load xml data into the XML object
myXML.someAttribute = newValue; | Attributes are accessible in AS3 using the @ prefix. For example: var myXML:XML =; trace(myXML.@name); myXML.@name = "new"; trace(myXML.@name); Output: something new | Change value of attribute on an XML object in AS3 Is there a easy way to do this? Or do I have to parse the file and do some search/replacing on my own? The ideal would be something like: var myXML: XML =???; //... load xml data into the XML object
myXML.someAttribute = newValue; | TITLE:
Change value of attribute on an XML object in AS3
QUESTION:
Is there a easy way to do this? Or do I have to parse the file and do some search/replacing on my own? The ideal would be something like: var myXML: XML =???; //... load xml data into the XML object
myXML.someAttribute = newValue;
ANSWER:
Attributes ... | [
"xml",
"actionscript-3",
"actionscript"
] | 3 | 15 | 17,277 | 2 | 0 | 2008-09-18T09:54:40.027000 | 2008-09-18T12:12:32.147000 |
91,307 | 91,514 | Attaching additional javadoc in Intellij IDEA | When I use quick documentaion lookup (Ctrl+Q) on j2ee classes or annotations in IDEA I only get an empty javadoc. It only contains the basics like class name. How do I add the javadoc to the libs IDEA provides itself? | You can attach javadoc to any library you have configure in your module or project. Just access the project structure windows (File -> Project Structure), then select "modules" and select the module that has the dependency you want to configure. Then select the "Dependencies" tab, select the dependency that's missing t... | Attaching additional javadoc in Intellij IDEA When I use quick documentaion lookup (Ctrl+Q) on j2ee classes or annotations in IDEA I only get an empty javadoc. It only contains the basics like class name. How do I add the javadoc to the libs IDEA provides itself? | TITLE:
Attaching additional javadoc in Intellij IDEA
QUESTION:
When I use quick documentaion lookup (Ctrl+Q) on j2ee classes or annotations in IDEA I only get an empty javadoc. It only contains the basics like class name. How do I add the javadoc to the libs IDEA provides itself?
ANSWER:
You can attach javadoc to any... | [
"java",
"intellij-idea",
"javadoc"
] | 71 | 99 | 50,514 | 4 | 0 | 2008-09-18T09:54:47.890000 | 2008-09-18T10:37:06.213000 |
91,318 | 109,530 | How to extend default timeout period in flash application? | I have an application written in flash (actually it is written in Haxe and run under SHWX but it doesn't matter here). I have a pretty complex task that consumes a lot of CPU power and sometimes executes for more that 15 seconds. If that happens, I've got an error saying 'A script has executed for longer than the defau... | Another way is to link a swfmill -based swf via -swf-lib switch and set this ScriptLimits tag there, haxe will re-use it then. | How to extend default timeout period in flash application? I have an application written in flash (actually it is written in Haxe and run under SHWX but it doesn't matter here). I have a pretty complex task that consumes a lot of CPU power and sometimes executes for more that 15 seconds. If that happens, I've got an er... | TITLE:
How to extend default timeout period in flash application?
QUESTION:
I have an application written in flash (actually it is written in Haxe and run under SHWX but it doesn't matter here). I have a pretty complex task that consumes a lot of CPU power and sometimes executes for more that 15 seconds. If that happe... | [
"flash",
"timeout",
"haxe"
] | 8 | 2 | 13,857 | 5 | 0 | 2008-09-18T09:56:57.620000 | 2008-09-20T21:48:08.400000 |
91,344 | 91,358 | Can Visual Studio 2008 work with Team System 2005? | I would like to upgrade my team from VS2005 to VS2008 without touching the version of Team Server which is 2005. Is that possible? And if so, how do I tell VS to recognize TFS? Currently in my VS2008 options menu, I don't have any source control to choose from. | Yes, you can... (We're doing that here too) Tools -> Connect To Team Foundation Server "Add..." Enter IP / hostname | Can Visual Studio 2008 work with Team System 2005? I would like to upgrade my team from VS2005 to VS2008 without touching the version of Team Server which is 2005. Is that possible? And if so, how do I tell VS to recognize TFS? Currently in my VS2008 options menu, I don't have any source control to choose from. | TITLE:
Can Visual Studio 2008 work with Team System 2005?
QUESTION:
I would like to upgrade my team from VS2005 to VS2008 without touching the version of Team Server which is 2005. Is that possible? And if so, how do I tell VS to recognize TFS? Currently in my VS2008 options menu, I don't have any source control to ch... | [
"visual-studio",
"tfs"
] | 5 | 3 | 1,577 | 4 | 0 | 2008-09-18T10:01:39.823000 | 2008-09-18T10:04:16.730000 |
91,350 | 91,374 | Multiple forms on ASP.NET page | Coming from a Classic ASP background, I'm used to multiple forms on a page, but this clearly limited in a ASP.NET page. However, I have a situation where I have a form that gathers input from the user, saves the data to a DB, and afterwards I want to render (and tweak the values of) a special form that posts to the Pay... | You can have multiple forms, it's just only one form may have the runat="server" attribute. There are a bunch of answers to getting PayPal to work; but as it's a learning vehicle that may be cheating. In all honesty, I'd look at the full-blown PayPal API rather than use the method of the somewhat simplistic form (with ... | Multiple forms on ASP.NET page Coming from a Classic ASP background, I'm used to multiple forms on a page, but this clearly limited in a ASP.NET page. However, I have a situation where I have a form that gathers input from the user, saves the data to a DB, and afterwards I want to render (and tweak the values of) a spe... | TITLE:
Multiple forms on ASP.NET page
QUESTION:
Coming from a Classic ASP background, I'm used to multiple forms on a page, but this clearly limited in a ASP.NET page. However, I have a situation where I have a form that gathers input from the user, saves the data to a DB, and afterwards I want to render (and tweak th... | [
"asp.net",
"webforms"
] | 5 | 8 | 21,690 | 4 | 0 | 2008-09-18T10:02:52.863000 | 2008-09-18T10:07:29.950000 |
91,352 | 91,599 | XMP Library for Ruby | Can anyone recommend an open source Ruby library for adding XMP metadata to JPEG images? | MiniExiftool, which is just a wrapper around the Exiftool command-line app, is the only open-source one I know of. There's a commercial library called Chilkat, but I do not have experience with it, being that it is commercial. | XMP Library for Ruby Can anyone recommend an open source Ruby library for adding XMP metadata to JPEG images? | TITLE:
XMP Library for Ruby
QUESTION:
Can anyone recommend an open source Ruby library for adding XMP metadata to JPEG images?
ANSWER:
MiniExiftool, which is just a wrapper around the Exiftool command-line app, is the only open-source one I know of. There's a commercial library called Chilkat, but I do not have exper... | [
"ruby",
"xmp"
] | 3 | 5 | 1,108 | 1 | 0 | 2008-09-18T10:03:42.097000 | 2008-09-18T10:54:59.337000 |
91,357 | 95,427 | What is the value of href attribute in openid.server link tag if Techorati OpenID is hosted at my site? | I want to log in to Stack Overflow with Techorati OpenID hosted at my site. https://stackoverflow.com/users/login has some basic information. I understood that I should change to but if I change to or it does not work. | A general way to find out the answer to this question is to load the page you want to delegate to ( http://technorati.com/people/technorati/USERNAME in this case), look at the source, and find the server tag used there. If there are openid2 tags, you should copy those as well. | What is the value of href attribute in openid.server link tag if Techorati OpenID is hosted at my site? I want to log in to Stack Overflow with Techorati OpenID hosted at my site. https://stackoverflow.com/users/login has some basic information. I understood that I should change to but if I change to or it does not wor... | TITLE:
What is the value of href attribute in openid.server link tag if Techorati OpenID is hosted at my site?
QUESTION:
I want to log in to Stack Overflow with Techorati OpenID hosted at my site. https://stackoverflow.com/users/login has some basic information. I understood that I should change to but if I change to ... | [
"openid"
] | 0 | 1 | 736 | 2 | 0 | 2008-09-18T10:04:13.657000 | 2008-09-18T18:35:47.030000 |
91,362 | 91,375 | How to escape braces (curly brackets) in a format string in .NET | How can brackets be escaped in using string.Format? For example: String val = "1,2,3" String.Format(" foo {{0}}", val); This example doesn't throw an exception, but it outputs the string foo {0}. Is there a way to escape the brackets? | For you to output foo {1, 2, 3} you have to do something like: string t = "1, 2, 3"; string v = String.Format(" foo {{{0}}}", t); To output a { you use {{ and to output a } you use }}. Or now, you can also use C# string interpolation like this (a feature available in C# 6.0) Escaping brackets: String interpolation $(""... | How to escape braces (curly brackets) in a format string in .NET How can brackets be escaped in using string.Format? For example: String val = "1,2,3" String.Format(" foo {{0}}", val); This example doesn't throw an exception, but it outputs the string foo {0}. Is there a way to escape the brackets? | TITLE:
How to escape braces (curly brackets) in a format string in .NET
QUESTION:
How can brackets be escaped in using string.Format? For example: String val = "1,2,3" String.Format(" foo {{0}}", val); This example doesn't throw an exception, but it outputs the string foo {0}. Is there a way to escape the brackets?
A... | [
"c#",
".net",
"string",
"parsing",
"formatting"
] | 1,178 | 1,485 | 374,562 | 13 | 0 | 2008-09-18T10:04:48.583000 | 2008-09-18T10:07:35.737000 |
91,364 | 204,934 | Mercury Quick Test Pro and Virtual machines: Works from one client machine but not another | I have a virtual machine (VMware) with Mercury Quick Test Professional 9.2 installed. I have a script to test an application, written in VB.NET using the Infragistics library. If I access this virtual machine using my laptop (using Remote Desktop), everything works fine, the script completes without a problem. My lapto... | OK. I've found the problem. In fact, the script was failing silently because that's what the person who wrote the script told it to do. It couldn't validate something which was off screen, so the script failed. The problem was the QTP definition of 'off screen'. I have two screens attached to my laptop, the screen for ... | Mercury Quick Test Pro and Virtual machines: Works from one client machine but not another I have a virtual machine (VMware) with Mercury Quick Test Professional 9.2 installed. I have a script to test an application, written in VB.NET using the Infragistics library. If I access this virtual machine using my laptop (usi... | TITLE:
Mercury Quick Test Pro and Virtual machines: Works from one client machine but not another
QUESTION:
I have a virtual machine (VMware) with Mercury Quick Test Professional 9.2 installed. I have a script to test an application, written in VB.NET using the Infragistics library. If I access this virtual machine us... | [
"vb.net",
"automated-tests",
"qtp"
] | 6 | 5 | 6,247 | 5 | 0 | 2008-09-18T10:05:25.587000 | 2008-10-15T14:29:38.193000 |
91,367 | 92,226 | How to trace JavaScript events like onclick onblur? | Is there a way to debug or trace every JavaScript event in Internet Explorer 7? I have a bug that prevents scrolling after text-selecting, and I have no idea which event or action creates the bug. I really want to see which events are being triggered when I move the mouse for example. It's too much work to rewire the s... | Borkdude said: You might want to try Visual Studio 2008 and its feature to debug JavaScript code. I've been hacking around event handling multiple times, and in my opinion, although classical stepping debuggers are useful to track long code runs, they're not good in tracking events. Imagine listening to mouse move even... | How to trace JavaScript events like onclick onblur? Is there a way to debug or trace every JavaScript event in Internet Explorer 7? I have a bug that prevents scrolling after text-selecting, and I have no idea which event or action creates the bug. I really want to see which events are being triggered when I move the m... | TITLE:
How to trace JavaScript events like onclick onblur?
QUESTION:
Is there a way to debug or trace every JavaScript event in Internet Explorer 7? I have a bug that prevents scrolling after text-selecting, and I have no idea which event or action creates the bug. I really want to see which events are being triggered... | [
"javascript",
"debugging",
"events"
] | 12 | 1 | 31,236 | 10 | 0 | 2008-09-18T10:05:44.197000 | 2008-09-18T12:50:04.257000 |
91,368 | 91,558 | Checking from shell script if a directory contains files | From a shell script, how do I check if a directory contains files? Something similar to this if [ -e /some/dir/* ]; then echo "huzzah"; fi; but which works if the directory contains one or several files (the above one only works with exactly 0 or 1 files). | The solutions so far use ls. Here's an all bash solution: #!/bin/bash shopt -s nullglob dotglob # To include hidden files files=(/some/dir/*) if [ ${#files[@]} -gt 0 ]; then echo "huzzah"; fi | Checking from shell script if a directory contains files From a shell script, how do I check if a directory contains files? Something similar to this if [ -e /some/dir/* ]; then echo "huzzah"; fi; but which works if the directory contains one or several files (the above one only works with exactly 0 or 1 files). | TITLE:
Checking from shell script if a directory contains files
QUESTION:
From a shell script, how do I check if a directory contains files? Something similar to this if [ -e /some/dir/* ]; then echo "huzzah"; fi; but which works if the directory contains one or several files (the above one only works with exactly 0 o... | [
"bash",
"unix",
"shell"
] | 154 | 89 | 266,266 | 30 | 0 | 2008-09-18T10:05:52.217000 | 2008-09-18T10:46:21.353000 |
91,384 | 91,561 | Unit testing for C++ code - Tools and methodology | I'm working on a large c++ system that is has been in development for a few years now. As part of an effort to improve the quality of the existing code we engaged on a large long-term refactoring project. Do you know a good tool that can help me write unit tests in C++? Maybe something similar to Junit or Nunit? Can an... | Applying unit tests to legacy code was the very reason Working Effectively with Legacy Code was written. Michael Feathers is the author - as mentioned in other answers, he was involved in the creation of both CppUnit and CppUnitLite. | Unit testing for C++ code - Tools and methodology I'm working on a large c++ system that is has been in development for a few years now. As part of an effort to improve the quality of the existing code we engaged on a large long-term refactoring project. Do you know a good tool that can help me write unit tests in C++?... | TITLE:
Unit testing for C++ code - Tools and methodology
QUESTION:
I'm working on a large c++ system that is has been in development for a few years now. As part of an effort to improve the quality of the existing code we engaged on a large long-term refactoring project. Do you know a good tool that can help me write ... | [
"c++",
"unit-testing",
"refactoring"
] | 139 | 85 | 66,748 | 22 | 0 | 2008-09-18T10:08:47 | 2008-09-18T10:47:17.373000 |
91,398 | 196,865 | Best way to debug an ODBC driver on Windows | What is the best way to debug a custom ODBC driver on Windows? A former member of our team wrote the driver so we have the source available. How do you attach a debugger to the driver? Or is it easier to just add "trace prints" to the driver to see what is going on? | The best solution i found so far is a combination of trace prints and breakpoints (int 3) compiled into the driver. Trace prints for general debug information and the breakpoints for pieces of the code where I need to more thoroughly investigate the inner state of the driver. | Best way to debug an ODBC driver on Windows What is the best way to debug a custom ODBC driver on Windows? A former member of our team wrote the driver so we have the source available. How do you attach a debugger to the driver? Or is it easier to just add "trace prints" to the driver to see what is going on? | TITLE:
Best way to debug an ODBC driver on Windows
QUESTION:
What is the best way to debug a custom ODBC driver on Windows? A former member of our team wrote the driver so we have the source available. How do you attach a debugger to the driver? Or is it easier to just add "trace prints" to the driver to see what is g... | [
"windows",
"odbc"
] | 3 | 3 | 9,831 | 4 | 0 | 2008-09-18T10:11:21.487000 | 2008-10-13T06:38:15.840000 |
91,420 | 91,456 | Export variable from C++ static library | I have a static library written in C++ and I have a structure describing data format, i.e. struct Format{ long fmtId; long dataChunkSize; long headerSize;
Format(long, long, long);
bool operator==(Format const & other) const; }; Some of data formats are widely used, like {fmtId=0, dataChunkSize=128, headerSize=0} and... | Don't use the static keyword on global declarations. Here is an article explain the visibility of variables with/without static. The static gives globals internal linkage, that is, only visible in the translation unit they are declared in. | Export variable from C++ static library I have a static library written in C++ and I have a structure describing data format, i.e. struct Format{ long fmtId; long dataChunkSize; long headerSize;
Format(long, long, long);
bool operator==(Format const & other) const; }; Some of data formats are widely used, like {fmtId... | TITLE:
Export variable from C++ static library
QUESTION:
I have a static library written in C++ and I have a structure describing data format, i.e. struct Format{ long fmtId; long dataChunkSize; long headerSize;
Format(long, long, long);
bool operator==(Format const & other) const; }; Some of data formats are widely... | [
"c++",
"export"
] | 4 | 7 | 8,429 | 3 | 0 | 2008-09-18T10:14:58.153000 | 2008-09-18T10:21:36.983000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.