instruction
stringlengths
0
30k
Perhaps you should look at having both client-side and server-side validation. If anything slips past the client-side validation you can then feel free to throw an exception if your business object would be made invalid. One approach I've used was to apply custom attributes to business object properties, which descr...
Reporting Services Deployment
|reporting-services|deployment|
I need to create a repeatable process for deploying SQL Server Reporting Services reports. I am not in favor of using Visual Studio and or Business Development Studio to do this. The rs.exe method of scripting deployments also seems rather clunky. Does anyone have a very elegant way that they have been able to deplo...
|deployment|reporting-services|
I need to create a repeatable process for deploying SQL Server Reporting Services reports. I am not in favor of using Visual Studio and or Business Development Studio to do this. The rs.exe method of scripting deployments also seems rather clunky. Does anyone have a very elegant way that they have been able to deplo...
as a SingleCall type, your SampleObject will be created for every call the client makes. This suggests to me that your object is at fault, and you don't show what it does. You need to look at any dependancies it has on shared resources orlocks. Try writing some debug out in the SampleObject's constructor to see how far...
Time Parsing in Flex
|apache-flex|time|parse|
Is there any way to parse a string in the format HH:MM into a Date (or other) object using the standard libraries? I know that I can parse something like "9/17/2008 10:30" into a Date object using var date:Date = new Date(Date.parse("9/17/2008 10:30"); But I want to parse just 10:30 by itself. The followi...
|apache-flex|parsing|date|time|
Too lazy to actually write it up myself, but you should be able to use a mathematical converter and bind to your parent windows width (either by name, or with a RelativeSource ancestor search). //I know I borrowed this from someone, sorry I forgot to add a comment from whom public class ScaledValueConvert...
Have you considered prepending "01/01/2000 " to the time string and then applying Date? Alternately there's probably a tokenizer that will take the input and split it up at the : giving you an array of strings you can convert to integers. A tokenizer isn't hard to write, either, and can be fun if one doesn't exist ...
Microsoft has never made those claims but they ARE making moves in the WORA arena. Silverlight 2.0 for example will use a subset of the .NET framework and be available on Windows, Linux (through the Moonlight project), MacOS, Windows Mobile, and Nokia handsets. As others have mentioned, the Mono project has also bro...
While not solving the problem of brute force (as others already mentioned) you might want to sort your numbers first, and then go over the possible ones left (since once you passed Sum value, you can't add any number larger than Goal - Sum). This will change the way you implement your algorithm (in order to sort onl...
CLR via C# by Jeffrey Richter goes into depth about generics, and is one of the priceless resources every .NET developer should own and read.
C++ API for returning sequences in a generic way
|c++|generics|api|sequences|
If I am writing a library and I have a function that needs to return a sequence of values, I could do something like: std::vector<int> get_sequence(); However, this requires the library user to use the std::vector<> container rather than allowing them to use whatever container they want to use. In addition, ...
You can create some sort of index and it might get faster. We can build a index like this: Dictionary<char, List<ClassFoo>> indexByFirstLetter; foreach (var cf in collection) { indexByFirstLetter[cf.bar[0]] = indexByFirstLetter[cf.bar[0]] ?? new List<ClassFoo>(); indexByFirstLetter[cf.bar[0...
How is a web service request handled in ASP.Net
|asp.net|web-services|
When a client makes a web service request, how does asp.net assign an instance of the service class to handle that request? Is a new instance of the service class created per request or is there pooling happening or is there a singleton instance used to handle all requests?
Crystal Reports and LINQ
|.net|linq|linq-to-sql|reporting|crystal-reports|
Has anyone figured out how to use Crystal Reports with Linq to SQL?
Jython can also be used as an embedded scripting language within a Java program. You may find it useful at some point to write something with a built in extension language. If working with Java Jython is an option for this (Groovy is another). I have mainly used Jython for exploratory programming on Java systems...
If you're running on Windows you could look at [Distributed File Systems][1] [1]: http://en.wikipedia.org/wiki/Distributed_File_System_(Microsoft)
GPS APIs
|api|gps|
I'm looking for a GPS with a good API. I would like to be able to send an address to it, and tell it to navigate to that address. I also need to pull the current location from the GPS. I'd like to be able to do this with the GPS hooked up to a laptop by bluetooth or even just a USB cable. I've looked at the Dash ...
If you want to talk to a Garmin GPS, you can check out their [developer website][1]. They've got resources ranging from talking to Web Services all the way to doing low-level Serial & USB I/O to interface directly with the devices. [1]: http://developer.garmin.com
The Erlang programming language provides an easy-to-use style of concurrent programming. You may never actually use Erlang, but the concepts are transportable to other languages. You might want to read the book _Programming Erlang: Software for a Concurrent World_ .
The Erlang programming language provides an easy-to-use style of concurrent programming. You may never actually use Erlang, but the concepts are transportable to other languages. You might want to read the book _Programming Erlang: Software for a Concurrent World_ . Fans of functional programming claim that there ...
You need to use the DesktopDirectory special folder instead: `Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)` should give you the redirected directory.
Personalized icon next to the URL address in the browser's address bar?
|design|
How do I code for a company icon to appear on the left-side next to the URL address in the browser's address bar?
it loads www.whateveryouron.com/favicon.ico if your domain is robermyers.com, just put a favicon.ico 16px icon thats accessible, and you're in like flint. just try this [googles][1] or [stackoverflows][2] [1]: http://www.google.com/favicon.ico [2]: http://stackoverflow.com/favicon.ico
load a file on the webserver called [favicon.ico][1] [1]: http://stackoverflow.com/favicon.ico
You are looking for a [Favicon][1]. [1]: http://stackoverflow.com/questions/6642/preferred-way-to-use-favicons#6645
In a .net 2 winforms application, what's a good way to set the culture for the entire application? Setting CurrentThread.CurrentCulture for every new thread is repetitive and error-prone. Ideally I'd like to set it when the app starts and forget about it.
We made that change because we wanted a bit of symmetry with the [] indexer. The Eval() method uses reflection and looks into the model to retrieve values. The indexer only looks at items directly added to the dictionary.
How do you maintain java webapps in different staging environments?
|java|configuration|spring|web-applications|
You might have a set of properties that is used on the developer machine, which varies from developer to developer, another set for a staging environment, and yet another for the production environment. In a Spring application you may also have beans that you want to load in a local environment but not in a product...
Your problem does not concern XML: it concerns character encodings. What it comes down to is that every string, be it XML or otherwise, consists of bytes and you cannot know what characters these bytes represent, unless you are told what character encoding the string has. If, for instance, the supplier tells you it's U...
What version of Eclipse? Europa? Ganymede? What do you mean by workspace? An Eclipse workspace is not something you deploy, it holds your projects. You will need to generate a WAR file (or the folder of files that would comprise the WAR file), a project would typically include an ANT or Maven build script to do t...
Use web services to wrap common code / libraries that you want to share across the interfaces. All the listed platforms have decent support for webservices.
If you choose to create your own collection class you should check out the types in [System.Collections.ObjectModel Namespace](http://msdn.microsoft.com/en-us/library/system.collections.objectmodel.aspx). The namespace defines base classes thare are ment to make it easier for implementers to create a custom collect...
There are a couple of scenarios to consider: (a) if you are porting an existing application and wondering if Mono is good enough for this task; (b) you are starting to write some new code, and you want to know if Mono is mature enough. For the first case, you can use the Mono Migration Analyzer tool (Moma) to eval...
*Even with all the facts and processes in the world.. every decision boils down to a judgment call - Forgot where I read that* I think it's more of a experience / flight time call. Basically if you see the dependency as a candidate object that may be replaced in the near future, use dependency injection. If I see '...
You may also want to look at asynchronously downloading your tiles via one of the Ajax libraries available. Let's say your user can view 9 tiles at a time and scroll/zoom. Download those 9 tiles they can see plus whatever is needed to handle the zoom for those tiles on the first load; then you'll need to play around wi...
They hold all the form designer stuff that used to go in the #Region " Web Form Designer Generated Code " section of the code. instead of putting it in the .aspx.vb file where people might edit it (mistakenly or not), it's been moved to a separate file, so that you don't have ever look at it.
> Hey, look at what I found! > > http://gafter.blogspot.com/2007/03/compact-object-comparator.html Oh yes, I forgot about the IdentityHashMap (Java 6 and above only). Just have to pay attention at releasing your comparator.
You'd have the least problems running windows not in a VM, but for development your experience should be close to perfect with a VM. Both will give you less issues than MonoDevelop presumably, which is an entirely different CLR, compiler and a reimplementation of the framework.
Damn, I really thought you were talking about the operator all along. ;-) Anyway … > Does this If function perform better than the IIf function? Definitely. Remember, it's built into the language. Only one of the two conditional arguments has to be evaluated, potentially saving a costly operation. > Does the I...
TextMate + the [Flex and ActionScript 3 bundles][1] is a great combo. Throw in [ProjectPlus][2] and you have an almost full featured development environment. What's missing is visual design tools (which I'm sceptical of anyway), debugger (the command line version isn't very easy to work with) and a profiler. I've lo...
@amrox - If I am understanding your suggestion correctly, you're saying that I should bind a value to the hidden property of the NSTableColumns in my table? That seems like it would work, however I don't think that NSTableColumn has a hidden property, since the isHidden and setHidden messages control the visibility of ...
Well not really elegant. We created our own tool that uses the reportingservices2005 web service. We found this to be the most reliable way of getting what we want. It's not really that difficult and lets you expand it to do other things like creating data sources and folders as required.
We do this by shelling out to gnuplot to generate the charts as PNGs server-side. It's a bit old-school and the charts aren't interactive but it works and is cacheable. (The other reason we do this is so we can put exactly the same chart in the PDF version of the report).
Disable non-severe PL/SQL warnings: ALTER SESSION SET PLSQL_WARNINGS='ENABLE:SEVERE';
I very much like <a href="http://www.omnigroup.com/applications/Omnigraffle/">Omnigraffle</A>, with <A HREF="http://v1.garrettdimon.com/resources/templates-stencils-for-visio-omnigraffle">stencils</A> for UI design. More UI stencils are <A HREF="http://graffletopia.com/categories/user-interface">also available</A>. ...
Wouldn't (f.x = 1) be an expression evaluating to true, and thus, sizeof( f.x = 1) is asking for the size of true in terms of how many chars it would take to store it? I should also add that the Wikipedia article on [sizeof][1] is nice. In particular, they say "sizeof is a compile-time operator th...
Wouldn't (f.x = 1) be an expression evaluating to true (technically in evaluates to result of the assignment, which is 1/true in this case), and thus, sizeof( f.x = 1) is asking for the size of true in terms of how many chars it would take to store it? I should also add that the Wikipedia article o...
There is a great deal of language and UI framework specific resources available for people interested in building application UIs. However, before delving into specific technologies, there is much to be learned about Human-Computer Interaction and how it applies to user interface design. Some references to look at: ...
|java|tomcat|time|servlets|sockets|
Got the same problem but didn't found a good solution yet for detecting it automatically . Now im using PsPad (www.pspad.com) for that ;) Works fine
One way would be: (loop for word in word-list when (good-enough-score-p word) collect word) And another: (remove-if-not 'good-enough-score-p word-list) And yet another: (mapcan (lambda (word) (when (good-enough-score-p word) (list word))) word-list) Etc...
One way would be: (loop for word in word-list when (good-enough-score-p word) collect word) And another: (remove-if-not 'good-enough-score-p word-list) And yet another: (mapcan (lambda (word) (when (good-enough-score-p word) (list word))...
There are several built-in ways of doing this. One way would be: (remove-if-not 'good-enough-score-p word-list) And another: (loop for word in word-list when (good-enough-score-p word) collect word) And yet another: (mapcan (lambda (word) (when (good-eno...
Here is an example of how you might do that in Python, the concepts are similar in any language. >>> import urllib2, string >>> devilsdict = urllib2.urlopen('http://www.gutenberg.org/files/972/972.txt').read() >>> workinglist = devilsdict.split() >>> cleanlist = [item.strip(string.punctuation) for...
var cycleId = setInterval(cycleCharts, 10000, 4242); From the third parameter and onwards - they get passed into the function so in my example you send 4242 as the chartId. I know it might not be the answer to the question you posed, but it might the the solution to your problem? I think the value it gets is just ra...
It is quite simple, use JSR75 (FileConnection) and remember to sign your midlet with a valid (trusted) certificate.
I think you forgot to set the TransparencyKey of the area you want to be glass. From the article, > In your Windows Forms application, you > simply need to set the TransparencyKey > property to a color that you won't use > elsewhere in the application (I use > Gainsboro, for reasons that will > become apparen...
I love CarbonEmacs because it sticks very close to the standard GNU Emacs distribution, while still fitting in nicely with the Mac desktop. To me, it "felt" like Emacs on my Ubuntu desktop even if it looked like a Mac application.
Ruby - Exit Message
|ruby|
Since I got a quick response on the last Ruby [question][1] I asked, I have another one that's been bothering me. Is there a one line function call that quits the program and displays a message? I know in Perl its as simple as this: die("Message goes here") Essentially I'm just tired of typing this: pu...
Since I got a quick response on the last Ruby [question][1] I asked, I have another one that's been bothering me. Is there a one line function call that quits the program and displays a message? I know in Perl its as simple as this: die("Message goes here") Essentially I'm just tired of typing this: pu...
Since I got a quick response on the last Ruby [question][1] I asked, I have another one that's been bothering me. Is there a one line function call that quits the program and displays a message? I know in Perl its as simple as this: die("Message goes here") Essentially I'm just tired of typing this: pu...
Getting someone new to look at it.
The 'abort' function does this. For example: abort("Message goes here")
To sum it up: * There is [none in C#](http://www.google.com/search?hl=en&q=c%23+inputbox). * You can use the dialog from Visual Basic by adding a reference to Microsoft.VisualBasic: <ol> <li>In <strong>Solution Explorer</strong> right-click on the <strong>References</strong> folder.</li> <li>Select <stron...
Rails SSL Requirement plugin -- shouldn't it check to see if you're in production mode before redirecting to https?
|ruby-on-rails|ssl|https|
[Take a look at the ssl_requirement plugin.][1] Shouldn't it check to see if you're in production mode? We're seeing a redirect to https in development mode, which seems odd. Or is that the normal behavior for the plugin? I thought it behaved differently in the past. [1]: http://github.com/rails/ssl_requir...
There is an example in Oracle Documentation: <http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96612/d_obtoo2.htm> You do not need to close it DECLARE input_string VARCHAR2(16) := 'tigertigertigert'; raw_input RAW(128) := UTL_RAW.CAST_TO_RAW(input_string); k...
better command for Windows?
|windows|macos|command-line|terminal|
While I grew up using Windows, I transitioned to my much-loved Mac years ago. I don't want to start a flame war here on operating systems. I do, however, want a terminal a little closer to what I'm used to. I'm not asking for full POSIX support - I don't have the patience to install CygWing - but I miss tabbed ter...
Where is TFS work item help text displayed?
|visual-studio|tfs|
I'm creating some custom work items in TFS and the helptext field seems handy but I don't see where it is being displayed in Team Explorer or Team System Web Access. Where is this information displayed?
I know you said you don't want to install anything, but I strongly suggest you give Services For Unix a shot: <http://technet.microsoft.com/en-us/interopmigration/bb380242.aspx>
I'm using powershell, its awesome to keep you from going crazy, and it has rm and mkdir and ls. Tabbed terminals is still not in powershell, and copy paste is similar to cmd, but its way better than cmd.exe.
I'm using [powershell][1], its awesome to keep you from going crazy, and it has rm and mkdir and ls. Tabbed terminals is still not in powershell, and copy paste is similar to cmd, but its way better than cmd.exe. [1]: http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx
what about getting rid of the system menu and then putting it back in another place yourseld (say next to the close button etc.)?
[PowerCmd][1] is great, with a ton of features including tabs, cut/copy/past, etc. [Console][2] is also a great replacement and is a bit more stripped down than PowerCmd (which can sometimes be a little *too* feature rich. Also, with both of these, if you have powershell installed, it is possible to run powershel...
[PowerShell][1] is worth looking into. [1]: http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx