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
190,915
190,968
Using tables in UDF's in Excel 2007
I am writing a UDF for Excel 2007 which I want to pass a table to, and then reference parts of that table in the UDF. So, for instance my table called "Stock" may look something like this: Name Cost Items in Stock Teddy Bear £10 10 Lollipops 20p 1000 I have a UDF which I want to calculate the total cost of all the item...
This is very basic (no pun intended) but it will do what you describe. For larger tables it may become slow as under the hood it's going back and forth between the macro function and the worksheet, and that kind of activity adds up. It assumes that you have one row of headers and one column of names (hence the For loop...
Using tables in UDF's in Excel 2007 I am writing a UDF for Excel 2007 which I want to pass a table to, and then reference parts of that table in the UDF. So, for instance my table called "Stock" may look something like this: Name Cost Items in Stock Teddy Bear £10 10 Lollipops 20p 1000 I have a UDF which I want to calc...
TITLE: Using tables in UDF's in Excel 2007 QUESTION: I am writing a UDF for Excel 2007 which I want to pass a table to, and then reference parts of that table in the UDF. So, for instance my table called "Stock" may look something like this: Name Cost Items in Stock Teddy Bear £10 10 Lollipops 20p 1000 I have a UDF wh...
[ "excel", "user-defined-functions", "vba" ]
1
1
1,168
2
0
2008-10-10T11:35:22.773000
2008-10-10T11:58:57.753000
190,936
190,948
How is 'from/where/select' keywords impemented under the hood in LINQ and C#?
When I type 'from' (in a LINQ query) after importing System.Linq namespace, it is understood as a keyword. How does this magic happen? Is 'from' a extension method on some type?
In practice, yes - LINQ keywords map to extension methods. But actually, it is more interesting; it is literally as though the compiler substitutes directly for a few key methods, i.e. var qry = from cust in db.Customers where cust.IsActive select cust; becomes: var qry = db.Customers.Where(cust => cust.IsActive); (if ...
How is 'from/where/select' keywords impemented under the hood in LINQ and C#? When I type 'from' (in a LINQ query) after importing System.Linq namespace, it is understood as a keyword. How does this magic happen? Is 'from' a extension method on some type?
TITLE: How is 'from/where/select' keywords impemented under the hood in LINQ and C#? QUESTION: When I type 'from' (in a LINQ query) after importing System.Linq namespace, it is understood as a keyword. How does this magic happen? Is 'from' a extension method on some type? ANSWER: In practice, yes - LINQ keywords map ...
[ "c#", ".net", "linq" ]
7
6
2,544
3
0
2008-10-10T11:45:54.377000
2008-10-10T11:49:32.357000
190,937
218,326
Screen glint effect in WPF or Silverlight
I'm looking for a way to create an "it will look cool" effect for a full screen WPF application I'm working on - a "screen glint" effect that animates or moves across the whole screen to give off a shiny display experience. I'm thinking of creating a large rectangle with a highlighted-gradient and transparent backgroun...
I came up with a solution that looks pretty good. Some sample XAML that I chalked up in Blend 2.0 SP1 looks like this: An option is to do this in code behind, which is pretty neat if you want to have granular control of the animation. For example: ScreenGlintRect.Width = Width; ScreenGlintRect.Height = Height; var anim...
Screen glint effect in WPF or Silverlight I'm looking for a way to create an "it will look cool" effect for a full screen WPF application I'm working on - a "screen glint" effect that animates or moves across the whole screen to give off a shiny display experience. I'm thinking of creating a large rectangle with a high...
TITLE: Screen glint effect in WPF or Silverlight QUESTION: I'm looking for a way to create an "it will look cool" effect for a full screen WPF application I'm working on - a "screen glint" effect that animates or moves across the whole screen to give off a shiny display experience. I'm thinking of creating a large rec...
[ "wpf", "silverlight", "xaml" ]
5
6
3,915
4
0
2008-10-10T11:46:19.243000
2008-10-20T12:53:08.620000
190,940
212,885
T4 Template directory missing on build server
I've just set up a new build server with the Windows 2008.NET 3.5 SDK, and for some reason it hasn't installed c:\Program Files\Common Files\Microsoft Shared\TextTemplating so I can't run t4 templates on it. I had a look at the install options in add/remove programs and every single option is checked. Any ideas why it ...
The T4 templating engine comes with Visual Studio 2005 SDK or natively with any installation of Visual Studio 2008. I didn't try the express editions to see if the T4 is present but I strongly recommend that you give it a try. You can download Visual Studio 2008 Express right here.
T4 Template directory missing on build server I've just set up a new build server with the Windows 2008.NET 3.5 SDK, and for some reason it hasn't installed c:\Program Files\Common Files\Microsoft Shared\TextTemplating so I can't run t4 templates on it. I had a look at the install options in add/remove programs and eve...
TITLE: T4 Template directory missing on build server QUESTION: I've just set up a new build server with the Windows 2008.NET 3.5 SDK, and for some reason it hasn't installed c:\Program Files\Common Files\Microsoft Shared\TextTemplating so I can't run t4 templates on it. I had a look at the install options in add/remov...
[ ".net", "build", "t4" ]
2
2
450
3
0
2008-10-10T11:47:13.580000
2008-10-17T16:35:56.893000
190,956
191,027
Industry experience with WYSIWYG editors
Just wanted to get an idea for ways (web) developers get round the short fall of (most) WYSIWYG editors, whereby the users that are editing the text aren't always HTML literate enough to produce good/great results. In the past we have resigned ourselves to either locking down the editor or simply not supplying one. Wha...
If I understand your question correctly, my advice would be to allow basic text formatting in the editor (bold, italicize, underline, paragraph breaks, etc). Anything beyond that should be handled either by custom fields in your CMS system that talk to the corresponding template, or directly by your designers / front-e...
Industry experience with WYSIWYG editors Just wanted to get an idea for ways (web) developers get round the short fall of (most) WYSIWYG editors, whereby the users that are editing the text aren't always HTML literate enough to produce good/great results. In the past we have resigned ourselves to either locking down th...
TITLE: Industry experience with WYSIWYG editors QUESTION: Just wanted to get an idea for ways (web) developers get round the short fall of (most) WYSIWYG editors, whereby the users that are editing the text aren't always HTML literate enough to produce good/great results. In the past we have resigned ourselves to eith...
[ "wysiwyg" ]
1
1
610
3
0
2008-10-10T11:55:14.967000
2008-10-10T12:25:01.677000
190,963
191,042
Can I access the keychain on the iPhone?
This question discusses encrypting data on the iPhone using the crypt() function. As an alternative, is there a keychain on the iPhone and if so, what code would I use to access it in order to store login details and then retrieve them for us in an application?
There is a keychain you can use - for code, the best bet is to check out the GenericKeychain sample application from Apple: GenericKeychain sample
Can I access the keychain on the iPhone? This question discusses encrypting data on the iPhone using the crypt() function. As an alternative, is there a keychain on the iPhone and if so, what code would I use to access it in order to store login details and then retrieve them for us in an application?
TITLE: Can I access the keychain on the iPhone? QUESTION: This question discusses encrypting data on the iPhone using the crypt() function. As an alternative, is there a keychain on the iPhone and if so, what code would I use to access it in order to store login details and then retrieve them for us in an application?...
[ "iphone", "objective-c", "cocoa-touch", "keychain" ]
29
34
55,748
7
0
2008-10-10T11:57:44.400000
2008-10-10T12:32:03.647000
190,967
190,975
Getting the pattern back from a compiled re?
Assume I have created a compiled re: x = re.compile('^\d+$') Is there a way to extract the pattern string (^\d+$) back from the x?
You can get it back with x.pattern from the Python documentation on Regular Expression Objects
Getting the pattern back from a compiled re? Assume I have created a compiled re: x = re.compile('^\d+$') Is there a way to extract the pattern string (^\d+$) back from the x?
TITLE: Getting the pattern back from a compiled re? QUESTION: Assume I have created a compiled re: x = re.compile('^\d+$') Is there a way to extract the pattern string (^\d+$) back from the x? ANSWER: You can get it back with x.pattern from the Python documentation on Regular Expression Objects
[ "python", "regex" ]
25
32
4,907
1
0
2008-10-10T11:58:40.920000
2008-10-10T12:01:41.273000
190,988
191,007
How do I set the character set using XMLHttp Object for a POST in classic ASP?
I have to use the XMLHttp object in classic ASP in order to send some data to another server via HTTP from server to server: sURL = SOME_URL Set oXHttp = Server.CreateObject("Msxml2.XMLHTTP") oXHttp.open "POST", sURL, false oXHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded;charset:ISO-8859-1;...
You can set the codepage used by setting the option 'SXH_OPTION_URL_CODEPAGE' http://msdn.microsoft.com/en-us/library/ms763811(VS.85).aspx You should also be using the 'MSXML2.ServerXMLHTTP' object not the 'MSXML2.XMLHttp' object which is for single threaded client side apps.
How do I set the character set using XMLHttp Object for a POST in classic ASP? I have to use the XMLHttp object in classic ASP in order to send some data to another server via HTTP from server to server: sURL = SOME_URL Set oXHttp = Server.CreateObject("Msxml2.XMLHTTP") oXHttp.open "POST", sURL, false oXHttp.setReque...
TITLE: How do I set the character set using XMLHttp Object for a POST in classic ASP? QUESTION: I have to use the XMLHttp object in classic ASP in order to send some data to another server via HTTP from server to server: sURL = SOME_URL Set oXHttp = Server.CreateObject("Msxml2.XMLHTTP") oXHttp.open "POST", sURL, fal...
[ "encoding", "asp-classic", "character-encoding", "serverxmlhttp" ]
5
6
16,165
2
0
2008-10-10T12:08:28.780000
2008-10-10T12:16:36.920000
191,010
191,029
How to get a complete list of object's methods and attributes?
dir(re.compile(pattern)) does not return pattern as one of the lists's elements. Namely it returns: ['__copy__', '__deepcopy__', 'findall', 'finditer', 'match', 'scanner', 'search', 'split', 'sub', 'subn'] According to the manual, it is supposed to contain the object's attributes' names, the names of its class's attrib...
For the complete list of attributes, the short answer is: no. The problem is that the attributes are actually defined as the arguments accepted by the getattr built-in function. As the user can reimplement __getattr__, suddenly allowing any kind of attribute, there is no possible generic way to generate that list. The ...
How to get a complete list of object's methods and attributes? dir(re.compile(pattern)) does not return pattern as one of the lists's elements. Namely it returns: ['__copy__', '__deepcopy__', 'findall', 'finditer', 'match', 'scanner', 'search', 'split', 'sub', 'subn'] According to the manual, it is supposed to contain ...
TITLE: How to get a complete list of object's methods and attributes? QUESTION: dir(re.compile(pattern)) does not return pattern as one of the lists's elements. Namely it returns: ['__copy__', '__deepcopy__', 'findall', 'finditer', 'match', 'scanner', 'search', 'split', 'sub', 'subn'] According to the manual, it is su...
[ "python" ]
252
149
349,086
5
0
2008-10-10T12:18:32.580000
2008-10-10T12:25:22.613000
191,013
191,040
Can anonymous class implement interface?
Is it possible to have an anonymous type implement an interface? I've got a piece of code that I would like to work, but don't know how to do this. I've had a couple of answers that either say no, or create a class that implements the interface construct new instances of that. This isn't really ideal, but I'm wondering...
No, anonymous types cannot implement an interface. From the C# programming guide: Anonymous types are class types that consist of one or more public read-only properties. No other kinds of class members such as methods or events are allowed. An anonymous type cannot be cast to any interface or type except for object.
Can anonymous class implement interface? Is it possible to have an anonymous type implement an interface? I've got a piece of code that I would like to work, but don't know how to do this. I've had a couple of answers that either say no, or create a class that implements the interface construct new instances of that. T...
TITLE: Can anonymous class implement interface? QUESTION: Is it possible to have an anonymous type implement an interface? I've got a piece of code that I would like to work, but don't know how to do this. I've had a couple of answers that either say no, or create a class that implements the interface construct new in...
[ "c#", "anonymous-types" ]
514
392
194,987
9
0
2008-10-10T12:20:32.670000
2008-10-10T12:30:48.547000
191,020
191,140
QDockWidget initial width
How do I set the initial width of a QDockWidget? I have implemented the sizeHint function but what next?
The documentation for QDockWidget says: A QDockWidget acts as a wrapper for its child widget, set with setWidget(). Custom size hints, minimum and maximum sizes and size policies should be implemented in the child widget. QDockWidget will respect them, adjusting its own constraints to include the frame and title. Size ...
QDockWidget initial width How do I set the initial width of a QDockWidget? I have implemented the sizeHint function but what next?
TITLE: QDockWidget initial width QUESTION: How do I set the initial width of a QDockWidget? I have implemented the sizeHint function but what next? ANSWER: The documentation for QDockWidget says: A QDockWidget acts as a wrapper for its child widget, set with setWidget(). Custom size hints, minimum and maximum sizes a...
[ "c++", "qt", "qdockwidget" ]
15
15
14,632
2
0
2008-10-10T12:22:51.183000
2008-10-10T12:58:36.260000
191,023
191,041
How does Windows actually detect LAN (proxy) settings when using Automatic Configuration
When Windows Internet Properties -> Connections -> LAN Settings -> Automatic Configuration is set to "Automatically detect settings" how does Windows actually determine/discover what the settings are? Is it a network broadcast or some kind of targeted query to a server configured somewhere in the registry, or something...
Its simple: Browsers (Firefox works the same) query GET http://wpad/wpad.dat. If a web server named wpad is resolveable, it should serve wpad.dat, a script file analog to netscape PAC files. MIME type must also be "application/x-ns-proxy-autoconfig".
How does Windows actually detect LAN (proxy) settings when using Automatic Configuration When Windows Internet Properties -> Connections -> LAN Settings -> Automatic Configuration is set to "Automatically detect settings" how does Windows actually determine/discover what the settings are? Is it a network broadcast or s...
TITLE: How does Windows actually detect LAN (proxy) settings when using Automatic Configuration QUESTION: When Windows Internet Properties -> Connections -> LAN Settings -> Automatic Configuration is set to "Automatically detect settings" how does Windows actually determine/discover what the settings are? Is it a netw...
[ "windows", "proxy", "lan" ]
72
87
100,540
5
0
2008-10-10T12:24:07.607000
2008-10-10T12:31:35.033000
191,024
191,068
How to integrate telecommuters in an agile process?
I'm sure that all of us have had to deal with telecommuters at some point in time, and I'm facing a situation now where my new project will have a "core" group of office workers and some off-site telecommuters. Not wanting to repeat past mistakes, I'd really like to know what ways people have tried in the past to effec...
Set the ground rules upfront. Don't be wishy-washy about them. You've probably eliminated the "I got stuck in traffic" excuse for missing the meeting or whatever when they're working from home (or a satellite site) and so there's no reason to expect less out of them. Take advantage of technology: Use IM. We use it here...
How to integrate telecommuters in an agile process? I'm sure that all of us have had to deal with telecommuters at some point in time, and I'm facing a situation now where my new project will have a "core" group of office workers and some off-site telecommuters. Not wanting to repeat past mistakes, I'd really like to k...
TITLE: How to integrate telecommuters in an agile process? QUESTION: I'm sure that all of us have had to deal with telecommuters at some point in time, and I'm facing a situation now where my new project will have a "core" group of office workers and some off-site telecommuters. Not wanting to repeat past mistakes, I'...
[ "agile", "scrum" ]
12
6
2,154
13
0
2008-10-10T12:24:16.187000
2008-10-10T12:42:34.903000
191,043
195,947
How to get started creating CSS for given (dynamically generated) HTML?
The Separat ion of Layout and Content is the domain of CSS and HTML - so far well understood. Now about separat ing... I'm looking for hints and Best Practices to get started with the task of providing a "skin" or "theme" for a content management system. Background: We are starting to embrace a Portal Server/Content Ma...
If you're looking for practical examples of separating style and content, then I'd suggestion the CSS Zen Garden. Trawling through the HTML and CSS is inspirational and enlightening and should help with what you're trying to do. My #1 tip would be be to make everything as semantic as possible and use lots of classes an...
How to get started creating CSS for given (dynamically generated) HTML? The Separat ion of Layout and Content is the domain of CSS and HTML - so far well understood. Now about separat ing... I'm looking for hints and Best Practices to get started with the task of providing a "skin" or "theme" for a content management s...
TITLE: How to get started creating CSS for given (dynamically generated) HTML? QUESTION: The Separat ion of Layout and Content is the domain of CSS and HTML - so far well understood. Now about separat ing... I'm looking for hints and Best Practices to get started with the task of providing a "skin" or "theme" for a co...
[ "html", "css", "styling" ]
2
2
388
3
0
2008-10-10T12:32:30.773000
2008-10-12T20:04:03.980000
191,054
191,779
What are the basic minimum set of Code Analysis rules that you would recommend?
What are the basic minimum set of Code Analysis rules that you would recommend for a 200K LOC solution? We're using unit testing but code analysis has been turned off. Ideally all rules would be turned on by default but I'd like to do this gently and turn on rules in batches so we do not have to deal with everything at...
I've found a list of rules turned on by Microsoft as of 2007. Not really a set of rules but a good advice on turning on Code Analysis on an existing code base can be found in Phil Haack's answer to a related question.
What are the basic minimum set of Code Analysis rules that you would recommend? What are the basic minimum set of Code Analysis rules that you would recommend for a 200K LOC solution? We're using unit testing but code analysis has been turned off. Ideally all rules would be turned on by default but I'd like to do this ...
TITLE: What are the basic minimum set of Code Analysis rules that you would recommend? QUESTION: What are the basic minimum set of Code Analysis rules that you would recommend for a 200K LOC solution? We're using unit testing but code analysis has been turned off. Ideally all rules would be turned on by default but I'...
[ ".net", "tfs", "code-analysis" ]
1
1
265
1
0
2008-10-10T12:36:39.330000
2008-10-10T15:09:28.540000
191,057
191,087
Architecture Tips: Business Logic / Data Access
We plan to redesign, improve our (C#) application architecture. Anyone has some framework, hompage or book recommendations? Mainly concerning the business logic.
Maybe look at CSLA.NET? Its a framework that really builds around business objects. Buy the book and read it. Maybe its not the framework for you, but im sure it will give you some nice ideas about how to do it.
Architecture Tips: Business Logic / Data Access We plan to redesign, improve our (C#) application architecture. Anyone has some framework, hompage or book recommendations? Mainly concerning the business logic.
TITLE: Architecture Tips: Business Logic / Data Access QUESTION: We plan to redesign, improve our (C#) application architecture. Anyone has some framework, hompage or book recommendations? Mainly concerning the business logic. ANSWER: Maybe look at CSLA.NET? Its a framework that really builds around business objects....
[ "c#", "architecture", "business-logic" ]
0
3
632
1
0
2008-10-10T12:39:09.917000
2008-10-10T12:48:33.860000
191,066
930,649
How do you manage the String Translation Process?
I am working on a Software Project that needs to be translated into 30 languages. This means that changing any string incurs into a relatively high cost. Additionally, translation does not happen overnight, because the translation package needs to be worked by different translators, so this might take a while. Adding n...
I'm not sure the platform you're internationalizing in. I've written an answer before on the best way to il8n an application. See What do I need to know to globalize an asp.net application? That said - managing the translations themselves is hard. The problem is that you'll be using the same piece of text across multip...
How do you manage the String Translation Process? I am working on a Software Project that needs to be translated into 30 languages. This means that changing any string incurs into a relatively high cost. Additionally, translation does not happen overnight, because the translation package needs to be worked by different...
TITLE: How do you manage the String Translation Process? QUESTION: I am working on a Software Project that needs to be translated into 30 languages. This means that changing any string incurs into a relatively high cost. Additionally, translation does not happen overnight, because the translation package needs to be w...
[ "internationalization" ]
24
13
7,027
11
0
2008-10-10T12:42:17.697000
2009-05-30T21:18:59.170000
191,082
191,104
Matching an (easy??) regular expression using C#'s regex
Ok sorry this might seem like a dumb question but I cannot figure this thing out: I am trying to parse a string and simply want to check whether it only contains the following characters: '0123456789dD+ ' I have tried many things but just can't get to figure out the right regex to use! Regex oReg = new Regex(@"[\d dD+]...
Try this: @"^[0-9dD+ ]+$" The ^ and $ at the beginning and end signify the beginning and end of the input string respectively. Thus between the beginning and then end only the stated characters are allowed. In your example, the regex matches if the string contains one of the characters even if it contains other charact...
Matching an (easy??) regular expression using C#'s regex Ok sorry this might seem like a dumb question but I cannot figure this thing out: I am trying to parse a string and simply want to check whether it only contains the following characters: '0123456789dD+ ' I have tried many things but just can't get to figure out ...
TITLE: Matching an (easy??) regular expression using C#'s regex QUESTION: Ok sorry this might seem like a dumb question but I cannot figure this thing out: I am trying to parse a string and simply want to check whether it only contains the following characters: '0123456789dD+ ' I have tried many things but just can't ...
[ "c#", "regex" ]
2
8
1,428
6
0
2008-10-10T12:47:27.653000
2008-10-10T12:51:29.283000
191,093
191,147
What Tools Do You Recommend To Auto-Build Your Application?
As recently as several years ago, the developers actually made the builds that went to clients. This was obviously a disaster for reasons too numerous to list. Then when we started to learn the errors of our ways, we looked for a way to auto-build the entire application on a dedicated build machine. The culture at that...
Definitely look into MSBuild if you're on the Microsoft stack. Joel is always going on and on about how great FinalBuilder is, so that might be worth a look as well.
What Tools Do You Recommend To Auto-Build Your Application? As recently as several years ago, the developers actually made the builds that went to clients. This was obviously a disaster for reasons too numerous to list. Then when we started to learn the errors of our ways, we looked for a way to auto-build the entire a...
TITLE: What Tools Do You Recommend To Auto-Build Your Application? QUESTION: As recently as several years ago, the developers actually made the builds that went to clients. This was obviously a disaster for reasons too numerous to list. Then when we started to learn the errors of our ways, we looked for a way to auto-...
[ "build-process", "build-automation" ]
8
4
3,171
9
0
2008-10-10T12:49:26.263000
2008-10-10T12:59:39.503000
191,125
191,154
Why should I create my child controls in CreateChildControls() on a CompositeControl?
Ok so the obvious answer is, because the flow of a composite control demands my childcontrols to be created at a certain point in time. I got a problem i think other people must have had as well. My control is a composite "container/collection" control. It will be fed with an object and based on that objects data it wi...
what you're describing IS a databound control. And yes, it's somewhat complicated, but it's the proper design paradigm for this type of instance. That said, had you considered utilizing the repeater control rather than trying to roll out your own composite which behaves in the exact same manner? Rather than passing it ...
Why should I create my child controls in CreateChildControls() on a CompositeControl? Ok so the obvious answer is, because the flow of a composite control demands my childcontrols to be created at a certain point in time. I got a problem i think other people must have had as well. My control is a composite "container/c...
TITLE: Why should I create my child controls in CreateChildControls() on a CompositeControl? QUESTION: Ok so the obvious answer is, because the flow of a composite control demands my childcontrols to be created at a certain point in time. I got a problem i think other people must have had as well. My control is a comp...
[ "asp.net", "composite-controls" ]
2
1
1,841
1
0
2008-10-10T12:55:35.283000
2008-10-10T13:02:32.570000
191,136
191,393
UI Components for Windows Mobile Applications (.NET Compact Framework)
Applications which run on mobile devices have special user interface requirements. I think Apple did a great job introducing innovative controls on the iPhone/iPod touch platform. Now, I have to design an application for the Windows Mobile platform using the.NET Compact Framework (Visual Studio 2008). I wonder if there...
A few months ago, I searched and found nothing (satisfactory). I had to implement my own control library. Lack of good existing "touch-aware" libraries makes me think I should commercialize mine, but it's very incomplete.
UI Components for Windows Mobile Applications (.NET Compact Framework) Applications which run on mobile devices have special user interface requirements. I think Apple did a great job introducing innovative controls on the iPhone/iPod touch platform. Now, I have to design an application for the Windows Mobile platform ...
TITLE: UI Components for Windows Mobile Applications (.NET Compact Framework) QUESTION: Applications which run on mobile devices have special user interface requirements. I think Apple did a great job introducing innovative controls on the iPhone/iPod touch platform. Now, I have to design an application for the Window...
[ "windows-mobile", "compact-framework", "controls", "user-interface" ]
13
4
20,457
13
0
2008-10-10T12:57:41.940000
2008-10-10T13:57:45.437000
191,137
191,175
Database development organisation
A question regarding a DB development project. The database already exist and is rather large (several TBs). What do you use for version control in DB development? How do you control concurrent changes to the data model by different teams What is your approach to the Unit Testing in the DB development How do you deal w...
For most of these, while the tools don't apply the general processes of code development do: Maintain a development system separate from production with enough data to get useful performance metrics when testing a new model This system has unit tests (SQL queries, commits, aborted atomic commits, etc) written and run a...
Database development organisation A question regarding a DB development project. The database already exist and is rather large (several TBs). What do you use for version control in DB development? How do you control concurrent changes to the data model by different teams What is your approach to the Unit Testing in th...
TITLE: Database development organisation QUESTION: A question regarding a DB development project. The database already exist and is rather large (several TBs). What do you use for version control in DB development? How do you control concurrent changes to the data model by different teams What is your approach to the ...
[ "database", "version-control", "obfuscation" ]
3
2
243
2
0
2008-10-10T12:58:01.253000
2008-10-10T13:08:20.577000
191,143
215,962
Entity Framework Validation
I'm getting ready to start a new project and I've been researching the entity framework. My question is what is the best strategy for validating the entities? Other projects I've worked on have used attributes for most of the validation, but obviously this is not possible in the entity framework. Is the only way to do ...
I have not actually used the Entity framework before but a quick search indicates that you have several options. 1) Validate at another layer in your application Always an option, I just thought I would throw it out there explicitly. 2) Hook into the OnChanged events of the Entity then perform validation Likely brittle...
Entity Framework Validation I'm getting ready to start a new project and I've been researching the entity framework. My question is what is the best strategy for validating the entities? Other projects I've worked on have used attributes for most of the validation, but obviously this is not possible in the entity frame...
TITLE: Entity Framework Validation QUESTION: I'm getting ready to start a new project and I've been researching the entity framework. My question is what is the best strategy for validating the entities? Other projects I've worked on have used attributes for most of the validation, but obviously this is not possible i...
[ "c#", ".net", "entity-framework", "validation" ]
17
11
22,998
6
0
2008-10-10T12:58:57.833000
2008-10-19T03:30:26.460000
191,151
191,189
What is the best way to store static unit test variables?
I am currently using NUnit and testing a class library. Up until now, I have used a list of constants at the top of the test class to hold some static test variables. Is this the best way to do this, or is there a more fluent way to handle it?
By "static test variables" do you actually mean constants (whether genuine constant, immutable instances or just ones you don't change)? I use those frequently, and just put them at the top of the test class. If there are several related test classes, it can be handy to separate out common values into a different class...
What is the best way to store static unit test variables? I am currently using NUnit and testing a class library. Up until now, I have used a list of constants at the top of the test class to hold some static test variables. Is this the best way to do this, or is there a more fluent way to handle it?
TITLE: What is the best way to store static unit test variables? QUESTION: I am currently using NUnit and testing a class library. Up until now, I have used a list of constants at the top of the test class to hold some static test variables. Is this the best way to do this, or is there a more fluent way to handle it? ...
[ "c#", ".net", "unit-testing", "nunit" ]
1
3
390
2
0
2008-10-10T13:01:38.407000
2008-10-10T13:11:13.177000
191,153
191,170
When would you use delegates in C#?
What are your usage of delegates in C#?
Now that we have lambda expressions and anonymous methods in C#, I use delegates much more. In C# 1, where you always had to have a separate method to implement the logic, using a delegate often didn't make sense. These days I use delegates for: Event handlers (for GUI and more) Starting threads Callbacks (e.g. for asy...
When would you use delegates in C#? What are your usage of delegates in C#?
TITLE: When would you use delegates in C#? QUESTION: What are your usage of delegates in C#? ANSWER: Now that we have lambda expressions and anonymous methods in C#, I use delegates much more. In C# 1, where you always had to have a separate method to implement the logic, using a delegate often didn't make sense. The...
[ "c#", ".net", "delegates" ]
104
103
42,918
20
0
2008-10-10T13:02:06.487000
2008-10-10T13:07:45.790000
191,157
191,318
window.onload vs <body onload=""/>
What exactly is the difference between the window.onload event and the onload event of the body tag? when do I use which and how should it be done correctly?
window.onload = myOnloadFunc and are different ways of using the same event. Using window.onload is less obtrusive though - it takes your JavaScript out of the HTML. All of the common JavaScript libraries, Prototype, ExtJS, Dojo, JQuery, YUI, etc. provide nice wrappers around events that occur as the document is loaded...
window.onload vs <body onload=""/> What exactly is the difference between the window.onload event and the onload event of the body tag? when do I use which and how should it be done correctly?
TITLE: window.onload vs <body onload=""/> QUESTION: What exactly is the difference between the window.onload event and the onload event of the body tag? when do I use which and how should it be done correctly? ANSWER: window.onload = myOnloadFunc and are different ways of using the same event. Using window.onload is ...
[ "javascript" ]
243
232
466,287
13
0
2008-10-10T13:03:33.003000
2008-10-10T13:39:24.133000
191,159
220,226
How do you convert VARCHAR to TIMESTAMP in MSSQL?
You'd like to call a stored proc on MS SQL that has a parameter type of TIMESTAMP within T-SQL, not ADO.NET using a VARCHAR value (e.g. '0x0000000002C490C8'). What do you do? UPDATE: This is where you have a "Timestamp" value coming at you but exists only as VARCHAR. (Think OUTPUT variable on another stored proc, but i...
A timestamp datatype is managed by SQL Server. I've never seen it used anywhere other than as a table column type. In that capacity, the column of type timestamp will give you a rigorous ordinal of the last insert/update on the row in relation to all other updates in the database. To see the most recent ordinal across ...
How do you convert VARCHAR to TIMESTAMP in MSSQL? You'd like to call a stored proc on MS SQL that has a parameter type of TIMESTAMP within T-SQL, not ADO.NET using a VARCHAR value (e.g. '0x0000000002C490C8'). What do you do? UPDATE: This is where you have a "Timestamp" value coming at you but exists only as VARCHAR. (T...
TITLE: How do you convert VARCHAR to TIMESTAMP in MSSQL? QUESTION: You'd like to call a stored proc on MS SQL that has a parameter type of TIMESTAMP within T-SQL, not ADO.NET using a VARCHAR value (e.g. '0x0000000002C490C8'). What do you do? UPDATE: This is where you have a "Timestamp" value coming at you but exists o...
[ "sql-server", "t-sql", "timestamp", "varchar" ]
8
0
53,270
3
0
2008-10-10T13:04:21.240000
2008-10-20T22:53:48.457000
191,160
191,199
How do I extract the version and path from an SVN working copy into a nant variable?
I am creating a new build process for a DotNet project which is to be held in Subversion. For each dll/exe that I compile (via Nant) I would like to include 2 additional attibutes in the dlls that are built. I already understand the workings of the 'asminfo' nant task. But I need help retrieving the information which I...
Firstly, you can use "svn info --xml >out.xml" to get the svn information to a text file. You can then use a Nant xml-peek to get a value out of the file into a variable.
How do I extract the version and path from an SVN working copy into a nant variable? I am creating a new build process for a DotNet project which is to be held in Subversion. For each dll/exe that I compile (via Nant) I would like to include 2 additional attibutes in the dlls that are built. I already understand the wo...
TITLE: How do I extract the version and path from an SVN working copy into a nant variable? QUESTION: I am creating a new build process for a DotNet project which is to be held in Subversion. For each dll/exe that I compile (via Nant) I would like to include 2 additional attibutes in the dlls that are built. I already...
[ "svn", "nant", "svn-repository" ]
3
3
1,546
4
0
2008-10-10T13:04:29.197000
2008-10-10T13:14:37.210000
191,179
191,531
How can I find the user's fonts in my .NET application?
How can I find the font that the user has set in their Windows Display Properties using C# in.NET? I want to display a form using the fonts that the user has selected. The fonts I want are those selected in the Windows Display Properties form for 3D-objects, menus and window title bars. But I cannot find a way to acces...
Using the SystemFonts class, you can get the fonts from the theme that the user selected. Also customizations the user made itself are returned. BTW: I (using XP) cannot select a font for 3D objects, the others are available.
How can I find the user's fonts in my .NET application? How can I find the font that the user has set in their Windows Display Properties using C# in.NET? I want to display a form using the fonts that the user has selected. The fonts I want are those selected in the Windows Display Properties form for 3D-objects, menus...
TITLE: How can I find the user's fonts in my .NET application? QUESTION: How can I find the font that the user has set in their Windows Display Properties using C# in.NET? I want to display a form using the fonts that the user has selected. The fonts I want are those selected in the Windows Display Properties form for...
[ ".net", "windows", "fonts" ]
2
1
374
2
0
2008-10-10T13:08:58.673000
2008-10-10T14:19:08.623000
191,184
208,196
Will a database generated from SQL Server Express work with the main version of SQL?
I want to create a SQL Server Express database on my local machine and then upload it to a website that will be using the full SQL Server software - can I do this?
You certainly can. You have a few options: Backup and restore Script everything manually Database publishing wizard Microsoft SQL Server Database Publishing Wizard can be found here: http://www.microsoft.com/downloads/details.aspx?familyid=56E5B1C5-BF17-42E0-A410-371A838E570A&displaylang=en
Will a database generated from SQL Server Express work with the main version of SQL? I want to create a SQL Server Express database on my local machine and then upload it to a website that will be using the full SQL Server software - can I do this?
TITLE: Will a database generated from SQL Server Express work with the main version of SQL? QUESTION: I want to create a SQL Server Express database on my local machine and then upload it to a website that will be using the full SQL Server software - can I do this? ANSWER: You certainly can. You have a few options: B...
[ "sql-server", "sql-server-express" ]
2
0
710
5
0
2008-10-10T13:09:22.400000
2008-10-16T11:42:21.307000
191,201
191,267
Indenting comments to match code in vim
I do all my coding in vim and am quite happy with it (so, please, no "use a different editor" responses), but have an ongoing annoyance in that the smartindent feature wants to not indent comments beginning with # at all. e.g., I want # Do something $x = $x + 1; if ($y) { # Do something else $y = $y + $z; } instead of ...
It looks like you're coding in Perl. Ensure that the following are set in your.vimrc: filetype plugin indent on syntax enable These will tell Vim to set the filetype when opening a buffer and configure the indentation and syntax highlighting. No need to explicitly set smartindent since Vim's included Perl syntax file w...
Indenting comments to match code in vim I do all my coding in vim and am quite happy with it (so, please, no "use a different editor" responses), but have an ongoing annoyance in that the smartindent feature wants to not indent comments beginning with # at all. e.g., I want # Do something $x = $x + 1; if ($y) { # Do so...
TITLE: Indenting comments to match code in vim QUESTION: I do all my coding in vim and am quite happy with it (so, please, no "use a different editor" responses), but have an ongoing annoyance in that the smartindent feature wants to not indent comments beginning with # at all. e.g., I want # Do something $x = $x + 1;...
[ "vim" ]
46
48
10,455
4
0
2008-10-10T13:15:09.470000
2008-10-10T13:27:40.180000
191,206
191,343
How to get list of running applications using PowerShell or VBScript
How does one get a list of running applications as shown in the "Applications" tab inside the Windows Task Manager using PowerShell or VBScript?
This should do the trick: Set Word = CreateObject("Word.Application") Set Tasks = Word.Tasks For Each Task in Tasks If Task.Visible Then Wscript.Echo Task.Name Next Word.Quit http://msdn.microsoft.com/en-us/library/bb212832.aspx
How to get list of running applications using PowerShell or VBScript How does one get a list of running applications as shown in the "Applications" tab inside the Windows Task Manager using PowerShell or VBScript?
TITLE: How to get list of running applications using PowerShell or VBScript QUESTION: How does one get a list of running applications as shown in the "Applications" tab inside the Windows Task Manager using PowerShell or VBScript? ANSWER: This should do the trick: Set Word = CreateObject("Word.Application") Set Tasks...
[ "powershell", "scripting", "vbscript" ]
18
5
52,086
5
0
2008-10-10T13:16:01.823000
2008-10-10T13:46:01.577000
191,208
191,256
Is recursion good in SQL Server?
I have a table in SQL server that has the normal tree structure of Item_ID, Item_ParentID. Suppose I want to iterate and get all CHILDREN of a particular Item_ID (at any level). Recursion seems an intuitive candidate for this problem and I can write an SQL Server function to do this. Will this affect performance if my ...
With the new MS SQL 2005 you could use the WITH keyword Check out this question and particularly this answer. With Oracle you could use CONNECT BY keyword to generate hierarchical queries ( syntax ). AFAIK with MySQL you'll have to use the recursion. Alternatively you could always build a cache table for your records p...
Is recursion good in SQL Server? I have a table in SQL server that has the normal tree structure of Item_ID, Item_ParentID. Suppose I want to iterate and get all CHILDREN of a particular Item_ID (at any level). Recursion seems an intuitive candidate for this problem and I can write an SQL Server function to do this. Wi...
TITLE: Is recursion good in SQL Server? QUESTION: I have a table in SQL server that has the normal tree structure of Item_ID, Item_ParentID. Suppose I want to iterate and get all CHILDREN of a particular Item_ID (at any level). Recursion seems an intuitive candidate for this problem and I can write an SQL Server funct...
[ "sql-server", "recursion" ]
9
5
5,557
8
0
2008-10-10T13:16:19.657000
2008-10-10T13:24:01.030000
191,209
191,289
How to say no to all "do you want to overwrite" prompts in a batch file copy?
By default, copying from the command prompt will prompt you to overwrite files that already exist in the target location. You can add "/Y" to say "Yes to all" replacements. But how can you say "No to all"? In other words, I want to copy everything from one directory that does not already exist in the target. The closes...
Unless there's a scenario where you'd not want to copy existing files in the source that have changed since the last copy, why not use XCOPY with /D without specifying a date?
How to say no to all "do you want to overwrite" prompts in a batch file copy? By default, copying from the command prompt will prompt you to overwrite files that already exist in the target location. You can add "/Y" to say "Yes to all" replacements. But how can you say "No to all"? In other words, I want to copy every...
TITLE: How to say no to all "do you want to overwrite" prompts in a batch file copy? QUESTION: By default, copying from the command prompt will prompt you to overwrite files that already exist in the target location. You can add "/Y" to say "Yes to all" replacements. But how can you say "No to all"? In other words, I ...
[ "batch-file", "copy" ]
62
74
133,391
14
0
2008-10-10T13:16:36.223000
2008-10-10T13:33:00.840000
191,215
191,961
How to stop java process gracefully?
How do I stop a Java process gracefully in Linux and Windows? When does Runtime.getRuntime().addShutdownHook get called, and when does it not? What about finalizers, do they help here? Can I send some sort of signal to a Java process from a shell? I am looking for preferably portable solutions.
Shutdown hooks execute in all cases where the VM is not forcibly killed. So, if you were to issue a "standard" kill ( SIGTERM from a kill command) then they will execute. Similarly, they will execute after calling System.exit(int). However a hard kill ( kill -9 or kill -SIGKILL ) then they won't execute. Similarly (and...
How to stop java process gracefully? How do I stop a Java process gracefully in Linux and Windows? When does Runtime.getRuntime().addShutdownHook get called, and when does it not? What about finalizers, do they help here? Can I send some sort of signal to a Java process from a shell? I am looking for preferably portabl...
TITLE: How to stop java process gracefully? QUESTION: How do I stop a Java process gracefully in Linux and Windows? When does Runtime.getRuntime().addShutdownHook get called, and when does it not? What about finalizers, do they help here? Can I send some sort of signal to a Java process from a shell? I am looking for ...
[ "java", "linux", "windows", "shell", "process" ]
92
86
141,727
7
0
2008-10-10T13:17:36.127000
2008-10-10T15:47:22.923000
191,224
692,420
OpenSource: Collaborative Design
After delving into the world of opensource I have found implementation is emphasised over design. Version control allows for a project to branch off in many directions, which projects may do; this suggests lack of consensus or direction amongst the participants. What software or websites are useful for collaborative de...
There are literally hundreds more collaboration apps out there and more keep appearing by the day, but these should get you started: Source Control (Online): Assembla - Public source is free, private repositories are paid Source Forge - Open source only Google Code - Open source only Git Hub - Public source is free, pr...
OpenSource: Collaborative Design After delving into the world of opensource I have found implementation is emphasised over design. Version control allows for a project to branch off in many directions, which projects may do; this suggests lack of consensus or direction amongst the participants. What software or website...
TITLE: OpenSource: Collaborative Design QUESTION: After delving into the world of opensource I have found implementation is emphasised over design. Version control allows for a project to branch off in many directions, which projects may do; this suggests lack of consensus or direction amongst the participants. What s...
[ "open-source", "collaboration" ]
6
14
1,234
10
0
2008-10-10T13:18:51.617000
2009-03-28T08:04:56.517000
191,233
191,366
How can I abort a long operation in WinDbg?
Often WinDbg will enter a state where it is *Busy* performing an operation. Often this is due to some mistake I made trying to dt some_variable_itll_never_find or setting a break point somewhere without symbols or the 1000's of other mistakes I make fumbling around this tool. Is there a way to cancel the current operat...
I don't have the tool now, but as far as I remember it should be Ctrl+Break.
How can I abort a long operation in WinDbg? Often WinDbg will enter a state where it is *Busy* performing an operation. Often this is due to some mistake I made trying to dt some_variable_itll_never_find or setting a break point somewhere without symbols or the 1000's of other mistakes I make fumbling around this tool....
TITLE: How can I abort a long operation in WinDbg? QUESTION: Often WinDbg will enter a state where it is *Busy* performing an operation. Often this is due to some mistake I made trying to dt some_variable_itll_never_find or setting a break point somewhere without symbols or the 1000's of other mistakes I make fumbling...
[ "windows", "debugging", "windbg" ]
77
88
32,274
4
0
2008-10-10T13:20:31.613000
2008-10-10T13:51:40.020000
191,242
191,254
Browsing SQL Server
Are there any tools for just browsing SQL Server? I ask because sometimes SSMS is a little heavy weight when I just want to look through the database and find one record, and SQLCMD doesn't really seem like a good choice when browsing through a lot of different records or a lot of large records.
Yes, QueryExpress is a great, lightweight tool (which also can be used from a USB stick) for browsing and querying SQL Server databases.
Browsing SQL Server Are there any tools for just browsing SQL Server? I ask because sometimes SSMS is a little heavy weight when I just want to look through the database and find one record, and SQLCMD doesn't really seem like a good choice when browsing through a lot of different records or a lot of large records.
TITLE: Browsing SQL Server QUESTION: Are there any tools for just browsing SQL Server? I ask because sometimes SSMS is a little heavy weight when I just want to look through the database and find one record, and SQLCMD doesn't really seem like a good choice when browsing through a lot of different records or a lot of ...
[ "sql-server" ]
4
10
1,240
3
0
2008-10-10T13:21:47.430000
2008-10-10T13:23:49.827000
191,247
192,231
Getting XAML of the current screen in silverlight 2
I am trying to send my dynamically created silverlight 2 page/image to a an ASP.net web service to render it as an bitmap image. I can see many examples how to get the XAML using javascript ( see here ) in version 1 of silverlight but I have a few differences. a) I am using silverlight 2 RC1 b) I have dynamically add c...
unfortunately there is not a method for a.ToXaml() on an element tree unfortunately. You can use VisualTreeHelper to build such a method and recurse through a particular element I suppose.
Getting XAML of the current screen in silverlight 2 I am trying to send my dynamically created silverlight 2 page/image to a an ASP.net web service to render it as an bitmap image. I can see many examples how to get the XAML using javascript ( see here ) in version 1 of silverlight but I have a few differences. a) I am...
TITLE: Getting XAML of the current screen in silverlight 2 QUESTION: I am trying to send my dynamically created silverlight 2 page/image to a an ASP.net web service to render it as an bitmap image. I can see many examples how to get the XAML using javascript ( see here ) in version 1 of silverlight but I have a few di...
[ "silverlight", "xaml", "image" ]
1
0
2,317
2
0
2008-10-10T13:23:04.853000
2008-10-10T16:50:56.413000
191,250
194,238
How to find the installation directory of a third-party application, such as Google Earth, using C#?
I have the following code fragment that starts a Google Earth process using a hardcoded path: var process = new Process { StartInfo = { //TODO: Get location of google earth executable from registry FileName = @"C:\Program Files\Google\Google Earth\googleearth.exe", Arguments = "\"" + kmlPath + "\"" } }; process.Start()...
Obviously if you're opening a specific file associated with the program then launching it via the file is preferable (for instance, the user might have a program associated with the file type they prefer to use). Here is a method I've used in the past to launch an application associated with a particular file type, but...
How to find the installation directory of a third-party application, such as Google Earth, using C#? I have the following code fragment that starts a Google Earth process using a hardcoded path: var process = new Process { StartInfo = { //TODO: Get location of google earth executable from registry FileName = @"C:\Progr...
TITLE: How to find the installation directory of a third-party application, such as Google Earth, using C#? QUESTION: I have the following code fragment that starts a Google Earth process using a hardcoded path: var process = new Process { StartInfo = { //TODO: Get location of google earth executable from registry Fil...
[ "c#", "google-earth" ]
2
4
4,485
4
0
2008-10-10T13:23:29.860000
2008-10-11T15:57:00.407000
191,251
196,214
How to install WPF application to a PC without Framework 3.5
I have a question about how to deploy WPF application into a PC without Framework 3.5. If a PC just installs Windows XP and sp3, Is it possible to design a setup package that can install WPF Application directly on this PC? The situation is like this: I designed a simple WPF Application. And I want to get its setup pac...
Visual Studio 2008 SP1 adds support for the "Client Profile" subset of the.NET Framework. If the Windows XP SP3 machines you're targeting don't have any version of the.NET Framework installed already, this will install a slimmed-down version of the Framework with the assemblies you need for a WPF app. Microsoft provide...
How to install WPF application to a PC without Framework 3.5 I have a question about how to deploy WPF application into a PC without Framework 3.5. If a PC just installs Windows XP and sp3, Is it possible to design a setup package that can install WPF Application directly on this PC? The situation is like this: I desig...
TITLE: How to install WPF application to a PC without Framework 3.5 QUESTION: I have a question about how to deploy WPF application into a PC without Framework 3.5. If a PC just installs Windows XP and sp3, Is it possible to design a setup package that can install WPF Application directly on this PC? The situation is ...
[ "wpf", "frameworks", "installation" ]
2
8
7,286
2
0
2008-10-10T13:23:34.867000
2008-10-12T22:24:54.663000
191,253
191,272
What are some convincing arguments to upgrade from Visual Studio 6?
I have a client who is still using Visual Studio 6 for building production systems. They write multi-threaded systems that use STL and run on mutli-processor machines. Occasionally when they change the spec of or increase the load on one of their server machines they get 'weird' difficult to reproduce errors... I know ...
Not supported on 64-bit systems, compatibility issues with Vista, and it was moved out of extended support by Microsoft on April 8, 2008 http://msdn.microsoft.com/en-us/vbrun/ms788708.aspx
What are some convincing arguments to upgrade from Visual Studio 6? I have a client who is still using Visual Studio 6 for building production systems. They write multi-threaded systems that use STL and run on mutli-processor machines. Occasionally when they change the spec of or increase the load on one of their serve...
TITLE: What are some convincing arguments to upgrade from Visual Studio 6? QUESTION: I have a client who is still using Visual Studio 6 for building production systems. They write multi-threaded systems that use STL and run on mutli-processor machines. Occasionally when they change the spec of or increase the load on ...
[ "c++", "visual-studio", "visual-c++", "stl", "visual-c++-6" ]
12
18
2,725
14
0
2008-10-10T13:23:48.407000
2008-10-10T13:28:16.450000
191,260
191,754
ASP.Net: Approaches to multilingual websites with Javascript and AJAX
We've recently completed phase 1 of a ASP.Net website in English and French. We went with using resource files to store language specific strings, but because the site used ASP.Net AJAX and javascript heavily we rigged up a solution to pass the right files through the ASP.Net pipeline where we could catch "tokens" and ...
In my main project (a RAD framework using PHP with gettext for translations) we're doing already alot of prepare operations on javascript files like merging and minifying them. Within this preperations we parse for gettext-markers and replace them with the language specific text. The result get save as javascript file ...
ASP.Net: Approaches to multilingual websites with Javascript and AJAX We've recently completed phase 1 of a ASP.Net website in English and French. We went with using resource files to store language specific strings, but because the site used ASP.Net AJAX and javascript heavily we rigged up a solution to pass the right...
TITLE: ASP.Net: Approaches to multilingual websites with Javascript and AJAX QUESTION: We've recently completed phase 1 of a ASP.Net website in English and French. We went with using resource files to store language specific strings, but because the site used ASP.Net AJAX and javascript heavily we rigged up a solution...
[ "c#", "asp.net", "javascript", "ajax", "internationalization" ]
1
1
1,546
2
0
2008-10-10T13:25:29.480000
2008-10-10T15:04:31.043000
191,291
191,898
Manually Trigger a TFS Team Build
How would you manually trigger additional team builds from a team build? For example, when we were in CC.Net other builds would trigger if certain builds were successful. The second build could either be projects that use this component or additional, long running test libraries for the same component.
One way you could do it is you could an an AfterEndToEndIteration target to your TFSBuild.proj file that would runs the TfsBuild.exe command line to start you other builds. I'm thinking something like this (though I haven't tested it)
Manually Trigger a TFS Team Build How would you manually trigger additional team builds from a team build? For example, when we were in CC.Net other builds would trigger if certain builds were successful. The second build could either be projects that use this component or additional, long running test libraries for th...
TITLE: Manually Trigger a TFS Team Build QUESTION: How would you manually trigger additional team builds from a team build? For example, when we were in CC.Net other builds would trigger if certain builds were successful. The second build could either be projects that use this component or additional, long running tes...
[ "tfs", "build-automation", "tfsbuild", "build" ]
5
4
2,508
2
0
2008-10-10T13:33:52.133000
2008-10-10T15:33:09.973000
191,306
191,823
How can I set the current line of execution in the eclipse java debugger?
I want to force the current execution line to a specific line in the same function, possibly skipping intermediate lines. All my old school debuggers had this feature, but I can't find it in eclipse. Is there a way to do it without changing code?
The first two answers seem to miss the topic, unless it is me not understanding the question. My understanding, a feature I searched myself, is that you want to skip a number of lines (when stepping in code) and set the program counter (to take assembly vocabulary) to the given line. It might be interesting to skip som...
How can I set the current line of execution in the eclipse java debugger? I want to force the current execution line to a specific line in the same function, possibly skipping intermediate lines. All my old school debuggers had this feature, but I can't find it in eclipse. Is there a way to do it without changing code?
TITLE: How can I set the current line of execution in the eclipse java debugger? QUESTION: I want to force the current execution line to a specific line in the same function, possibly skipping intermediate lines. All my old school debuggers had this feature, but I can't find it in eclipse. Is there a way to do it with...
[ "eclipse", "debugging", "execution" ]
34
15
13,946
5
0
2008-10-10T13:37:25.667000
2008-10-10T15:18:03.560000
191,312
191,377
How do I get to the menu in Emacs in console mode?
If you launch Emacs using the -nw flag to force a console session (rather than an X session if you have X windows running), how do you get to the menu? There are some items held in the menus that are infrequently-enough used on my part that I don't recall the escape or control sequence to do them.
M-x menu-bar-open, which is usually bound to F10. This works with and without menu-bar-mode (which just shows the names of the menus at the top of the screen).
How do I get to the menu in Emacs in console mode? If you launch Emacs using the -nw flag to force a console session (rather than an X session if you have X windows running), how do you get to the menu? There are some items held in the menus that are infrequently-enough used on my part that I don't recall the escape or...
TITLE: How do I get to the menu in Emacs in console mode? QUESTION: If you launch Emacs using the -nw flag to force a console session (rather than an X session if you have X windows running), how do you get to the menu? There are some items held in the menus that are infrequently-enough used on my part that I don't re...
[ "emacs" ]
94
94
56,508
7
0
2008-10-10T13:38:18.690000
2008-10-10T13:53:08.037000
191,342
191,348
Random record from a database table (T-SQL)
Is there a succinct way to retrieve a random record from a sql server table? I would like to randomize my unit test data, so am looking for a simple way to select a random id from a table. In English, the select would be "Select one id from the table where the id is a random number between the lowest id in the table an...
Is there a succinct way to retrieve a random record from a sql server table? Yes SELECT TOP 1 * FROM table ORDER BY NEWID() Explanation A NEWID() is generated for each row and the table is then sorted by it. The first record is returned (i.e. the record with the "lowest" GUID). Notes GUIDs are generated as pseudo-rando...
Random record from a database table (T-SQL) Is there a succinct way to retrieve a random record from a sql server table? I would like to randomize my unit test data, so am looking for a simple way to select a random id from a table. In English, the select would be "Select one id from the table where the id is a random ...
TITLE: Random record from a database table (T-SQL) QUESTION: Is there a succinct way to retrieve a random record from a sql server table? I would like to randomize my unit test data, so am looking for a simple way to select a random id from a table. In English, the select would be "Select one id from the table where t...
[ "sql-server", "t-sql", "random" ]
101
179
69,709
6
0
2008-10-10T13:45:45.463000
2008-10-10T13:46:58.703000
191,351
191,420
Windows scripting FOR command to rename all files in a directory
I am trying to rename all the files present in a Windows directory using FOR command as follows at the command prompt: for %1 in (*.*) do ren %1 test%1 E.g. This renames a file enc1.ctl to testenc1.ctl enc2.ctl to testenc2.ctl Thats not what i want. What i want is enc1.ctl renamed to test1.ctl enc2.ctl renamed to test2...
If you know the number of files, (say 10), you can use for /L %1 in (1,1,10) do ren enc%1.ctl test%1.ctl
Windows scripting FOR command to rename all files in a directory I am trying to rename all the files present in a Windows directory using FOR command as follows at the command prompt: for %1 in (*.*) do ren %1 test%1 E.g. This renames a file enc1.ctl to testenc1.ctl enc2.ctl to testenc2.ctl Thats not what i want. What ...
TITLE: Windows scripting FOR command to rename all files in a directory QUESTION: I am trying to rename all the files present in a Windows directory using FOR command as follows at the command prompt: for %1 in (*.*) do ren %1 test%1 E.g. This renames a file enc1.ctl to testenc1.ctl enc2.ctl to testenc2.ctl Thats not ...
[ "windows", "cmd" ]
1
1
18,707
4
0
2008-10-10T13:47:54.053000
2008-10-10T14:03:27.393000
191,354
191,474
Why doesn't WD Velociraptor speed up my VC++-compilation significantly?
Several people round here recommended switching to the new WD Velociraptor 10000rpm harddisk. Also magazine articles praise the performance. I bought one and mirrored my old system to it. The resulting increase in compilation-speed is somewhat disappointing: On my old Samsung drive (SATA, 7200), the compilation time wa...
Are you using the /MP option (undocumented, you have to enter it manually to your processor options) to enable source-level parallel build? That'll speed up your compile much more than just a faster harddisk. Gains from that are marginal.
Why doesn't WD Velociraptor speed up my VC++-compilation significantly? Several people round here recommended switching to the new WD Velociraptor 10000rpm harddisk. Also magazine articles praise the performance. I bought one and mirrored my old system to it. The resulting increase in compilation-speed is somewhat disa...
TITLE: Why doesn't WD Velociraptor speed up my VC++-compilation significantly? QUESTION: Several people round here recommended switching to the new WD Velociraptor 10000rpm harddisk. Also magazine articles praise the performance. I bought one and mirrored my old system to it. The resulting increase in compilation-spee...
[ "visual-c++", "hardware", "performance", "compilation" ]
6
6
1,093
10
0
2008-10-10T13:48:53.163000
2008-10-10T14:09:35.507000
191,359
191,403
How to convert a file to utf-8 in Python?
I need to convert a bunch of files to utf-8 in Python, and I have trouble with the "converting the file" part. I'd like to do the equivalent of: iconv -t utf-8 $file > converted/$file # this is shell code Thanks!
You can use the codecs module, like this: import codecs BLOCKSIZE = 1048576 # or some other, desired size in bytes with codecs.open(sourceFileName, "r", "your-source-encoding") as sourceFile: with codecs.open(targetFileName, "w", "utf-8") as targetFile: while True: contents = sourceFile.read(BLOCKSIZE) if not contents:...
How to convert a file to utf-8 in Python? I need to convert a bunch of files to utf-8 in Python, and I have trouble with the "converting the file" part. I'd like to do the equivalent of: iconv -t utf-8 $file > converted/$file # this is shell code Thanks!
TITLE: How to convert a file to utf-8 in Python? QUESTION: I need to convert a bunch of files to utf-8 in Python, and I have trouble with the "converting the file" part. I'd like to do the equivalent of: iconv -t utf-8 $file > converted/$file # this is shell code Thanks! ANSWER: You can use the codecs module, like th...
[ "python", "encoding", "file", "utf-8" ]
83
64
178,999
10
0
2008-10-10T13:50:26.467000
2008-10-10T13:59:07.760000
191,368
198,658
How can I set and restore FPU CTRL registers?
I can reset FPU's CTRL registers with this: http://support.microsoft.com/kb/326219 But how can I save current registers, and restore them later? It's from.net code.. What I'm doing, is from Delphi calling an.net dll as an COM module. Checking the Ctrl registers in delphi yield one value, checking with controlfp in the....
uses SysUtils; var SavedCW: Word; begin SavedCW:= Get8087CW; try Set8087CW($027f); // Call.NET code here finally Set8087CW(SavedCW); end; end;
How can I set and restore FPU CTRL registers? I can reset FPU's CTRL registers with this: http://support.microsoft.com/kb/326219 But how can I save current registers, and restore them later? It's from.net code.. What I'm doing, is from Delphi calling an.net dll as an COM module. Checking the Ctrl registers in delphi yi...
TITLE: How can I set and restore FPU CTRL registers? QUESTION: I can reset FPU's CTRL registers with this: http://support.microsoft.com/kb/326219 But how can I save current registers, and restore them later? It's from.net code.. What I'm doing, is from Delphi calling an.net dll as an COM module. Checking the Ctrl regi...
[ ".net", "delphi", "fpu", "ctrl" ]
5
7
1,843
2
0
2008-10-10T13:51:51.050000
2008-10-13T19:01:00.987000
191,387
192,278
How do you version your projects and manage releases?
Our situation is as follows, but I'm curious about this problem in any situation. We have a framework consisting of 4 projects: beans util framework web We also have modules that need a version and depend on a version of beans and util. Finally we have a customer project that consists of a specific version of the core ...
We use major.minor.bugfix. A major release only happens for huge changes. A minor release is called for when there is an API change. All other releases are bugfix releases. There's definitely utility in having a build or revision number there too for troubleshooting, although if you've got really rigorous CM you might ...
How do you version your projects and manage releases? Our situation is as follows, but I'm curious about this problem in any situation. We have a framework consisting of 4 projects: beans util framework web We also have modules that need a version and depend on a version of beans and util. Finally we have a customer pr...
TITLE: How do you version your projects and manage releases? QUESTION: Our situation is as follows, but I'm curious about this problem in any situation. We have a framework consisting of 4 projects: beans util framework web We also have modules that need a version and depend on a version of beans and util. Finally we ...
[ "java", "language-agnostic", "maven-2", "versioning" ]
8
10
3,214
9
0
2008-10-10T13:56:29.310000
2008-10-10T17:09:58.717000
191,390
191,436
How does one weed out dependencies in a large project?
I'm about to inherit a rather large Java enterprise project that has a large amount of third party dependencies. There is at least seventy JARs included and some of them would seem to be unused e.g. spring.jar which I know isn't used. It seems that over the years as various developers have touched upon the code base th...
Personally, I think you have to start by assessing the scale of the problem. It's going to be fairly painful, but I'd make a list of the dependencies and work out exactly which parts of the project use which ones. Then I'd work out exactly what features of each you're actually making use of (in many cases, you'll end u...
How does one weed out dependencies in a large project? I'm about to inherit a rather large Java enterprise project that has a large amount of third party dependencies. There is at least seventy JARs included and some of them would seem to be unused e.g. spring.jar which I know isn't used. It seems that over the years a...
TITLE: How does one weed out dependencies in a large project? QUESTION: I'm about to inherit a rather large Java enterprise project that has a large amount of third party dependencies. There is at least seventy JARs included and some of them would seem to be unused e.g. spring.jar which I know isn't used. It seems tha...
[ "java", "dependencies", "project" ]
0
4
529
7
0
2008-10-10T13:56:48.107000
2008-10-10T14:04:48.857000
191,396
191,558
Recommended placement of tempdb and log for SQL Server OLTP database(s)
Suppose the following configuration: Drive D... Data, Drive E.... TempDB, Drive F... Log. and suppose all drives are on separate spindles with respective drive controllers. Concerning performance; is the above configuration optimal, decent, or not advisable? With budgetary constraints in mind, can any of these DB's sha...
This is difficult to answer without a full analysis of your system. For example, to do this properly, we should have an idea what kind of IOPS your system will generate, in order to plan for slightly more capacity than peak load. I always love RAID10 across the board, separate arrays for everything, and in many instanc...
Recommended placement of tempdb and log for SQL Server OLTP database(s) Suppose the following configuration: Drive D... Data, Drive E.... TempDB, Drive F... Log. and suppose all drives are on separate spindles with respective drive controllers. Concerning performance; is the above configuration optimal, decent, or not ...
TITLE: Recommended placement of tempdb and log for SQL Server OLTP database(s) QUESTION: Suppose the following configuration: Drive D... Data, Drive E.... TempDB, Drive F... Log. and suppose all drives are on separate spindles with respective drive controllers. Concerning performance; is the above configuration optima...
[ "sql-server", "performance", "optimization", "configuration" ]
1
3
2,549
1
0
2008-10-10T13:58:07.513000
2008-10-10T14:23:56.400000
191,400
191,416
How do I protect all worksheet in an Excel workbook with a single click?
I have around 25 worksheets in my workbook (Excel spreadsheet). Is there a way I can protect all the 25 worksheets in single click? or this feature is not available and I will have to write a VBA code to accomplish this. I need very often to protect all sheets and unprotect all sheets and doing individually is time con...
I don't believe there's a way to do it without using VBA. If you are interested in a VBA solution, here is the code: Dim ws as Worksheet Dim pwd as String pwd = "" ' Put your password here For Each ws In Worksheets ws.Protect Password:=pwd Next ws Unprotecting is virtually the same: Dim ws as Worksheet Dim pwd as Stri...
How do I protect all worksheet in an Excel workbook with a single click? I have around 25 worksheets in my workbook (Excel spreadsheet). Is there a way I can protect all the 25 worksheets in single click? or this feature is not available and I will have to write a VBA code to accomplish this. I need very often to prote...
TITLE: How do I protect all worksheet in an Excel workbook with a single click? QUESTION: I have around 25 worksheets in my workbook (Excel spreadsheet). Is there a way I can protect all the 25 worksheets in single click? or this feature is not available and I will have to write a VBA code to accomplish this. I need v...
[ "excel", "vba" ]
7
16
56,735
4
0
2008-10-10T13:58:39.447000
2008-10-10T14:02:41.887000
191,404
191,521
Single Inheritance in C# - object class?
I have been asking myself this question for a long time now. Thought of posting it. C# doesn't support Multiple Inheritance(this is the fact). All classes created in C# derive out of 'Object' class(again a fact). So if C# does not support Multiple inheritance, then how are we able to extend a class even though it alrea...
Joel's answer is correct. There is a difference between multiple inheritance and an inhertance tree (or derivation chain). In your example, you actually show an inhertance tree: One object inherits (derives) from another object higher in the tree. Multiple inheritance allows one object to inherit from multiple base cla...
Single Inheritance in C# - object class? I have been asking myself this question for a long time now. Thought of posting it. C# doesn't support Multiple Inheritance(this is the fact). All classes created in C# derive out of 'Object' class(again a fact). So if C# does not support Multiple inheritance, then how are we ab...
TITLE: Single Inheritance in C# - object class? QUESTION: I have been asking myself this question for a long time now. Thought of posting it. C# doesn't support Multiple Inheritance(this is the fact). All classes created in C# derive out of 'Object' class(again a fact). So if C# does not support Multiple inheritance, ...
[ "c#" ]
10
8
9,177
8
0
2008-10-10T13:59:21.440000
2008-10-10T14:17:38.347000
191,413
191,887
Why does my spinner GIF stop while jQuery ajax call is running?
I'm just starting to wean myself from ASP.NET UpdatePanels. I'm using jQuery and jTemplates to bind the results of a web service to a grid, and everything works fine. Here's the thing: I'm trying to show a spinner GIF while the table is being refreshed (à la UpdateProgress in ASP.NET) I've got it all working, except th...
It's not the Ajax call that's freezing the browser. It's the success handler (applyTemplate). Inserting HTML into a document like that can freeze IE, depending on how much HTML there is. It's because the IE UI is single threaded; if you notice, the actual IE menus are frozen too while this is happening. As a test, try:...
Why does my spinner GIF stop while jQuery ajax call is running? I'm just starting to wean myself from ASP.NET UpdatePanels. I'm using jQuery and jTemplates to bind the results of a web service to a grid, and everything works fine. Here's the thing: I'm trying to show a spinner GIF while the table is being refreshed (à ...
TITLE: Why does my spinner GIF stop while jQuery ajax call is running? QUESTION: I'm just starting to wean myself from ASP.NET UpdatePanels. I'm using jQuery and jTemplates to bind the results of a web service to a grid, and everything works fine. Here's the thing: I'm trying to show a spinner GIF while the table is b...
[ "javascript", "jquery" ]
50
32
75,122
12
0
2008-10-10T14:01:21.390000
2008-10-10T15:30:58.637000
191,421
191,520
How to create a unique index on a NULL column?
I am using SQL Server 2005. I want to constrain the values in a column to be unique, while allowing NULLS. My current solution involves a unique index on a view like so: CREATE VIEW vw_unq WITH SCHEMABINDING AS SELECT Column1 FROM MyTable WHERE Column1 IS NOT NULL CREATE UNIQUE CLUSTERED INDEX unq_idx ON vw_unq (Colum...
Pretty sure you can't do that, as it violates the purpose of uniques. However, this person seems to have a decent work around: http://sqlservercodebook.blogspot.com/2008/04/multiple-null-values-in-unique-index-in.html
How to create a unique index on a NULL column? I am using SQL Server 2005. I want to constrain the values in a column to be unique, while allowing NULLS. My current solution involves a unique index on a view like so: CREATE VIEW vw_unq WITH SCHEMABINDING AS SELECT Column1 FROM MyTable WHERE Column1 IS NOT NULL CREATE ...
TITLE: How to create a unique index on a NULL column? QUESTION: I am using SQL Server 2005. I want to constrain the values in a column to be unique, while allowing NULLS. My current solution involves a unique index on a view like so: CREATE VIEW vw_unq WITH SCHEMABINDING AS SELECT Column1 FROM MyTable WHERE Column1 IS...
[ "sql", "sql-server", "indexing", "constraints", "unique" ]
115
25
122,768
5
0
2008-10-10T14:03:34.287000
2008-10-10T14:17:17.193000
191,429
230,152
CSS: Two 50% fluid columns not respecting min width
I'm trying to use this layout with two 50% column width instead. But it seems that when the right columns reaches its 'min-width', it goes under the left column. Is there any way to use the 'shim' technique to set a min-width to the wrapper so both columns stop resizing. Thus, eliminating the problem of the right colum...
I was able to come up with a "no HTML tables required" solution based off of a technique by Stu Nicholls at CSS Play and I personally like it because not only does it work in IE6+ and FF2+, it is also valid CSS that does not require any hacks. For my argument on why a CSS-based layout is preferable over HTML tables, se...
CSS: Two 50% fluid columns not respecting min width I'm trying to use this layout with two 50% column width instead. But it seems that when the right columns reaches its 'min-width', it goes under the left column. Is there any way to use the 'shim' technique to set a min-width to the wrapper so both columns stop resizi...
TITLE: CSS: Two 50% fluid columns not respecting min width QUESTION: I'm trying to use this layout with two 50% column width instead. But it seems that when the right columns reaches its 'min-width', it goes under the left column. Is there any way to use the 'shim' technique to set a min-width to the wrapper so both c...
[ "internet-explorer", "layout", "css" ]
8
6
11,136
8
0
2008-10-10T14:04:16.610000
2008-10-23T15:21:12.377000
191,443
191,532
How would you reference lookup/meta data?
I've run into this issue quite a few times and never liked the solution chosen. Let's say you have a list of States (just as a simple example) in the database. In your code-behind, you want to be able to reference a State by ID and have the list of them available via Intellisense. For example: States.Arizona.Id //retur...
I believe that if it shows up in Intellisense, then, by definition, it is hard-coded into your program. That said, if your goal is make the hard-coding as painless as possible, on thing you might try is auto-generating your enumeration based on what's in the database. That is, you can write a program that reads the dat...
How would you reference lookup/meta data? I've run into this issue quite a few times and never liked the solution chosen. Let's say you have a list of States (just as a simple example) in the database. In your code-behind, you want to be able to reference a State by ID and have the list of them available via Intellisen...
TITLE: How would you reference lookup/meta data? QUESTION: I've run into this issue quite a few times and never liked the solution chosen. Let's say you have a list of States (just as a simple example) in the database. In your code-behind, you want to be able to reference a State by ID and have the list of them availa...
[ "c#", ".net", "asp.net" ]
3
0
224
3
0
2008-10-10T14:06:07.137000
2008-10-10T14:19:18.093000
191,483
192,378
How do i submit an ajax request before the page is loaded
I want to check the login status of a user through an ajax request. Depending wether the user is logged in I want to display either the username/password input or the username. Currently the request is sent on body.onload and a prgoress indicator is shown until the response arrives. Is there a better way? Let's assume ...
If you don't want to depend on a toolkit, you can create your own DOMReady function that looks kinda like this: /* Usage: DOMReady(ajaxFunc); */ function DOMReady(f) { if (!document.all) { document.addEventListener("DOMContentLoaded", f, false); } else { if (document.readystate == 'complete') { window.setTimeout(f, 0);...
How do i submit an ajax request before the page is loaded I want to check the login status of a user through an ajax request. Depending wether the user is logged in I want to display either the username/password input or the username. Currently the request is sent on body.onload and a prgoress indicator is shown until ...
TITLE: How do i submit an ajax request before the page is loaded QUESTION: I want to check the login status of a user through an ajax request. Depending wether the user is logged in I want to display either the username/password input or the username. Currently the request is sent on body.onload and a prgoress indicat...
[ "javascript", "ajax" ]
3
2
5,727
5
0
2008-10-10T14:10:43.913000
2008-10-10T17:31:48.983000
191,493
192,008
Avoiding Dialog Boilerplate in Delphi and /or C++
I often need to design a dialog in Delphi/C++Builder that allows various properties of an object to be modified, and the code to use it typically looks like this. Dialog.Edit1.Text:= MyObject.Username; Dialog.Edit2.Text:= MyObject.Password; //... many more of the same if (Dialog.ShowModal = mrOk) begin MyObject.Userna...
well, something that I feel completely invaluable is the GExperts plugin wizard "Reverse Statement" which is invoked after installing GExperts by pressing Shift + ALT + R What it does is automatically switch the assignments around for the highlighted block. For example: edit1.text:= dbfield.asString; becomes dbField.as...
Avoiding Dialog Boilerplate in Delphi and /or C++ I often need to design a dialog in Delphi/C++Builder that allows various properties of an object to be modified, and the code to use it typically looks like this. Dialog.Edit1.Text:= MyObject.Username; Dialog.Edit2.Text:= MyObject.Password; //... many more of the same ...
TITLE: Avoiding Dialog Boilerplate in Delphi and /or C++ QUESTION: I often need to design a dialog in Delphi/C++Builder that allows various properties of an object to be modified, and the code to use it typically looks like this. Dialog.Edit1.Text:= MyObject.Username; Dialog.Edit2.Text:= MyObject.Password; //... many ...
[ "c++", "delphi", "modal-dialog", "boilerplate" ]
4
3
807
6
0
2008-10-10T14:11:42.897000
2008-10-10T15:54:58.180000
191,503
191,535
PHP readdir is not reading some files
I'm using the following code to loop through a directory to print out the names of the files. However, not all of the files are displayed. I have tried using clearstatcache with no effect. $str = ''; $ignore = array('.', '..'); $dh = @opendir( $path ); if ($dh === FALSE) { // error } $file = readdir( $dh ); while( $f...
Your break keywords messes up your code: Your loop very likely first encounters the '.' directory and than breaks out of your while loop. try replacing it with a continue and you should be fine.
PHP readdir is not reading some files I'm using the following code to loop through a directory to print out the names of the files. However, not all of the files are displayed. I have tried using clearstatcache with no effect. $str = ''; $ignore = array('.', '..'); $dh = @opendir( $path ); if ($dh === FALSE) { // erro...
TITLE: PHP readdir is not reading some files QUESTION: I'm using the following code to loop through a directory to print out the names of the files. However, not all of the files are displayed. I have tried using clearstatcache with no effect. $str = ''; $ignore = array('.', '..'); $dh = @opendir( $path ); if ($dh ==...
[ "php" ]
2
1
2,485
3
0
2008-10-10T14:14:07.340000
2008-10-10T14:19:42.803000
191,528
191,585
Does PHP have a built in mechanism to failover from one database server to another?
I found this: http://www.evolt.org/failover-database-connection-with-php-mysql and similar examples. But is there a better way? I am thinking along the lines of the Automatic Failover Client in the MS SQL Native Client.
It's traditional to handle failover strategies at the system level; that way all applications can enjoy a robust environment. I'd like to refer to MySQL failover strategy and MySQL proxy. The latter describes a MySQL utility that can do load balancing and failover, and seems quite easy to set up. Not the answer to the ...
Does PHP have a built in mechanism to failover from one database server to another? I found this: http://www.evolt.org/failover-database-connection-with-php-mysql and similar examples. But is there a better way? I am thinking along the lines of the Automatic Failover Client in the MS SQL Native Client.
TITLE: Does PHP have a built in mechanism to failover from one database server to another? QUESTION: I found this: http://www.evolt.org/failover-database-connection-with-php-mysql and similar examples. But is there a better way? I am thinking along the lines of the Automatic Failover Client in the MS SQL Native Client...
[ "php", "mysql", "database", "failover" ]
5
8
2,549
4
0
2008-10-10T14:18:53.663000
2008-10-10T14:29:39.647000
191,530
191,562
How do you change your apparent country of origin to test a site?
I want to be able to set my country of origin - does this involve testing through a proxy, or is there something that can be set else where?
I would use TOR for this purpose. That way you are sure you are hitting the site from a different country.
How do you change your apparent country of origin to test a site? I want to be able to set my country of origin - does this involve testing through a proxy, or is there something that can be set else where?
TITLE: How do you change your apparent country of origin to test a site? QUESTION: I want to be able to set my country of origin - does this involve testing through a proxy, or is there something that can be set else where? ANSWER: I would use TOR for this purpose. That way you are sure you are hitting the site from ...
[ "browser", "regional", "web-testing" ]
7
6
26,558
5
0
2008-10-10T14:19:03.833000
2008-10-10T14:24:46.897000
191,533
191,554
SVN and binaries
After asking this question I was advised not to check in binaries into subversion. My question is then what do I do with 3rd party dlls that are required to be in the bin folder? I need to be able checkout a working copy and have that run as a website with all dlls, etc intact.
The answers to your other question suggest you don't commit any generated files to subversion. DLLs in the bin folder are often built as part of the application, therefore, they should be regenerated rather than stored in subversion. If the DLLs are 3rd party DLLs for which you don't have the source code then I would s...
SVN and binaries After asking this question I was advised not to check in binaries into subversion. My question is then what do I do with 3rd party dlls that are required to be in the bin folder? I need to be able checkout a working copy and have that run as a website with all dlls, etc intact.
TITLE: SVN and binaries QUESTION: After asking this question I was advised not to check in binaries into subversion. My question is then what do I do with 3rd party dlls that are required to be in the bin folder? I need to be able checkout a working copy and have that run as a website with all dlls, etc intact. ANSWE...
[ "svn" ]
30
55
5,427
10
0
2008-10-10T14:19:18.780000
2008-10-10T14:23:19.800000
191,536
191,617
Converting XML to JSON using Python?
I've seen a fair share of ungainly XML->JSON code on the web, and having interacted with Stack's users for a bit, I'm convinced that this crowd can help more than the first few pages of Google results can. So, we're parsing a weather feed, and we need to populate weather widgets on a multitude of web sites. We're looki...
There is no "one-to-one" mapping between XML and JSON, so converting one to the other necessarily requires some understanding of what you want to do with the results. That being said, Python's standard library has several modules for parsing XML (including DOM, SAX, and ElementTree). As of Python 2.6, support for conve...
Converting XML to JSON using Python? I've seen a fair share of ungainly XML->JSON code on the web, and having interacted with Stack's users for a bit, I'm convinced that this crowd can help more than the first few pages of Google results can. So, we're parsing a weather feed, and we need to populate weather widgets on ...
TITLE: Converting XML to JSON using Python? QUESTION: I've seen a fair share of ungainly XML->JSON code on the web, and having interacted with Stack's users for a bit, I'm convinced that this crowd can help more than the first few pages of Google results can. So, we're parsing a weather feed, and we need to populate w...
[ "python", "json", "xml", "converters" ]
226
70
395,828
19
0
2008-10-10T14:19:44.207000
2008-10-10T14:34:55.580000
191,565
191,608
Teach an M.B.A. the intricacies of Microsoft SQL Server (and how's it different from MySQL?)
I haven't had to interact w/MSSQL much in my development career, though I've spent many an hour working with MySQL. An M.B.A. friend of mine is starting a job where she needs to gain functional knowledge of MSSQL Server, and I'd really like to help. What are the differences between MSSQL and MySQL? How would you recomm...
I'd love to say, "you can't". But that would be untrue (or at least mean). If she has any background with database design at all, then this is merely a new RDBMS. If she's never done database design, the place to start is not so much with MS SQL, but with how databases work, in my opinion. Database Design for Mere Mort...
Teach an M.B.A. the intricacies of Microsoft SQL Server (and how's it different from MySQL?) I haven't had to interact w/MSSQL much in my development career, though I've spent many an hour working with MySQL. An M.B.A. friend of mine is starting a job where she needs to gain functional knowledge of MSSQL Server, and I'...
TITLE: Teach an M.B.A. the intricacies of Microsoft SQL Server (and how's it different from MySQL?) QUESTION: I haven't had to interact w/MSSQL much in my development career, though I've spent many an hour working with MySQL. An M.B.A. friend of mine is starting a job where she needs to gain functional knowledge of MS...
[ "mysql", "sql-server" ]
0
5
601
4
0
2008-10-10T14:24:58.393000
2008-10-10T14:33:20.217000
191,567
191,645
Ruby Meta Programming Question
I was looking at the Ruby logging library Logging.logger method and have a question from the source at github relating to this piece of code: logger =::Logging::Logger.new(name) logger.add_appenders appender logger.additive = false class << logger def close @appenders.each {|a| a.close} h =::Logging::Repository.instan...
this actually deletes the method (when it actually gets executed). It's a safeguard to make sure close is not called twice. It kind of looks like there are nested 'class << ' constructs, but there aren't. The inner class << is executed when the method is called and the outer class << is called when the method is define...
Ruby Meta Programming Question I was looking at the Ruby logging library Logging.logger method and have a question from the source at github relating to this piece of code: logger =::Logging::Logger.new(name) logger.add_appenders appender logger.additive = false class << logger def close @appenders.each {|a| a.close} ...
TITLE: Ruby Meta Programming Question QUESTION: I was looking at the Ruby logging library Logging.logger method and have a question from the source at github relating to this piece of code: logger =::Logging::Logger.new(name) logger.add_appenders appender logger.additive = false class << logger def close @appenders.e...
[ "ruby", "metaprogramming" ]
5
11
657
1
0
2008-10-10T14:25:13.200000
2008-10-10T14:39:31.313000
191,592
205,690
How do I get rid of the mouse cursor in full-screen exclusive mode?
I'm working on a simple 2D game engine in Java, and having no trouble with FSEM, buffer strategies, and so on; my issue is with the mouse cursor. In windowed mode, I can hide the mouse cursor, no problem, by using setCursor() from my JFrame to set a wholly-transparent cursor. However, after a call to device.setFullScre...
I think I've finally found the solution: System.setProperty("apple.awt.fullscreenhidecursor","true"); This is an Apple-proprietary system property that hides the mouse cursor when an application is in full-screen mode. It's the only way I've found to fix it.
How do I get rid of the mouse cursor in full-screen exclusive mode? I'm working on a simple 2D game engine in Java, and having no trouble with FSEM, buffer strategies, and so on; my issue is with the mouse cursor. In windowed mode, I can hide the mouse cursor, no problem, by using setCursor() from my JFrame to set a wh...
TITLE: How do I get rid of the mouse cursor in full-screen exclusive mode? QUESTION: I'm working on a simple 2D game engine in Java, and having no trouble with FSEM, buffer strategies, and so on; my issue is with the mouse cursor. In windowed mode, I can hide the mouse cursor, no problem, by using setCursor() from my ...
[ "java", "mouse", "fullscreen", "mouse-cursor" ]
5
4
15,048
7
0
2008-10-10T14:31:02.500000
2008-10-15T17:42:13.547000
191,609
191,625
Where are the best locations to write an error log in Windows?
Where would you write an error log file, say ErrorLog.txt, in Windows? Keep in mind the path would need to be open to basic users for file write permissions. I know the eventlog is a possible location for writing errors, but does it work for "user" level permissions? EDIT: I am targeting Windows 2003, but I was posing ...
Have you considered logging the event viewer instead? If you want to write your own log, I suggest the users local app setting directory. Make a product directory under there. It's different on different version of Windows. On Vista, you cannot put files like this under c:\program files. You will run into a lot of prob...
Where are the best locations to write an error log in Windows? Where would you write an error log file, say ErrorLog.txt, in Windows? Keep in mind the path would need to be open to basic users for file write permissions. I know the eventlog is a possible location for writing errors, but does it work for "user" level pe...
TITLE: Where are the best locations to write an error log in Windows? QUESTION: Where would you write an error log file, say ErrorLog.txt, in Windows? Keep in mind the path would need to be open to basic users for file write permissions. I know the eventlog is a possible location for writing errors, but does it work f...
[ "permissions", "error-logging" ]
12
14
4,895
10
0
2008-10-10T14:33:21.093000
2008-10-10T14:36:04.423000
191,640
191,656
Determine Oracle null == null
I wish to search a database table on a nullable column. Sometimes the value I'm search for is itself NULL. Since Null is equal to nothing, even NULL, saying where MYCOLUMN=SEARCHVALUE will fail. Right now I have to resort to where ((MYCOLUMN=SEARCHVALUE) OR (MYCOLUMN is NULL and SEARCHVALUE is NULL)) Is there a simpler...
You can do the IsNull or NVL stuff, but it's just going to make the engine do more work. You'll be calling functions to do column conversions which then have to have the results compared. Use what you have where ((MYCOLUMN=SEARCHVALUE) OR (MYCOLUMN is NULL and SEARCHVALUE is NULL))
Determine Oracle null == null I wish to search a database table on a nullable column. Sometimes the value I'm search for is itself NULL. Since Null is equal to nothing, even NULL, saying where MYCOLUMN=SEARCHVALUE will fail. Right now I have to resort to where ((MYCOLUMN=SEARCHVALUE) OR (MYCOLUMN is NULL and SEARCHVALU...
TITLE: Determine Oracle null == null QUESTION: I wish to search a database table on a nullable column. Sometimes the value I'm search for is itself NULL. Since Null is equal to nothing, even NULL, saying where MYCOLUMN=SEARCHVALUE will fail. Right now I have to resort to where ((MYCOLUMN=SEARCHVALUE) OR (MYCOLUMN is N...
[ "sql", "oracle", "null", "nullable" ]
51
76
30,945
11
0
2008-10-10T14:37:54.843000
2008-10-10T14:42:06.330000
191,641
192,596
Report handler architecture question
I am attempting to have a ReportHandler service to handle report creation. Reports can have multiple, differing number of parameters that could be set. In the system currently there are several different methods of creating reports (MS reporting services, html reports, etc) and the way the data is generated for each re...
From your description, if you're looking for a pattern that matches better than Factory, try Strategy: Strategy Pattern Your context could be a custom class which encapsulates and abstracts the different report inputs (you could use the AbstractFactory pattern for this part) Your strategy could implement any number of ...
Report handler architecture question I am attempting to have a ReportHandler service to handle report creation. Reports can have multiple, differing number of parameters that could be set. In the system currently there are several different methods of creating reports (MS reporting services, html reports, etc) and the ...
TITLE: Report handler architecture question QUESTION: I am attempting to have a ReportHandler service to handle report creation. Reports can have multiple, differing number of parameters that could be set. In the system currently there are several different methods of creating reports (MS reporting services, html repo...
[ "c#", "asp.net", "report", "activereports" ]
3
3
618
3
0
2008-10-10T14:38:35.013000
2008-10-10T18:40:00.843000
191,642
191,736
Is it a good idea to use normalised tables with denormalised indexed views?
I'm architecting a new app at the moment, with a high read:write ratio. At my current employer we have lots of denormalised data on our tables for performance reasons. Is it better practice to have totally 3NF tables and then use indexed views to do all the denormalisation? Should I run queries against the tables or vi...
In general it's a good idea to have denormalized views if you need to access across multiple normalized tables very frequently. In most cases it'll be a significant performance increase over using a join and querying directly against the tables, and it's usually not any less maintainable, since either your view or join...
Is it a good idea to use normalised tables with denormalised indexed views? I'm architecting a new app at the moment, with a high read:write ratio. At my current employer we have lots of denormalised data on our tables for performance reasons. Is it better practice to have totally 3NF tables and then use indexed views ...
TITLE: Is it a good idea to use normalised tables with denormalised indexed views? QUESTION: I'm architecting a new app at the moment, with a high read:write ratio. At my current employer we have lots of denormalised data on our tables for performance reasons. Is it better practice to have totally 3NF tables and then ...
[ "sql", "database", "normalization", "denormalization" ]
3
3
566
2
0
2008-10-10T14:38:54.950000
2008-10-10T14:59:21.397000
191,657
1,382,611
Which effects library should I integrate with GWT?
I am curious if anyone has done a comparison between the different options out there. So far I am leaning towards using Moo.fx because loading prototype.js just to use scriptaculous seems a bit much. Does that make sense? Are there any other effects libraries worth trying? Thanks.
I've found a viable alternative to the recommended JS libraries -- a GWT-native Java library called GWT-FX developed by Adam Tacy. Some of its features include built-in effects (Fade, Slide, Highlight), physics transition types (linear, ease in/out, elastic), and the ability to build your own effects by specifying CSS ...
Which effects library should I integrate with GWT? I am curious if anyone has done a comparison between the different options out there. So far I am leaning towards using Moo.fx because loading prototype.js just to use scriptaculous seems a bit much. Does that make sense? Are there any other effects libraries worth try...
TITLE: Which effects library should I integrate with GWT? QUESTION: I am curious if anyone has done a comparison between the different options out there. So far I am leaning towards using Moo.fx because loading prototype.js just to use scriptaculous seems a bit much. Does that make sense? Are there any other effects l...
[ "javascript", "css", "gwt", "comparison", "effects" ]
4
0
2,594
7
0
2008-10-10T14:42:19.343000
2009-09-05T06:11:38.563000
191,687
191,712
How Can I Build wxWidgets With Eclipse On Windows
I installed wxWidgets 2.8.9 on a Windows XP SP2 box and built the library according to the directions and now I'm trying to get the Hello World! tutorial app to build from within Eclipse and I'm just missing something apparently. Any idea how to get Cygwin, Eclipse and wxWidgets to play nice together?
This answer was posted by Lars Uffmann to the comp.soft-sys.wxwindows newsgroup. In a nutshell: Add c:/cygwin/usr/local/bin to the path in the Eclipse project configuration Add ``wx-config --cxxflags`‘ to the GCC C++ Compiler command Move the ${FLAGS} variable to the end of the GCC C++ Linker Command Line Pattern Add `...
How Can I Build wxWidgets With Eclipse On Windows I installed wxWidgets 2.8.9 on a Windows XP SP2 box and built the library according to the directions and now I'm trying to get the Hello World! tutorial app to build from within Eclipse and I'm just missing something apparently. Any idea how to get Cygwin, Eclipse and ...
TITLE: How Can I Build wxWidgets With Eclipse On Windows QUESTION: I installed wxWidgets 2.8.9 on a Windows XP SP2 box and built the library according to the directions and now I'm trying to get the Hello World! tutorial app to build from within Eclipse and I'm just missing something apparently. Any idea how to get Cy...
[ "c++", "eclipse", "cygwin", "wxwidgets" ]
0
3
4,914
2
0
2008-10-10T14:48:21.483000
2008-10-10T14:54:38.227000
191,692
191,702
Code to get *.aspx in a website
Is there a method to get all of the.aspx files in my website? Maybe iterate through the site's file structure and add to an array?
Directory.GetFiles(HttpContext.Current.Server.MapPath(@"/"), "*.aspx", SearchOption.AllDirectories);
Code to get *.aspx in a website Is there a method to get all of the.aspx files in my website? Maybe iterate through the site's file structure and add to an array?
TITLE: Code to get *.aspx in a website QUESTION: Is there a method to get all of the.aspx files in my website? Maybe iterate through the site's file structure and add to an array? ANSWER: Directory.GetFiles(HttpContext.Current.Server.MapPath(@"/"), "*.aspx", SearchOption.AllDirectories);
[ "asp.net", "directory-traversal" ]
3
6
291
3
0
2008-10-10T14:50:21.603000
2008-10-10T14:52:43.253000
191,700
191,744
Configuring python
I am new to python and struggling to find how to control the amount of memory a python process can take? I am running python on a Cento OS machine with more than 2 GB of main memory size. Python is taking up only 128mb of this and I want to allocate it more. I tried to search all over the internet on this for last half...
Forget all that, python just allocates more memory as needed, there is not a myriad of comandline arguments for the VM as in java, just let it run. For all comandline switches you can just run python -h or read man python.
Configuring python I am new to python and struggling to find how to control the amount of memory a python process can take? I am running python on a Cento OS machine with more than 2 GB of main memory size. Python is taking up only 128mb of this and I want to allocate it more. I tried to search all over the internet on...
TITLE: Configuring python QUESTION: I am new to python and struggling to find how to control the amount of memory a python process can take? I am running python on a Cento OS machine with more than 2 GB of main memory size. Python is taking up only 128mb of this and I want to allocate it more. I tried to search all ov...
[ "python", "memory" ]
2
11
1,654
2
0
2008-10-10T14:52:04.360000
2008-10-10T15:02:11.843000
191,704
192,894
Using regular expressions how do I find a pattern surrounded by two other patterns without including the surrounding strings?
I want to use regular expressions (Perl compatible) to be able to find a pattern surrounded by two other patterns, but not include the strings matching the surrounding patterns in the match. For example, I want to be able to find occurrences of strings like: Foo Bar Baz But only have the match include the middle part: ...
In the general case, you probably can't. The simplest approach is to match everything and use backreferences to capture the portion of interest: Foo\s+(Bar)\s+Baz This isn't the same as not including the surrounding text in the match though. That probably doesn't matter if all you want to do is extract "Bar" but would ...
Using regular expressions how do I find a pattern surrounded by two other patterns without including the surrounding strings? I want to use regular expressions (Perl compatible) to be able to find a pattern surrounded by two other patterns, but not include the strings matching the surrounding patterns in the match. For...
TITLE: Using regular expressions how do I find a pattern surrounded by two other patterns without including the surrounding strings? QUESTION: I want to use regular expressions (Perl compatible) to be able to find a pattern surrounded by two other patterns, but not include the strings matching the surrounding patterns...
[ "regex" ]
4
4
1,523
4
0
2008-10-10T14:53:21.083000
2008-10-10T20:17:02.240000
191,734
191,777
PHP based form validation
I'm looking for an easy to use, reasonably complete form validation solution for php. I recall using one years ago that used a few tags on the HMTL side then captured the OB to replace them with some pretty serious code. This feels slightly like overkill me, yet I'm not REALLY wanting to go nuts with my own right now. ...
Since you are already using Smarty, you may want to consider the PEAR package HTML_QuickForm (this page says it's being replaced by v2, but that's still in alpha. V1 is pretty solid). The package allows you to build and process your forms in an easy, straightforward API, and then has a renderer class that works with Sm...
PHP based form validation I'm looking for an easy to use, reasonably complete form validation solution for php. I recall using one years ago that used a few tags on the HMTL side then captured the OB to replace them with some pretty serious code. This feels slightly like overkill me, yet I'm not REALLY wanting to go nu...
TITLE: PHP based form validation QUESTION: I'm looking for an easy to use, reasonably complete form validation solution for php. I recall using one years ago that used a few tags on the HMTL side then captured the OB to replace them with some pretty serious code. This feels slightly like overkill me, yet I'm not REALL...
[ "php", "validation", "smarty" ]
1
2
965
1
0
2008-10-10T14:58:31.867000
2008-10-10T15:09:13.530000
191,740
191,773
Give DROP PROCEDURE a parameter
I'm using SqlServer for the first time, and in every single one of our create procedure scripts there is a block of code like below to remove the procedure if it already exists: IF EXISTS (SELECT * FROM information_schema.routines WHERE routine_name = 'SomeProcedureName' AND routine_type = 'PROCEDURE' BEGIN DROP PROCE...
The full answer is: DECLARE @SQL VARCHAR(8000) SELECT @SQL = 'USE ' + DB_NAME() + CHAR(10) SET @SQL = @SQL + 'DROP PROCEDURE ' + @procName --PRINT @SQL EXEC(@SQL) The one given by Andrew will only work if the default database for your login is set to the database you want. When using dynamic sql you get a new database ...
Give DROP PROCEDURE a parameter I'm using SqlServer for the first time, and in every single one of our create procedure scripts there is a block of code like below to remove the procedure if it already exists: IF EXISTS (SELECT * FROM information_schema.routines WHERE routine_name = 'SomeProcedureName' AND routine_type...
TITLE: Give DROP PROCEDURE a parameter QUESTION: I'm using SqlServer for the first time, and in every single one of our create procedure scripts there is a block of code like below to remove the procedure if it already exists: IF EXISTS (SELECT * FROM information_schema.routines WHERE routine_name = 'SomeProcedureName...
[ "sql-server", "t-sql" ]
6
7
3,749
3
0
2008-10-10T15:01:15.980000
2008-10-10T15:09:02.017000
191,746
191,767
How do I access the "displayed" text of a select box option from the DOM?
Given the following HTML: displayed text 1 How do I grab the string "displayed text 1" using Javascript/the DOM?
var sel = document.getElementById("my_dropdown"); //get the selected option var selectedText = sel.options[sel.selectedIndex].text; //or get the first option var optionText = sel.options[0].text; //or get the option with value="1" for(var i=0; i
How do I access the "displayed" text of a select box option from the DOM? Given the following HTML: displayed text 1 How do I grab the string "displayed text 1" using Javascript/the DOM?
TITLE: How do I access the "displayed" text of a select box option from the DOM? QUESTION: Given the following HTML: displayed text 1 How do I grab the string "displayed text 1" using Javascript/the DOM? ANSWER: var sel = document.getElementById("my_dropdown"); //get the selected option var selectedText = sel.option...
[ "javascript", "dom" ]
3
10
11,957
6
0
2008-10-10T15:02:32.920000
2008-10-10T15:07:31.460000
191,748
191,770
Using arrays by reference
Why is the following code "crashing" in PHP? $normal_array = array(); $array_of_arrayrefs = array( &$normal_array ); end( $array_of_arrayrefs )["one"] = 1; // choking on this one The expected result is that the final code line appends $normal_array with key one having value 1 but there is no output what so ever, not e...
This doesn't crash, it just contains a syntax error: end( $array_of_arrayrefs )["one"] = 1; Unfortunately, you cannot treat function return values as arrays in PHP. You have to assign the value explicitly. Unfortunately, this doesn't work here because end makes a copy of the returned value.
Using arrays by reference Why is the following code "crashing" in PHP? $normal_array = array(); $array_of_arrayrefs = array( &$normal_array ); end( $array_of_arrayrefs )["one"] = 1; // choking on this one The expected result is that the final code line appends $normal_array with key one having value 1 but there is no ...
TITLE: Using arrays by reference QUESTION: Why is the following code "crashing" in PHP? $normal_array = array(); $array_of_arrayrefs = array( &$normal_array ); end( $array_of_arrayrefs )["one"] = 1; // choking on this one The expected result is that the final code line appends $normal_array with key one having value ...
[ "php", "arrays", "reference" ]
0
3
681
1
0
2008-10-10T15:02:38.287000
2008-10-10T15:08:05.890000
191,766
192,635
Find which class in which jar has a given serialVersionUID
When I get a java.io.InvalidClassException, it gives me the serialVersionUID that it wants, and the serialVersionUID that it got. Is there an easy way to tell which of my dozens of jars using the wrong serialVersionUID? Update: I should mention that our intention is to update everything at the same time, but I'm trying...
use the serialver tool from the sun jdk for each class in the jar.
Find which class in which jar has a given serialVersionUID When I get a java.io.InvalidClassException, it gives me the serialVersionUID that it wants, and the serialVersionUID that it got. Is there an easy way to tell which of my dozens of jars using the wrong serialVersionUID? Update: I should mention that our intenti...
TITLE: Find which class in which jar has a given serialVersionUID QUESTION: When I get a java.io.InvalidClassException, it gives me the serialVersionUID that it wants, and the serialVersionUID that it got. Is there an easy way to tell which of my dozens of jars using the wrong serialVersionUID? Update: I should mentio...
[ "java", "serialversionuid" ]
1
5
3,829
6
0
2008-10-10T15:07:28.557000
2008-10-10T18:51:56.327000
191,787
191,888
Renaming Tables SQL Server, cascading that change through PK and FK's
I want to find a sql command or something that can do this where I have a table named tblFoo and I want to name it tblFooBar. However, I want the primary key to also be change, for example, currently it is: CONSTRAINT [PK_tblFoo] PRIMARY KEY CLUSTERED And I want a name change to change it to: CONSTRAINT [PK_tblFooBar] ...
This is just off the top of my head and isn't complete (you'd need to add similar code for indexes). Also, you would need to either add code to avoid renaming objects from a table with the same base name, but additional characters - for example, this code would also list tblFoo2 and all of its associated objects. Hopef...
Renaming Tables SQL Server, cascading that change through PK and FK's I want to find a sql command or something that can do this where I have a table named tblFoo and I want to name it tblFooBar. However, I want the primary key to also be change, for example, currently it is: CONSTRAINT [PK_tblFoo] PRIMARY KEY CLUSTERE...
TITLE: Renaming Tables SQL Server, cascading that change through PK and FK's QUESTION: I want to find a sql command or something that can do this where I have a table named tblFoo and I want to name it tblFooBar. However, I want the primary key to also be change, for example, currently it is: CONSTRAINT [PK_tblFoo] PR...
[ "sql", "sql-server", "t-sql", "rename" ]
5
7
6,186
4
0
2008-10-10T15:11:13.807000
2008-10-10T15:31:06.437000
191,788
191,846
Two directional list Enumerator in .NET
In my c# app, I've got a list that I navigate with an Enumerator. It works great for moving forward through the list, but the Enumerator class doesn't have a MoveBack method. Is there different class that has a MoveBack method, or do I need to write my own?
Any enumerators using the IEnumerator interface by definition must start before the first element and iterate forwards through the collection. In short: they don't support backwards traversal. If you want backwards traversal you'll need to write your own enumeration functions that allow you start anywhere you want.
Two directional list Enumerator in .NET In my c# app, I've got a list that I navigate with an Enumerator. It works great for moving forward through the list, but the Enumerator class doesn't have a MoveBack method. Is there different class that has a MoveBack method, or do I need to write my own?
TITLE: Two directional list Enumerator in .NET QUESTION: In my c# app, I've got a list that I navigate with an Enumerator. It works great for moving forward through the list, but the Enumerator class doesn't have a MoveBack method. Is there different class that has a MoveBack method, or do I need to write my own? ANS...
[ ".net" ]
3
1
467
3
0
2008-10-10T15:12:03.837000
2008-10-10T15:23:17.933000
191,791
191,832
Enum Parameters
I am hoping to find a way to do this in vb.net: Say you have function call getPaint(Color). You want the call to be limited to the parameter values of (red,green,yellow). When they enter that parameter, the user is provided the available options, like how a boolean parameter functions. Any ideas?
to limit a enum with a large number of values, to just a few you could do the following C# List allow = new List { Color.Red, Color.Green, Color.Yellow }; if (!allow.Contains(color)) { throw new ArguementException("Invalid Color"); } VB Dim allow As New List(Of Color)() allow.Add(Color.Red) allow.Add(Color.Green) allow...
Enum Parameters I am hoping to find a way to do this in vb.net: Say you have function call getPaint(Color). You want the call to be limited to the parameter values of (red,green,yellow). When they enter that parameter, the user is provided the available options, like how a boolean parameter functions. Any ideas?
TITLE: Enum Parameters QUESTION: I am hoping to find a way to do this in vb.net: Say you have function call getPaint(Color). You want the call to be limited to the parameter values of (red,green,yellow). When they enter that parameter, the user is provided the available options, like how a boolean parameter functions....
[ "vb.net", "functional-programming", "function" ]
1
4
1,426
2
0
2008-10-10T15:12:28.050000
2008-10-10T15:20:29.873000
191,796
191,862
Designing for extranet from the beginning?
I've been tasked to develop a web application to cover one of our business functions. It needs to have external access from outside our network. At the same time, it needs to be done fairly quickly. I don't have any experience in extranet applications so I'm not exactly sure what all is involved. Learning about it is t...
You can take many things for granted when you are developing for local network: Highspeed network Trusted user base Same timezone for all users (this makes maintenance jobs easier to schedule among other things) Control over which browsers and versions users should use Authentication against LAN authentication system o...
Designing for extranet from the beginning? I've been tasked to develop a web application to cover one of our business functions. It needs to have external access from outside our network. At the same time, it needs to be done fairly quickly. I don't have any experience in extranet applications so I'm not exactly sure w...
TITLE: Designing for extranet from the beginning? QUESTION: I've been tasked to develop a web application to cover one of our business functions. It needs to have external access from outside our network. At the same time, it needs to be done fairly quickly. I don't have any experience in extranet applications so I'm ...
[ "web-applications", "extranet" ]
2
1
400
3
0
2008-10-10T15:13:16.440000
2008-10-10T15:26:23.323000
191,806
191,840
Is Windows Vista worth considering when developing for Windows XP?
Quite a few comments to answers in a different post, Where are the best locations to write an error log in Windows?, gave me the impression that a lot of things regarding standard folders ( %APPDATA%; %TEMP% ) in Windows Vista are different from Windows XP, which should of course be taken into account when developing s...
Personally, I'd have a quick look at the effort level of what it would take to enable "Vista Support" in your application. If the effort levels are acceptable based on the allotted time to make changes in your project then it's good to account for the future in any design. You know your implementation better than anyon...
Is Windows Vista worth considering when developing for Windows XP? Quite a few comments to answers in a different post, Where are the best locations to write an error log in Windows?, gave me the impression that a lot of things regarding standard folders ( %APPDATA%; %TEMP% ) in Windows Vista are different from Windows...
TITLE: Is Windows Vista worth considering when developing for Windows XP? QUESTION: Quite a few comments to answers in a different post, Where are the best locations to write an error log in Windows?, gave me the impression that a lot of things regarding standard folders ( %APPDATA%; %TEMP% ) in Windows Vista are diff...
[ "windows-vista", "windows-xp" ]
2
8
494
8
0
2008-10-10T15:15:49.617000
2008-10-10T15:21:59.950000
191,808
1,368,939
Batch file uploading with a flashplayer dialog
I'm currently looking at ways to allow people to select multiple files at once to batch upload images. I'm evaluating these options for my ASP.NET web app: YUI Uploader Flajaxian SWFUpload Dojo Toolkit Multi file uploader I'm leaning toward YUI because the documentation is clear and I basically already wrote the file u...
Thanks for everyone's opinion but I ended up using YUI Uploader because that's what flickr uses and the project spec was basically an analysis of flickr 's features. The experience of using it was essentially excellent, and being able to compare it to what flickr did was also helpful.
Batch file uploading with a flashplayer dialog I'm currently looking at ways to allow people to select multiple files at once to batch upload images. I'm evaluating these options for my ASP.NET web app: YUI Uploader Flajaxian SWFUpload Dojo Toolkit Multi file uploader I'm leaning toward YUI because the documentation is...
TITLE: Batch file uploading with a flashplayer dialog QUESTION: I'm currently looking at ways to allow people to select multiple files at once to batch upload images. I'm evaluating these options for my ASP.NET web app: YUI Uploader Flajaxian SWFUpload Dojo Toolkit Multi file uploader I'm leaning toward YUI because th...
[ "asp.net", "dojo", "yui", "flajaxian" ]
2
1
718
3
0
2008-10-10T15:16:00.477000
2009-09-02T16:58:22.753000
191,812
193,144
How can I create a custom Property for my assembly?
How can I create a custom property for my.Net assembly which would then be visible under the Details tab in Windows explorer? Something to sit parallel with "File Description", "Type", "Product Version"... etc Update: To quote my comment to Lars... "Whilst I would have liked to do this from within Visual studio, that i...
Your compiler does not support it. AssemblyFileVersionAttribute and all work because the compiler generates a win32 resource in your assembly called VERSIONINFO with that information in it. That is what windows is reading. Other attributes are just saved as metadata along with your code. You could make a tool to change...
How can I create a custom Property for my assembly? How can I create a custom property for my.Net assembly which would then be visible under the Details tab in Windows explorer? Something to sit parallel with "File Description", "Type", "Product Version"... etc Update: To quote my comment to Lars... "Whilst I would hav...
TITLE: How can I create a custom Property for my assembly? QUESTION: How can I create a custom property for my.Net assembly which would then be visible under the Details tab in Windows explorer? Something to sit parallel with "File Description", "Type", "Product Version"... etc Update: To quote my comment to Lars... "...
[ ".net", "assemblies", "attributes" ]
9
5
3,294
3
0
2008-10-10T15:16:30.130000
2008-10-10T21:46:00.377000
191,814
191,836
Can pipes be used across LAN computers?
Can pipes be used across LAN computers? In particular I'm looking for Windows, but if you have more info on other platforms, that will also help others who find this thread later.
Yes they can. Named pipes can be used to provide communication between processes on the same computer or between processes on different computers across a network. If the server service is running, all named pipes are accessible remotely http://msdn.microsoft.com/en-us/library/aa365590.aspx
Can pipes be used across LAN computers? Can pipes be used across LAN computers? In particular I'm looking for Windows, but if you have more info on other platforms, that will also help others who find this thread later.
TITLE: Can pipes be used across LAN computers? QUESTION: Can pipes be used across LAN computers? In particular I'm looking for Windows, but if you have more info on other platforms, that will also help others who find this thread later. ANSWER: Yes they can. Named pipes can be used to provide communication between pr...
[ "c++", "c", "ipc", "pipe" ]
3
7
3,234
2
0
2008-10-10T15:16:40.600000
2008-10-10T15:21:20.527000
191,817
192,076
CSS floated divs with form elements disappear in Safari 3 on a mac
I'm roughing a layout together and doing some browser testing. Never came across this issue before, check out the contact form in the footer of this page http://staging.terrilynn.com/fundraising/ There is a div with a width of 298px floated to the right that comes first in the source order. It is followed by several ot...
I guess I found the problem: screen.css (line 382) #footer-contact-form div { margin:0 300px 10px 0; overflow:hidden; } "overflow:hidden" causes the problem.
CSS floated divs with form elements disappear in Safari 3 on a mac I'm roughing a layout together and doing some browser testing. Never came across this issue before, check out the contact form in the footer of this page http://staging.terrilynn.com/fundraising/ There is a div with a width of 298px floated to the right...
TITLE: CSS floated divs with form elements disappear in Safari 3 on a mac QUESTION: I'm roughing a layout together and doing some browser testing. Never came across this issue before, check out the contact form in the footer of this page http://staging.terrilynn.com/fundraising/ There is a div with a width of 298px fl...
[ "css", "google-chrome", "safari", "webkit", "css-float" ]
2
0
2,166
3
0
2008-10-10T15:17:19.350000
2008-10-10T16:12:39.613000
191,819
193,652
WCF - returning large images - your experience and tips on doing so
We are using a WCF service layer to return images from a repository. Some of the images are color, multi-page, nearly all are TIFF format. We experience slowness - one of many issues. 1.) What experiences have you had with returning images via WCF 2.) Do you have any suggestions tips for returning large images? 3.) All...
Okay Just to second the responses by ZombieSheep and Seba Gomez, you should definitely look at streaming your data. By doing so you could seamlessly integrate the GZipStream into the process. On the client side you can reverse the compression process and convert the stream back to your desired image. By using streaming...
WCF - returning large images - your experience and tips on doing so We are using a WCF service layer to return images from a repository. Some of the images are color, multi-page, nearly all are TIFF format. We experience slowness - one of many issues. 1.) What experiences have you had with returning images via WCF 2.) ...
TITLE: WCF - returning large images - your experience and tips on doing so QUESTION: We are using a WCF service layer to return images from a repository. Some of the images are color, multi-page, nearly all are TIFF format. We experience slowness - one of many issues. 1.) What experiences have you had with returning i...
[ "c#", ".net", "wcf" ]
4
5
4,333
5
0
2008-10-10T15:17:47.523000
2008-10-11T04:36:30.173000
191,826
192,363
Web Service throwing exception using Axis2 Java
I'm actually developing a Web Service in Java using Axis 2. I designed my service as a POJO (Plain Old Java Object) with public method throwing exceptions: public class MyService { public Object myMethod() throws MyException { [...] } } I then generated the WSDL using Axis2 ant task. With the WSDL I generate a client s...
I don't really think there is a problem. Your Client calls a method on the server. That method results in an exception. Axis transforms this exception to something which can be send to the client to indicate the error. All exceptions, as far as I know, are wrapped into an AxisFault which is then transmitted to the clie...
Web Service throwing exception using Axis2 Java I'm actually developing a Web Service in Java using Axis 2. I designed my service as a POJO (Plain Old Java Object) with public method throwing exceptions: public class MyService { public Object myMethod() throws MyException { [...] } } I then generated the WSDL using Axi...
TITLE: Web Service throwing exception using Axis2 Java QUESTION: I'm actually developing a Web Service in Java using Axis 2. I designed my service as a POJO (Plain Old Java Object) with public method throwing exceptions: public class MyService { public Object myMethod() throws MyException { [...] } } I then generated ...
[ "java", "web-services", "exception", "axis" ]
2
4
14,587
3
0
2008-10-10T15:18:20.940000
2008-10-10T17:26:46.157000
191,831
191,856
What do I need to re-build my web server?
I am getting ready to completely overhaul my web server. I use it for both development and to present product to clients. It also hosts my company website. I will be loading MS Server 2008 and MS SQL 2008. I want it to have the latest.NET Framework as well as the latest MVC templates. I want it to use SubSonic. I also ...
Well, sounds like you've already got a good list going. Though I'd recommend against SourceSafe. See here for details. SubVersion is a free alternative. Or perhaps git or something like that if you're up for a challenge. [edit to add] If you can afford it, TFS is a nice product that gives you bug tracking, version cont...
What do I need to re-build my web server? I am getting ready to completely overhaul my web server. I use it for both development and to present product to clients. It also hosts my company website. I will be loading MS Server 2008 and MS SQL 2008. I want it to have the latest.NET Framework as well as the latest MVC tem...
TITLE: What do I need to re-build my web server? QUESTION: I am getting ready to completely overhaul my web server. I use it for both development and to present product to clients. It also hosts my company website. I will be loading MS Server 2008 and MS SQL 2008. I want it to have the latest.NET Framework as well as ...
[ "ajax", "webserver", "visual-web-developer", "rebuild" ]
1
3
227
2
0
2008-10-10T15:20:29.170000
2008-10-10T15:25:27.913000
191,845
191,863
How to store images in your filesystem
Currently, I've got images (max. 6MB) stored as BLOB in a InnoDB table. As the size of the data is growing, the nightly backup is growing slower and slower hindering normal performance. So, the binary data needs to go to the file system. (pointers to the files will be kept in the DB.) The data has a tree like relation:...
Just split your userid from behind. e.g. UserID = 6435624 Path = /images/24/56/6435624 As for the backup you could use MySQL Replication and backup the slave database to avoid problems (e.g. locks) while backuping.
How to store images in your filesystem Currently, I've got images (max. 6MB) stored as BLOB in a InnoDB table. As the size of the data is growing, the nightly backup is growing slower and slower hindering normal performance. So, the binary data needs to go to the file system. (pointers to the files will be kept in the ...
TITLE: How to store images in your filesystem QUESTION: Currently, I've got images (max. 6MB) stored as BLOB in a InnoDB table. As the size of the data is growing, the nightly backup is growing slower and slower hindering normal performance. So, the binary data needs to go to the file system. (pointers to the files wi...
[ "database", "data-structures", "blob", "file-organization" ]
31
23
14,397
3
0
2008-10-10T15:23:17.200000
2008-10-10T15:26:29.690000
191,855
191,964
How do I determine what files in my ClearCase local view have not yet been added to source control?
If I have added/removed/modified a large number of files in my local ClearCase view, how can I be certain that all the files have been added to source control?
Your answer is correct, for snapshot views (which you call 'local view'?) In a dynamic view, a simple cleartool lsprivate would suffice. But that would leave out hijacked files (which are already added to source control, but may have been modified without ClearCase knowing it) So I would recommend to complete your comm...
How do I determine what files in my ClearCase local view have not yet been added to source control? If I have added/removed/modified a large number of files in my local ClearCase view, how can I be certain that all the files have been added to source control?
TITLE: How do I determine what files in my ClearCase local view have not yet been added to source control? QUESTION: If I have added/removed/modified a large number of files in my local ClearCase view, how can I be certain that all the files have been added to source control? ANSWER: Your answer is correct, for snaps...
[ "version-control", "clearcase" ]
14
8
10,874
3
0
2008-10-10T15:25:21.330000
2008-10-10T15:47:34.297000
191,861
191,902
"Class not Registered" restoring a Sharepoint ( WSS ) 2003 backup.dat file
I need to do some work with a backup WSS.dat file and I'm having real trouble making it do anything. I've got it installed through stsadm and that appears to have gone smoothly, but the site now redirects me to an error page - just the classic "File Not Found" one, but in the URL it suggests the errortext would be "Cla...
Here is what I do in such a case: Use procmon to track down registry usage. Have an eye on HKCR\CLSID and NAME NOT FOUND results therein. Take note of the CLSIDs it is not finding, Google them up to get a clue if they might have to do with your problem. Find out which.dll provides them, and register that.dll with regsv...
"Class not Registered" restoring a Sharepoint ( WSS ) 2003 backup.dat file I need to do some work with a backup WSS.dat file and I'm having real trouble making it do anything. I've got it installed through stsadm and that appears to have gone smoothly, but the site now redirects me to an error page - just the classic "...
TITLE: "Class not Registered" restoring a Sharepoint ( WSS ) 2003 backup.dat file QUESTION: I need to do some work with a backup WSS.dat file and I'm having real trouble making it do anything. I've got it installed through stsadm and that appears to have gone smoothly, but the site now redirects me to an error page - ...
[ "sharepoint", "backup", "wss", "restore" ]
0
0
570
1
0
2008-10-10T15:26:21.750000
2008-10-10T15:33:31.097000
191,873
191,908
Determining 64-bit vs. 32-bit Windows
I'd like to configure visual studio 2005 to copy.dll's based on whether the OS is 64-bit or 32-bit during a build. I do not want to specify what the platform target is. My first attempt was to use a batch file to lookup the Windows version, but some 32-bit and 64-bit versions of Windows share the same version number. A...
You should be able to read the environment variable %PROCESSOR_ARCHITECTURE%. Here is some great information on it. http://blogs.msdn.com/david.wang/archive/2006/03/26/HOWTO-Detect-Process-Bitness.aspx
Determining 64-bit vs. 32-bit Windows I'd like to configure visual studio 2005 to copy.dll's based on whether the OS is 64-bit or 32-bit during a build. I do not want to specify what the platform target is. My first attempt was to use a batch file to lookup the Windows version, but some 32-bit and 64-bit versions of Wi...
TITLE: Determining 64-bit vs. 32-bit Windows QUESTION: I'd like to configure visual studio 2005 to copy.dll's based on whether the OS is 64-bit or 32-bit during a build. I do not want to specify what the platform target is. My first attempt was to use a batch file to lookup the Windows version, but some 32-bit and 64-...
[ "windows", "visual-studio-2005", "64-bit", "32-bit" ]
12
7
5,855
3
0
2008-10-10T15:28:12.230000
2008-10-10T15:34:42.373000