instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I'm working on a boot loader on an x86 machine. When the BIOS copies the contents of the MBR to 0x7c00 and jumps to that address, is there a standard meaning to the contents of the registers? Do the registers have standard values? I know that the segment registers are typically set to 0, but will sometimes be 0x7c0. Wh...
stackexchange/codereview
What are attributes in .NET, what are they good for, and how do I create my own attributes?
stackexchange/codereview
Debugging in visual studio seems to have been broken with sp1. Single stepping randomly does not work and just starts to run. Sometimes breakpoints are ignored. It is unpredictable and unusable. It will generally hit the first break point but after that it is totally unpredictable. Any idea what needs to be done to c...
stackexchange/codereview
I'm trying to import an XML file via a web page in a Ruby on Rails application, the code ruby view code is as follows (I've removed HTML layout tags to make reading the code easier) <% form_for( :fmfile, :url => '/fmfiles', :html => { :method => :post, :name => 'Form_Import_DDR', :enctype => 'multipart/form-data' } ) d...
stackexchange/codereview
If you've ever used Eclipse, you've probably noticed the great keyboard shortcuts that let you hit a shortcut key combination, then just type the first few characters of a function, class, filename, etc. It's even smart enough to put open files first in the list. I'm looking for a similar functionality for Visual Stud...
stackexchange/codereview
I have a simple page with my ScriptManager and my UpdatePanel, and my ContentTemplate has one ListBox and one Label. I am just trying to catch its OnSelectionChanged so I can update the text in the Label. No matter what settings I try to tweak, I always get a full-page postback. Is this really not going to work, or a...
stackexchange/codereview
Is it possible to validate an xml file against its associated schema using Visual Studio 2005 IDE? I could only see options to create a schema based on the current file, or show the XSLT output
stackexchange/codereview
My company has tried to adopt the scrum methodology with mixed success. Theses are some areas where we've had issues. How do you handle these? Tracking requirements from Product Marketing through to product. We're trying out JIRA to track all requirements individually and assigning a release to each one as it is p...
stackexchange/codereview
Did you ever have to choose between WISA or LAMP at the beginning of a web project? While pros and cons are littered around the net, it would be helpful to know about your real experience in coming up w/ criteria, evaluating, deciding, and reflecting upon your decision to go w/ either platform.
stackexchange/codereview
In the Windows applications I work on, we have a custom framework that sits directly above Win32 (don't ask). When we create a window, our normal practice is to put this in the window's user data area via SetWindowLong(hwnd, GWL_USERDATA, this), which allows us to have an MFC-like callback or a tightly integrated WndP...
stackexchange/codereview
I've seen different program managers write specs in different format. Almost every one has had his/her own style of writing a spec. On one hand are those wordy documents which given to a programmer are likely to cause him/her missing a few things. I personally dread the word documents spec...I think its because of my r...
stackexchange/codereview
I'm taking the leap: my PHP scripts will ALL fail gracefully! At least, that's what I'm hoping for...` I don't want to wrap (practically) every single line in try...catch statements, so I think my best bet is to make a custom error handler for the beginning of my files. I'm testing it out on a practice page: function c...
stackexchange/codereview
I have a very simple WPF application in which I am using data binding to allow editing of some custom CLR objects. I am now wanting to put some input validation in when the user clicks save. However, all the WPF books I have read don't really devote any space to this issue. I see that you can create custom ValidationRu...
stackexchange/codereview
Is there a good, native Mac tool to view Mercurial repositories, similar to gitnub for Git?
stackexchange/codereview
I have the unfortunate task of fixing a legacy ASP site that was migrated to Windows Server 2003, and I know nothing about ASP. The main issue appears to be with ASPSmartUpload, of which I have version 2.3 installed. According to http://foradvice.net/smart_upload_faq.htm: FAQ: does aspSmartUpload work on Windows 2...
stackexchange/codereview
I need the month+year from the datetime in SQL Server like 'Jan 2008'. I'm grouping the query by month, year. I've searched and found functions like datepart, convert, etc., but none of them seem useful for this. Am I missing something here? Is there a function for this?
stackexchange/codereview
I know that the MsNLB can be configured to user mulitcast with IGMP. However, if the switch does not support IGMP what are the options?
stackexchange/codereview
I seem to remember reading something about how it is bad for structs to implement interfaces in CLR via C#, but I can't seem to find anything about it. Is it bad? Are there unintended consequences of doing so? public interface Foo { Bar GetBar(); } public struct Fubar : Foo { public Bar GetBar() { return new Bar(); }...
stackexchange/codereview
Original Question I am currently engaged in teaching my brother to program. He is a total beginner, but very smart. (And he actually wants to learn). I've noticed that some of our sessions have gotten bogged down in minor details, and I don't feel I've been very organized. (But the answers to this post have helped a ...
stackexchange/codereview
I am using Simpletest as my unit test framework for the PHP site I am currently working on. I like the fact that it is shipped with a simple HTML reporter, but I would like a bit more advanced reporter. I have read the reporter API documentation, but it would be nice to be able to use an existing reporter, instead of h...
stackexchange/codereview
I'm hosting Python script with Python for Delphi components inside my Delphi application. I'd like to create background tasks which keep running by script. Is it possible to create threads which keep running even if the script execution ends (but not the host process, which keeps going on). I've noticed that the progr...
stackexchange/codereview
We've occasionally been getting problems whereby our long-running server processes (running on Windows Server 2003) have thrown an exception due to a memory allocation failure. Our suspicion is these allocations are failing due to memory fragmentation. Therefore, we've been looking at some alternative memory allocatio...
stackexchange/codereview
I would like to save the programs settings every time the user exits the program. So I need a way to call a function when the user quits the program. How do I do that? I am using Java 1.5.
stackexchange/codereview
I work with embedded Linux systems that sometimes want to get their IP address from a DHCP server. The DHCP Client client we use (dhcpcd) has limited retry logic. If our device starts up without any DHCP server available and times out, dhcpcd will exit and the device will never get an IP address until it's rebooted w...
stackexchange/codereview
Is there any feasible way of using generics to create a Math library that does not depend on the base type chosen to store data? In other words, let's assume I want to write a Fraction class. The fraction can be represented by two ints or two doubles or whatnot. The important thing is that the basic four arithmetic ope...
stackexchange/codereview
I’ve writen a little python script that just pops up a message box containing the text passed on the command line. I want to pop it up only when the window —resulting from a previous call— is not open. from Tkinter import * import tkMessageBox root = Tk() root.withdraw() # TODO not if a window with this title exists...
stackexchange/codereview
So I'm using an app that stores images heavily in the DB. What's your outlook on this? I'm more of a type to store the location in the filesystem, than store it directly in the DB. What do you think are the pros/cons?
stackexchange/codereview
I need to convert a named instance of SQL server 2005, to a default instance. Is there a way to do this without a reinstall? The problem is, 2 out of 6 of the developers, installed with a named instance. So its becoming a pain changing connection strings for the other 4 of us. I am looking for the path of least resist...
stackexchange/codereview
I have a cross-platform (Python) application which needs to generate a JPEG preview of the first page of a PDF. On the Mac I am spawning sips. Is there something similarly simple I can do on Windows?
stackexchange/codereview
I have a Ruby on Rails Website that makes HTTP calls to an external Web Service. About once a day I get a SystemExit (stacktrace below) error email where a call to the service has failed. If I then try the exact same query on my site moments later it works fine. It's been happening since the site went live and I've ha...
stackexchange/codereview
How can I add horizontal scroll capabilities to the asp.net listbox control?
stackexchange/codereview
I want my controller to return the right HTTP response code when the user lacks permission to view a particular page.
stackexchange/codereview
I'm trying to alpha blend sprites and backgrounds with devkitPro (including libnds, libarm, etc). Does anyone know how to do this?
stackexchange/codereview
I currently have a relatively small (4 or 5 tables, 5000 rows) MySQL database that I would like to convert to an sqlite database. As I'd potentially have to do this more than once, I'd be grateful if anyone could recommend any useful tools, or at least any easily-replicated method. (I have complete admin access to the...
stackexchange/codereview
What I'd like to do is something like the following: FooClass.prototype.method = function():String { return "Something"; } var foo:FooClass = new FooClass(); foo.method(); Which is to say, I'd like to extend a generated class with a single method, not via inheritance but via the prototype. The class is generated ...
stackexchange/codereview
I'm currently tasked with replacing an Apache + Resin Java web server with a Resin-only configuration. Currently in our apache setup, we use .htaccess and a small user database to provide passwording at a directory level. Does anyone know the equivalent setup when using just Resin as the web server?
stackexchange/codereview
I know a few advanced ways, to change directories. pushd and popd (directory stack) or cd - (change to last directory). But I am looking for quick way to achieve the following: Say, I am in a rather deep dir: /this/is/a/very/deep/directory/structure/with\ lot\ of\ nasty/names and I want to switch to /this/is/another...
stackexchange/codereview
I have a query where I wish to retrieve the oldest X records. At present my query is something like the following: SELECT Id, Title, Comments, CreatedDate FROM MyTable WHERE CreatedDate > @OlderThanDate ORDER BY CreatedDate DESC I know that normally I would remove the 'DESC' keyword to switch the order of the records...
stackexchange/codereview
Is there a way to tell MS SQL that a query is not too important and that it can (and should) take its time? Likewise is there a way to tell MS SQL that it should give higher priority to a query?
stackexchange/codereview
I hope everyone will pardon the length, and narrative fashion, of this question. I decided to describe the situation in some detail in my blog. I later saw Joel's invitation to this site, and I thought I'd paste it here to see if anyone has any insight into the situation. I wrote, and now support, an application that...
stackexchange/codereview
Is there a way I can configure the MidPointRounding enumeration default setting in a config file (I.e. web.config or app.config) I have a considerable source code base, and I need to configure at the application scope how rounding will occur, whether used in Math.Round or decimal type rounding... I would like to do t...
stackexchange/codereview
Can anyone recommend a good binary XML format? It's for a JavaME application, so it needs to be a) Easy to implement on the server, and b) Easy to write a low-footprint parser for on a low-end JavaME client device. And it goes without saying that it needs to be smaller than XML, and faster to parse. The data would be ...
stackexchange/codereview
We are looking for a WYSIWYG editor control for our windows application (vb.net or c#) so that users can design HTML emails (to send using the SMTP objects in the dot net framework) before sending. Currently all the available editors we can find have one of the following issues: They rely on mshtml.dll or the web brow...
stackexchange/codereview
In my application I have TextBox in a FormView bound to a LinqDataSource like so: <asp:TextBox ID="MyTextBox" runat="server" Text='<%# Bind("MyValue") %>' AutoPostBack="True" ontextchanged="MyTextBox_TextChanged" /> protected void MyTextBox_TextChanged(object sender, EventArgs e) { MyFo...
stackexchange/codereview
We are working on a winforms app in Visual Studio 2005 and the setup project we created output both an MSI and an EXE. We aren't sure what the EXE file is used for because we are able to install without the EXE.
stackexchange/codereview
I'm working on a web application that needs to prints silently -- that is without user involvement. What's the best way to accomplish this? It doesn't like it can be done with strictly with Javascript, nor Flash and/or AIR. The closest I've seen involves a Java applet. I can understand why it would a Bad Idea for ju...
stackexchange/codereview
I have a database with a table Customers that have some data I have another database in the office that everything is the same, but my table Customers is empty How can I create a sql file in SQL Server 2005 (T-SQL) that takes everything on the table Customers from the first database, creates a, let's say, buildcustomer...
stackexchange/codereview
Why does the default IntelliJ default class javadoc comment use non-standard syntax? Instead of creating a line with "User: jstauffer" it could create a line with "@author jstauffer". The other lines that it creates (Date and Time) probably don't have javadoc syntax to use but why not use the javadoc syntax when availa...
stackexchange/codereview
I am developing a web page code, which fetches dynamically the content from the server and then places this content to container nodes using something like container.innerHTML = content; Sometimes I have to overwrite some previous content in this node. This works fine, until it happens that previous content occupied m...
stackexchange/codereview
I want to implement in Java a class for handling graph data structures. I have a Node class and an Edge class. The Graph class maintains two list: a list of nodes and a list of edges. Each node must have an unique name. How do I guard against a situation like this: Graph g = new Graph(); Node n1 = new Node("#1"); Nod...
stackexchange/codereview
Does anyone know a tool for Profiling JavaScript in IE? List available: IE8 (Internet Explorer 8 only) JavaScript Profiler YUI!
stackexchange/codereview
Certainly there's the difference in general syntax, but what other critical distinctions exist? There are some differences, right?
stackexchange/codereview
What is the best way of doing case-insensitive string comparison in C++ without transforming a string to all uppercase or all lowercase? Please indicate whether the methods are Unicode-friendly and how portable they are.
stackexchange/codereview
What are all the possible ways in which we can get memory leaks in .NET? I know of two: Not properly un-registering Event Handlers/Delegates. Not disposing dynamic child controls in Windows Forms: Example: // Causes Leaks Label label = new Label(); this.Controls.Add(label); this.Controls.Remove(label); // Co...
stackexchange/codereview
How do you manage deploying InfoPath forms to different sharepoint servers? Is there a better way to deal all the data connections being site-specific without opening the forms, editing the data connections and republishing for each environment?
stackexchange/codereview
I have a svn repo on my machine (Windows). Anyone have a script to back it up to a network share? I'm using the repo locally since I'm disconnected a lot. The network share is on a server with a backup strategy. I'm a perfect candidate for git/hg but I don't want to give up my VS integration just yet.
stackexchange/codereview
We've been trying to alter a lot of columns from nullable to not nullable, which involves dropping all the associated objects, making the change, and recreating the associated objects. We've been using SQL Compare to generate the scripts, but I noticed that SQL Compare doesn't script statistic objects. Does this mean i...
stackexchange/codereview
I have to POST some parameters to a URL outside my network, and the developers on the other side asked me to not use HTTP Parameters: instead I have to post my key-values in HTTP Headers. The fact is that I don't really understand what they mean: I tried to use a ajax-like post, with XmlHttp objects, and also I tried t...
stackexchange/codereview
I have a set of Berkeley DB files on my Linux file system that I'd like to examine. What useful tools exist for getting a quick overview of the contents? I can write Perl scripts that use BDB modules for examining them, but I'm looking for some CLI utility to be able to take a look inside without having to start writin...
stackexchange/codereview
I have a MySQL table with coordinates; the column names are X and Y. Now I want to swap the column values in this table, so that X becomes Y and Y becomes X. The most apparent solution would be renaming the columns, but I don't want to make structure changes since I don't necessarily have permissions to do that. Is thi...
stackexchange/codereview
How can I open a cmd window in a specific location without having to navigate all the way to the directory I want?
stackexchange/codereview
I've recently had a need to do a bit of lisp editing and I found the nifty Ready Lisp package for OS X, which is great, except Aquamacs automatically uses a proportional font (which is idiotic, IMHO) and I want to change it to a monospace font. However, I'm not really much of an EMACS user, and the preferences menu in ...
stackexchange/codereview
Pretty much every other editor that isn't a vi descendant (vim, cream, vi-emu) seems to use the emacs shortcuts (ctrl+w to delete back a word and so on)
stackexchange/codereview
I want to use the functions exposed under the OpenGL extensions. I'm on Windows, how do I do this?
stackexchange/codereview
For example, http://developer.apple.com/cocoa/pyobjc.html is still for OS X 10.4 Tiger, not 10.5 Leopard.. And that's the official Apple documentation for it.. The official PyObjC page is equally bad, http://pyobjc.sourceforge.net/ It's so bad it's baffling.. I'm considering learning Ruby primarily because the RubyCoco...
stackexchange/codereview
I am starting to work on a hobby project with a Python codebase and I would like to set up some form of continuous integration (i.e. running a battery of test-cases each time a check-in is made and sending nag e-mails to responsible persons when the tests fail) similar to CruiseControl or TeamCity. I realize I could do...
stackexchange/codereview
I'm trying to do 'Attach to Process' for debugging in Visual Studio 2008 and I can't figure out what process to attach to. Help.
stackexchange/codereview
Can I use this approach efficiently? using(SqlCommand cmd = new SqlCommand("GetSomething", new SqlConnection(Config.ConnectionString)) { cmd.Connection.Open(); // set up parameters and CommandType to StoredProcedure etc. etc. cmd.ExecuteNonQuery(); } My concern is : Will the Dispose method of the SqlComman...
stackexchange/codereview
Here is the sample code for my accordion: <mx:Accordion x="15" y="15" width="230" height="599" styleName="myAccordion"> <mx:Canvas id="pnlSpotlight" label="SPOTLIGHT" height="100%" width="100%" horizontalScrollPolicy="off"> <mx:VBox width="100%" height="80%" paddingTop="2" paddingBottom="1" verticalGap="1"...
stackexchange/codereview
I have a directory with PDF files that I need to create an index for. It is a PHP page with a list of links: <A HREF="path to file">filename</A> The filenames can be complicated: LVD 2-1133 - Ändring av dumpningslina (1984-11-20).pdf What is the correct way to link to this file on a Linux/Apache server? Is there a PH...
stackexchange/codereview
I haven't touched sharepoint in years. If I want to setup a development environment to get up to speed, what options do I have? I don't have an MSDN license, is there anyway I can get up and running for free? (for development only)
stackexchange/codereview
How does a stack overflow occur and what are the ways to make sure it doesn't happen, or ways to prevent one?
stackexchange/codereview
What's the best way to handle a user going back to a page that had cached items in an asp.net app? Is there a good way to capture the back button (event?) and handle the cache that way?
stackexchange/codereview
Perhaps the biggest risk in pushing new functionality to live lies with the database modifications required by the new code. In Rails, I believe they have 'migrations', in which you can programmatically make changes to your development host, and then make the same changes live along with the code that uses the revised ...
stackexchange/codereview
How can I call a custom action dll written in managed code (.net) from an installer without using an unmanaged intermediary?
stackexchange/codereview
After the suggestion to use a library for my ajax needs I am going to use one, the problem is that there are so many and I've no idea how to even begin telling them apart. Thus, can anybody A) Give a rundown of the differences or B) Point me (and others like me) somewhere that has such a list. Failing that plan C is...
stackexchange/codereview
Moderator note: This question is not a good fit for our question and answer format with the topicality rules which currently apply for Stack Overflow. We normally use a "historical lock" for such questions where the content still has value. However, the answers on this question are actively maintained and a historical...
stackexchange/codereview
I have a web application that should behave differently for internal users than external ones. The web application is available over the Internet, and therefore obviously to the internal users as well. All the users are anonymous, not authenticated, but the page should render differently for internal users than externa...
stackexchange/codereview
The SQL Server Express 2008 setup allow you to assign different user account for each service. For a development environment, would you use a domain user, local user, NT Authority\NETWORK SERCVICE, NT Authority\Local System or some other account and why?
stackexchange/codereview
Semantically speaking, is there an appropriate place in today's websites (late 2008+) where using the bold <b> and italic <i> tags are more useful than the more widely used <strong> and <em> tags?
stackexchange/codereview
A DB Audit Trail captures the User Last Modified, Modified Date, and Created Date. There are several possible implementations: SQL Server Triggers Add UserModified, ModifiedDate, CreatedDate columns to the database and include logic in Stored Procedures or Insert, Update statements accordingly. It would be nice if yo...
stackexchange/codereview
I've got the task of displaying a web form to represent the properties in a .NET class. In WinForms, there's a pre-fab control named PropertyGrid that is a lot like what I need. I'm just looking for something to display a simple layout of property names next to an appropriate control like a textbox for strings or a d...
stackexchange/codereview
I would like to test a function with a tuple from a set of fringe cases and normal values. For example, while testing a function which returns true whenever given three lengths that form a valid triangle, I would have specific cases, negative / small / large numbers, values close-to being overflowed, etc.; what is more...
stackexchange/codereview
Uploading my first decently sized web app to my shared host provided me with a fresh set of challenges, by which I mean, sleepless nights. The issue was that I had most certainly not developed my application for medium trust (or had any clue what that was.) I mitigated all of the issues, save one. I had written an in...
stackexchange/codereview
I was reading More Joel on Software when I came across Joel Spolsky saying something about a particular type of programmer knowing the difference between an int and an Integer in Java/C# (Object-Oriented Programming Languages). So, what is the difference?
stackexchange/codereview
Does anyone know a good way to do this? I need to have simple forms that submit to email without writing a lot of code. These forms will be hosted in content-viewer web parts or similar in MOSS 2007. I'd like to avoid using InfoPath.
stackexchange/codereview
I'm needing to check the differences between two XMLs but not "blindly", Given that both use the same DTD, I'm actually interested in verifying wether they have the same amount of elements or if there's differences.
stackexchange/codereview
I have a Java application that launches another java application. The launcher has a watchdog timer and receives periodic notifications from the second VM. However, if no notifications are received then the second virtual machine should be killed and the launcher will perform some additional clean-up activities. The ...
stackexchange/codereview
Choosing the correct lifecycle and methodology isn't as easy as it was before when there weren't so many methodologies, this days a new one emerges every day. I've found that most projects require a certain level of evolution and that each project is different from the rest. That way, extreme programming works with for...
stackexchange/codereview
When you are starting a personal programming project, what is your first step? I'm trying to start a project thats just an idea at the moment. I get lots of these and I dive right into the code and after a while just completely lose interest and or just forget about the project. When you are starting, what is your firs...
stackexchange/codereview
I'd like to redirect the stdout of process proc1 to two processes proc2 and proc3: proc2 -> stdout / proc1 \ proc3 -> stdout I tried proc1 | (proc2 & proc3) but it doesn't seem to work, i.e. echo 123 | (tr 1 a & tr 1 b) writes b23 to stdout instead of a23 b23
stackexchange/codereview
The below HTML/CSS/Javascript (jQuery) code displays the #makes select box. Selecting an option displays the #models select box with relevant options. The #makes select box sits off-center and the #models select box fills the empty space when it is displayed. How do you style the form so that the #makes select box is ...
stackexchange/codereview
I just saw Clone Detective linked on YCombinator news, and the idea heavily appeals to me. It seems like it would be useful for many languages, not just C#, but I haven't seen anything similar elsewhere. Edit: For those who don't want to follow the link, Clone Detective scans the codebase for duplicate code that may wa...
stackexchange/codereview
I may just be missing this functionality, but does anyone know if there is a widget available: I need to list the subject for all the entries that are associated with a given tag. For example: I have 5 articles tagged with "Tutorial", I'd like to see a list as follows: Tutorial 1: Installing the app Tutorial 2: Custom...
stackexchange/codereview
Let's say I had a program in C# that did something computationally expensive, like encoding a list of WAV files into MP3s. Ordinarily I would encode the files one at a time, but let's say I wanted the program to figure out how many CPU cores I had and spin up an encoding thread on each core. So, when I run the program ...
stackexchange/codereview
I asked a question about Currying and closures were mentioned. What is a closure? How does it relate to currying?
stackexchange/codereview
I find working on the command line in Windows frustrating, primarily because the console window is wretched to use compared to terminal applications on linux and OS X such as "rxvt", "xterm", or "Terminal". Major complaints: No standard copy/paste. You have to turn on "mark" mode and it's only available from a multi...
stackexchange/codereview
In my code fprintf returns successfully by returning the number of bytes written in STREAM, but in the actual file the string I wrote is not there.
stackexchange/codereview
I'm just wondering if it exists better solution for this. BitConverter.ToInt32(sample_guid.ToByteArray(), 0)
stackexchange/codereview
I'm a complete Xcode/Objective-C/Cocoa newbie but I'm learning fast and really starting to enjoy getting to grips with a new language, platform and paradigm. One thing is though, having been using Visual Studio with R# for so long I've kind of been spoiled with the coding tools such as refactorings and completion etc a...
stackexchange/codereview