instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
What is the simplest SQL query to find the second largest integer value in a specific column? There are maybe duplicate values in the column.
stackexchange/codereview
I really feel that I should learn Lisp and there are plenty of good resources out there to help me do it. I'm not put off by the complicated syntax, but where in "traditional commercial programming" would I find places it would make sense to use it instead of a procedural language. Is there a commercial killer-app out ...
stackexchange/codereview
How would I change the initial templates created by Xcode when creating a new Cocoa Class. I am referring to the comments and class name created when using Xcode's new class wizard.
stackexchange/codereview
I would like to use something like CLR Profiles on .Net 2.0 to see what objects are taking more space in the heap at any given time (of an ASP.Net worker process). However, the CLR Profiler only lets me START an app, not attach to an existing one. I assume this is because it tracks allocations and GC too, but i'm not v...
stackexchange/codereview
What is the best Image Manager to integrate in TinyMce editor apart the official Moxiecode commercial ones? I'm looking to integrate a light texteditor in an asp.net mvc application and I choosed the Tinymce solution (and not the classic FCKEditor as this seems more lightweight and more jquery friendly). Sadly TinyMce ...
stackexchange/codereview
in C# I'd like to invoke the label edit of a newly added item to a ListView. basically, if I have a click here to add scenario, as soon as the new item is added, I want the text label to be in a user editable state. Thanks!
stackexchange/codereview
I am trying to code a flowchart generator for a language using Ruby. I wanted to know if there were any libraries that I could use to draw various shapes for the various flowchart elements and write out text to those shapes. I would really prefer not having to write code for drawing basic shapes, if I can help it. C...
stackexchange/codereview
a little new to the windows workflow stuff so go easy :) I wish to design a workflow host environment that has high availability - a minimum of 2 WF runtime hosts on separate hardware both pointing to the same persistance or tracking SQL database. I am looking for a pattern whereby I can asynchronously create new workf...
stackexchange/codereview
I'm aware of things like onchange, onmousedown and onmouseup but is there a good reference somewhere that lists all of them complete with possibly a list of the elements that they cover?
stackexchange/codereview
I am working on a new project. Is there any benefit with going with a WCF web service over a regular old fashion web service? Visual Studio offers templates for both. What are the differences? Pros and cons?
stackexchange/codereview
I'm looking for any way that I can improve the selector performance of a jQuery call. Specifically things like this: Is $("div.myclass") faster than $(".myclass") I would think it might be, but I don't know if jQuery is smart enough to limit the search by tag name first, etc. Anyone have any ideas for how to formulat...
stackexchange/codereview
My code needs to determine how long a particular process has been running. But it continues to fail with an access denied error message on the Process.StartTime request. This is a process running with a User's credentials (ie, not a high-privilege process). There's clearly a security setting or a policy setting, or som...
stackexchange/codereview
If I have a <input id="uploadFile" type="file" /> tag, and a submit button, how do I determine, in IE6 (and above) if a file has been selected by the user. In FF, I just do: var selected = document.getElementById("uploadBox").files.length > 0; But that doesn't work in IE.
stackexchange/codereview
I'm writing my first iPhone app, so I haven't gotten around to figuring out much in the way of debugging. Essentially my app displays an image and when touched plays a short sound. When compiling and building the project in XCode, everything builds successfully, but when the app is run in the iPhone simulator, it crash...
stackexchange/codereview
When I try to do any svn command and supply the --username and/or --password options, it prompts me for my password anyways, and always will attempt to use my current user instead of the one specified by --username. Neither --no-auth-cache nor --non-interactive have any effect on this. This is a problem because I'm try...
stackexchange/codereview
In the linux file system, where should user scripts be placed? I'm thinking specifically python scripts to be called by cron.
stackexchange/codereview
I have a product, X, which we deliver to a client, C every month, including bugfixes, enhancements, new development etc.) Each month, I am asked to err "guarantee" the quality of the product. For this we use a number of statistics garnered from the tests that we do, such as: reopen rate (number of bugs reopened/number...
stackexchange/codereview
I'm working on an application where users have to make a call and type a verification number with the keypad of their phone. I would like to be able to detect if the number they type is correct or not. The phone system does not have access to a list of valid numbers, but instead, it will validate the number against an ...
stackexchange/codereview
I am trying to get SpecUnit to run in a continuous integration build using Nant. At the moment the files are in the correct place but no output is generated from SpecUnit.Report.exe. Here is the relevant task from the nant build script: <echo message="**** Starting SpecUnit report generation ****" /> <copy file="${spec...
stackexchange/codereview
I really need to see some honest, thoughtful debate on the merits of the currently accepted enterprise application design paradigm. I am not convinced that entity objects should exist. By entity objects I mean the typical things we tend to build for our applications, like "Person", "Account", "Order", etc. My current d...
stackexchange/codereview
Is it possible to get UI text from an external application in C#. In particular, is there a way to read Unicode text from a label (I assume it's a normal Windows label control) from an external Win32 app that was written by a 3rd party? The text is visible, but not selectable by mouse in the UI. I assume there is some...
stackexchange/codereview
Given a (source) patch file, what's the easiest way to apply this patch on the source files under Windows? A GUI tool where I can visually compare the unchanged-changed source lines would be great.
stackexchange/codereview
Recently, I've been dealing with an error with accessing MAPI via the .NET framework (as described in this article). I am now left with a series of memory access violation errors. To get past the issues, I have been trying to use this 3rd party component, which has a Visual C++ core. Unfortunately - we are still having...
stackexchange/codereview
The company I used to work with has two developers working fulltime, and a handful of freelancers. They're in the process of hiring a new lead developer to try to bring order and management to the development. But, currently, one of the developers has seen the light of Django (the company has only developed in PHP to d...
stackexchange/codereview
I have an Interface called IStep that can do some computation (See "Execution in the Kingdom of Nouns"). At runtime, I want to select the appropriate implementation by class name. // use like this: IStep step = GetStep(sName);
stackexchange/codereview
I'm looking for a good way to enumerate all the Video codecs on a Windows XP/Vista machine. I need present the user with a set of video codecs, including the compressors and decompressors. The output would look something like Available Decoders DiVX Version 6.0 XVID Motion JPEG CompanyX's MPEG-2 Decoder Windows Media...
stackexchange/codereview
This error just started popping up all over our site. Permission denied to call method to Location.toString I'm seeing google posts that suggest that this is related to flash and our crossdomain.xml. What caused this to occur and how do you fix?
stackexchange/codereview
I've just started using the MVP pattern in the large ASP.NET application that I'm building (re-building actually) and I am having a hard time figuring out how I should be using Events applied to the view. Say I have 2 drop down lists in a User Control, where one is dependent on the other's value: <%@ Control Language="...
stackexchange/codereview
We are getting new dev machines and moving up to Vista 64 Ultimate to take advantage of our 8gb ram. Our manager wants us to do all dev in 32bit virtual machines to make sure there will be no problems with our code moving into production. Is there any way to guarantee the resultant programs will work on 32bit os's? ...
stackexchange/codereview
Ok, I asked a question earlier about Flex and ADO.NET Data Services but didn't get much response so I thought I'd rephrase. Does anyone have any experience building Adobe Flex applications with a .NET back-end? If so, what architecture did you use and what third-party tools if any did you employ. I've read a little ...
stackexchange/codereview
I have a C++ app that needs to connect to a JAVA web app, are there any good, open source SOAP packages for this, or would it be easier to just roll my own?
stackexchange/codereview
What do the result codes in SVN mean? I need a quick reference.
stackexchange/codereview
How do I create a branch in SVN?
stackexchange/codereview
A Windows process created from an exe file has access to the command string that invoked it, including its file's path and filename. eg. C:\MyApp\MyApp.exe --help. But this is not so for a DLL invoked via LoadLibrary. Does anyone know of a way for a function loaded via DLL to find out what its path and filename are? Sp...
stackexchange/codereview
As a novice in practicing test-driven development, I often end up in a quandary as to how to unit test persistence to a database. I know that technically this would be an integration test (not a unit test), but I want to find out the best strategies for the following: Testing queries. Testing inserts. How do I know t...
stackexchange/codereview
I am trying to snoop on a log file that an application is writing to. I have successfully hooked createfile with the detours library from MSR, but createfile never seems to be called with file I am interested in snooping on. I have also tried hooking openfile with the same results. I am not an experienced Windows/C++ ...
stackexchange/codereview
I need to set the height of every textbox on my form, some of which are nested within other controls. I thought I could do something like this: private static IEnumerator<TextBox> FindTextBoxes(Control rootControl) { foreach (Control control in rootControl.Controls) { if (control.Controls.Count > 0) ...
stackexchange/codereview
Does anyone know of a FOSS Python lib for generating Identicons? I've looked, but so far I haven't had much luck.
stackexchange/codereview
I would like to have a VM to look at how applications appear and to develop OS-specific applications, however, I want to keep all my code on my Windows machine so if I decide to nuke a VM or anything like that, it's all still there. If it matters, I'm using VirtualBox.
stackexchange/codereview
Possible Duplicate: NAnt or MSBuild, which one to choose and when? What is the best build tool for .NET? I currently use NAnt but only because I have experience with Ant. Is MSBuild preferred?
stackexchange/codereview
I have a Singleton/Factory object that I'd like to write a JUnit test for. The Factory method decides which implementing class to instantiate based upon a classname in a properties file on the classpath. If no properties file is found, or the properties file does not contain the classname key, then the class will insta...
stackexchange/codereview
For all the RSS feeds I subscribe to I use Google Reader, which I love. I do however have a couple of specific RSS feeds that I'd like to be notified of as soon as they get updated (say, for example, an RSS feed for a forum I like to monitor and respond to as quickly as possible). Are there any tools out there for thi...
stackexchange/codereview
The IE Developer Toolbar is a plugin that can dock or separate from the browser. I understand its much more difficult to do this in IE than in Firefox. How does one create an IE plugin? What languages are available for this task? How can I make a Hello World plugin?
stackexchange/codereview
Have you used VS.NET Architect Edition's Application and System diagrams to start designing a solution? If so, did you find it useful? Did the "automatic implementation" feature work ok?
stackexchange/codereview
I have always thought that the .equals() method in java should be overridden to be made specific to the class you have created. In other words to look for equivalence of two different instances rather than two references to the same instance. However I have encountered other programmers who seem to think that the defau...
stackexchange/codereview
In Eclipse 3.2.2 on Linux content assist is not finding classes within the same project. Upgrading above 3.2 is not an option as SWT is not available above 3.2 for Solaris. I have seen suggestions to clean the workspace, reopen the workspace, run eclipse with the -clean command, none of which has worked.
stackexchange/codereview
Is there a simple way of getting a HTML textarea and an input type="text" to render with (approximately) equal width (in pixels), that works in different browsers? A CSS/HTML solution would be brilliant. I would prefer not to have to use Javascript. Thanks /Erik
stackexchange/codereview
I'm a firm believer of the heretic thought of tight coupling between the backend and frontend: I want existing, implied knowledge about a backend to be automatically made use of when generating user interfaces. E.g., if a VARCHAR column has a maximum with of 20 characters, there GUIs should automatically constrain the ...
stackexchange/codereview
What I have so far is #!/bin/sh php_syntax_check() { retval=0 for i in $(git-diff-index --name-only --cached HEAD -- | grep -e '\.php$'); do if [ -f $i ]; then output=$(php -l $i) retval=$? if [ $retval -gt 0 ]; then echo "===========================...
stackexchange/codereview
When looking beyond the RAD (drag-drop and configure) way of building user interfaces that many tools encourage you are likely to come across three design patterns called Model-View-Controller, Model-View-Presenter and Model-View-ViewModel. My question has three parts to it: What issues do these patterns address? How ...
stackexchange/codereview
How can I set the background color of an HTML element using css in JavaScript?
stackexchange/codereview
I have taken over the development of a web application that is targeted at the .net 1.0 framework and is written in C# and Visual Basic. I decided that the first thing we need to do is refine the build process, I wrote build files for the C# projects, but am having tons of problems creating a build file for Visual Bas...
stackexchange/codereview
I'm trying to improve performance under high load and would like to implement opcode caching. Which of the following should I use? APC - Installation Guide eAccelerator - Installation Guide XCache - Installation Guide I'm also open to any other alternatives that have slipped under my radar. Currently running on a sto...
stackexchange/codereview
In Perl, what is a good way to perform a replacement on a string using a regular expression and store the value in a different variable, without changing the original? I usually just copy the string to a new variable then bind it to the s/// regex that does the replacement on the new string, but I was wondering if ther...
stackexchange/codereview
When restoring a SQL Server Database, I notice that there are 3 different Recovery States to choose from: Restore with Recovery Restore with No Recovery Restore with Standby I've always left it at it's default value, but what do they all mean? (Preferably in layman's terms)
stackexchange/codereview
I am running into an issue I had before; can't find my reference on how to solve it. Here is the issue. We encrypt the connection strings section in the app.config for our client application using code below: config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None) If config.Conne...
stackexchange/codereview
I'd like to take an existing application (written in OCaml) and create an Emacs "interface" for it (like, for example, the Emacs GDB mode). I would prefer to do this without writing a ton of Lisp code. In MVC terms, I'd like for the View to be Emacs, but for the Model and Controller to remain (primarily) OCaml. Does an...
stackexchange/codereview
I have a project group that contains a project I'm working on as well as some related component and packages. I prefer to keep the database links active during design-time. I know how to write the code which would change the database file location, but in this case, I'm just using ".\data" instead, for various design-...
stackexchange/codereview
I'm going to build an API for a web app and I'm interested in what people can suggest as good practices. I'm already planning to make it versioned (version 1 can only control certain aspects of the system, version 2 could control more, but this may need a change in the way authentication is performed that would be inco...
stackexchange/codereview
I'm working on bringing some old code from 1998 up to the 21st century. One of the first steps in the process is converting the printf statements to QString variables. No matter how many times I look back at printf though, I always end up forgetting one thing or the other. So, for fun, let's decode it together, for ...
stackexchange/codereview
I am working on a project right now that involves receiving a message from another application, formatting the contents of that message, and sending it to a printer. The technology of choice is C# windows service. The output could be called a report, I suppose, but a reporting engine is not necessary. A simple templ...
stackexchange/codereview
I'm using the .NETCF (Windows Mobile) Graphics class and the DrawString() method to render a single character to the screen. The problem is that I can't seem to get it centred properly. No matter what I set for the Y coordinate of the location of the string render, it always comes out lower than that and the larger the...
stackexchange/codereview
I use rsync to synchronize files to Windows clients in a server agnostic way. What methods are available to send the progress of rsync to the parent process for display in a gui progress bar? I imagine two or three choices exist. (1) Watch STDOUT (2) Watch rsync.exe log file, similar to unix tail (3) Watch rsync consol...
stackexchange/codereview
I joined a new company about a month ago. The company is rather small in size and has pretty strong "start-up" feel to it. I'm working as a Java developer on a team of 3 others. The company primarily sells a service to for businesses/business-type people to use in communicating with each other. One of the main things I...
stackexchange/codereview
Why does Visual Studio declare new classes as private in C#? I almost always switch them over to public, am I the crazy one?
stackexchange/codereview
I want to use the MultipleLookupField control in a web page that will run in the context of SharePoint. I was wondering if anyone would help me with an example, which shows step by step how to use the control two display two SPField Collections.
stackexchange/codereview
I was looking at the API documentation for stl vector, and noticed there was no method on the vector class that allowed the removal of an element with a certain value. This seems like a common operation, and it seems odd that there's no built in way to do this.
stackexchange/codereview
Looking for books or other references that discuss actually how to write a code coverage tool in Java; some of the various techniques or tricks - source vs. byte code instrumentation. This is for a scripting language that generates Java byte code under the hood.
stackexchange/codereview
I want to get the MD5 Hash of a string value in SQL Server 2005. I do this with the following command: SELECT HashBytes('MD5', 'HelloWorld') However, this returns a VarBinary instead of a VarChar value. If I attempt to convert 0x68E109F0F40CA72A15E05CC22786F8E6 into a VarChar I get há ðô§*à\Â'†øæ instead of 68E109F0F4...
stackexchange/codereview
Checkboxes in HTML forms don't have implicit labels with them. Adding an explicit label (some text) next to it doesn't toggle the checkbox. How do I make a checkbox toggle from clicking on the text label as well?
stackexchange/codereview
I am a web-developer working in PHP. I have some limited experience with using Test Driven Development in C# desktop applications. In that case we used nUnit for the unit testing framework. I would like to start using TDD in new projects but I'm really not sure where to begin. What recommendations do you have for a PH...
stackexchange/codereview
We have an encryption service that we've exposed over net. tcp. Most of the time, the service is used to encrypt/decrypt strings. However, every now and then, we the need to encrypt large documents (pdf, JPG, bmp, etc.). What are the best endpoint settings for a scenario like this? Should I accept/return a stream? I've...
stackexchange/codereview
What web site structure(s)/architecture(s) would the community swear by, with a narrowing down in the direction towards more of a small facebook style project? I understand the question to be rather broad/subjective; but being relatively new to the area of web development, I find just looking at and learning from examp...
stackexchange/codereview
I have been hearing a lot of good things about DVCS systems, in particular about bazaar. Apart from the concept of distributed repository, I see two main advantages being touted: the merge is better automated, and the rename is handled right. Could someone please point me at some text explaining how exactly the improve...
stackexchange/codereview
Is there a Regular Expression that can detect SQL in a string? Does anyone have a sample of something that they have used before to share?
stackexchange/codereview
I assume that you can't use a JavaScript code snippet to validate if the browser user has turned off JavaScript. So what can I use instead? Can someone offer a code sample? I'm looking to wrap an if/then statement around it. I often code in CFML, if that helps.
stackexchange/codereview
I'd like to allow a user to set up an SSH tunnel to a particular machine on a particular port (say, 5000), but I want to restrict this user as much as possible. (Authentication will be with public/private keypair). I know I need to edit the relevant ~/.ssh/authorized_keys file, but I'm not sure exactly what content to ...
stackexchange/codereview
The new extensions in .Net 3.5 allow functionality to be split out from interfaces. For instance in .Net 2.0 public interface IHaveChildren { string ParentType { get; } int ParentId { get; } List<IChild> GetChildren() } Can (in 3.5) become: public interface IHaveChildren { string ParentType { get; } ...
stackexchange/codereview
I've come back to using NHibernate after using other technologies (CSLA and Subsonic) for a couple of years, and I'm finding the querying a bit frustrating, especially when compared to Subsonic. I was wondering what other approaches people are using? The Hibernate Query Language doesn't feel right to me, seems too much...
stackexchange/codereview
I have a product which has been traditionally shipped as an MSI file. It is deployed through some sort of SMS push to thousands of desktops by our various clients. The software we use to create these installers is getting long in the tooth and we are looking to replace it. We have already standardized on InstallAnyw...
stackexchange/codereview
I do not want TortoiseSVN to alert me with sounds - e.g. when it fails to update. How do I turn off sounds in TortoiseSVN?
stackexchange/codereview
When it comes to web-design, I am horrible at producing anything remotely good looking. Thankfully there are a lot of free sources for design templates. However, a problem with these designs is that they just cover a single page, and not many use cases. If you take a look at CSS Zen Gardens, they have 1 single HTML fil...
stackexchange/codereview
In SQL Server 2005, we can create similar tables in two different ways. We can use a table variable: declare @tmp table (Col1 int, Col2 int); Or we can use a temporary table: create table #tmp (Col1 int, Col2 int); What are the differences between these two? I have read conflicting opinions on whether @tmp still uses...
stackexchange/codereview
Is there a way to make S3 default to an index.html page? E.g.: My bucket object listing: /index.html /favicon.ico /images/logo.gif A call to www.example.com/index.html works great! But if one were to call www.example.com/ we'd either get a 403 or a REST object listing XML document depending on how bucket-level ACL w...
stackexchange/codereview
What can be reasons to prevent a class from being inherited? (e.g. using sealed on a c# class) Right now I can't think of any.
stackexchange/codereview
I can set the PHP include path in the php.ini: include_path = /path/to/site/includes/ But then other websites are affected so that is no good. I can set the PHP include in the start of every file: $path = '/path/to/site/includes/'; set_include_path(get_include_path() . PATH_SEPARATOR . $path); But that seems like bad...
stackexchange/codereview
I have seen two ways of implementing DAO-DVO design. 1) DVO are objects and DAOs are instantiated using factories i.e DAOs are also objects 2) DVOs are again objects but in this case, DAOs are classes which contain only static methods which accept DVOs to perform tasks. I was wondering which way is better and more scal...
stackexchange/codereview
Has anyone used the lockfile utility that ships with procmail in conjunction with NFS mounted directories? The lockfile man page states that "Lockfile is NFS-resistant and eight-bit clean."
stackexchange/codereview
I'm still new to the ASP.NET world, so I could be way off base here, but so far this is to the best of my (limited) knowledge! Let's say I have a standard business object "Contact" in the Business namespace. I write a Web Service to retrieve a Contact's info from a database and return it. I then write a client applicat...
stackexchange/codereview
So I'm working on a project that will allow users to enter poker hand histories from sites like PokerStars and then display the hand to them. It seems that regex would be a great tool for this, however I rank my regex knowledge at "slim to none". So I'm using PHP and looping through this block of text line by line and ...
stackexchange/codereview
I'm interested in learning some (ideally) database agnostic ways of selecting the nth row from a database table. It would also be interesting to see how this can be achieved using the native functionality of the following databases: SQL Server MySQL PostgreSQL SQLite Oracle I am currently doing something like the fo...
stackexchange/codereview
I am using a class library which represents some of its configuration in .xml. The configuration is read in using the XmlSerializer. Fortunately, the classes which represent the .xml use the XmlAnyElement attribute at which allows me to extend the configuration data for my own purposes without modifying the original cl...
stackexchange/codereview
We have a service that has some settings that are supported only over net.tcp. What's the best way to add another endpoint? Do I need to create an entire new host?
stackexchange/codereview
I find myself to be a visual person and sometimes it's easier to learn something if I can draw diagram/pictures out of it. My question is which tool do I use if I want to map a programming framework (for example .net) visually and see the relationship between all entities (such as classes and members).
stackexchange/codereview
I’m looking at rewriting a portion of our application in C# (currently legacy VB6 code). The module I am starting with is responsible for importing data from a variety of systems into our database. About 5-6 times a year, a new client asks us to write a new import for the system that they use. Presently, this requires...
stackexchange/codereview
Can you tell me what is the difference between abstraction and information hiding in software development? I am confused. Abstraction hides detail implementation and information hiding abstracts whole details of something. Update: I found a good answer for these three concepts. See the separate answer below for several...
stackexchange/codereview
I understand how I can change the dns settings for my domains by editing my bind configs, when I run my own name-servers. I know that I can define the name-servers with my registrar via their online control panels. But I have no idea how that part works... How does my registrar store the data about the name-servers? Is...
stackexchange/codereview
Stack Overflow has a subversion version number at the bottom: svn revision: 679 I want to use such automatic versioning with my .NET Web Site/Application, Windows Forms, WPD projects/solutions. How do I implement this?
stackexchange/codereview
Edit: This question was written in 2008, which was like 3 internet ages ago. If this question is still relevant to your environment, please accept my condolences. Everyone else should convert into a format supported by your browsers (That would be H.264 if Internet Explorer is needed, and probably AV1, VP8/VP9 if not) ...
stackexchange/codereview
I have come across a lot of optimization tips which say that you should mark your classes as sealed to get extra performance benefits. I ran some tests to check the performance differential and found none. Am I doing something wrong? Am I missing the case where sealed classes will give better results? Has anyone run te...
stackexchange/codereview