instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
We have made use of Passolo for a number of years, but it's kind of clunky and overpriced. It's got to be able to handle winforms and WPF.... Are there any open source alternatives?
stackexchange/codereview
I'm looking to replace a couple of machines in the office with a more powerful multi-processor machine running either VMware or Microsoft's Hyper-V with a view to hosting a mix of Windows Server 2003, Windows Server 2008 and Linux operating systems. The machines are used mainly for testing ASP.Net or Perl web sites. I ...
stackexchange/codereview
I have some strings of xxh:yym format where xx is hours and yy is minutes like "05h:30m". What is an elegant way to convert a string of this type to TimeSpan?
stackexchange/codereview
Our dev shop currently uses Visual SourceSafe. We all know how that could end up (badly), so we're investigating other systems. First up is Perforce. Does anyone have experience with using it and its integration into Visual Studio (2003/2005/2008)? Is it as good as any other, or is it pretty solid with good features, c...
stackexchange/codereview
Why does the following code not work as I was expecting? <?php $data = array( array('Area1', null, null), array(null, 'Section1', null), array(null, null, 'Location1'), array('Area2', null, null), array(null, 'Section2', null), array(null, null, 'Location2') ); $root = array(); foreach ($data as...
stackexchange/codereview
As many of you probably know, online banks nowadays have a security system whereby you are asked some personal questions before you even enter your password. Once you have answered them, you can choose for the bank to "remember this computer" so that in the future you can login by only entering your password. How does...
stackexchange/codereview
Can anyone out there recommend a good online resource for CSS 'design patterns'? I know design patterns in a software context usually refer to OO based design patterns, but I mean design patterns in the broader sense of the term: i.e. common, clean solutions to common problems / tasks. An example of such a resource wou...
stackexchange/codereview
I'm looking for a clear, concise and accurate answer. Ideally as the actual answer, although links to good explanations welcome. This also applies to VB.Net, but the keywords are different - ByRef and ByVal.
stackexchange/codereview
Summary Hi All, OK, further into my adventures with custom controls... In summary, here is that I have learned of three main "classes" of custom controls. Please feel free to correct me if any of this is wrong! UserControls - Which inherit from UserControl and are contained within an ASCX file. These are pretty limite...
stackexchange/codereview
I have an array of objects that when another object hits one of them, the object will be removed. I have removed it from the stage using removeChild() and removed from the array using splice(), but somehow the object is still calling some of its functions which is causing errors. How do I completely get rid of an objec...
stackexchange/codereview
Continuing my problem from yesterday, the Silverlight datagrid I have from this issue is now causing Stack Overflow errors when sorting a column with a large amount of data (Like the text column that contains a where clause for a SQL statment). When you sort, it'll fire the SelectedIndexChanged event for the datagrid ...
stackexchange/codereview
I need to know if it is possible to dynamically bind a textbox residing within a datarepeater to a 'dynamically' created BindingSource. I am using VB.net. The database I am using is a MySQL database. I have to use the connection dynamically due to the fact that the database my not permanently reside on the same ser...
stackexchange/codereview
I have a DataSet which I get a DataTable from that I am being passed back from a function call. It has 15-20 columns, however I only want 10 columns of the data. Is there a way to remove those columns that I don't want, copy the DataTable to another that has only the columns defined that I want or is it just better to ...
stackexchange/codereview
I have a bulletin board (punBB based) that I was running out of the root directory for a couple of years. I foolishly decided to do a little gardening and in the process moved the punbb code into it's own subdirectory. The code works great; as long as you point the browser at the new subdirectory. The issue is that the...
stackexchange/codereview
How can I drop all tables whose names begin with a given string? I think this can be done with some dynamic SQL and the INFORMATION_SCHEMA tables.
stackexchange/codereview
Possible Duplicate: How can I register a global hot key to say CTRL+SHIFT+(LETTER) using WPF and .NET 3.5? I'd like to have multiple global hotkeys in my new app (to control the app from anywhere in windows), and all of the given sources/solutions I found on the web seem to provide with a sort of a limping solution ...
stackexchange/codereview
Maybe the need to do this is a 'design smell' but thinking about another question, I was wondering what the cleanest way to implement the inverse of this: foreach(ISomethingable somethingableClass in collectionOfRelatedObjects) { somethingableClass.DoSomething(); } i.e. How to get/iterate through all the objects tha...
stackexchange/codereview
I've seen examples like this: public class MaxSeconds { public static final int MAX_SECONDS = 25; } and supposed that I could have a Constants class to wrap constants in, declaring them static final. I know practically no Java at all and am wondering if this is the best way to create constants.
stackexchange/codereview
Because Linux (and its variants) have a completely different set of fonts than Windows and Mac OS X, is there anyone with any experience of creating cross-platform font families - ideally finding equivalents to the common fonts found on the aforementioned operating systems? If so, what is the best route to take?
stackexchange/codereview
I recently "needed" a zip function in Perl 5 (while I was thinking about How do I calculate relative time?), i.e. a function that takes two lists and "zips" them together to one list, interleaving the elements. (Pseudo)example: @a=(1, 2, 3); @b=('apple', 'orange', 'grape'); zip @a, @b; # (1, 'apple', 2, 'orange', 3, '...
stackexchange/codereview
I need to query an Exchange server to find all messages having a certain value in PR_SEARCH_KEY. Do I have to open every mailbox and iterate through it or is there a faster solution? Edit: This is for a program that needs to prepend something to the subject line of all copies of a message I got through a journal mailbo...
stackexchange/codereview
I have a script for OS X 10.5 that focuses the Search box in the Help menu of any application. I have it on a key combination and, much like Spotlight, I want it to toggle when I run the script. So, I want to detect if the search box is already focused for typing, and if so, type Esc instead of clicking the Help menu...
stackexchange/codereview
I have three models: class ReleaseItem < ActiveRecord::Base has_many :pack_release_items has_one :pack, :through => :pack_release_items end class Pack < ActiveRecord::Base has_many :pack_release_items has_many :release_items, :through=>:pack_release_items end class PackReleaseItem < ActiveRecord::Base belon...
stackexchange/codereview
I know how to do this if I iterate through all of the characters in the string but I am looking for a more elegant method.
stackexchange/codereview
I need to store contact information for users. I want to present this data on the page as an hCard and downloadable as a vCard. I'd also like to be able to search the database by phone number, email, etc. What do you think is the best way to store this data? Since users could have multiple addresses, etc complete norm...
stackexchange/codereview
If I get an error code result from a Cocoa function, is there any easy way to figure out what it means (other than by grepping through all the .h files in the framework bundles)?
stackexchange/codereview
I have 3 Linux machines, and want some way to keep the dotfiles in their home directories in sync. Some files, like .vimrc, are the same across all 3 machines, and some are unique to each machine. I've used SVN before, but all the buzz about DVCSs makes me think I should try one - is there a particular one that would w...
stackexchange/codereview
I'm trying to check, using an automated discovery tool, when JAR files in remote J2EE application servers have changed content. Currently, the system downloads the whole JAR using WMI to checksum it locally, which is slow for large JARs. For UNIXy servers (and Windows servers with Cygwin), I can just log in over SSH an...
stackexchange/codereview
I'm trying to get only the list of id of object bob for example instead of the list of bob. It's ok with a HQL request, but I would know if it's possible using criteria ? An example : final StringBuilder hql = new StringBuilder(); hql.append( "select bob.id from " ) .append( bob.class.getName() ).append( " bob " ) ...
stackexchange/codereview
I have a core dump file from a process that has probably a file descriptor leak (it opens files and sockets but apparently sometimes forgets to close some of them). Is there a way to find out which files and sockets the process had opened before crashing? I can't easily reproduce the crash, so analyzing the core file s...
stackexchange/codereview
I admit I know enough about COM and IE architecture only to be dangerous. I have a working C# .NET ActiveX control similar to this: using System; using System.Runtime.InteropServices; using BrowseUI; using mshtml; using SHDocVw; using Microsoft.Win32; namespace CTI { public interface CTIActiveXInterfa...
stackexchange/codereview
My users use the site pretty equally 24/7. Is there a meme for build timing? International audience, single cluster of servers on eastern time, but gets hit well into the morning, by international clients. 1 db, several web servers, so if no db, simple, whenever. But when the site has to come down, when would you, as a...
stackexchange/codereview
I have an MS Access database, how can I determine which encoding characters are used in the database?
stackexchange/codereview
I've to admin a small website for my alumni group which is hosted by my ISV. The url is something like www.myIsv.com/myWebSite/ which is quite ugly and very forgetable. The main admin of the webserver has registered a domain name www.mysmallwebsite.com and put a index.html with this content: <html> <head> <title>www.my...
stackexchange/codereview
Have been trying out the new Dynamic Data site create tool that shipped with .NET 3.5. The tool uses LINQ Datasources to get the data from the database using a .dmbl context file for a reference. I am interseted in customizing a data grid but I need to show data from more than one table. Does anyone know how to do th...
stackexchange/codereview
I've been running Tomcat 5.5 with Java 1.4 for a while now with a huge webapp. Most of the time it runs fine, but sometimes it will just hang, with no exception generated, and no apparant way of getting it to run again other than re-starting Tomcat. The tomcat instance is allowed a gigabyte of memory on the heap, but...
stackexchange/codereview
I need to get the number of digits containing the number 1. I know in java I can take the input as a String and use charAt, but I understand there is no implicit String function in C. How can I accomplish this?
stackexchange/codereview
I've encountered an interesting problem while developing for our legacy XWindows application. For reasons that don't bear explaining, I am sending ClientMessage from a comand-line utility to a GUI app.Most of the messages end up having the same contents, as the message's purpose is to trigger a synchronous communicatio...
stackexchange/codereview
Greetings, I'm trying to find a way to 'unbind' a socket from a particular IP/Port combination. My pseudocode looks like this: ClassA a = new ClassA(); //(class A instantiates socket and binds it to 127.0.0.1:4567) //do something //...much later, a has been garbage-collected away. ClassA aa = new ClassA(); //crash...
stackexchange/codereview
How do I have two effects in jQuery run in sequence, not simultaneously? Take this piece of code for example: $("#show-projects").click(function() { $(".page:visible").fadeOut("normal"); $("#projects").fadeIn("normal"); }); The fadeOut and the fadeIn run simultaneously, how do I make them run one after the oth...
stackexchange/codereview
Google custom search code is provided as a form tag. However, Asp.net only allows a single form tag on a page. What is the best way to implement their code so you can include it on an aspx page (say as part of a Masterpage or navigation element).
stackexchange/codereview
I'm desperately looking for cheap ways to lower the build times on my home PC. I just read an article about disabling the Last Access Time attribute of a file on Windows XP, so that simple reads don't write anything back to disk. It's really simple too. At a DOS-prompt write: fsutil behavior set disablelastaccess 1 H...
stackexchange/codereview
What is the best, preferably free/open source tool for auto-generating Java unit-tests? I know, the unit-tests cannot really serve the same purpose as normal TDD Unit-Tests which document and drive the design of the system. However auto-generated unit-tests can be useful if you have a huge legacy codebase and want to k...
stackexchange/codereview
I would like to have a Guile script, which implements functions, which output test result messages according to the TAP protocol.
stackexchange/codereview
I have a webapp that uses JNDI lookups to get a connection to the database. The connection works fine and returns the query no problems. The issue us that the connection does not close properly and is stuck in the 'sleep' mode (according to mysql administrator). This means that they become unusable nad then I run out o...
stackexchange/codereview
I have a number of users with multi-megabyte files that need to be processed before they can be uploaded. I am trying to find a way to do this without having to install any executable software on their machines. If every machine shipped with, say, Python it would be easy. I could have a Python script do everything. Th...
stackexchange/codereview
When I am working with ASP.NET, I find that there are always unexpected things I run into that take forever to debug. I figure that having a consolidated list of these would be great for those "weird error" circumstances, plus to expand our knowledge of oddness in the platform. So: answer with one of your "Gotcha"s! I'...
stackexchange/codereview
What's the best way to clone a control in Silverlight (including it's children)? UPDATE Is there a better way in Silverlight 2?
stackexchange/codereview
Courses for people who are being introduced to programming very often include a code project, which I think is a nice way to learn. However, such projects often feel too artificial, and are thus not very rewarding to work on. What are your ideas of rewarding code projects? (Preferably easy to begin, and extendable at w...
stackexchange/codereview
I am recently in charge of an older app written in C# using asp.net 1.1. Are there any resources to guide me in converting the application to a newer version of of the .NET Framework. My main pause is that there are ton's of customized DataGrids in the app as it is written now and since so much of the code needs to...
stackexchange/codereview
I've created an Access 2007 form that displays, for example, Products from a Product table. One of the fields in the Product table is a CategoryID that corresponds to this product's parent category. In the form, the CategoryID needs to be represented as a combo box that is bound to the Category table. The idea here i...
stackexchange/codereview
In an embedded application (written in C, on a 32-bit processor) with hard real-time constraints, the execution time of critical code (specially interrupts) needs to be constant. How do you insure that time variability is not introduced in the execution of the code, specifically due to the processor's caches (be it L1,...
stackexchange/codereview
In Javascript: How does one find the coordinates (x, y, height, width) of every link in a webpage?
stackexchange/codereview
I'm doing a fair bit of work in Ruby recently, and using ruby script/console Is absolutely critical. However, I'm really disappointed with the default Windows console in Vista, especially in that there's a really annoying bug where moving the cursor back when at the bottom of the screen irregularly causes it to jump ...
stackexchange/codereview
I already have an entity model in a separate dll that contains various objects that I need to use. I don't really want to create or duplicate entities using the EF designer. Instead I would like to configure it so that when I call a stored procedure it will map certain columns to specific properties. I know you can do ...
stackexchange/codereview
I am just starting out with DI & unit testing and have hit a snag which I am sure is a no brainer for those more experienced devs : I have a class called MessageManager which receives data and saves it to a db. Within the same assembly (project in Visual Studio) I have created a repository interface with all the method...
stackexchange/codereview
Most of our Eclipse projects have multiple source folders, for example: src/main/java src/test/java When you right-click on a class and choose New JUnit Test, the default source folder for the new test is "src/main/java" (presumably the first source folder listed in the project properties). Is there any way to change...
stackexchange/codereview
I'm using Flash to play an .flv movieclip on my site, but I want to have the .swf send trigger an event in my javascript when it start loading, starts playing and ends playing. What is the best way to do that in Flash CS3 using Actionscript 3.0 ?
stackexchange/codereview
I would like to convert the following string into an array/nested array: str = "[[this, is],[a, nested],[array]]" newarray = # this is what I need help with! newarray.inspect # => [['this','is'],['a','nested'],['array']]
stackexchange/codereview
How can I split long commands over multiple lines in a batch file?
stackexchange/codereview
My DataView is acting funny and it is sorting things alphabetically and I need it to sort things numerically. I have looked all across the web for this one and found many ideas on how to sort it with ICompare, but nothing really solid. So my questions are How do I implement ICompare on a DataView (Looking for code h...
stackexchange/codereview
I'm using jquery ajax to post updates back to my server. I'm concerned about making sure I have put in place appropriate measures so that only my AJAX calls can post data. My stack is PHP on Apache against a MySQL backend. Advice greatly appreciated!
stackexchange/codereview
When attempting to print using the SSRS Viewer Web Part in SharePoint I get the following error. An error occured during printing. (0x8007F303) The settings we are using in this box (production) are exactly the same as the settings in testing where this works perfectly fine. Anyone have any good ideas or faced this ...
stackexchange/codereview
When someone logs into a site using Open ID, what goes on behind the scene? can someone explain to me the work flow/steps of what happens during a typical login from a partner open ID site? (like this site) i.e. when I login at myopenid, what is passed into this site? how does SO know it was a correct login?
stackexchange/codereview
I want to download a lot of urls in a script but I do not want to save the ones that lead to HTTP errors. As far as I can tell from the man pages, neither curl or wget provide such functionality. Does anyone know about another downloader who does?
stackexchange/codereview
I would like to compile a DLL under Visual Studio 2008 that depends on msvcr90.dll as a private assembly (basically I'll dump this DLL into the same directory as my application) without needing an external manifest file. I followed the steps outlined in http://msdn.microsoft.com/en-us/library/ms235291.aspx section "Dep...
stackexchange/codereview
I want to have a text box that the user can type in that shows an Ajax-populated list of my model's names, and then when the user selects one I want the HTML to save the model's ID, and use that when the form is submitted. I've been poking at the auto_complete plugin that got excised in Rails 2, but it seems to have no...
stackexchange/codereview
We have simple HTML form with <input type="file">, like shown below: <form> <label for="attachment">Attachment:</label> <input type="file" name="attachment" id="attachment"> <input type="submit"> </form> In IE7 (and probably all famous browsers, including old Firefox 2), if we submit a file like '//server1/path/...
stackexchange/codereview
In my web application I include all of my JavaScripts as js files that are embedded resources in the assembly, and add them to the page using ClientScriptManager.GetWebResourceUrl(). However, in some of my js files, I have references to other static assets like image urls. I would like to make those assembly resources ...
stackexchange/codereview
I'm currently working on a quite large library (5M lines of code, in C++ under VS2005, 1 solution and close to 100 projects). Even though we distribute compilation, and use incremental linking, recompilation and relinking after small source modifications takes between a few minutes (usually at least 3) and close to one...
stackexchange/codereview
THis is a followup to my previous question "Font-dependent control positioning." It's an attempt to solve the real problem behind that question, perhaps in ways different than the one I was asking about. Example of the problem statement: I want a checkbox that says "Adjust prices by <X> <Y> after loading," where <X> is...
stackexchange/codereview
Using MVC out of the box I found the generated URLs can be misleading and I wanted to know if this can be fixed or if my approach/understanding is wrong. Suppose I have a CreateEgg page, which has a form on it, and once the form is filled in and submitted the user is taken to a ListEggs page with the new egg in it. So ...
stackexchange/codereview
Given an Oracle table created using the following: CREATE TABLE Log(WhenAdded TIMESTAMP(6) WITH TIME ZONE); Using the Python ODBC module from its Win32 extensions (from the win32all package), I tried the following: import dbi, odbc connection = odbc.odbc("Driver=Oracle in OraHome92;Dbq=SERVER;Uid=USER;Pwd=PASSWD") c...
stackexchange/codereview
Something to take an XML schema and let you add/edit data but not change the XML structure, preferably installed on a server. basically a UI to edit xml documents as a web app. Someone has got to have done this already right?
stackexchange/codereview
If you were to mandate a minimum percentage code-coverage for unit tests, perhaps even as a requirement for committing to a repository, what would it be? Please explain how you arrived at your answer (since if all you did was pick a number, then I could have done that all by myself ;)
stackexchange/codereview
What is the best way to track changes in a database table? Imagine you got an application in which users (in the context of the application not DB users ) are able to change data which are store in some database table. What's the best way to track a history of all changes, so that you can show which user at what time c...
stackexchange/codereview
Do any asynchronous connectors exist for Mysql that can be used within a C or C++ application? I'm looking for something that can be plugged into a reactor pattern written in Boost.Asio. [Edit:] Running a synchronous connector in threads is not an option.
stackexchange/codereview
I'm trying to test a simple WebForms (asp.net) based UI, and follow the MVP pattern to allow my UI to be more testable. As I follow the TDD methodology for backend algorithms, I find that there are some unit test refactorings that happen in the spirit of the DRY principle (Don't Repeat Yourself). As I try to apply thi...
stackexchange/codereview
Are people still writing SOAP services or is it a technology that has passed its architectural shelf life? Are people returning to binary formats?
stackexchange/codereview
How do I cast an int to an enum in C#?
stackexchange/codereview
I have a very large code base that contains extensive unit tests (using CppUnit). I need to work out what percentage of the code is exercised by these tests, and (ideally) generate some sort of report that tells me on a per-library or per-file basis, how much of the code was exercised. Here's the kicker: this has to ru...
stackexchange/codereview
Suppose you have an ActiveRecord::Observer in one of your Ruby on Rails applications - how do you test this observer with rSpec?
stackexchange/codereview
How to you find the URL that represents the documentation of a .NET framework method on the MSDN website? For example, I want to embed the URL for the .NET framework method into some comments in some code. The normal "mangled" URL that one gets searching MSDN isn't very friendly looking: http://msdn.microsoft.com/libr...
stackexchange/codereview
During a typical day programming, I implement functions in a way that I would like to remember. For instance, say I tuned a DB insert function that, when I come across the situation again, I want to find what I did to resuse. I need a place to keep the solution(what I did), and I need to find it somehow, which may be m...
stackexchange/codereview
I'm executing stored procedures using SET FMTONLY ON, in order to emulate what our code generator does. However, it seems that the results are cached when executed like this, as I'm still getting a Conversion failed error from a proc that I have just dropped! This happens even when I execute the proc without SET FMTON...
stackexchange/codereview
I am working with ASP.net. I am trying to call a method that exists on the base class for the page I am using. I want to call this method via Javascript and do not require any rendering to be handled by ASP.net. What would be the easiest way to accomplish this. I have looked at PageMethods which for some reason are no...
stackexchange/codereview
I need to select data when a page is viewed and update the 'views' column is there a way to do this in one query, or do I have to use to distinct queries?
stackexchange/codereview
In the following snippet: public class a { public void otherMethod(){} public void doStuff(String str, InnerClass b){} public void method(a){ doStuff("asd", new InnerClass(){ public void innerMethod(){ otherMethod(); } } ...
stackexchange/codereview
I'm currently looping through a datareader and calling the System.Net.Mail.SmtpClient's Send() method. The problem with this is that it's slow. Each email takes about 5-10 seconds to send (it's possible this is just an issue with my host). I had to override the executionTimeout default in my web.config file (it default...
stackexchange/codereview
I'm trying to come up with a design for a thread pool with a lot of design requirements for my job. This is a real problem for working software, and it's a difficult task. I have a working implementation but I'd like to throw this out to SO and see what interesting ideas people can come up with, so that I can compare ...
stackexchange/codereview
Say you want a simple maze on an N by M grid, with one path through, and a good number of dead ends, but that looks "right" (i.e. like someone made it by hand without too many little tiny dead ends and all that). Is there a known way to do this?
stackexchange/codereview
I'm responsible for some test database servers. Historically, too many other poeple have access to them. They run on SQL Server 2005. I've been writing queries and wrapping them in scripts so I can run a regular audit of rights. Finding out which users had Administrator rights on the server itself was fine, as was...
stackexchange/codereview
Is there any visible progress? Is it now just an academic exercise? Do you believe Perl will continue to evolve with or without Perl 6 or will soon be forgotten?
stackexchange/codereview
We are looking for a C++ Soap web services framework that support RPC, preferably open source. Any recommendations?
stackexchange/codereview
I found the ad on this site to Krypton controls (and here's another one!) and was wondering if any of you using vs.net 05 or 08 are using them and how that's working out. If you're answering, please specify which parts you're using (free, ribbons, tabs) and which vs.net you're on, which language(s) you use, along with ...
stackexchange/codereview
Suppose you have the following EJB 3 interfaces/classes: public interface Repository<E> { public void delete(E entity); } public abstract class AbstractRepository<E> implements Repository<E> { public void delete(E entity){ //... } } public interface FooRepository<Foo> { //other methods } @Local(Fo...
stackexchange/codereview
In Oracle I can declare a reference cursor... TYPE t_spool IS REF CURSOR RETURN spool%ROWTYPE; ...and use it to pass a cursor as the return value... FUNCTION end_spool RETURN t_spool AS v_spool t_spool; BEGIN COMMIT; OPEN v_spool FOR SELECT * FROM...
stackexchange/codereview
I am introducing automated integration testing to a mature application that until now has only been manually tested. The app is Windows based and talks to a MySQL database. What is the best way (including details of any tools recommended) to keep tests independent of each other in terms of the database transactions tha...
stackexchange/codereview
I have a function where I need to do something to a string. I need the function to return a boolean indicating whether or not the operation succeeded, and I also need to return the modified string. In C#, I would use an out parameter for the string, but there is no equivalent in Python. I'm still very new to Python...
stackexchange/codereview
I'm just getting dirty in WinForms, and I've discovered, through a lovely tutorial, the magic of dragging a database table onto the design view of my main form. So, all is lovely, I've got my DataGridView with all of the columns represented beautifully. BUT... When I run my application against this brand new, empty .sd...
stackexchange/codereview