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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
91,443 | 97,518 | Amazon S3 standalone stub server | I seem to recall reading about an Amazon S3-compatible test server that you could run on your own server for unit tests or whatever. However, I've just exhausted my patience looking for this with both Google and AWS. Does such a thing exist? If not, I think I'll write one. Note: I'm asking about Amazon S3 (the storage ... | Are you thinking of Park Place? FYI, its old home page is offline now. | Amazon S3 standalone stub server I seem to recall reading about an Amazon S3-compatible test server that you could run on your own server for unit tests or whatever. However, I've just exhausted my patience looking for this with both Google and AWS. Does such a thing exist? If not, I think I'll write one. Note: I'm ask... | TITLE:
Amazon S3 standalone stub server
QUESTION:
I seem to recall reading about an Amazon S3-compatible test server that you could run on your own server for unit tests or whatever. However, I've just exhausted my patience looking for this with both Google and AWS. Does such a thing exist? If not, I think I'll write ... | [
"unit-testing",
"amazon-s3",
"amazon-web-services",
"stub"
] | 19 | 7 | 6,187 | 7 | 0 | 2008-09-18T10:19:46.350000 | 2008-09-18T22:10:02.990000 |
91,478 | 694,208 | Examples of Hierarchical-Model-View-Controller (HMVC)? | I'm interested in the Presentation-Abstraction-Control? (aka Hierarchical-Model-View-Controller (HMVC)) Architectural Pattern for constructing complex user interfaces (GUI or web) and was wondering if anyone was aware of any examples in the wild where I could read the code? I'm aware of the JavaWorld article and associ... | In the php world, I'm aware of a few methods that might qualify as HMVC. They all allow calling a controller and displaying the results from within a view. The calls can be nested infinitly creating widgets within widgets. Zend Framework: Action View Helper CodeIgniter: 3rd party Modular Extensions - HMVC Kohana: 3rd p... | Examples of Hierarchical-Model-View-Controller (HMVC)? I'm interested in the Presentation-Abstraction-Control? (aka Hierarchical-Model-View-Controller (HMVC)) Architectural Pattern for constructing complex user interfaces (GUI or web) and was wondering if anyone was aware of any examples in the wild where I could read ... | TITLE:
Examples of Hierarchical-Model-View-Controller (HMVC)?
QUESTION:
I'm interested in the Presentation-Abstraction-Control? (aka Hierarchical-Model-View-Controller (HMVC)) Architectural Pattern for constructing complex user interfaces (GUI or web) and was wondering if anyone was aware of any examples in the wild w... | [
"user-interface",
"design-patterns",
"model-view-controller"
] | 9 | 4 | 9,911 | 5 | 0 | 2008-09-18T10:27:06.440000 | 2009-03-29T06:29:32.590000 |
91,480 | 120,863 | source for eclipse plugin.xml page | I would like to know where can I find the code which eclipse uses to display the forms in the plugin.xml file. In particular I am looking for the form layout used in the extension tab in the plugin.xml | You can import the eclipse plugins into your workspace by using import -> Plugins and Fragments from the package explorer. Then use the following options: Select from all plug-ins and fragments found at the specified location import from the target platform with source folders (last option) Import the org.eclipse.pde.u... | source for eclipse plugin.xml page I would like to know where can I find the code which eclipse uses to display the forms in the plugin.xml file. In particular I am looking for the form layout used in the extension tab in the plugin.xml | TITLE:
source for eclipse plugin.xml page
QUESTION:
I would like to know where can I find the code which eclipse uses to display the forms in the plugin.xml file. In particular I am looking for the form layout used in the extension tab in the plugin.xml
ANSWER:
You can import the eclipse plugins into your workspace b... | [
"eclipse",
"rcp"
] | 1 | 0 | 608 | 2 | 0 | 2008-09-18T10:27:13.133000 | 2008-09-23T13:06:27.317000 |
91,511 | 91,575 | How to wrap an existing memory buffer as a DC for GDI | I have a memory buffer corresponding to my screen resolution (1280x800 at 24-bits-per-pixel) that contains my screen contents at 24bpp. I want to convert this to 8-bpp (ie. Halftone color palette in Windows). I currently do this: 1. Use CreateDIBSection to allocate a new 1280x800 24-bpp buffer and access it as a DC, as... | OK, to address the two parts of the problem. the following code shows how to get at the pixels inside of a bitmap, change them and put them back into the bitmap. You could always generate a dummy bitmap of the correct size and format, open it up, copy over your data and you then have a bitmap object with your data: pri... | How to wrap an existing memory buffer as a DC for GDI I have a memory buffer corresponding to my screen resolution (1280x800 at 24-bits-per-pixel) that contains my screen contents at 24bpp. I want to convert this to 8-bpp (ie. Halftone color palette in Windows). I currently do this: 1. Use CreateDIBSection to allocate ... | TITLE:
How to wrap an existing memory buffer as a DC for GDI
QUESTION:
I have a memory buffer corresponding to my screen resolution (1280x800 at 24-bits-per-pixel) that contains my screen contents at 24bpp. I want to convert this to 8-bpp (ie. Halftone color palette in Windows). I currently do this: 1. Use CreateDIBSe... | [
"c#",
".net",
"c++",
"vb.net",
"gdi+"
] | 3 | 2 | 3,173 | 4 | 0 | 2008-09-18T10:36:08.477000 | 2008-09-18T10:50:36.557000 |
91,518 | 91,807 | jQuery attribute selectors: How to query for an attribute with a custom namespace | Suppose I have a simple XHTML document that uses a custom namespace for attributes:...... How do I match each element that has a certain custom attribute using jQuery? Using $("div[custom:attr]") does not work. (Tried with Firefox only, so far.) | jQuery does not support custom namespaces directly, but you can find the divs you are looking for by using filter function. // find all divs that have custom:attr $('div').filter(function() { return $(this).attr('custom:attr'); }).each(function() { // matched a div with custom::attr $(this).html('I was found.'); }); | jQuery attribute selectors: How to query for an attribute with a custom namespace Suppose I have a simple XHTML document that uses a custom namespace for attributes:...... How do I match each element that has a certain custom attribute using jQuery? Using $("div[custom:attr]") does not work. (Tried with Firefox only, s... | TITLE:
jQuery attribute selectors: How to query for an attribute with a custom namespace
QUESTION:
Suppose I have a simple XHTML document that uses a custom namespace for attributes:...... How do I match each element that has a certain custom attribute using jQuery? Using $("div[custom:attr]") does not work. (Tried wi... | [
"javascript",
"jquery"
] | 34 | 43 | 70,732 | 5 | 0 | 2008-09-18T10:38:41.543000 | 2008-09-18T11:42:08.583000 |
91,521 | 91,531 | How can drawString method be used for writing diagonal way | I am using c# 2005 i want to write string diagonally on image. But by default c# provides the option to write horizontally or vertically. how we write diagonally? Thanks | Do a Graphics.rotateTransform before the drawString call. Don't forget to reverse the change afterwards, as Phil Wright points out. | How can drawString method be used for writing diagonal way I am using c# 2005 i want to write string diagonally on image. But by default c# provides the option to write horizontally or vertically. how we write diagonally? Thanks | TITLE:
How can drawString method be used for writing diagonal way
QUESTION:
I am using c# 2005 i want to write string diagonally on image. But by default c# provides the option to write horizontally or vertically. how we write diagonally? Thanks
ANSWER:
Do a Graphics.rotateTransform before the drawString call. Don't ... | [
"c#",
"image",
"visual-studio-2005",
"gdi",
"drawstring"
] | 6 | 7 | 6,243 | 5 | 0 | 2008-09-18T10:39:21.590000 | 2008-09-18T10:42:17.730000 |
91,563 | 91,597 | Switch over PropertyType | How can I make this work? switch(property.PropertyType){ case typeof(Boolean): //doStuff break; case typeof(String): //doOtherStuff break; default: break; } I don't want to use the name since string comparing for types is just awfull and can be subject to change. | System.Type propertyType = typeof(Boolean); System.TypeCode typeCode = Type.GetTypeCode(propertyType); switch (typeCode) { case TypeCode.Boolean: //doStuff break; case TypeCode.String: //doOtherStuff break; default: break; } You can use an hybrid approach for TypeCode.Object where you dynamic if with typeof. This is ve... | Switch over PropertyType How can I make this work? switch(property.PropertyType){ case typeof(Boolean): //doStuff break; case typeof(String): //doOtherStuff break; default: break; } I don't want to use the name since string comparing for types is just awfull and can be subject to change. | TITLE:
Switch over PropertyType
QUESTION:
How can I make this work? switch(property.PropertyType){ case typeof(Boolean): //doStuff break; case typeof(String): //doOtherStuff break; default: break; } I don't want to use the name since string comparing for types is just awfull and can be subject to change.
ANSWER:
Syst... | [
"c#",
"switch-statement"
] | 39 | 71 | 23,936 | 10 | 0 | 2008-09-18T10:47:28.717000 | 2008-09-18T10:54:29.400000 |
91,576 | 91,595 | crti.o file missing | I'm building a project using a GNU tool chain and everything works fine until I get to linking it, where the linker complains that it is missing/can't find crti.o. This is not one of my object files, it seems to be related to libc but I can't understand why it would need this crti.o, wouldn't it use a library file, e.g... | crti.o is the bootstrap library, generally quite small. It's usually statically linked into your binary. It should be found in /usr/lib. If you're running a binary distribution they tend to put all the developer stuff into -dev packages (e.g. libc6-dev) as it's not needed to run compiled programs, just to build them. Y... | crti.o file missing I'm building a project using a GNU tool chain and everything works fine until I get to linking it, where the linker complains that it is missing/can't find crti.o. This is not one of my object files, it seems to be related to libc but I can't understand why it would need this crti.o, wouldn't it use... | TITLE:
crti.o file missing
QUESTION:
I'm building a project using a GNU tool chain and everything works fine until I get to linking it, where the linker complains that it is missing/can't find crti.o. This is not one of my object files, it seems to be related to libc but I can't understand why it would need this crti.... | [
"makefile",
"linker"
] | 29 | 30 | 78,939 | 9 | 0 | 2008-09-18T10:50:42.483000 | 2008-09-18T10:54:09.183000 |
91,616 | 91,705 | Easiest cross platform widget toolkit? | What is the easiest cross platform widget toolkit? I'm looking for one that minimally covers Windows, OSX, and Linux with a C or C++ interface. | I don't know of any I've personally used with a C API, but wxWidgets is C++. It runs on Windows, Linux, and Mac OS X. And if you're looking for easy, wxPython is a Python wrapper around wxWidgets and it is pretty easy to use. | Easiest cross platform widget toolkit? What is the easiest cross platform widget toolkit? I'm looking for one that minimally covers Windows, OSX, and Linux with a C or C++ interface. | TITLE:
Easiest cross platform widget toolkit?
QUESTION:
What is the easiest cross platform widget toolkit? I'm looking for one that minimally covers Windows, OSX, and Linux with a C or C++ interface.
ANSWER:
I don't know of any I've personally used with a C API, but wxWidgets is C++. It runs on Windows, Linux, and Ma... | [
"c++",
"c",
"cross-platform",
"gui-toolkit"
] | 7 | 11 | 5,417 | 6 | 0 | 2008-09-18T10:58:48.470000 | 2008-09-18T11:17:16.273000 |
91,627 | 91,781 | JBoss 4.23 and EJB 2 support | Does anyone know if the JBoss 4.2.3 release that is compiled for Java 6 still supports EJB 2? I'm having issues where it can't cast a class to a certain interface where I never had this problem before and the code hasn't changed. | EJB2-style beans should still work in the 4.2 release. What interface do you want to cast to? Maybe that particular interface was renamed or moved. You should try not to use container-specific classes. | JBoss 4.23 and EJB 2 support Does anyone know if the JBoss 4.2.3 release that is compiled for Java 6 still supports EJB 2? I'm having issues where it can't cast a class to a certain interface where I never had this problem before and the code hasn't changed. | TITLE:
JBoss 4.23 and EJB 2 support
QUESTION:
Does anyone know if the JBoss 4.2.3 release that is compiled for Java 6 still supports EJB 2? I'm having issues where it can't cast a class to a certain interface where I never had this problem before and the code hasn't changed.
ANSWER:
EJB2-style beans should still work... | [
"jboss"
] | 0 | 1 | 655 | 1 | 0 | 2008-09-18T11:01:35.313000 | 2008-09-18T11:35:02.597000 |
91,628 | 92,505 | MS SQL Server 2005 - How to Auto Increment a field (not primary key) | I would like to automatically increment a field named `incrementID' anytime any field in any row within the table named 'tb_users' is updated. Currently I am doing it via the sql update statement. i.e "UPDATE tb_users SET name = @name, incrementID = incrementID + 1.....WHERE id = @id; I'm wondering how I can do this au... | This trigger should do the trick: create trigger update_increment for update as if not update(incrementID) UPDATE tb_users SET incrementID = incrementID + 1 from inserted WHERE tb_users.id = inserted.id | MS SQL Server 2005 - How to Auto Increment a field (not primary key) I would like to automatically increment a field named `incrementID' anytime any field in any row within the table named 'tb_users' is updated. Currently I am doing it via the sql update statement. i.e "UPDATE tb_users SET name = @name, incrementID = i... | TITLE:
MS SQL Server 2005 - How to Auto Increment a field (not primary key)
QUESTION:
I would like to automatically increment a field named `incrementID' anytime any field in any row within the table named 'tb_users' is updated. Currently I am doing it via the sql update statement. i.e "UPDATE tb_users SET name = @nam... | [
"sql-server"
] | 1 | 2 | 31,980 | 4 | 0 | 2008-09-18T11:01:53.017000 | 2008-09-18T13:25:47.447000 |
91,629 | 91,724 | JavaScript RegEx Elements Match | I'm trying to match elements with a name that is 'container1$container2$chkChecked', using a regex of '.+\$chkChecked', but I'm not getting the matches I expect when the element name is as described. What am I doing wrong? | my guess, by your use of quotes, is you did something like re = new RegExp('.+\$chkChecked'); which won't work because js takes advantage of the \ in its string interpretation as an escape so it never makes it into the regex interpreter instead you want re = new RegExp('.+\\$chkChecked'); | JavaScript RegEx Elements Match I'm trying to match elements with a name that is 'container1$container2$chkChecked', using a regex of '.+\$chkChecked', but I'm not getting the matches I expect when the element name is as described. What am I doing wrong? | TITLE:
JavaScript RegEx Elements Match
QUESTION:
I'm trying to match elements with a name that is 'container1$container2$chkChecked', using a regex of '.+\$chkChecked', but I'm not getting the matches I expect when the element name is as described. What am I doing wrong?
ANSWER:
my guess, by your use of quotes, is yo... | [
"javascript",
"regex"
] | 1 | 3 | 303 | 5 | 0 | 2008-09-18T11:02:58.913000 | 2008-09-18T11:20:14.393000 |
91,635 | 91,659 | PostSharp - il weaving - thoughts | I am considering using Postsharp framework to ease the burden of application method logging. It basically allows me to adorn methods with logging attribute and at compile time injects the logging code needed into the il. I like this solution as it keeps the noise out of the deign time code environment. Any thoughts, ex... | I apply logging with AOP using Castle Windsor DynamicProxies. I was already using Castle for it's IoC container, so using it for AOP was the path of least resistence for me. If you want more info let me know, I'm in the process of tidying the code up for releasing it as a blog post Edit Ok, here's the basic Intercepter... | PostSharp - il weaving - thoughts I am considering using Postsharp framework to ease the burden of application method logging. It basically allows me to adorn methods with logging attribute and at compile time injects the logging code needed into the il. I like this solution as it keeps the noise out of the deign time ... | TITLE:
PostSharp - il weaving - thoughts
QUESTION:
I am considering using Postsharp framework to ease the burden of application method logging. It basically allows me to adorn methods with logging attribute and at compile time injects the logging code needed into the il. I like this solution as it keeps the noise out ... | [
"c#",
"visual-studio",
"logging",
"aop",
"postsharp"
] | 10 | 7 | 4,858 | 3 | 0 | 2008-09-18T11:05:05.240000 | 2008-09-18T11:08:49.163000 |
91,666 | 91,735 | NI CVI with Python | I'd like to integrate a Python IDLE-esque command prompt interface into an existing NI-CVI (LabWindows) application. I've tried to follow the Python.org discussions but seem to get lost in the details. Is there a resource out there for dummies like me? | Here is a python sample code calling a CVI. There are DaqMx python bindings too. | NI CVI with Python I'd like to integrate a Python IDLE-esque command prompt interface into an existing NI-CVI (LabWindows) application. I've tried to follow the Python.org discussions but seem to get lost in the details. Is there a resource out there for dummies like me? | TITLE:
NI CVI with Python
QUESTION:
I'd like to integrate a Python IDLE-esque command prompt interface into an existing NI-CVI (LabWindows) application. I've tried to follow the Python.org discussions but seem to get lost in the details. Is there a resource out there for dummies like me?
ANSWER:
Here is a python samp... | [
"python",
"labview",
"labwindows",
"cvi"
] | 2 | 1 | 2,474 | 1 | 0 | 2008-09-18T11:09:50.177000 | 2008-09-18T11:22:06.027000 |
91,672 | 91,702 | What is the best way to add users to multiple groups in a database? | In an application where users can belong to multiple groups, I'm currently storing their groups in a column called groups as a binary. Every four bytes is a 32 bit integer which is the GroupID. However, this means that to enumerate all the users in a group I have to programatically select all users, and manually find o... | You have a many-to-many relationship between users and groups. This calls for a separate table to combine users with groups: User: (UserId[PrimaryKey], UserName etc.) Group: (GroupId[PrimaryKey], GroupName etc.) UserInGroup: (UserId[ForeignKey], GroupId[ForeignKey]) To find all users in a given group, you just say: sel... | What is the best way to add users to multiple groups in a database? In an application where users can belong to multiple groups, I'm currently storing their groups in a column called groups as a binary. Every four bytes is a 32 bit integer which is the GroupID. However, this means that to enumerate all the users in a g... | TITLE:
What is the best way to add users to multiple groups in a database?
QUESTION:
In an application where users can belong to multiple groups, I'm currently storing their groups in a column called groups as a binary. Every four bytes is a 32 bit integer which is the GroupID. However, this means that to enumerate al... | [
"sql",
"database"
] | 3 | 10 | 3,970 | 5 | 0 | 2008-09-18T11:10:40.050000 | 2008-09-18T11:16:36.133000 |
91,678 | 92,124 | How can I specify the local address on a java.net.URLConnection? | My Tomcat instance is listening to multiple IP addresses, but I want to control which source IP address is used when opening a URLConnection. How can I specify this? | This should do the trick: URL url = new URL(yourUrlHere); Proxy proxy = new Proxy(Proxy.Type.DIRECT, new InetSocketAddress( InetAddress.getByAddress( new byte[]{your, ip, interface, here}), yourTcpPortHere)); URLConnection conn = url.openConnection(proxy); And you are done. Dont forget to handle exceptions nicely and o... | How can I specify the local address on a java.net.URLConnection? My Tomcat instance is listening to multiple IP addresses, but I want to control which source IP address is used when opening a URLConnection. How can I specify this? | TITLE:
How can I specify the local address on a java.net.URLConnection?
QUESTION:
My Tomcat instance is listening to multiple IP addresses, but I want to control which source IP address is used when opening a URLConnection. How can I specify this?
ANSWER:
This should do the trick: URL url = new URL(yourUrlHere); Prox... | [
"java",
"tomcat",
"ip",
"urlconnection"
] | 11 | 6 | 12,590 | 4 | 0 | 2008-09-18T11:12:16.737000 | 2008-09-18T12:34:34.013000 |
91,683 | 91,872 | How do you implement unit-testing in large scale C++ projects? | I believe strongly in using unit-tests as part of building large multi-platform applications. We currently are planning on having our unit-tests within a separate project. This has the benefit of keeping our code base clean. I think, however, that this would separate the test code from the implementation of the unit. W... | There are many Test Unit frameforks for C++. CppUnit is certainly not the one I would choose (at least in its stable version 1.x, as it lacks many tests, and requires a lot of redundant lines of codes). So far, my preferred framework is CxxTest, and I plan on evaluating Fructose some day. Any way, there are a few "pape... | How do you implement unit-testing in large scale C++ projects? I believe strongly in using unit-tests as part of building large multi-platform applications. We currently are planning on having our unit-tests within a separate project. This has the benefit of keeping our code base clean. I think, however, that this woul... | TITLE:
How do you implement unit-testing in large scale C++ projects?
QUESTION:
I believe strongly in using unit-tests as part of building large multi-platform applications. We currently are planning on having our unit-tests within a separate project. This has the benefit of keeping our code base clean. I think, howev... | [
"c++",
"unit-testing",
"coding-style"
] | 43 | 23 | 49,136 | 9 | 0 | 2008-09-18T11:13:14.817000 | 2008-09-18T11:57:34.100000 |
91,688 | 91,725 | What are the differences between a clustered and a non-clustered index? | What are the differences between a clustered and a non-clustered index? | Clustered Index Only one per table Faster to read than non clustered as data is physically stored in index order Non Clustered Index Can be used many times per table Quicker for insert and update operations than a clustered index Both types of index will improve performance when select data with fields that use the ind... | What are the differences between a clustered and a non-clustered index? What are the differences between a clustered and a non-clustered index? | TITLE:
What are the differences between a clustered and a non-clustered index?
QUESTION:
What are the differences between a clustered and a non-clustered index?
ANSWER:
Clustered Index Only one per table Faster to read than non clustered as data is physically stored in index order Non Clustered Index Can be used many... | [
"sql-server",
"indexing",
"clustered-index",
"non-clustered-index"
] | 307 | 291 | 301,435 | 13 | 0 | 2008-09-18T11:14:23.283000 | 2008-09-18T11:20:23.067000 |
91,692 | 91,827 | JSTL/JSP EL (Expression Language) in a non JSP (standalone) context | Can anyone recommend a framework for templating/formatting messages in a standalone application along the lines of the JSP EL (Expression Language)? I would expect to be able to instantiate a an object of some sort, give it a template along the lines of Dear ${customer.firstName}. You order will be dispatched on ${orde... | You can just use the Universal Expression Language itself. You need an implementation (but there are a few to choose from). After that, you need to implement three classes: ELResolver, FunctionMapper and VariableMapper. This blog post describes how to do it: Java: using EL outside J2EE. | JSTL/JSP EL (Expression Language) in a non JSP (standalone) context Can anyone recommend a framework for templating/formatting messages in a standalone application along the lines of the JSP EL (Expression Language)? I would expect to be able to instantiate a an object of some sort, give it a template along the lines o... | TITLE:
JSTL/JSP EL (Expression Language) in a non JSP (standalone) context
QUESTION:
Can anyone recommend a framework for templating/formatting messages in a standalone application along the lines of the JSP EL (Expression Language)? I would expect to be able to instantiate a an object of some sort, give it a template... | [
"java",
"jsp",
"el",
"text-formatting"
] | 13 | 12 | 10,501 | 10 | 0 | 2008-09-18T11:15:06.370000 | 2008-09-18T11:46:30.367000 |
91,699 | 91,717 | PHP equivalent of Perl's 'use strict' (to require variables to be initialzied before use) | Python's convention is that variables are created by first assignment, and trying to read their value before one has been assigned raises an exception. PHP by contrast implicitly creates a variable when it is read, with a null value. This means it is easy to do this in PHP: function mymodule_important_calculation() { $... | PHP doesn't do much forward checking of things at parse time. The best you can do is crank up the warning level to report your mistakes, but by the time you get an E_NOTICE, its too late, and its not possible to force E_NOTICES to occur in advance yet. A lot of people are toting the "error_reporting E_STRICT" flag, but... | PHP equivalent of Perl's 'use strict' (to require variables to be initialzied before use) Python's convention is that variables are created by first assignment, and trying to read their value before one has been assigned raises an exception. PHP by contrast implicitly creates a variable when it is read, with a null val... | TITLE:
PHP equivalent of Perl's 'use strict' (to require variables to be initialzied before use)
QUESTION:
Python's convention is that variables are created by first assignment, and trying to read their value before one has been assigned raises an exception. PHP by contrast implicitly creates a variable when it is rea... | [
"php"
] | 9 | 10 | 7,052 | 7 | 0 | 2008-09-18T11:16:10.533000 | 2008-09-18T11:19:47.077000 |
91,703 | 91,768 | End-to-End application testing from a users standpoint | I am looking for a good way to consistently test my web applications from the end users point of view. I have all kinds of ways to check to make sure my code is working behind the scenes. I can't count the number of times that I make a change to a piece of code, test it and it works fine and then deploy it only to have... | Have you seen this technique using fitnesse and selenium? Can't vouch for how easy it is to set up, we've looked at selenium a little and one of our test analysts is keen to integrate something like FIT/Fitnesse into our automated testing but we're not there yet. | End-to-End application testing from a users standpoint I am looking for a good way to consistently test my web applications from the end users point of view. I have all kinds of ways to check to make sure my code is working behind the scenes. I can't count the number of times that I make a change to a piece of code, te... | TITLE:
End-to-End application testing from a users standpoint
QUESTION:
I am looking for a good way to consistently test my web applications from the end users point of view. I have all kinds of ways to check to make sure my code is working behind the scenes. I can't count the number of times that I make a change to a... | [
"asp.net",
"unit-testing",
"testing"
] | 1 | 3 | 1,719 | 3 | 0 | 2008-09-18T11:17:03.933000 | 2008-09-18T11:30:18.207000 |
91,710 | 91,751 | When people talk about scaling a website with 'shards', what do they mean? | I have heard the 'shard' technique mentioned several times with regard to solving scaling problems for large websites. What is this 'shard' technique and why is it so good? | Karl Seguin has a good blog post about sharding. From the post: Sharding is the separation of your data across multiple servers. How you separate your data is up to you, but generally it’s done on some fundamental identifier. | When people talk about scaling a website with 'shards', what do they mean? I have heard the 'shard' technique mentioned several times with regard to solving scaling problems for large websites. What is this 'shard' technique and why is it so good? | TITLE:
When people talk about scaling a website with 'shards', what do they mean?
QUESTION:
I have heard the 'shard' technique mentioned several times with regard to solving scaling problems for large websites. What is this 'shard' technique and why is it so good?
ANSWER:
Karl Seguin has a good blog post about shardi... | [
"database",
"scalability",
"sharding"
] | 11 | 9 | 830 | 3 | 0 | 2008-09-18T11:17:45.960000 | 2008-09-18T11:26:49.730000 |
91,715 | 91,759 | C++ strings without <string> and STL | I've not used C++ very much in the past, and have recently been doing a lot of C#, and I'm really struggling to get back into the basics of C++ again. This is particularly tricky as work mandates that none of the most handy C++ constructs can be used, so all strings must be char *'s, and there is no provision for STL l... | You'll probably need to use strcmp to see if the string is already stored: for (int index=0; index<=lastIndex; index++) { if (strcmp(registeredNames[index], name) == 0) { return; // Already registered } } Then if you really need to store a copy of the string, then you'll need to allocate a buffer and copy the character... | C++ strings without <string> and STL I've not used C++ very much in the past, and have recently been doing a lot of C#, and I'm really struggling to get back into the basics of C++ again. This is particularly tricky as work mandates that none of the most handy C++ constructs can be used, so all strings must be char *'s... | TITLE:
C++ strings without <string> and STL
QUESTION:
I've not used C++ very much in the past, and have recently been doing a lot of C#, and I'm really struggling to get back into the basics of C++ again. This is particularly tricky as work mandates that none of the most handy C++ constructs can be used, so all string... | [
"c++",
"string",
"list"
] | 5 | 6 | 6,715 | 14 | 0 | 2008-09-18T11:19:37.657000 | 2008-09-18T11:28:57.960000 |
91,721 | 92,061 | Cross browser issue (iframe sizing) | I am displaying pages from an external site (that I own) in an iframe in one of my pages. It's all fine except when viewed in Opera with the browser window size reduced (not widescreen), when the iframe shrinks and squashes the content. It works in widescreen (maximize browser window), and is OK in IE7, Firefox, Chrome... | We had a similar issue with iframe sizing on our web app main page, although in IE6. The solution was to trap the window.onresize event and call a JavaScript function to appropriately size the iframe. content is the name of the iframe we want sized. Also note that we are using ASP.Net AJAX's $get which translates to do... | Cross browser issue (iframe sizing) I am displaying pages from an external site (that I own) in an iframe in one of my pages. It's all fine except when viewed in Opera with the browser window size reduced (not widescreen), when the iframe shrinks and squashes the content. It works in widescreen (maximize browser window... | TITLE:
Cross browser issue (iframe sizing)
QUESTION:
I am displaying pages from an external site (that I own) in an iframe in one of my pages. It's all fine except when viewed in Opera with the browser window size reduced (not widescreen), when the iframe shrinks and squashes the content. It works in widescreen (maxim... | [
"html",
"css",
"iframe",
"cross-browser",
"resize"
] | 3 | 1 | 762 | 1 | 0 | 2008-09-18T11:19:53.520000 | 2008-09-18T12:27:10.037000 |
91,734 | 91,787 | How to transform a date-string in classic asp | I'm a little blockheaded right now… I have a date string in european format dd.mm.yyyy and need to transform it to mm.dd.yyyy with classic ASP. Any quick ideas? | If its always in that format you could use split d = split(".","dd.mm.yyyy") s = d(1) & "." & d(0) & "." & d(2) this would allow for dates like 1.2.99 as well | How to transform a date-string in classic asp I'm a little blockheaded right now… I have a date string in european format dd.mm.yyyy and need to transform it to mm.dd.yyyy with classic ASP. Any quick ideas? | TITLE:
How to transform a date-string in classic asp
QUESTION:
I'm a little blockheaded right now… I have a date string in european format dd.mm.yyyy and need to transform it to mm.dd.yyyy with classic ASP. Any quick ideas?
ANSWER:
If its always in that format you could use split d = split(".","dd.mm.yyyy") s = d(1) ... | [
"asp-classic"
] | 4 | 5 | 30,788 | 6 | 0 | 2008-09-18T11:21:49.490000 | 2008-09-18T11:35:55.930000 |
91,745 | 163,247 | DataGridViewComboBoxColumn adding different items to each row . | I am building a table using the DataGridView where a user can select items from a dropdown in each cell. To simplify the problem, lets say i have 1 column. I am using the DataGridViewComboBoxColumn in the designer. I am trying to support having each row in that column have a different list of items to choose from. Is t... | Yes. This can be done using the DataGridViewComboBoxCell. Here is an example method to add the items to just one cell, rather than the whole column. private void setCellComboBoxItems(DataGridView dataGrid, int rowIndex, int colIndex, object[] itemsToAdd) { DataGridViewComboBoxCell dgvcbc = (DataGridViewComboBoxCell) da... | DataGridViewComboBoxColumn adding different items to each row . I am building a table using the DataGridView where a user can select items from a dropdown in each cell. To simplify the problem, lets say i have 1 column. I am using the DataGridViewComboBoxColumn in the designer. I am trying to support having each row in... | TITLE:
DataGridViewComboBoxColumn adding different items to each row .
QUESTION:
I am building a table using the DataGridView where a user can select items from a dropdown in each cell. To simplify the problem, lets say i have 1 column. I am using the DataGridViewComboBoxColumn in the designer. I am trying to support ... | [
"c#",
"winforms",
"datagridview"
] | 17 | 20 | 32,661 | 7 | 0 | 2008-09-18T11:23:05.433000 | 2008-10-02T16:13:14.520000 |
91,747 | 91,758 | Background color of a ListBox item (Windows Forms) | How can I set the background color of a specific item in a System.Windows.Forms.ListBox? I would like to be able to set multiple ones if possible. | Probably the only way to accomplish that is to draw the items yourself. Set the DrawMode to OwnerDrawFixed and code something like this on the DrawItem event: private void listBox_DrawItem(object sender, DrawItemEventArgs e) { e.DrawBackground(); Graphics g = e.Graphics;
g.FillRectangle(new SolidBrush(Color.Silver), e... | Background color of a ListBox item (Windows Forms) How can I set the background color of a specific item in a System.Windows.Forms.ListBox? I would like to be able to set multiple ones if possible. | TITLE:
Background color of a ListBox item (Windows Forms)
QUESTION:
How can I set the background color of a specific item in a System.Windows.Forms.ListBox? I would like to be able to set multiple ones if possible.
ANSWER:
Probably the only way to accomplish that is to draw the items yourself. Set the DrawMode to Own... | [
"c#",
"winforms",
"listbox",
"colors"
] | 55 | 56 | 101,422 | 4 | 0 | 2008-09-18T11:24:05.150000 | 2008-09-18T11:28:45.527000 |
91,766 | 91,788 | How do I sort an ASP.NET DataGrid by the length of a field? | I have a DataGrid where each column has a SortExpression. I would like the sort expression to be the equivalent of "ORDER BY LEN(myField)". I have tried SortExpression="LEN(myField)" but this throws an exception as it is not valid syntax. Any ideas? | What about returning the len by the query already, but don't show that column, only use it as your original column's sortexpression? I don't think that your idea is supported by default. | How do I sort an ASP.NET DataGrid by the length of a field? I have a DataGrid where each column has a SortExpression. I would like the sort expression to be the equivalent of "ORDER BY LEN(myField)". I have tried SortExpression="LEN(myField)" but this throws an exception as it is not valid syntax. Any ideas? | TITLE:
How do I sort an ASP.NET DataGrid by the length of a field?
QUESTION:
I have a DataGrid where each column has a SortExpression. I would like the sort expression to be the equivalent of "ORDER BY LEN(myField)". I have tried SortExpression="LEN(myField)" but this throws an exception as it is not valid syntax. Any... | [
"asp.net",
"datagrid"
] | 0 | 3 | 729 | 5 | 0 | 2008-09-18T11:29:49.970000 | 2008-09-18T11:36:07.757000 |
91,778 | 91,853 | How to remove all event handlers from an event | To create a new event handler on a control you can do this c.Click += new EventHandler(mainFormButton_Click); or this c.Click += mainFormButton_Click; and to remove an event handler you can do this c.Click -= mainFormButton_Click; But how do you remove all event handlers from an event? | I found a solution on the MSDN forums. The sample code below will remove all Click events from button1. public partial class Form1: Form { public Form1() { InitializeComponent();
button1.Click += button1_Click; button1.Click += button1_Click2; button2.Click += button2_Click; }
private void button1_Click(object sender... | How to remove all event handlers from an event To create a new event handler on a control you can do this c.Click += new EventHandler(mainFormButton_Click); or this c.Click += mainFormButton_Click; and to remove an event handler you can do this c.Click -= mainFormButton_Click; But how do you remove all event handlers f... | TITLE:
How to remove all event handlers from an event
QUESTION:
To create a new event handler on a control you can do this c.Click += new EventHandler(mainFormButton_Click); or this c.Click += mainFormButton_Click; and to remove an event handler you can do this c.Click -= mainFormButton_Click; But how do you remove al... | [
"c#",
".net",
"winforms",
"events"
] | 439 | 196 | 549,760 | 18 | 0 | 2008-09-18T11:34:23.783000 | 2008-09-18T11:53:15.280000 |
91,784 | 91,794 | How can I delete duplicate rows in a table | I have a table with say 3 columns. There's no primary key so there can be duplicate rows. I need to just keep one and delete the others. Any idea how to do this is Sql Server? | I'd SELECT DISTINCT the rows and throw them into a temporary table, then drop the source table and copy back the data from the temp. EDIT: now with code snippet! INSERT INTO TABLE_2 SELECT DISTINCT * FROM TABLE_1 GO DELETE FROM TABLE_1 GO INSERT INTO TABLE_1 SELECT * FROM TABLE_2 GO | How can I delete duplicate rows in a table I have a table with say 3 columns. There's no primary key so there can be duplicate rows. I need to just keep one and delete the others. Any idea how to do this is Sql Server? | TITLE:
How can I delete duplicate rows in a table
QUESTION:
I have a table with say 3 columns. There's no primary key so there can be duplicate rows. I need to just keep one and delete the others. Any idea how to do this is Sql Server?
ANSWER:
I'd SELECT DISTINCT the rows and throw them into a temporary table, then d... | [
"sql",
"sql-server",
"database"
] | 14 | 23 | 6,802 | 13 | 0 | 2008-09-18T11:35:27.290000 | 2008-09-18T11:37:31.247000 |
91,791 | 91,966 | Grep and Sed Equivalent for XML Command Line Processing | When doing shell scripting, typically data will be in files of single line records like csv. It's really simple to handle this data with grep and sed. But I have to deal with XML often, so I'd really like a way to script access to that XML data via the command line. What are the best tools? | I've found xmlstarlet to be pretty good at this sort of thing. http://xmlstar.sourceforge.net/ Should be available in most distro repositories, too. An introductory tutorial is here: http://www.ibm.com/developerworks/library/x-starlet.html | Grep and Sed Equivalent for XML Command Line Processing When doing shell scripting, typically data will be in files of single line records like csv. It's really simple to handle this data with grep and sed. But I have to deal with XML often, so I'd really like a way to script access to that XML data via the command lin... | TITLE:
Grep and Sed Equivalent for XML Command Line Processing
QUESTION:
When doing shell scripting, typically data will be in files of single line records like csv. It's really simple to handle this data with grep and sed. But I have to deal with XML often, so I'd really like a way to script access to that XML data v... | [
"xml",
"command-line",
"scripting"
] | 150 | 108 | 75,092 | 14 | 0 | 2008-09-18T11:36:58.067000 | 2008-09-18T12:14:07.213000 |
91,800 | 820,025 | Order SharePoint search results by more columns | I'm using a FullTextSqlQuery in SharePoint 2007 (MOSS) and need to order the results by two columns: SELECT WorkId FROM SCOPE() ORDER BY Author ASC, Rank DESC However it seems that only the first column from ORDER BY is taken into account when returning results. In this case the results are ordered correctly by Author,... | Microsoft finally posted a knowledge base article about this issue. "When using RANK in the ORDER BY clause of a SharePoint Search query, no other properties should be used" http://support.microsoft.com/kb/970830 Symptom: When using RANK in the ORDER BY clause of a SharePoint Search query only the first ORDER BY column... | Order SharePoint search results by more columns I'm using a FullTextSqlQuery in SharePoint 2007 (MOSS) and need to order the results by two columns: SELECT WorkId FROM SCOPE() ORDER BY Author ASC, Rank DESC However it seems that only the first column from ORDER BY is taken into account when returning results. In this c... | TITLE:
Order SharePoint search results by more columns
QUESTION:
I'm using a FullTextSqlQuery in SharePoint 2007 (MOSS) and need to order the results by two columns: SELECT WorkId FROM SCOPE() ORDER BY Author ASC, Rank DESC However it seems that only the first column from ORDER BY is taken into account when returning ... | [
"sharepoint",
"search",
"moss"
] | 2 | 2 | 4,402 | 4 | 0 | 2008-09-18T11:39:48.653000 | 2009-05-04T13:09:27.787000 |
91,810 | 91,818 | Is there a pretty printer for python data? | Working with python interactively, it's sometimes necessary to display a result which is some arbitrarily complex data structure (like lists with embedded lists, etc.) The default way to display them is just one massive linear dump which just wraps over and over and you have to parse carefully to read it. Is there some... | from pprint import pprint a = [0, 1, ['a', 'b', 'c'], 2, 3, 4] pprint(a) Note that for a short list like my example, pprint will in fact print it all on one line. However, for more complex structures it does a pretty good job of pretty printing data. | Is there a pretty printer for python data? Working with python interactively, it's sometimes necessary to display a result which is some arbitrarily complex data structure (like lists with embedded lists, etc.) The default way to display them is just one massive linear dump which just wraps over and over and you have t... | TITLE:
Is there a pretty printer for python data?
QUESTION:
Working with python interactively, it's sometimes necessary to display a result which is some arbitrarily complex data structure (like lists with embedded lists, etc.) The default way to display them is just one massive linear dump which just wraps over and o... | [
"python",
"prettify"
] | 21 | 30 | 11,250 | 4 | 0 | 2008-09-18T11:43:45.413000 | 2008-09-18T11:44:54.990000 |
91,817 | 92,045 | What's the use/meaning of the @ character in variable names in C#? | I discovered that you can start your variable name with a '@' character in C#. In my C# project I was using a web service (I added a web reference to my project) that was written in Java. One of the interface objects defined in the WSDL had a member variable with the name "params". Obviously this is a reserved word in ... | Straight from the C# Language Specification, Identifiers (C#): The prefix "@" enables the use of keywords as identifiers, which is useful when interfacing with other programming languages. The character @ is not actually part of the identifier, so the identifier might be seen in other languages as a normal identifier, ... | What's the use/meaning of the @ character in variable names in C#? I discovered that you can start your variable name with a '@' character in C#. In my C# project I was using a web service (I added a web reference to my project) that was written in Java. One of the interface objects defined in the WSDL had a member var... | TITLE:
What's the use/meaning of the @ character in variable names in C#?
QUESTION:
I discovered that you can start your variable name with a '@' character in C#. In my C# project I was using a web service (I added a web reference to my project) that was written in Java. One of the interface objects defined in the WSD... | [
"c#",
"variables",
"naming",
"specifications",
"reserved-words"
] | 340 | 355 | 55,289 | 9 | 0 | 2008-09-18T11:44:52.773000 | 2008-09-18T12:24:52.490000 |
91,826 | 91,907 | FitNesse for Delphi 2006 / Delphi 2007 /Delphi 2009 | Is there a version of FitNesse that works on Delphi 2006/2007/2009? If so where can I find It? Are there any other programs like FitNesse that work on Delphi 2006? | Fitnesse has support for Delphi. See the FitServers page at fitnesse.org. | FitNesse for Delphi 2006 / Delphi 2007 /Delphi 2009 Is there a version of FitNesse that works on Delphi 2006/2007/2009? If so where can I find It? Are there any other programs like FitNesse that work on Delphi 2006? | TITLE:
FitNesse for Delphi 2006 / Delphi 2007 /Delphi 2009
QUESTION:
Is there a version of FitNesse that works on Delphi 2006/2007/2009? If so where can I find It? Are there any other programs like FitNesse that work on Delphi 2006?
ANSWER:
Fitnesse has support for Delphi. See the FitServers page at fitnesse.org. | [
"delphi",
"fitnesse",
"fit-framework"
] | 5 | 3 | 1,434 | 2 | 0 | 2008-09-18T11:46:16.017000 | 2008-09-18T12:06:01.727000 |
91,831 | 91,836 | Detecting Web.Config Authentication Mode | Say I have the following web.config: Using ASP.NET C#, how can I detect the Mode value of the Authentication tag? | Try Context.User.Identity.AuthenticationType Go for PB's answer folks | Detecting Web.Config Authentication Mode Say I have the following web.config: Using ASP.NET C#, how can I detect the Mode value of the Authentication tag? | TITLE:
Detecting Web.Config Authentication Mode
QUESTION:
Say I have the following web.config: Using ASP.NET C#, how can I detect the Mode value of the Authentication tag?
ANSWER:
Try Context.User.Identity.AuthenticationType Go for PB's answer folks | [
"c#",
"asp.net",
"authentication",
"web-config"
] | 15 | 4 | 23,789 | 6 | 0 | 2008-09-18T11:47:15.063000 | 2008-09-18T11:48:38.757000 |
91,834 | 91,845 | D-Editor with debugging | i've been programming a while in D (http://www.digitalmars.com/d/) now. I prefer it to Java because it is faster. However, i have not found an Editor that supports Code-Completion and Debugging (Step-Over, Step-Into, Breakpoints,...). Do you have any suggestions? P.S: gdb did not work. | Descent, the Eclipse plugin, should support both (if you have a D supporting debugger installed). I have to admit I haven't tried it in a long time though, and when I did, debugging did not work, using gdb. See also this question Personally I use Vim which currently provides neither completion nor debugging, although I... | D-Editor with debugging i've been programming a while in D (http://www.digitalmars.com/d/) now. I prefer it to Java because it is faster. However, i have not found an Editor that supports Code-Completion and Debugging (Step-Over, Step-Into, Breakpoints,...). Do you have any suggestions? P.S: gdb did not work. | TITLE:
D-Editor with debugging
QUESTION:
i've been programming a while in D (http://www.digitalmars.com/d/) now. I prefer it to Java because it is faster. However, i have not found an Editor that supports Code-Completion and Debugging (Step-Over, Step-Into, Breakpoints,...). Do you have any suggestions? P.S: gdb did n... | [
"editor",
"d"
] | 3 | 4 | 1,621 | 4 | 0 | 2008-09-18T11:48:27.727000 | 2008-09-18T11:51:19.967000 |
91,851 | 91,915 | Software Design Description Practise | How many people actually write an SDD document before writing a single line of code? How do you handle large CSCI's? What standard do you use for SDD content? What tailoring have you done? | I certainly have. Historically and on recent projects. Years ago I worked in organisations where templates were everything. Then I worked other places where the templates were looser or non-existent or didn't fit the projects I was working on. Now the content of the software design is pretty much governed by what I nee... | Software Design Description Practise How many people actually write an SDD document before writing a single line of code? How do you handle large CSCI's? What standard do you use for SDD content? What tailoring have you done? | TITLE:
Software Design Description Practise
QUESTION:
How many people actually write an SDD document before writing a single line of code? How do you handle large CSCI's? What standard do you use for SDD content? What tailoring have you done?
ANSWER:
I certainly have. Historically and on recent projects. Years ago I ... | [
"software-design"
] | 1 | 2 | 772 | 3 | 0 | 2008-09-18T11:52:42.320000 | 2008-09-18T12:06:45.983000 |
91,856 | 91,879 | Are indexes on temporary tables deleted when the table is deleted? | Would the following SQL remove also the index - or does it have to be removed separately? CREATE TABLE #Tbl (field int)
CREATE NONCLUSTERED INDEX idx ON #Tbl (field)
DROP TABLE #Tbl | Yes they are. You can search in MSSQL help for CREATE INDEX article it is said there: "Indexes can be created on a temporary table. When the table is dropped or the session ends, all indexes and triggers are dropped." | Are indexes on temporary tables deleted when the table is deleted? Would the following SQL remove also the index - or does it have to be removed separately? CREATE TABLE #Tbl (field int)
CREATE NONCLUSTERED INDEX idx ON #Tbl (field)
DROP TABLE #Tbl | TITLE:
Are indexes on temporary tables deleted when the table is deleted?
QUESTION:
Would the following SQL remove also the index - or does it have to be removed separately? CREATE TABLE #Tbl (field int)
CREATE NONCLUSTERED INDEX idx ON #Tbl (field)
DROP TABLE #Tbl
ANSWER:
Yes they are. You can search in MSSQL help... | [
"t-sql",
"indexing",
"temp-tables"
] | 22 | 25 | 19,026 | 3 | 0 | 2008-09-18T11:53:53.517000 | 2008-09-18T11:59:27.060000 |
91,857 | 91,866 | Renaming/Mapping Cygwin Folders | Can I safely rename the cygdrive folder? Also, I would like to add other folders at root and map them to folders on windows in the same way as /cygdrive/c maps to my C drive. Is that possible? | Yes, you can. See The Cygwin Mount Table in Cygwin's documentation. I have my documents folder mounted as /doc. These mounts end up in the registry and are retained across reboots etc. | Renaming/Mapping Cygwin Folders Can I safely rename the cygdrive folder? Also, I would like to add other folders at root and map them to folders on windows in the same way as /cygdrive/c maps to my C drive. Is that possible? | TITLE:
Renaming/Mapping Cygwin Folders
QUESTION:
Can I safely rename the cygdrive folder? Also, I would like to add other folders at root and map them to folders on windows in the same way as /cygdrive/c maps to my C drive. Is that possible?
ANSWER:
Yes, you can. See The Cygwin Mount Table in Cygwin's documentation. ... | [
"cygwin"
] | 3 | 7 | 3,130 | 2 | 0 | 2008-09-18T11:54:00.943000 | 2008-09-18T11:56:07.520000 |
91,890 | 2,278,316 | Reading quicken data files | Looking for an open source library, for C++, Java, C# or Python, for reading the data from Quicken.qdf files. @Swati: Quicken.qif format is for transfer only and is not kept up to date by the application like the.qdf file is. | QDF is proprietary and not really meant for reading other than my Quicken, probably for a reason as it is messy. I would recommend finding a way to export the qdf into an OFX (Open Financial Exchange) or qif file. I have done some financial and quickbooks automation and I did something similar. The problem is if you do... | Reading quicken data files Looking for an open source library, for C++, Java, C# or Python, for reading the data from Quicken.qdf files. @Swati: Quicken.qif format is for transfer only and is not kept up to date by the application like the.qdf file is. | TITLE:
Reading quicken data files
QUESTION:
Looking for an open source library, for C++, Java, C# or Python, for reading the data from Quicken.qdf files. @Swati: Quicken.qif format is for transfer only and is not kept up to date by the application like the.qdf file is.
ANSWER:
QDF is proprietary and not really meant ... | [
"c#",
"java",
"python",
"file-format",
"quicken"
] | 13 | 5 | 12,683 | 3 | 0 | 2008-09-18T12:02:19.317000 | 2010-02-17T04:29:31.037000 |
91,899 | 91,965 | Use grep to find content in files and move them if they match | I'm using grep to generate a list of files I need to move: grep -L -r 'Subject: \[SPAM\]'. How can I pass this list to the mv command and move the files somewhere else? | If you want to find and move files that do not match your pattern (move files that don't contain 'Subject \[SPAM\]' in this example) use: grep -L -Z -r 'Subject: \[SPAM\]'. | xargs -0 -I{} mv {} DIR The -Z means output with zeros (\0) after the filenames (so spaces are not used as delimeters). xargs -0 means interpret ... | Use grep to find content in files and move them if they match I'm using grep to generate a list of files I need to move: grep -L -r 'Subject: \[SPAM\]'. How can I pass this list to the mv command and move the files somewhere else? | TITLE:
Use grep to find content in files and move them if they match
QUESTION:
I'm using grep to generate a list of files I need to move: grep -L -r 'Subject: \[SPAM\]'. How can I pass this list to the mv command and move the files somewhere else?
ANSWER:
If you want to find and move files that do not match your patt... | [
"linux",
"shell",
"scripting",
"grep"
] | 66 | 89 | 77,144 | 9 | 0 | 2008-09-18T12:03:45.833000 | 2008-09-18T12:14:06.947000 |
91,905 | 91,921 | Adding urgent priority to mail set from mailto link | I want to add a mailto link on our web page. I want to add a urgent priority to this mail. | mailto links just doesn't support this feature, sorry. however, you could use a specific subject and filter it in your inbox Send a email | Adding urgent priority to mail set from mailto link I want to add a mailto link on our web page. I want to add a urgent priority to this mail. | TITLE:
Adding urgent priority to mail set from mailto link
QUESTION:
I want to add a mailto link on our web page. I want to add a urgent priority to this mail.
ANSWER:
mailto links just doesn't support this feature, sorry. however, you could use a specific subject and filter it in your inbox Send a email | [
"email",
"mailto"
] | 8 | 9 | 5,186 | 5 | 0 | 2008-09-18T12:05:48.467000 | 2008-09-18T12:07:51.253000 |
91,917 | 96,126 | How can we share individual rules between .drl files in JBoss Rules? | We are using JBoss Rules (a.k.a. Drools) and have several.drl files that each contain several rules. Is there a way to avoid duplication between files, so that we can define common rules that are available to more than one.drl file? Unfortunately, there does not seem to be any kind of include or module facility. | There is no way of including rules from another.drl file from within a.drl file. You can however add two.drl files to the same ruleBase and they will work as if they were in the same file. PackageBuilder builder = new PackageBuilder(); builder.addPackageFromDrl( new InputStreamReader( getClass().getResourceAsStream( "c... | How can we share individual rules between .drl files in JBoss Rules? We are using JBoss Rules (a.k.a. Drools) and have several.drl files that each contain several rules. Is there a way to avoid duplication between files, so that we can define common rules that are available to more than one.drl file? Unfortunately, the... | TITLE:
How can we share individual rules between .drl files in JBoss Rules?
QUESTION:
We are using JBoss Rules (a.k.a. Drools) and have several.drl files that each contain several rules. Is there a way to avoid duplication between files, so that we can define common rules that are available to more than one.drl file? ... | [
"drools",
"modularization",
"jboss-rules"
] | 3 | 2 | 3,067 | 1 | 0 | 2008-09-18T12:07:09.337000 | 2008-09-18T19:38:43.383000 |
91,932 | 92,108 | How does the Strategy Pattern work? | How does it work, what is it used for and when should one use it? | Let's explain the strategy pattern the easy way: You have a class Car() with a method run(), so you use it this way in a pseudo language: mycar = new Car() mycar.run() Now, you may want to change the run() behavior on the fly, while the program is executing. For example, you might want to simulate a motor failure or th... | How does the Strategy Pattern work? How does it work, what is it used for and when should one use it? | TITLE:
How does the Strategy Pattern work?
QUESTION:
How does it work, what is it used for and when should one use it?
ANSWER:
Let's explain the strategy pattern the easy way: You have a class Car() with a method run(), so you use it this way in a pseudo language: mycar = new Car() mycar.run() Now, you may want to ch... | [
"design-patterns",
"strategy-pattern"
] | 67 | 84 | 37,280 | 6 | 0 | 2008-09-18T12:09:49.250000 | 2008-09-18T12:32:30.693000 |
91,933 | 91,951 | Performance when checking for duplicates | I've been working on a project where I need to iterate through a collection of data and remove entries where the "primary key" is duplicated. I have tried using a List and Dictionary With the dictionary I found slightly better performance, even though I never need the Boolean tagged with each entry. My expectation is t... | They have added the HashSet class in.NET 3.5. But I guess it will be on par with the Dictionary. If you have less than say a 100 elements a List will probably perform better. | Performance when checking for duplicates I've been working on a project where I need to iterate through a collection of data and remove entries where the "primary key" is duplicated. I have tried using a List and Dictionary With the dictionary I found slightly better performance, even though I never need the Boolean ta... | TITLE:
Performance when checking for duplicates
QUESTION:
I've been working on a project where I need to iterate through a collection of data and remove entries where the "primary key" is duplicated. I have tried using a List and Dictionary With the dictionary I found slightly better performance, even though I never n... | [
"c#",
"performance",
"collections",
".net-2.0"
] | 1 | 3 | 493 | 6 | 0 | 2008-09-18T12:10:00.903000 | 2008-09-18T12:12:21.320000 |
91,957 | 119,650 | How do I use groovy to search+replace in XML? | How do I use groovy to search+replace in XML? I need something as short/easy as possible, since I'll be giving this code to the testers for their SoapUI scripting. More specifically, how do I turn: into: value | Some of the stuff you can do with an XSLT you can also do with some form of 'search & replace'. It all depends on how complex your problem is and how 'generic' you want to implement the solution. To make your own example slightly more generic: xml.replaceFirst(" [^<]* ", ' 32165487 ') The solution you choose is up to y... | How do I use groovy to search+replace in XML? How do I use groovy to search+replace in XML? I need something as short/easy as possible, since I'll be giving this code to the testers for their SoapUI scripting. More specifically, how do I turn: into: value | TITLE:
How do I use groovy to search+replace in XML?
QUESTION:
How do I use groovy to search+replace in XML? I need something as short/easy as possible, since I'll be giving this code to the testers for their SoapUI scripting. More specifically, how do I turn: into: value
ANSWER:
Some of the stuff you can do with an ... | [
"xml",
"groovy",
"soapui"
] | 2 | 2 | 19,778 | 9 | 0 | 2008-09-18T12:12:56.403000 | 2008-09-23T07:46:00.207000 |
91,981 | 92,085 | How to mock object construction? | Is there a way to mock object construction using JMock in Java? For example, if I have a method as such: public Object createObject(String objectType) { if(objectType.equals("Integer") { return new Integer(); } else if (objectType.equals("String") { return new String(); } }...is there a way to mock out the expectation ... | The only thing I can think of is to have the create method on at factory object, which you would than mock. But in terms of mocking a constructor call, no. Mock objects presuppose the existence of the object, whereas a constructor presuppose that the object doesn't exist. At least in java where allocation and initializ... | How to mock object construction? Is there a way to mock object construction using JMock in Java? For example, if I have a method as such: public Object createObject(String objectType) { if(objectType.equals("Integer") { return new Integer(); } else if (objectType.equals("String") { return new String(); } }...is there a... | TITLE:
How to mock object construction?
QUESTION:
Is there a way to mock object construction using JMock in Java? For example, if I have a method as such: public Object createObject(String objectType) { if(objectType.equals("Integer") { return new Integer(); } else if (objectType.equals("String") { return new String()... | [
"java",
"tdd",
"junit",
"mocking"
] | 8 | 8 | 10,671 | 6 | 0 | 2008-09-18T12:16:14.307000 | 2008-09-18T12:30:31.370000 |
91,984 | 92,097 | How do I hotkey directly to File Search tab in Eclipse | When I use CTRL + H I end up on the Java Search tab. I would very much like a shortcut to go directly to File Search instead. Is that possible? See image here for what I'm talking about: | You can just define a key binding that opens the file search: Go to Preferences > General > Keys Type "file search" in the search box. (If there are no results, and you have a really old Eclipse version, select the Include Unbound Commands check box.) Put the caret into the Binding text box and press the key combinatio... | How do I hotkey directly to File Search tab in Eclipse When I use CTRL + H I end up on the Java Search tab. I would very much like a shortcut to go directly to File Search instead. Is that possible? See image here for what I'm talking about: | TITLE:
How do I hotkey directly to File Search tab in Eclipse
QUESTION:
When I use CTRL + H I end up on the Java Search tab. I would very much like a shortcut to go directly to File Search instead. Is that possible? See image here for what I'm talking about:
ANSWER:
You can just define a key binding that opens the fi... | [
"eclipse",
"editor",
"hotkeys"
] | 116 | 147 | 37,273 | 9 | 0 | 2008-09-18T12:17:14.960000 | 2008-09-18T12:31:35.860000 |
91,986 | 92,009 | LINQ to SQL: How to write a 'Like' select? | I've got the following SQL: select * from transaction_log where stoptime like '%2008%' How do I write this in LINQ to SQL syntax? | If you want to use the literal method, it's like this: var query = from l in transaction_log where SqlMethods.Like(l.stoptime, "%2008%") select l; Another option is: var query = from l in transaction_log where l.stoptime.Contains("2008") select l; If it's a DateTime: var query = from l in transaction_log where l.stopti... | LINQ to SQL: How to write a 'Like' select? I've got the following SQL: select * from transaction_log where stoptime like '%2008%' How do I write this in LINQ to SQL syntax? | TITLE:
LINQ to SQL: How to write a 'Like' select?
QUESTION:
I've got the following SQL: select * from transaction_log where stoptime like '%2008%' How do I write this in LINQ to SQL syntax?
ANSWER:
If you want to use the literal method, it's like this: var query = from l in transaction_log where SqlMethods.Like(l.sto... | [
"linq-to-sql"
] | 20 | 30 | 15,312 | 6 | 0 | 2008-09-18T12:17:18.220000 | 2008-09-18T12:20:41.860000 |
91,994 | 92,005 | relational operator expression order | This is probably a silly question, but curiosity has gotten the better of me. I've been seeing code lately that seems to "reverse" the order of expressions for relational operators e.g.: if (0 == someVariable) As opposed to what I normally see/write: if (someVariable == 0) To me, the second method seems more readable a... | I understand that this is personal preference. Although by putting the variable second you can ensure that you don't accidentally assign the constant to the variable which used to concearn c developers. This is probably why you are seeing it in c# as developers switch language. | relational operator expression order This is probably a silly question, but curiosity has gotten the better of me. I've been seeing code lately that seems to "reverse" the order of expressions for relational operators e.g.: if (0 == someVariable) As opposed to what I normally see/write: if (someVariable == 0) To me, th... | TITLE:
relational operator expression order
QUESTION:
This is probably a silly question, but curiosity has gotten the better of me. I've been seeing code lately that seems to "reverse" the order of expressions for relational operators e.g.: if (0 == someVariable) As opposed to what I normally see/write: if (someVariab... | [
"c#",
"operators",
"logical-operators"
] | 1 | 6 | 631 | 6 | 0 | 2008-09-18T12:17:43.850000 | 2008-09-18T12:20:19.507000 |
92,001 | 92,054 | What is the real difference between Pointers and References? | AKA - What's this obsession with pointers? Having only really used modern, object oriented languages like ActionScript, Java and C#, I don't really understand the importance of pointers and what you use them for. What am I missing out on here? | It's all just indirection: The ability to not deal with data, but say "I'll direct you to some data, over there". You have the same concept in Java and C#, but only in reference format. The key differences are that references are effectively immutable signposts - they always point to something. This is useful, and easy... | What is the real difference between Pointers and References? AKA - What's this obsession with pointers? Having only really used modern, object oriented languages like ActionScript, Java and C#, I don't really understand the importance of pointers and what you use them for. What am I missing out on here? | TITLE:
What is the real difference between Pointers and References?
QUESTION:
AKA - What's this obsession with pointers? Having only really used modern, object oriented languages like ActionScript, Java and C#, I don't really understand the importance of pointers and what you use them for. What am I missing out on her... | [
"c",
"pointers",
"reference"
] | 29 | 81 | 8,200 | 22 | 0 | 2008-09-18T12:19:54.187000 | 2008-09-18T12:26:09.773000 |
92,004 | 92,024 | Programmatically Make Bound Column Invisible | I'm trying to make a data bound column invisible after data binding, because it won't exist before data binding. However, the DataGrid.Columns collection indicates a count of 0, making it seem as if the automatically generated columns don't belong to the collection. How can I make a column that is automatically generat... | You have to add code to the line item rendering code and set the visibility of that column to false. Even though its bound, the event will be fired for each record and you can manipulate the output. | Programmatically Make Bound Column Invisible I'm trying to make a data bound column invisible after data binding, because it won't exist before data binding. However, the DataGrid.Columns collection indicates a count of 0, making it seem as if the automatically generated columns don't belong to the collection. How can ... | TITLE:
Programmatically Make Bound Column Invisible
QUESTION:
I'm trying to make a data bound column invisible after data binding, because it won't exist before data binding. However, the DataGrid.Columns collection indicates a count of 0, making it seem as if the automatically generated columns don't belong to the co... | [
"asp.net"
] | 0 | 2 | 1,767 | 4 | 0 | 2008-09-18T12:20:15.123000 | 2008-09-18T12:22:29.940000 |
92,006 | 92,033 | How do I determine if a random string sounds like English? | I have an algorithm that generates strings based on a list of input words. How do I separate only the strings that sounds like English words? ie. discard RDLO while keeping LORD. EDIT: To clarify, they do not need to be actual words in the dictionary. They just need to sound like English. For example KEAL would be acce... | You can build a markov-chain of a huge english text. Afterwards you can feed words into the markov chain and check how high the probability is that the word is english. See here: http://en.wikipedia.org/wiki/Markov_chain At the bottom of the page you can see the markov text generator. What you want is exactly the rever... | How do I determine if a random string sounds like English? I have an algorithm that generates strings based on a list of input words. How do I separate only the strings that sounds like English words? ie. discard RDLO while keeping LORD. EDIT: To clarify, they do not need to be actual words in the dictionary. They just... | TITLE:
How do I determine if a random string sounds like English?
QUESTION:
I have an algorithm that generates strings based on a list of input words. How do I separate only the strings that sounds like English words? ie. discard RDLO while keeping LORD. EDIT: To clarify, they do not need to be actual words in the dic... | [
"string",
"linguistics",
"nlp"
] | 24 | 30 | 5,664 | 13 | 0 | 2008-09-18T12:20:20.787000 | 2008-09-18T12:23:40.590000 |
92,008 | 92,105 | Programmatically setting the record pointer in a C# DataGridView | How do I programmatically set the record pointer in a C# DataGridView? I've tried "DataGridView.Rows[DesiredRowIndex].Selected=true;", and that does not work. All it does is highlight that row within the grid; it doesn not move the record pointer to that row. | To change the active row for the datagrid you need to set the current cell property of the datagrid to a non-hidden non-disabled, non-header cell on the row that you have selected. You'd do this like: dataGridView1.CurrentCell = this.dataGridView1[YourColumn,YourRow]; Making sure that the cell matches the above criteri... | Programmatically setting the record pointer in a C# DataGridView How do I programmatically set the record pointer in a C# DataGridView? I've tried "DataGridView.Rows[DesiredRowIndex].Selected=true;", and that does not work. All it does is highlight that row within the grid; it doesn not move the record pointer to that ... | TITLE:
Programmatically setting the record pointer in a C# DataGridView
QUESTION:
How do I programmatically set the record pointer in a C# DataGridView? I've tried "DataGridView.Rows[DesiredRowIndex].Selected=true;", and that does not work. All it does is highlight that row within the grid; it doesn not move the recor... | [
"c#",
".net",
"winforms",
"datagridview"
] | 3 | 3 | 8,866 | 2 | 0 | 2008-09-18T12:20:25.747000 | 2008-09-18T12:32:23.330000 |
92,029 | 2,291,384 | .NET UML generation from code? | Is there anything out there that for.NET that can generate UML diagrams from code. Preferably an addin for Visual Studio. Starting work on a mature project that has little architectural documentation can be painful at first. Eventually you get the ins and outs of the code but helping to see how the code all fits togeth... | Visual Studio 2010 Ultimate supports UML class, sequence, component, use case, and activity diagrams. It also supports creating sequence, dependency graphs, and layer diagrams from code. Regarding your question about generating UML diagrams from code, there's a response here in the VS Architecture & Modeling tools foru... | .NET UML generation from code? Is there anything out there that for.NET that can generate UML diagrams from code. Preferably an addin for Visual Studio. Starting work on a mature project that has little architectural documentation can be painful at first. Eventually you get the ins and outs of the code but helping to s... | TITLE:
.NET UML generation from code?
QUESTION:
Is there anything out there that for.NET that can generate UML diagrams from code. Preferably an addin for Visual Studio. Starting work on a mature project that has little architectural documentation can be painful at first. Eventually you get the ins and outs of the cod... | [
".net",
"visual-studio",
"uml"
] | 2 | 1 | 3,977 | 6 | 0 | 2008-09-18T12:23:15.210000 | 2010-02-18T19:04:09.950000 |
92,035 | 712,960 | Set selected item on a DataGridViewComboboxColumn | I have a datagridview with a DataGridViewComboboxColumn column with 3 values: "Small", "Medium", "Large" I get back the users default which in this case is "Medium" I want to show a dropdown cell in the datagridview but default the value to "Medium". i would do this in a regular combobox by doing selected index or just... | When you get into the datagridview it is probably best to get into databinding. This will take care of all of the selected index stuff you are talking about. However, if you want to get in there by yourself, DataGridView.Rows[rowindex].Cells[columnindex].Value will let you get and set the value associated to the DataGr... | Set selected item on a DataGridViewComboboxColumn I have a datagridview with a DataGridViewComboboxColumn column with 3 values: "Small", "Medium", "Large" I get back the users default which in this case is "Medium" I want to show a dropdown cell in the datagridview but default the value to "Medium". i would do this in ... | TITLE:
Set selected item on a DataGridViewComboboxColumn
QUESTION:
I have a datagridview with a DataGridViewComboboxColumn column with 3 values: "Small", "Medium", "Large" I get back the users default which in this case is "Medium" I want to show a dropdown cell in the datagridview but default the value to "Medium". i... | [
"c#",
".net",
"winforms",
"datagridview"
] | 5 | 6 | 32,458 | 4 | 0 | 2008-09-18T12:23:52.773000 | 2009-04-03T08:00:59.250000 |
92,039 | 92,071 | " Attach to Process " in Visual Studio 2005 | I installed Visual Studio 2005 ( with SP1 ) and made the default settings as what is required for C++. Now i open a solution and run the exe. Under " Tools " menu item i go and Select " Attach the process " and i attach it to the exe i just ran. I put breakpoints several places in the code ( this breakpoints looks enab... | Perhaps it is attaching to "the wrong kind" of code. In the "Attach to Process" dialog, there is a setting that allows you to select the kind of code you want to debug. Try clicking "Select" button next to "Attach to" text box and checking only "Managed code" the relevant code type. http://img204.imageshack.us/img204/3... | " Attach to Process " in Visual Studio 2005 I installed Visual Studio 2005 ( with SP1 ) and made the default settings as what is required for C++. Now i open a solution and run the exe. Under " Tools " menu item i go and Select " Attach the process " and i attach it to the exe i just ran. I put breakpoints several plac... | TITLE:
" Attach to Process " in Visual Studio 2005
QUESTION:
I installed Visual Studio 2005 ( with SP1 ) and made the default settings as what is required for C++. Now i open a solution and run the exe. Under " Tools " menu item i go and Select " Attach the process " and i attach it to the exe i just ran. I put breakp... | [
"c++",
"visual-studio-2005",
"visual-c++-2005"
] | 1 | 5 | 2,102 | 3 | 0 | 2008-09-18T12:24:35.783000 | 2008-09-18T12:29:02.030000 |
92,043 | 106,760 | Is there a simple tool to convert mysql to postgresql syntax? | I've tried the tools listed here, some with more success than others, but none gave me valid postgres syntax I could use (tinyint errors etc.) | There's a mysqldump option which makes it output PostgreSQL code: mysqldump --compatible=postgresql... But that doesn't work too well. Instead, please see the mysql-to-postgres tool as described in Linus Oleander's answer. | Is there a simple tool to convert mysql to postgresql syntax? I've tried the tools listed here, some with more success than others, but none gave me valid postgres syntax I could use (tinyint errors etc.) | TITLE:
Is there a simple tool to convert mysql to postgresql syntax?
QUESTION:
I've tried the tools listed here, some with more success than others, but none gave me valid postgres syntax I could use (tinyint errors etc.)
ANSWER:
There's a mysqldump option which makes it output PostgreSQL code: mysqldump --compatible... | [
"mysql",
"database",
"postgresql"
] | 25 | 20 | 70,132 | 10 | 0 | 2008-09-18T12:24:45.673000 | 2008-09-20T01:54:31.543000 |
92,052 | 92,573 | session variable mixup in ASP.NET? | Is it possible for ASP.NET to mix up which user is associated with which session variable on the server? Are session variables immutably tied to the original user that created them across time, space & dimension? | To answer your original question: Sessions are keyed to an id that is placed in a cookie. This id is generated using some random number crypto routines. It is not guaranteed to be unique but it is highly unlikely that it will ever be duplicated in the span of the life of a session. Even if your sessions run for full wo... | session variable mixup in ASP.NET? Is it possible for ASP.NET to mix up which user is associated with which session variable on the server? Are session variables immutably tied to the original user that created them across time, space & dimension? | TITLE:
session variable mixup in ASP.NET?
QUESTION:
Is it possible for ASP.NET to mix up which user is associated with which session variable on the server? Are session variables immutably tied to the original user that created them across time, space & dimension?
ANSWER:
To answer your original question: Sessions ar... | [
"asp.net",
"session",
"variables"
] | 1 | 2 | 3,228 | 8 | 0 | 2008-09-18T12:25:59.510000 | 2008-09-18T13:35:55.020000 |
92,059 | 92,125 | GUI Testing tools and feedbacks | I am working on the issue of testing my GUI and I am not entirely sure of the best approach here. My GUI is built using a traditional MVC framework so I am easily able to test the logic parts of the GUI without bringing up the GUI itself. However, when it comes to testing the functionality of the GUI, I am not really s... | You have (at least) 2 issues - the complexity of the environment (the server) and the complexity of the GUI. There are many tools for automating GUI testing. All of them are more or less fragile and require pretty much constant maintenance in the face of changing layout. There is benefit to be gained from using them, b... | GUI Testing tools and feedbacks I am working on the issue of testing my GUI and I am not entirely sure of the best approach here. My GUI is built using a traditional MVC framework so I am easily able to test the logic parts of the GUI without bringing up the GUI itself. However, when it comes to testing the functionali... | TITLE:
GUI Testing tools and feedbacks
QUESTION:
I am working on the issue of testing my GUI and I am not entirely sure of the best approach here. My GUI is built using a traditional MVC framework so I am easily able to test the logic parts of the GUI without bringing up the GUI itself. However, when it comes to testi... | [
"unit-testing",
"user-interface",
"functional-programming"
] | 15 | 4 | 6,261 | 13 | 0 | 2008-09-18T12:26:52.423000 | 2008-09-18T12:34:38.600000 |
92,073 | 92,109 | Smallest Unicode encodings for different languages? | What are the typical average bytes-per-character rates for different unicode encodings in different languages? E.g. if I wanted the smallest number of bytes to encode some english text, then on average UTF-8 would be 1-byte per character and UTF-16 would be 2 so I'd pick UTF-8. If I wanted some Korean text, then UTF-16... | For any given language, your bytes-per-character rates are fairly constant, because most languages are allocated to contiguous code pages. The big exception is accented Latin characters, which are allocated higher in the code space than the unaccented forms. I don't have hard numbers for these. For languages with conti... | Smallest Unicode encodings for different languages? What are the typical average bytes-per-character rates for different unicode encodings in different languages? E.g. if I wanted the smallest number of bytes to encode some english text, then on average UTF-8 would be 1-byte per character and UTF-16 would be 2 so I'd p... | TITLE:
Smallest Unicode encodings for different languages?
QUESTION:
What are the typical average bytes-per-character rates for different unicode encodings in different languages? E.g. if I wanted the smallest number of bytes to encode some english text, then on average UTF-8 would be 1-byte per character and UTF-16 w... | [
"unicode"
] | 2 | 2 | 3,554 | 6 | 0 | 2008-09-18T12:29:07.473000 | 2008-09-18T12:32:30.913000 |
92,082 | 92,123 | How to add a column with a default value to an existing table in SQL Server? | How can I add a column with a default value to an existing table in SQL Server 2000 / SQL Server 2005? | Syntax: ALTER TABLE {TABLENAME} ADD {COLUMNNAME} {TYPE} {NULL|NOT NULL} CONSTRAINT {CONSTRAINT_NAME} DEFAULT {DEFAULT_VALUE} WITH VALUES Example: ALTER TABLE SomeTable ADD SomeCol Bit NULL --Or NOT NULL. CONSTRAINT D_SomeTable_SomeCol --When Omitted a Default-Constraint Name is autogenerated. DEFAULT (0)--Optional Defa... | How to add a column with a default value to an existing table in SQL Server? How can I add a column with a default value to an existing table in SQL Server 2000 / SQL Server 2005? | TITLE:
How to add a column with a default value to an existing table in SQL Server?
QUESTION:
How can I add a column with a default value to an existing table in SQL Server 2000 / SQL Server 2005?
ANSWER:
Syntax: ALTER TABLE {TABLENAME} ADD {COLUMNNAME} {TYPE} {NULL|NOT NULL} CONSTRAINT {CONSTRAINT_NAME} DEFAULT {DEF... | [
"sql",
"sql-server",
"sql-server-2005",
"sql-server-2000"
] | 3,263 | 4,104 | 3,749,044 | 45 | 0 | 2008-09-18T12:30:04.630000 | 2008-09-18T12:34:33.437000 |
92,093 | 92,363 | Removing leading zeroes from a field in a SQL statement | I am working on a SQL query that reads from a SQLServer database to produce an extract file. One of the requirements to remove the leading zeroes from a particular field, which is a simple VARCHAR(10) field. So, for example, if the field contains '00001A', the SELECT statement needs to return the data as '1A'. Is there... | select substring(ColumnName, patindex('%[^0]%',ColumnName), 10) | Removing leading zeroes from a field in a SQL statement I am working on a SQL query that reads from a SQLServer database to produce an extract file. One of the requirements to remove the leading zeroes from a particular field, which is a simple VARCHAR(10) field. So, for example, if the field contains '00001A', the SEL... | TITLE:
Removing leading zeroes from a field in a SQL statement
QUESTION:
I am working on a SQL query that reads from a SQLServer database to produce an extract file. One of the requirements to remove the leading zeroes from a particular field, which is a simple VARCHAR(10) field. So, for example, if the field contains... | [
"sql",
"sql-server",
"t-sql"
] | 111 | 168 | 360,586 | 16 | 0 | 2008-09-18T12:31:04.723000 | 2008-09-18T13:07:56.460000 |
92,100 | 98,422 | Is it possible to set code behind a resource dictionary in WPF for event handling? | Is it possible to set code behind a resource dictionary in WPF. For example in a usercontrol for a button you declare it in XAML. The event handling code for the button click is done in the code file behind the control. If I was to create a data template with a button how can I write the event handler code for it's but... | I think what you're asking is you want a code-behind file for a ResourceDictionary. You can totally do this! In fact, you do it the same way as for a Window: Say you have a ResourceDictionary called MyResourceDictionary. In your MyResourceDictionary.xaml file, put the x:Class attribute in the root element, like so: The... | Is it possible to set code behind a resource dictionary in WPF for event handling? Is it possible to set code behind a resource dictionary in WPF. For example in a usercontrol for a button you declare it in XAML. The event handling code for the button click is done in the code file behind the control. If I was to creat... | TITLE:
Is it possible to set code behind a resource dictionary in WPF for event handling?
QUESTION:
Is it possible to set code behind a resource dictionary in WPF. For example in a usercontrol for a button you declare it in XAML. The event handling code for the button click is done in the code file behind the control.... | [
"wpf"
] | 160 | 234 | 75,344 | 5 | 0 | 2008-09-18T12:31:43.800000 | 2008-09-19T00:45:08.203000 |
92,103 | 92,643 | MySQL slow query log - how slow is slow? | What do you find is the optimal setting for mysql slow query log parameter, and why? | I recommend these three lines log_slow_queries set-variable = long_query_time=1 log-queries-not-using-indexes The first and second will log any query over a second. As others have pointed out a one second query is pretty far gone if you are a shooting for a high transaction rate on your website, but I find that it turn... | MySQL slow query log - how slow is slow? What do you find is the optimal setting for mysql slow query log parameter, and why? | TITLE:
MySQL slow query log - how slow is slow?
QUESTION:
What do you find is the optimal setting for mysql slow query log parameter, and why?
ANSWER:
I recommend these three lines log_slow_queries set-variable = long_query_time=1 log-queries-not-using-indexes The first and second will log any query over a second. As... | [
"mysql",
"database",
"performance"
] | 21 | 18 | 9,626 | 5 | 0 | 2008-09-18T12:32:07.950000 | 2008-09-18T13:43:57.340000 |
92,113 | 92,147 | How do you get through the inevitable motivational "slump" near the end of projects? | When working on a project, after the interesting parts are coded, my motivation is severely diminished. What do you do to get over this problem? | Don't leave all the "boring" bits to the end - make sure that each component works, with regression tests and documentation, as early as possible in the project. That said, the last few weeks are still going to involve chasing down the really elusive bugs, dealing with last-second requirements changes, finalising the d... | How do you get through the inevitable motivational "slump" near the end of projects? When working on a project, after the interesting parts are coded, my motivation is severely diminished. What do you do to get over this problem? | TITLE:
How do you get through the inevitable motivational "slump" near the end of projects?
QUESTION:
When working on a project, after the interesting parts are coded, my motivation is severely diminished. What do you do to get over this problem?
ANSWER:
Don't leave all the "boring" bits to the end - make sure that e... | [
"project-management"
] | 7 | 5 | 555 | 13 | 0 | 2008-09-18T12:33:04.250000 | 2008-09-18T12:37:21.820000 |
92,114 | 92,165 | How can I copy a large file on Windows without CopyFile or CopyFileEx? | There is a limitation on Windows Server 2003 that prevents you from copying extremely large files, in proportion to the amount of RAM you have. The limitation is in the CopyFile and CopyFileEx functions, which are used by xcopy, Explorer, Robocopy, and the.NET FileInfo class. Here is the error that you get: Cannot copy... | The best option is to just open the original file for reading, the destination file for writing and then loop copying it block by block. In pseudocode: f1 = open(filename1); f2 = open(filename2, "w"); while(!f1.eof() ) { buffer = f1.read(buffersize); err = f2.write(buffer, buffersize); if err!= NO_ERROR_CODE break; } f... | How can I copy a large file on Windows without CopyFile or CopyFileEx? There is a limitation on Windows Server 2003 that prevents you from copying extremely large files, in proportion to the amount of RAM you have. The limitation is in the CopyFile and CopyFileEx functions, which are used by xcopy, Explorer, Robocopy, ... | TITLE:
How can I copy a large file on Windows without CopyFile or CopyFileEx?
QUESTION:
There is a limitation on Windows Server 2003 that prevents you from copying extremely large files, in proportion to the amount of RAM you have. The limitation is in the CopyFile and CopyFileEx functions, which are used by xcopy, Ex... | [
"c#",
"windows",
"file-io"
] | 12 | 16 | 16,789 | 2 | 0 | 2008-09-18T12:33:05.950000 | 2008-09-18T12:39:26.217000 |
92,230 | 92,318 | Python, beyond the basics | I've gotten to grips with the basics of Python and I've got a small holiday which I want to use some of to learn a little more Python. The problem is that I have no idea what to learn or where to start. I'm primarily web development but in this case I don't know how much difference it will make. | Well, there are great ressources for advanced Python programming: Dive Into Python ( read it for free ) Online python cookbooks (e.g. here and there ) O'Reilly's Python Cookbook (see amazon) A funny riddle game: Python Challenge Here is a list of subjects you must master if you want to write "Python" on your resume: li... | Python, beyond the basics I've gotten to grips with the basics of Python and I've got a small holiday which I want to use some of to learn a little more Python. The problem is that I have no idea what to learn or where to start. I'm primarily web development but in this case I don't know how much difference it will mak... | TITLE:
Python, beyond the basics
QUESTION:
I've gotten to grips with the basics of Python and I've got a small holiday which I want to use some of to learn a little more Python. The problem is that I have no idea what to learn or where to start. I'm primarily web development but in this case I don't know how much diff... | [
"python"
] | 13 | 16 | 4,721 | 10 | 0 | 2008-09-18T12:51:07.733000 | 2008-09-18T13:01:53.463000 |
92,239 | 92,357 | Can CSS truly override the order of HTML elements on a page? | If you have several div s on a page, you can use CSS to size, float them and move them round a little... but I can't see a way to get past the fact that the first div will show near the top of the page and the last div will be near the bottom! I cannot completely override the order of the elements as they come from the... | With Floating, and with position absolute, you can pull some pretty good positioning magic to change some of the order of the page. For instance, with StackOverflow, if the markup was setup right, the title, and main body content could be the first 2 things in the markup, and then the navigation/search, and finally the... | Can CSS truly override the order of HTML elements on a page? If you have several div s on a page, you can use CSS to size, float them and move them round a little... but I can't see a way to get past the fact that the first div will show near the top of the page and the last div will be near the bottom! I cannot comple... | TITLE:
Can CSS truly override the order of HTML elements on a page?
QUESTION:
If you have several div s on a page, you can use CSS to size, float them and move them round a little... but I can't see a way to get past the fact that the first div will show near the top of the page and the last div will be near the botto... | [
"html",
"css"
] | 23 | 9 | 15,108 | 8 | 0 | 2008-09-18T12:52:18.510000 | 2008-09-18T13:07:06.977000 |
92,258 | 751,060 | Why does mvn release:prepare fail while tagging? | With my multiproject pom I get an error while running release:prepare. There is nothing fancy about the project setup and every release-step before runs fine. The error I get is: [INFO] ------------------------------------------------------------------------ [ERROR] BUILD FAILURE [INFO] --------------------------------... | This issue is addressed in the latest version of the maven-release-plugin. Add this to your POM to pull it in. maven-release-plugin 2.0-beta-9 The issue that was fixed is MRELEASE-375. | Why does mvn release:prepare fail while tagging? With my multiproject pom I get an error while running release:prepare. There is nothing fancy about the project setup and every release-step before runs fine. The error I get is: [INFO] ------------------------------------------------------------------------ [ERROR] BUIL... | TITLE:
Why does mvn release:prepare fail while tagging?
QUESTION:
With my multiproject pom I get an error while running release:prepare. There is nothing fancy about the project setup and every release-step before runs fine. The error I get is: [INFO] -------------------------------------------------------------------... | [
"svn",
"maven-2",
"release",
"maven-scm"
] | 5 | 10 | 15,814 | 8 | 0 | 2008-09-18T12:55:16.553000 | 2009-04-15T10:22:44.367000 |
92,290 | 92,301 | How to make visualstudio .net work with VB6 and service pack 6 | I have VB application that requires visual service pack 6 to run, now when I install visualstudio.net (any version of.net) Its debugger doesn't work properly,I am able to create windows/web application in visualstudio.net but not able to debug anything, so I have to keep 2 computers, one for VB and one for.net, does an... | I've used visual studio 6 and visual studio 2005 on the same system, so I know you can set it up so that both debuggers work. However, when I did it the setup just worked, so I can't tell you what I did to make it work, except that VS2005 was on the machine first. | How to make visualstudio .net work with VB6 and service pack 6 I have VB application that requires visual service pack 6 to run, now when I install visualstudio.net (any version of.net) Its debugger doesn't work properly,I am able to create windows/web application in visualstudio.net but not able to debug anything, so ... | TITLE:
How to make visualstudio .net work with VB6 and service pack 6
QUESTION:
I have VB application that requires visual service pack 6 to run, now when I install visualstudio.net (any version of.net) Its debugger doesn't work properly,I am able to create windows/web application in visualstudio.net but not able to d... | [
"visual-studio"
] | 1 | 0 | 251 | 1 | 0 | 2008-09-18T12:57:48.340000 | 2008-09-18T12:59:51.893000 |
92,323 | 92,483 | Silverlight interaction with DataSet web services | My colleague has found himself in an "interesting" situation. He is working on a Silverlight (2.0) prototype that needs to call existing web services in the enterprise and bind the returned data to data-display controls. The thing is, the web services return.NET DataSets (they are not about to change existing implement... | AFAIK, when a.NET web service returns a DataSet, it returns its XML representation (which is pretty friendly). The fact that a.NET client can consume the DataSet directly only abstracts the fact that an Xml Serialization-Deserialization is taking place. So I would manually query the web services you require, observe th... | Silverlight interaction with DataSet web services My colleague has found himself in an "interesting" situation. He is working on a Silverlight (2.0) prototype that needs to call existing web services in the enterprise and bind the returned data to data-display controls. The thing is, the web services return.NET DataSet... | TITLE:
Silverlight interaction with DataSet web services
QUESTION:
My colleague has found himself in an "interesting" situation. He is working on a Silverlight (2.0) prototype that needs to call existing web services in the enterprise and bind the returned data to data-display controls. The thing is, the web services ... | [
"silverlight"
] | 1 | 1 | 3,674 | 4 | 0 | 2008-09-18T13:02:14.740000 | 2008-09-18T13:22:44.740000 |
92,328 | 502,619 | How can I access the ListViewItems of a WPF ListView? | Within an event, I'd like to put the focus on a specific TextBox within the ListViewItem's template. The XAML looks like this: I've tried the following in the code behind: (myList.FindName("myBox") as TextBox).Focus(); but I seem to have misunderstood the FindName() docs, because it returns null. Also the ListView.Item... | To understand why ContainerFromItem didn't work for me, here some background. The event handler where I needed this functionality looks like this: var item = new SomeListItem(); SomeList.Add(item); ListViewItem = SomeList.ItemContainerGenerator.ContainerFromItem(item); // returns null After the Add() the ItemContainerG... | How can I access the ListViewItems of a WPF ListView? Within an event, I'd like to put the focus on a specific TextBox within the ListViewItem's template. The XAML looks like this: I've tried the following in the code behind: (myList.FindName("myBox") as TextBox).Focus(); but I seem to have misunderstood the FindName()... | TITLE:
How can I access the ListViewItems of a WPF ListView?
QUESTION:
Within an event, I'd like to put the focus on a specific TextBox within the ListViewItem's template. The XAML looks like this: I've tried the following in the code behind: (myList.FindName("myBox") as TextBox).Focus(); but I seem to have misunderst... | [
"wpf",
"listview",
"internals"
] | 17 | 22 | 46,325 | 6 | 0 | 2008-09-18T13:02:56.987000 | 2009-02-02T09:02:33.323000 |
92,329 | 92,379 | Clean builds in continuous integration | We use a CruiseControl.Net/NAnt/Subversion stack for CI. Doing a fresh checkout for every build is way too time-consuming, so currently we just do an update on a working copy. However, this leaves the possibility that orphaned files may remain in the working copy, after being deleted in source control. We have tried us... | If you do just 'update', SVN will delete all the files that were deleted in the source control. However files that were created during build process might still be there and might interfere with new build. I'm not sure if SVN has a command to delete them but I guess you could do that with a little script, SVN definitel... | Clean builds in continuous integration We use a CruiseControl.Net/NAnt/Subversion stack for CI. Doing a fresh checkout for every build is way too time-consuming, so currently we just do an update on a working copy. However, this leaves the possibility that orphaned files may remain in the working copy, after being dele... | TITLE:
Clean builds in continuous integration
QUESTION:
We use a CruiseControl.Net/NAnt/Subversion stack for CI. Doing a fresh checkout for every build is way too time-consuming, so currently we just do an update on a working copy. However, this leaves the possibility that orphaned files may remain in the working copy... | [
"svn",
"cruisecontrol.net",
"nant"
] | 7 | 5 | 815 | 5 | 0 | 2008-09-18T13:03:17.377000 | 2008-09-18T13:09:56.550000 |
92,342 | 92,385 | "Greedy" <Delete> and <Backspace> in Visual Studio | Is there the way to apply "greedy" behavior to and keys in Visual Studio? By "greedy" I mean such behavior when all whitespace between cursor position and next word bound can be deleted using one keystroke. | Well, I don't think you can change the binding of the delete key or backspace key - but CTRL+DEL & CTRL+Backspace are pretty close to what you want. | "Greedy" <Delete> and <Backspace> in Visual Studio Is there the way to apply "greedy" behavior to and keys in Visual Studio? By "greedy" I mean such behavior when all whitespace between cursor position and next word bound can be deleted using one keystroke. | TITLE:
"Greedy" <Delete> and <Backspace> in Visual Studio
QUESTION:
Is there the way to apply "greedy" behavior to and keys in Visual Studio? By "greedy" I mean such behavior when all whitespace between cursor position and next word bound can be deleted using one keystroke.
ANSWER:
Well, I don't think you can change ... | [
"visual-studio",
"keyboard"
] | 4 | 7 | 2,456 | 9 | 0 | 2008-09-18T13:05:33.970000 | 2008-09-18T13:10:47.623000 |
92,373 | 92,891 | Django + FCGID on Fedora Core 9 -- what am I missing? | Fedora Core 9 seems to have FCGID instead of FastCGI as a pre-built, YUM-managed module. [ I'd rather not have to maintain a module outside of YUM; so no manual builds for me or my sysadmins. ] I'm trying to launch Django through the runfastcgi interface (per the FastCGI deployment docs). What I'm seeing is the resulti... | Why don't you try modwsgi? It sounds as the preffered way these days for WSGI applications such as Django. If you don't wan't to compile stuff for Fedora Core, that might be trickier. Regarding to your first question, this seems to solve the fcgid configuration problem. Note that you don't want to run the django applic... | Django + FCGID on Fedora Core 9 -- what am I missing? Fedora Core 9 seems to have FCGID instead of FastCGI as a pre-built, YUM-managed module. [ I'd rather not have to maintain a module outside of YUM; so no manual builds for me or my sysadmins. ] I'm trying to launch Django through the runfastcgi interface (per the Fa... | TITLE:
Django + FCGID on Fedora Core 9 -- what am I missing?
QUESTION:
Fedora Core 9 seems to have FCGID instead of FastCGI as a pre-built, YUM-managed module. [ I'd rather not have to maintain a module outside of YUM; so no manual builds for me or my sysadmins. ] I'm trying to launch Django through the runfastcgi int... | [
"python",
"django",
"apache2",
"fastcgi",
"fcgid"
] | 0 | 3 | 1,451 | 1 | 0 | 2008-09-18T13:09:21.480000 | 2008-09-18T14:13:09.720000 |
92,376 | 92,397 | Creating hidden folders | Is there any way that I can programmatically create (and I guess access) hidden folders on a storage device from within c#? | using System.IO;
string path = @"c:\folders\newfolder"; // or whatever if (!Directory.Exists(path)) { DirectoryInfo di = Directory.CreateDirectory(path); di.Attributes = FileAttributes.Directory | FileAttributes.Hidden; } | Creating hidden folders Is there any way that I can programmatically create (and I guess access) hidden folders on a storage device from within c#? | TITLE:
Creating hidden folders
QUESTION:
Is there any way that I can programmatically create (and I guess access) hidden folders on a storage device from within c#?
ANSWER:
using System.IO;
string path = @"c:\folders\newfolder"; // or whatever if (!Directory.Exists(path)) { DirectoryInfo di = Directory.CreateDirecto... | [
"c#",
".net",
"filesystems"
] | 48 | 131 | 44,623 | 5 | 0 | 2008-09-18T13:09:41.760000 | 2008-09-18T13:12:05.357000 |
92,396 | 92,439 | Why can't variables be declared in a switch statement? | I've always wondered this - why can't you declare variables after a case label in a switch statement? In C++ you can declare variables pretty much anywhere (and declaring them close to first use is obviously a good thing) but the following still won't work: switch (val) { case VAL: // This won't work int newVal = 42; b... | Case statements are only labels. This means the compiler will interpret this as a jump directly to the label. In C++, the problem here is one of scope. Your curly brackets define the scope as everything inside the switch statement. This means that you are left with a scope where a jump will be performed further into th... | Why can't variables be declared in a switch statement? I've always wondered this - why can't you declare variables after a case label in a switch statement? In C++ you can declare variables pretty much anywhere (and declaring them close to first use is obviously a good thing) but the following still won't work: switch ... | TITLE:
Why can't variables be declared in a switch statement?
QUESTION:
I've always wondered this - why can't you declare variables after a case label in a switch statement? In C++ you can declare variables pretty much anywhere (and declaring them close to first use is obviously a good thing) but the following still w... | [
"c++",
"switch-statement"
] | 1,129 | 1,345 | 394,222 | 23 | 0 | 2008-09-18T13:11:55.467000 | 2008-09-18T13:17:14.533000 |
92,413 | 103,713 | Global vs Universal Active Directory Group access for a web app | I have a SQL Server 2000, C# & ASP.net web app. We want to control access to it by using Active Directory groups. I can get authentication to work if the group I put in is a 'Global' but not if the group is 'Universal'. How can I make this work with 'Universal' groups an well? Here's my authorization block: | Turns out I needed to use the "Pre Win2000" id not the regular one. | Global vs Universal Active Directory Group access for a web app I have a SQL Server 2000, C# & ASP.net web app. We want to control access to it by using Active Directory groups. I can get authentication to work if the group I put in is a 'Global' but not if the group is 'Universal'. How can I make this work with 'Unive... | TITLE:
Global vs Universal Active Directory Group access for a web app
QUESTION:
I have a SQL Server 2000, C# & ASP.net web app. We want to control access to it by using Active Directory groups. I can get authentication to work if the group I put in is a 'Global' but not if the group is 'Universal'. How can I make thi... | [
"asp.net",
"authentication",
"active-directory",
"web-applications"
] | 2 | 0 | 4,339 | 2 | 0 | 2008-09-18T13:14:12.153000 | 2008-09-19T17:01:35.320000 |
92,427 | 92,585 | How do I apply inline CSS to an ASP.NET server control? | Based on a simple test I ran, I don't think it's possible to put an inline | According to www.w3schools.com: The style element goes in the head section. If you want to include a style sheet in your page, you should define the style sheet externally, and link to it using. So it's not a good idea to include style elements (e.g. a block) in a control. If you could, it'd probably have an effect in ... | How do I apply inline CSS to an ASP.NET server control? Based on a simple test I ran, I don't think it's possible to put an inline | TITLE:
How do I apply inline CSS to an ASP.NET server control?
QUESTION:
Based on a simple test I ran, I don't think it's possible to put an inline
ANSWER:
According to www.w3schools.com: The style element goes in the head section. If you want to include a style sheet in your page, you should define the style sheet e... | [
"asp.net",
"css"
] | 20 | 14 | 68,559 | 4 | 0 | 2008-09-18T13:15:35.957000 | 2008-09-18T13:37:14.487000 |
92,434 | 92,460 | Exception getting past Application.ThreadException and AppDomain.CurrentDomain.UnhandledException | I'm having a problem with an application hanging and giving me the default "Please tell Microsoft about this problem" popup, instead of the "unhandled exception" dialog in the application. In the application code, the Application.ThreadException and AppDomain.CurrentDomain.UnhandledException are both redirected to a me... | Just shooting in the dark here - is it possible that the ArgumentOutOfRangeException is actually thrown from your exception handler? Additionally, you didn't say what type of application is in question -- Application.ThreadException only affects WinForms threads, so if this isn't a GUI application it's useless. (See th... | Exception getting past Application.ThreadException and AppDomain.CurrentDomain.UnhandledException I'm having a problem with an application hanging and giving me the default "Please tell Microsoft about this problem" popup, instead of the "unhandled exception" dialog in the application. In the application code, the Appl... | TITLE:
Exception getting past Application.ThreadException and AppDomain.CurrentDomain.UnhandledException
QUESTION:
I'm having a problem with an application hanging and giving me the default "Please tell Microsoft about this problem" popup, instead of the "unhandled exception" dialog in the application. In the applicat... | [
"c#",
"exception"
] | 5 | 2 | 2,656 | 3 | 0 | 2008-09-18T13:16:26.127000 | 2008-09-18T13:20:12.483000 |
92,438 | 93,029 | Stripping non printable characters from a string in python | I use to run $s =~ s/[^[:print:]]//g; on Perl to get rid of non printable characters. In Python there's no POSIX regex classes, and I can't write [:print:] having it mean what I want. I know of no way in Python to detect if a character is printable or not. What would you do? EDIT: It has to support Unicode characters a... | Iterating over strings is unfortunately rather slow in Python. Regular expressions are over an order of magnitude faster for this kind of thing. You just have to build the character class yourself. The unicodedata module is quite helpful for this, especially the unicodedata.category() function. See Unicode Character Da... | Stripping non printable characters from a string in python I use to run $s =~ s/[^[:print:]]//g; on Perl to get rid of non printable characters. In Python there's no POSIX regex classes, and I can't write [:print:] having it mean what I want. I know of no way in Python to detect if a character is printable or not. What... | TITLE:
Stripping non printable characters from a string in python
QUESTION:
I use to run $s =~ s/[^[:print:]]//g; on Perl to get rid of non printable characters. In Python there's no POSIX regex classes, and I can't write [:print:] having it mean what I want. I know of no way in Python to detect if a character is prin... | [
"python",
"string",
"non-printable"
] | 111 | 99 | 183,325 | 16 | 0 | 2008-09-18T13:17:06.797000 | 2008-09-18T14:28:04.380000 |
92,452 | 97,897 | Distributed Concurrency Control | I've been working on this for a few days now, and I've found several solutions but none of them incredibly simple or lightweight. The problem is basically this: We have a cluster of 10 machines, each of which is running the same software on a multithreaded ESB platform. I can deal with concurrency issues between thread... | you might want to consider using Hazelcast distributed locks. Super lite and easy. java.util.concurrent.locks.Lock lock = Hazelcast.getLock ("mymonitor"); lock.lock (); try { // do your stuff }finally { lock.unlock(); } Hazelcast - Distributed Queue, Map, Set, List, Lock | Distributed Concurrency Control I've been working on this for a few days now, and I've found several solutions but none of them incredibly simple or lightweight. The problem is basically this: We have a cluster of 10 machines, each of which is running the same software on a multithreaded ESB platform. I can deal with c... | TITLE:
Distributed Concurrency Control
QUESTION:
I've been working on this for a few days now, and I've found several solutions but none of them incredibly simple or lightweight. The problem is basically this: We have a cluster of 10 machines, each of which is running the same software on a multithreaded ESB platform.... | [
"java",
"concurrency",
"load-balancing",
"scaling",
"terracotta"
] | 56 | 34 | 23,867 | 13 | 0 | 2008-09-18T13:18:40.660000 | 2008-09-18T23:11:36.040000 |
92,455 | 92,580 | How can I write a lock free structure? | In my multithreaded application and I see heavy lock contention in it, preventing good scalability across multiple cores. I have decided to use lock free programming to solve this. How can I write a lock free structure? | Short answer is: You cannot. Long answer is: If you are asking this question, you do not probably know enough to be able to create a lock free structure. Creating lock free structures is extremely hard, and only experts in this field can do it. Instead of writing your own, search for an existing implementation. When yo... | How can I write a lock free structure? In my multithreaded application and I see heavy lock contention in it, preventing good scalability across multiple cores. I have decided to use lock free programming to solve this. How can I write a lock free structure? | TITLE:
How can I write a lock free structure?
QUESTION:
In my multithreaded application and I see heavy lock contention in it, preventing good scalability across multiple cores. I have decided to use lock free programming to solve this. How can I write a lock free structure?
ANSWER:
Short answer is: You cannot. Long ... | [
"multithreading",
"multicore",
"lock-free"
] | 36 | 45 | 11,368 | 21 | 0 | 2008-09-18T13:18:51.380000 | 2008-09-18T13:36:31.990000 |
92,456 | 92,926 | Using openssl encryption with Java | I have a legacy C++ module that offers encryption/decryption using the openssl library (DES encryption). I'm trying to translate that code into java, and I don't want to rely on a DLL, JNI, etc... C++ code looks like: des_string_to_key(reinterpret_cast (key1), &initkey); des_string_to_key(reinterpret_cast (key2), &key)... | I'm not an OpenSSL expert, but I'd guess the C++ code is using DES in CBC mode thus needing an IV (that's what the initKey probably is, and that's why you think you need two keys). If I'm right, you need to change your Java code to use DES in CBC mode too, then the Java code too will require an encryption key and an IV... | Using openssl encryption with Java I have a legacy C++ module that offers encryption/decryption using the openssl library (DES encryption). I'm trying to translate that code into java, and I don't want to rely on a DLL, JNI, etc... C++ code looks like: des_string_to_key(reinterpret_cast (key1), &initkey); des_string_to... | TITLE:
Using openssl encryption with Java
QUESTION:
I have a legacy C++ module that offers encryption/decryption using the openssl library (DES encryption). I'm trying to translate that code into java, and I don't want to rely on a DLL, JNI, etc... C++ code looks like: des_string_to_key(reinterpret_cast (key1), &initk... | [
"java",
"encryption",
"openssl"
] | 6 | 1 | 8,677 | 3 | 0 | 2008-09-18T13:19:02.767000 | 2008-09-18T14:16:35.420000 |
92,467 | 92,857 | What should be done to make TFS send e-mails for events? | Our Tfs server (Tfs2008) has smtp server installed. But we could not make Tfs send e-mails after events to the subscribers (we are using EventSubscriptionTool ). Our appsettings includes these lines: Is there any other tricks for this task...? | You sound like you have common part fixed - setting the appropriate appSettings in the web.config in %ProgramFile%\Microsoft Visual Studio 2008 Team Foundation Server\Web Services\Services. The following post from Pete Sheill might help you debug what's going wrong. http://blogs.msdn.com/psheill/archive/2005/11/28/4976... | What should be done to make TFS send e-mails for events? Our Tfs server (Tfs2008) has smtp server installed. But we could not make Tfs send e-mails after events to the subscribers (we are using EventSubscriptionTool ). Our appsettings includes these lines: Is there any other tricks for this task...? | TITLE:
What should be done to make TFS send e-mails for events?
QUESTION:
Our Tfs server (Tfs2008) has smtp server installed. But we could not make Tfs send e-mails after events to the subscribers (we are using EventSubscriptionTool ). Our appsettings includes these lines: Is there any other tricks for this task...?
... | [
"tfs"
] | 2 | 3 | 393 | 1 | 0 | 2008-09-18T13:21:16.537000 | 2008-09-18T14:09:19.930000 |
92,490 | 92,616 | Running JIRA on a VM | Anyone have any success or failure running Jira on a VM? I am setting up a new source control and defect tracking server. My server room is near full and my services group suggested a VM. I saw that a bunch of people are running SVN on VM (including NCSA). The VM would also free me from hardware problems and give me hi... | I don't see why you shouldn't run jira off a vm - but jira needs a good amount of resources, and if your vm resides on a heavily loaded machine, it may exhibit poor performance. Why not log a support request (support.atlassian.com) and ask? | Running JIRA on a VM Anyone have any success or failure running Jira on a VM? I am setting up a new source control and defect tracking server. My server room is near full and my services group suggested a VM. I saw that a bunch of people are running SVN on VM (including NCSA). The VM would also free me from hardware pr... | TITLE:
Running JIRA on a VM
QUESTION:
Anyone have any success or failure running Jira on a VM? I am setting up a new source control and defect tracking server. My server room is near full and my services group suggested a VM. I saw that a bunch of people are running SVN on VM (including NCSA). The VM would also free m... | [
"version-control",
"virtual-machine",
"jira"
] | 12 | 6 | 5,990 | 8 | 0 | 2008-09-18T13:23:33.693000 | 2008-09-18T13:40:57.817000 |
92,504 | 93,696 | Strong SSL with Tomcat 6 | I'm trying to create a self signed certificate for use with Apache Tomcat 6. Every certificate I can make always results in the browser connecting with AES-128. The customer would like me to demonstrate that I can create a connection at AES-256. I've tried java's keytool and openssl. I've tried with a variety of parame... | Okie doke, I think I just figured this out. As I said above, the key bit of knowledge is that the cert doesn't matter, so long as it's generated with an algorithm that supports AES 256-bit encryption (e.g., RSA). Just to make sure that we're on the same page, for my testing, I generated my self-signed cert using the fo... | Strong SSL with Tomcat 6 I'm trying to create a self signed certificate for use with Apache Tomcat 6. Every certificate I can make always results in the browser connecting with AES-128. The customer would like me to demonstrate that I can create a connection at AES-256. I've tried java's keytool and openssl. I've tried... | TITLE:
Strong SSL with Tomcat 6
QUESTION:
I'm trying to create a self signed certificate for use with Apache Tomcat 6. Every certificate I can make always results in the browser connecting with AES-128. The customer would like me to demonstrate that I can create a connection at AES-256. I've tried java's keytool and o... | [
"tomcat",
"ssl",
"aes"
] | 4 | 13 | 10,385 | 4 | 0 | 2008-09-18T13:25:43.343000 | 2008-09-18T15:40:36.857000 |
92,522 | 92,544 | HTTP GET in VB.NET | What is the best way to issue a http get in VB.net? I want to get the result of a request like http://api.hostip.info/?ip=68.180.206.184 | In VB.NET: Dim webClient As New System.Net.WebClient Dim result As String = webClient.DownloadString("http://api.hostip.info/?ip=68.180.206.184") In C#: System.Net.WebClient webClient = new System.Net.WebClient(); string result = webClient.DownloadString("http://api.hostip.info/?ip=68.180.206.184"); | HTTP GET in VB.NET What is the best way to issue a http get in VB.net? I want to get the result of a request like http://api.hostip.info/?ip=68.180.206.184 | TITLE:
HTTP GET in VB.NET
QUESTION:
What is the best way to issue a http get in VB.net? I want to get the result of a request like http://api.hostip.info/?ip=68.180.206.184
ANSWER:
In VB.NET: Dim webClient As New System.Net.WebClient Dim result As String = webClient.DownloadString("http://api.hostip.info/?ip=68.180.2... | [
"vb.net",
"http-get"
] | 49 | 80 | 223,616 | 7 | 0 | 2008-09-18T13:28:21.513000 | 2008-09-18T13:31:45.920000 |
92,537 | 93,598 | Get Control flow graph from Abstract Syntax Tree | I have an AST derived from the ANTLR Parser Generator for Java. What I want to do is somehow construct a control flow graph of the source code, where each statement or expression is a unique Node. I understand there must be some recursiveness to this identification, I was wondering what you would suggest as the best op... | Usually CFGs are computed on a lower-level representation (e.g. JVM bytecode). Someone did a thesis on such things a few years ago. There might be a helpful way described in there for how to get at that representation. Since your source and target languages are the same, there's no code generation step -- you're alread... | Get Control flow graph from Abstract Syntax Tree I have an AST derived from the ANTLR Parser Generator for Java. What I want to do is somehow construct a control flow graph of the source code, where each statement or expression is a unique Node. I understand there must be some recursiveness to this identification, I wa... | TITLE:
Get Control flow graph from Abstract Syntax Tree
QUESTION:
I have an AST derived from the ANTLR Parser Generator for Java. What I want to do is somehow construct a control flow graph of the source code, where each statement or expression is a unique Node. I understand there must be some recursiveness to this id... | [
"java",
"parsing",
"abstract-syntax-tree",
"control-flow"
] | 16 | 13 | 16,664 | 6 | 0 | 2008-09-18T13:30:45.593000 | 2008-09-18T15:30:36.680000 |
92,541 | 92,555 | Does NUnit work with .NET 3.5? | I'm just getting started with learning about Unit testing (and TDD in general). My question is does the latest version of NUnit support working in VS2008 with.NET 3.5? I've looked at the documentation pages at NUnit and they don't mention it. If anyone has worked with it in 3.5 are there any limitations or features tha... | I've been using nUnit with 3.5. As long as you have a version that works with 2.0 you should be fine - same CLR and all that.:) | Does NUnit work with .NET 3.5? I'm just getting started with learning about Unit testing (and TDD in general). My question is does the latest version of NUnit support working in VS2008 with.NET 3.5? I've looked at the documentation pages at NUnit and they don't mention it. If anyone has worked with it in 3.5 are there ... | TITLE:
Does NUnit work with .NET 3.5?
QUESTION:
I'm just getting started with learning about Unit testing (and TDD in general). My question is does the latest version of NUnit support working in VS2008 with.NET 3.5? I've looked at the documentation pages at NUnit and they don't mention it. If anyone has worked with it... | [
"visual-studio-2008",
".net-3.5",
"nunit"
] | 9 | 8 | 6,131 | 5 | 0 | 2008-09-18T13:31:23.767000 | 2008-09-18T13:32:58.583000 |
92,546 | 92,641 | Variable declarations in header files - static or not? | When refactoring away some #defines I came across declarations similar to the following in a C++ header file: static const unsigned int VAL = 42; const unsigned int ANOTHER_VAL = 37; The question is, what difference, if any, will the static make? Note that multiple inclusion of the headers isn't possible due to the cla... | The static means that there will be one copy of VAL created for each source file it is included in. But it also means that multiple inclusions will not result in multiple definitions of VAL that will collide at link time. In C, without the static you would need to ensure that only one source file defined VAL while the ... | Variable declarations in header files - static or not? When refactoring away some #defines I came across declarations similar to the following in a C++ header file: static const unsigned int VAL = 42; const unsigned int ANOTHER_VAL = 37; The question is, what difference, if any, will the static make? Note that multiple... | TITLE:
Variable declarations in header files - static or not?
QUESTION:
When refactoring away some #defines I came across declarations similar to the following in a C++ header file: static const unsigned int VAL = 42; const unsigned int ANOTHER_VAL = 37; The question is, what difference, if any, will the static make? ... | [
"c++",
"c",
"static"
] | 94 | 109 | 105,022 | 12 | 0 | 2008-09-18T13:32:05.637000 | 2008-09-18T13:43:40.133000 |
92,561 | 92,591 | Should I reject URLs longer than what is expected? | I am developing an application, and have URLs in the format www.example.com/some_url/some_parameter/some_keyword. I know by design that there is a maximum length that these URLs will have (and still be valid). Should I validate the URL length with every request in order to protect against buffer overflow/injection atta... | If you are not expecting that input, reject it. You should always validate your inputs, and certainly discard anything outside of the expected range. If you already know that your URL's honestly won't be beyond a certain length then rejecting it before it gets to the application seems wise. | Should I reject URLs longer than what is expected? I am developing an application, and have URLs in the format www.example.com/some_url/some_parameter/some_keyword. I know by design that there is a maximum length that these URLs will have (and still be valid). Should I validate the URL length with every request in orde... | TITLE:
Should I reject URLs longer than what is expected?
QUESTION:
I am developing an application, and have URLs in the format www.example.com/some_url/some_parameter/some_keyword. I know by design that there is a maximum length that these URLs will have (and still be valid). Should I validate the URL length with eve... | [
"web-services",
"rest",
"security",
"http",
"url"
] | 5 | 5 | 522 | 13 | 0 | 2008-09-18T13:34:08.177000 | 2008-09-18T13:37:29.883000 |
92,592 | 92,625 | Learning C# in Mono | How solid is Mono for C# development on Linux and OS X? I've been thinking about learning C# on the side, and was wondering if learning using Mono would suffice. | I have been using mono for upwards of 2 years now. Work is windows and.Net, home is mono on GNU/Linux. I have been able to run both GUI and ASP.NET apps with no problems from the same SVN repository. The only changes I had to make were in connection strings. ASP.NET works well under mod_mono for apache and xsp2. Some o... | Learning C# in Mono How solid is Mono for C# development on Linux and OS X? I've been thinking about learning C# on the side, and was wondering if learning using Mono would suffice. | TITLE:
Learning C# in Mono
QUESTION:
How solid is Mono for C# development on Linux and OS X? I've been thinking about learning C# on the side, and was wondering if learning using Mono would suffice.
ANSWER:
I have been using mono for upwards of 2 years now. Work is windows and.Net, home is mono on GNU/Linux. I have b... | [
"c#",
".net",
"mono",
"cross-platform"
] | 14 | 14 | 3,323 | 9 | 0 | 2008-09-18T13:37:31.897000 | 2008-09-18T13:41:43.180000 |
92,601 | 95,370 | SQL Compact Edition 3.5 SP 1 - LockTimeOutException - how to debug? | Intermittently in our app, we encounter LockTimeoutExceptions being throw from SQL CE. We've recently upgraded to 3.5 SP 1, and a number of them seem to have gone away, but we still do see them occasionally. I'm certain it's a bug in our code (which is multi-threaded) but I haven't been able to pin it down precisely. D... | I just realized that 3.5 SP1 includes new information in the exception that let me pin in down. SQL Server Compact timed out waiting for a lock. The default lock time is 2000ms for devices and 5000ms for desktops. The default lock timeout can be increased in the connection string using the ssce: default lock timeout pr... | SQL Compact Edition 3.5 SP 1 - LockTimeOutException - how to debug? Intermittently in our app, we encounter LockTimeoutExceptions being throw from SQL CE. We've recently upgraded to 3.5 SP 1, and a number of them seem to have gone away, but we still do see them occasionally. I'm certain it's a bug in our code (which is... | TITLE:
SQL Compact Edition 3.5 SP 1 - LockTimeOutException - how to debug?
QUESTION:
Intermittently in our app, we encounter LockTimeoutExceptions being throw from SQL CE. We've recently upgraded to 3.5 SP 1, and a number of them seem to have gone away, but we still do see them occasionally. I'm certain it's a bug in ... | [
"multithreading",
"sql-server-ce"
] | 1 | 1 | 3,621 | 2 | 0 | 2008-09-18T13:38:33.157000 | 2008-09-18T18:31:15.950000 |
92,617 | 96,998 | Many to Many Relationship in MS Dynamics CRM 4.0 - How to? | I'm working on a MS CRM server for a project at my university. What I'm trying to do is to let the user of the CRM to tag some contacts, I thought of creating an entity to archive the tags an to create an N:N relationship between the tag entity and the contact one. I've created and published the new entity and the rela... | I started to write up an answer, but realized you were talking about 4.0 and I've only done it in 3.0. I was able to find a screen cast about the new many to many feature in 4.0 however http://www.philiprichardson.org/blog/post/Titan-Many-to-Many-Relationships.aspx | Many to Many Relationship in MS Dynamics CRM 4.0 - How to? I'm working on a MS CRM server for a project at my university. What I'm trying to do is to let the user of the CRM to tag some contacts, I thought of creating an entity to archive the tags an to create an N:N relationship between the tag entity and the contact ... | TITLE:
Many to Many Relationship in MS Dynamics CRM 4.0 - How to?
QUESTION:
I'm working on a MS CRM server for a project at my university. What I'm trying to do is to let the user of the CRM to tag some contacts, I thought of creating an entity to archive the tags an to create an N:N relationship between the tag entit... | [
"many-to-many",
"entity-relationship",
"dynamics-crm-4",
"crm"
] | 0 | 0 | 2,394 | 1 | 0 | 2008-09-18T13:41:06.257000 | 2008-09-18T21:08:43.667000 |
92,638 | 92,798 | Self-owning web services, or services that can survive the death of the inventor | I noticed a new web service today called a Dead man's switch, which dispatches email in the event that you don't respond to periodic "pings" that prove you're still alive. But it occurred to me that I might outlive the person or organization that pays the bills for the service, making the service useless. There are oth... | You can't make a service robust in this way - if the bank account is a single point of failure then when (not if) it fails, you lose. A bank account can't exist without a legal entity to own it, but that's just a detail here - other failures are that Amazon might pull SC2, or raise the price, or make an incompatible AP... | Self-owning web services, or services that can survive the death of the inventor I noticed a new web service today called a Dead man's switch, which dispatches email in the event that you don't respond to periodic "pings" that prove you're still alive. But it occurred to me that I might outlive the person or organizati... | TITLE:
Self-owning web services, or services that can survive the death of the inventor
QUESTION:
I noticed a new web service today called a Dead man's switch, which dispatches email in the event that you don't respond to periodic "pings" that prove you're still alive. But it occurred to me that I might outlive the pe... | [
"web-services"
] | 2 | 4 | 336 | 6 | 0 | 2008-09-18T13:43:08.527000 | 2008-09-18T14:02:13.460000 |
92,651 | 167,686 | How much tolerance does google have for large site maps | I have a site map of a few thoasand pages where the only different content on them is the title attribute and the content plotted out in a google map? Will google punish me for this as spam? | Google has a specific standard for indexing geo-spatial content which they call a " Geo sitemap ". It's just an extension of the sitemaps.org protocol that adds an XML namespace and some extra tags to clue Google into your content which has map-related information on it. If you're already using KML to generate your map... | How much tolerance does google have for large site maps I have a site map of a few thoasand pages where the only different content on them is the title attribute and the content plotted out in a google map? Will google punish me for this as spam? | TITLE:
How much tolerance does google have for large site maps
QUESTION:
I have a site map of a few thoasand pages where the only different content on them is the title attribute and the content plotted out in a google map? Will google punish me for this as spam?
ANSWER:
Google has a specific standard for indexing ge... | [
"seo",
"sitemap"
] | 0 | 1 | 446 | 4 | 0 | 2008-09-18T13:45:28.087000 | 2008-10-03T16:18:18.760000 |
92,671 | 92,717 | How do I reserve caret position in CEdit control? | I'm programming an application in MFC (don't ask) and I have a CEdit box that holds a number. When that number is edited, I would like to act on the change, and then replace the caret where it was before I acted on the change - if the user was just before the "." in "35.40", I would like it to still be placed before th... | Use the GetSel() function before your change to store the location of the cursor, then use SelSel() to set it back. You can use these functions to get/set the location of the caret, not just to get/set the selection the user has made. | How do I reserve caret position in CEdit control? I'm programming an application in MFC (don't ask) and I have a CEdit box that holds a number. When that number is edited, I would like to act on the change, and then replace the caret where it was before I acted on the change - if the user was just before the "." in "35... | TITLE:
How do I reserve caret position in CEdit control?
QUESTION:
I'm programming an application in MFC (don't ask) and I have a CEdit box that holds a number. When that number is edited, I would like to act on the change, and then replace the caret where it was before I acted on the change - if the user was just bef... | [
"c++",
"mfc",
"user-interface"
] | 1 | 1 | 3,251 | 2 | 0 | 2008-09-18T13:47:04.977000 | 2008-09-18T13:53:08.707000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.