instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
If you could go back in time and tell yourself to read a specific book at the beginning of your career as a developer, which book would it be? I expect this list to be varied and to cover a wide range of things. To search: Use the search box in the upper-right corner. To search the answers of the current question, use ...
stackexchange/codereview
I'm looking to the equivalent of Windows _wfopen() under Mac OS X. Any idea? I need this in order to port a Windows library that uses wchar* for its File interface. As this is intended to be a cross-platform library, I am unable to rely on how the client application will get the file path and give it to the library.
stackexchange/codereview
I'm an ASP.NET developer who has used Microsoft SQL Server for all my database needs (both at work and for personal projects). I am considering trying out the LAMP stack for some of my personal projects. What are some of the main differences between MySQL and SQL Server? Is using stored procedures a common practice i...
stackexchange/codereview
There is previous little on the google on this subject other than people asking this very same question. How would I get started writing my own firewall? I'm looking to write one for the windows platform but I would also be interested in this information for other operating systems too. ­­­­­­­­­­­­­­­­­­
stackexchange/codereview
Possible Duplicate: Why not use tables for layout in HTML? Under what conditions should you choose tables instead of DIVs in HTML coding?
stackexchange/codereview
Is there any known way of listing the WMI classes and their properties available for a particular system? Im interested in a vbscript approach, but please suggest anything really :) P.S. Great site.
stackexchange/codereview
I am looking for a more technical explanation than the OS calls the function. Is there a website or book?
stackexchange/codereview
I'm running PHP 5.2.3 on Windows 2000 Server with IIS 5. I'm trying to get cURL working, so in my php.ini file, I have this line: extension_dir ="F:\PHP\ext" And later, I have: extension=php_curl.dll The file F:\PHP\ext\php_curl.dll exists, but when I try to run any PHP script, I get this in the error log: PHP Wa...
stackexchange/codereview
I've heard of the idea of bootstrapping a language, that is, writing a compiler/interpreter for the language in itself. I was wondering how this could be accomplished and looked around a bit, and saw someone say that it could only be done by either writing an initial compiler in a different language. hand-coding an i...
stackexchange/codereview
I've written a stored proc that will do an update if a record exists, otherwise it will do an insert. It looks something like this: update myTable set Col1=@col1, Col2=@col2 where ID=@ID if @@rowcount = 0 insert into myTable (Col1, Col2) values (@col1, @col2) My logic behind writing it in this way is that the update w...
stackexchange/codereview
I'm compiling a NAnt project on linux with TeamCity Continuous Integration server. I have been able to generate a test report by running NAnt on mono thru a Command Line Runner but don't have the options of using the report like a NAnt Runner. I'm also using MBUnit for the testing framework. How can I merge in the test...
stackexchange/codereview
I need to implement a Diff algorithm in VB.NET to find the changes between two different versions of a piece of text. I've had a scout around the web and have found a couple of different algorithms. Does anybody here know of a 'best' algorithm that I could implement?
stackexchange/codereview
I have seen these being used every which way, and have been accused of using them the wrong way (though in that case, I was using them that way to demonstrate a point). So, what do you think are the best practices for employing Extension Methods? Should development teams create a library of extension methods and deploy...
stackexchange/codereview
I'm having trouble figuring out how to get the testing framework set up and usable in Visual Studio 2008 for C++ presumably with the built-in unit testing suite. Any links or tutorials would be appreciated.
stackexchange/codereview
I need to store products for an e-commerce solution in a database. Each product should have descriptive information, such as name, description etc. I need any product to be localized to x number of languages. What I've done so far, is to make any column that should be localized and nvarchar(MAX) and then i store an XML...
stackexchange/codereview
We've got two developers on the same closed (ugh, stupid gov) network, Another developer a couple minutes drive down the road, and a fourth developer half-way across the country. E-Mail, ftp, and removal media are all possible methods of transfer for the people not on the same network. I am one of the two closed networ...
stackexchange/codereview
What is the complete and correct syntax for the SQL Case expression?
stackexchange/codereview
I'm suddenly back to WinForms, after years of web development, and am having trouble with something that should be simple. I have an ArrayList of business objects bound to a Windows Forms DataGrid. I'd like the user to be able to edit the cells, and when finished, press a Save button. At that point I'd like to it...
stackexchange/codereview
In Visual C++ a DWORD is just an unsigned long that is machine, platform, and SDK dependent. However, since DWORD is a double word (that is 2 * 16), is a DWORD still 32-bit on 64-bit architectures?
stackexchange/codereview
I have developed some classes with similar behavior, they all implement the same interface. I implemented a factory that creates the appropriate object and returns the interface. I am writing a unit test for the factory. All you get back is an interface to the object. What is the best way to test that the factory ha...
stackexchange/codereview
I'm working on a windows forms application (C#) where a user is entering data in a form. At any point while editing the data in the form the user can click one of the buttons on the form to perform certain actions. By default the focus goes to the clicked button so the user has to click back on to the control they wa...
stackexchange/codereview
I know I can figure out the name of the method as its being executed, just wondering if there is a way from the setup method. I guess an attribute method would work but from the setup method it would be the best. EDIT NUnit
stackexchange/codereview
I have multiple selects: <select id="one"> <option value="1">one</option> <option value="2">two</option> <option value="3">three</option> </select> <select id="two"> <option value="1">one</option> <option value="2">two</option> <option value="3">three</option> </select> What I want is to select "one" from ...
stackexchange/codereview
When writing a switch statement, there appears to be two limitations on what you can switch on in case statements. For example (and yes, I know, if you're doing this sort of thing it probably means your object-oriented (OO) architecture is iffy - this is just a contrived example!), Type t = typeof(int); switch (t)...
stackexchange/codereview
I'm looking for some examples or samples of routing for the following sort of scenario: The general example of doing things is: {controller}/{action}/{id} So in the scenario of doing a product search for a store you'd have: public class ProductsController: Controller { public ActionResult Search(string id) // id be...
stackexchange/codereview
We are bringing a new project in house and whereas previously all our work was on SQL Server the new product uses an oracle back end. Can anyone advise any crib sheets or such like that gives an SQL Server person like me a rundown of what the major differences are - Would like to be able to get up and running as soon a...
stackexchange/codereview
I was just looking through some information about Google's protocol buffers data interchange format. Has anyone played around with the code or even created a project around it? I'm currently using XML in a Python project for structured content created by hand in a text editor, and I was wondering what the general opin...
stackexchange/codereview
I am trying to grab the capital letters of a couple of words and wrap them in span tags. I am using preg_replace for extract and wrapping purposes, but it's not outputting anything. preg_replace("/[A-Z]/", "<span class=\"initial\">$1</span>", $str)
stackexchange/codereview
I am getting back into a bit more .NET after a few-years of not using it full-time and am wondering what the good unit testing packages are these days. I'm familiar with NUnit (a few years ago) and have played briefly around with IronRuby, with the goal of getting something like RSpec going, but I don't know much beyon...
stackexchange/codereview
I am looking for a text editor to be used in a web page. Where users can format the text and get a WYSIWYG experience. Doesn't need to be too fancy. But has to be easy to use and integrate into the page. Has to generate HTML as output. Support AJAX (one I checked works only with standard form submit) and has to be smal...
stackexchange/codereview
If I have a variable in C# that needs to be checked to determine if it is equal to one of a set of variables, what is the best way to do this? I'm not looking for a solution that stores the set in an array. I'm more curious to see if there is a solution that uses boolean logic in some way to get the answer. I know I co...
stackexchange/codereview
I have a column of data that contains a percentage range as a string that I'd like to convert to a number so I can do easy comparisons. Possible values in the string: '<5%' '5-10%' '10-15%' ... '95-100%' I'd like to convert this in my select where clause to just the first number, 5, 10, 15, etc. so that I can compare ...
stackexchange/codereview
When I am writing code in Python, I often need to remove items from a list or other sequence type based on some criteria. I haven't found a solution that is elegant and efficient, as removing items from a list you are currently iterating through is bad. For example, you can't do this: for name in names: if name[-5...
stackexchange/codereview
I've got a combo-box that sits inside of a panel in Flex 3. Basically I want to fade the panel using a Fade effect in ActionScript. I can get the fade to work fine, however the label of the combo-box does not fade. I had this same issue with buttons and found that their fonts needed to be embedded. No problem. I e...
stackexchange/codereview
In the course of your software development lifecycle, what essential design artifacts do you produce? What makes them essential to your practice? The project I'm currently on has been in production for more than 8 years. This web application has been actively enhanced and maintained over that time. While we have CMMI-b...
stackexchange/codereview
Does the Java language have delegate features, similar to how C# has support for delegates?
stackexchange/codereview
My app has many controls on its surface, and more are added dynamically at runtime. Although i am using tabs to limit the number of controls shown, and double-buffering too, it still flickers and stutters when it has to redraw (resize, maximize, etc). What are your tips and tricks to improve WinForms app performance?
stackexchange/codereview
We currently maintain a suit of MFC applications that are fairly well designed, however the user interface is beginning to look tired and a lot of the code is in need quite a bit of refactoring to tidy up some duplication and/or performance problems. We make use of quite a few custom controls that handle all their own...
stackexchange/codereview
On a web page I want to dynamically render very basic flow diagrams, i.e. a few boxes joined by lines. Ideally the user could then click on one of these boxes (DIVs?) and be taken to a different page. Resorting to Flash seems like an overkill. Is anyone aware of any client-side (i.e. server agnostic) Javascript or CSS ...
stackexchange/codereview
Is there any efficiency difference in an explicit vs implicit inner join? For example: SELECT * FROM table a INNER JOIN table b ON a.id = b.id; vs. SELECT a.*, b.* FROM table a, table b WHERE a.id = b.id;
stackexchange/codereview
I am trying to set a flag to show or hide a page element, but it always displays even when the expression is false. $canMerge = ($condition1 && $condition2) ? 'true' : 'false'; ... <?php if ($canMerge) { ?>Stuff<?php } ?> What's up?
stackexchange/codereview
I want to make an etag that matches what Apache produces. How does apache create it's etags?
stackexchange/codereview
Does anybody know any good resources for learning how to program CIL with in-depth descriptions of commands, etc.? I have looked around but not found anything particularly good.
stackexchange/codereview
Can you cast a List<int> to List<string> somehow? I know I could loop through and .ToString() the thing, but a cast would be awesome. I'm in C# 2.0 (so no LINQ).
stackexchange/codereview
This is starting to vex me. I recently decided to clear out my FTP, and stumbled across an old Wordpress install I forgot I had (oh yes, very security conscious me). Anyway, for some reason deleting the directory failed so I investigated to see what was causing the blockage and I've narrowed it down to a file in wp-con...
stackexchange/codereview
I have a class property exposing an internal IList<> through System.Collections.ObjectModel.ReadOnlyCollection<> How can I pass a part of this ReadOnlyCollection<> without copying elements into a new array (I need a live view, and the target device is short on memory)? I'm targetting Compact Framework 2.0.
stackexchange/codereview
I'm trying to create a custom workflow action with an output parameter for error handling. Working from various examples, I can't get Parameter Direction="Out" to work. Everything seems right, but when I try to assign the output to the "error" variable in SharePoint Designer, it places asterisks around it and flags it...
stackexchange/codereview
What are some macros that you have found useful in Visual Studio for code manipulation and automation?
stackexchange/codereview
I'm sure we've all seen it before...A code base that has been around for a year or two, and as features have been added and bugs fixed, we end up with pieces of code that aren't actually in use anymore. I'm wondering if there is a way (especially in VS.NET with or without a third-party tool) to search the codebase and...
stackexchange/codereview
Under Windows XP WPF true 3D content (which is usually displayed using the Viewport3D control) looks extremely ugly because it is by default not antialiased as the rest of the WPF graphics are. Especially at lower resolution the experience is so bad that it can not be used in production code. I have managed to force an...
stackexchange/codereview
Does anyone have a regular expression for matching function calls in C programs ?
stackexchange/codereview
In a desktop application needing some serious re-factoring, I have several chunks of code that look like this: private void LoadSettings() { WindowState = Properties.Settings.Default.WindowState; Location = Properties.Settings.Default.WindowLocation; ... } private void SaveSettings() { Properties.Setti...
stackexchange/codereview
I am developing a Reporting Services solution for a DOD website. Frequently I'll have a report and want to have as a parameter the Service (in addition to other similar mundane, but repetitive parameters like Fiscal Year, Data Effective Date, etc). Basically everything I've seen of SSRS 2005 says it can't be done... ...
stackexchange/codereview
How do I convert function input parameters to the right type? I want to return a string that has part of the URL passed into it removed. This works, but it uses a hard-coded string: function CleanUrl($input) { $x = "http://google.com".Replace("http://", "") return $x } $SiteName = CleanUrl($HostHeader) echo $S...
stackexchange/codereview
I have a form in C# that has a button that, when clicked, I want the background image to cycle through a set of images (which I have as resources to the project). The images are named '_1', '_2', etc. and each time I click the button I want its background image to increment to the next one and go back to "_1" when it ...
stackexchange/codereview
The company I work for has an old Access 2000 application that was using a SQL Server 2000 back-end. We were tasked with moving the back-end to a SQL Server 2005 database on a new server. Unfortunately, the application was not functioning correctly while trying to do any inserts or updates. My research has found man...
stackexchange/codereview
What are the best practices around creating flat file database structures in PHP? A lot of more matured PHP flat file frameworks out there which I attempt to implement SQL-like query syntax which is over the top for my purposes in most cases. (I would just use a database at that point). Are there any elegant tricks out...
stackexchange/codereview
I am porting a game, that was originally written for the Win32 API, to Linux (well, porting the OS X port of the Win32 port to Linux). I have implemented QueryPerformanceCounter by giving the uSeconds since the process start up: BOOL QueryPerformanceCounter(LARGE_INTEGER* performanceCount) { gettimeofday(&currentTi...
stackexchange/codereview
How can I create this file in a directory in windows 2003 SP2: .hgignore I get error: You must type a file name.
stackexchange/codereview
I am looking for something to integrate to my CI workflow. I've heard of dbdeploy but I'm looking for something else. The reason I don't like dbdeploy is I don't want to install java on my server. I would prefer of course that the solution doesn't involve stringing some shell scripts together.
stackexchange/codereview
On my Vista machine I cannot install the .Net framework 3.5 SP1. Setup ends few moments after ending the download of the required files, stating in the log that: [08/26/08,09:46:11] Microsoft .NET Framework 2.0SP1 (CBS): [2] Error: Installation failed for component Microsoft .NET Framework 2.0SP1 (CBS). MSI returned e...
stackexchange/codereview
I am working on a Office Word add-in for Word 2003. When I reopen the project, the VS2008 auto covert dialog box opens and tries to convert it to the Word 2007 format. How can I reopen this file and keep it in the Word 2003 format?
stackexchange/codereview
I have a setup project created by Visual Studio 2005, and consists of both a C# .NET 2.0 project and C++ MFC project, and the C++ run time. It works properly when run from the main console, but when run over a Terminal Server session on a Windows XP target, the install fails in the following way - When the Setup.exe...
stackexchange/codereview
I have an xPC target application that talks to a device over RS-232. I am using the xPC serial block for this. To talk to this device I first have to start at a default speed, say, 9600 bps, request a change of speed to, say 57600 bps, then change the speed on my side to match it. The problem with the xPC block is that...
stackexchange/codereview
I'm working on a C#/ASP.NET project that has all the javascript files in a /Javascript folder. If I refer to the JS file using this syntax: src="/Javascript/jsfile.js" then the file is correctly picked up if the project is deployed to the root of the URL. However, if this "web site" is deployed to a sub-folder of the m...
stackexchange/codereview
I have a job interview tomorrow for a .NET shop. For the past few years I have been developing in languages other than .NET and figure it is probably a good idea to brush up on what is cool and new in the world of .NET. I've been reading about LINQ and WPF but these are more technologies than trends. What else shoul...
stackexchange/codereview
I need to keep the files & folders on two Windows-based, non-domain machines synchronized across a public network. I was thinking rsync over SSH - but I was wondering if there is a simpler solution? Any possibility of using the sync framework over SFTP/SCP/SSH? Or I'm open to better ideas?
stackexchange/codereview
We get a large amount of data from our clients in pdf files in varying formats [layout-wise], these files are typically report output, and are typically properly annotated [they don't usually need OCR], but not formatted well enough that simply copying several hundred pages of text out of acrobat is not going to work. ...
stackexchange/codereview
I'm currently building a Java app that could end up being run on many different platforms, but primarily variants of Solaris, Linux and Windows. Has anyone been able to successfully extract information such as the current disk space used, CPU utilisation and memory used in the underlying OS? What about just what the Ja...
stackexchange/codereview
I am attempting to parse a string like the following using a .NET regular expression: H3Y5NC8E-TGA5B6SB-2NVAQ4E0 and return the following using Split: H3Y5NC8E TGA5B6SB 2NVAQ4E0 I validate each character against a specific character set (note that the letters 'I', 'O', 'U' & 'W' are absent), so using strin...
stackexchange/codereview
I've got a Windows DLL that I wrote, written in C/C++ (all exported functions are 'C'). The DLL works fine for me in VC++. I've given the DLL to another company who do all their development in VB. They seem to be having a problem linking to the functions. I haven't used VB in ten years and I don't even have it installe...
stackexchange/codereview
I'm currently implementing a raytracer. Since raytracing is extremely computation heavy and since I am going to be looking into CUDA programming anyway, I was wondering if anyone has any experience with combining the two. I can't really tell if the computational models match and I would like to know what to expect. I g...
stackexchange/codereview
We have a large database on which we have DB side pagination. This is quick, returning a page of 50 rows from millions of records in a small fraction of a second. Users can define their own sort, basically choosing what column to sort by. Columns are dynamic - some have numeric values, some dates and some text. While ...
stackexchange/codereview
When writing multithreaded applications, one of the most common problems experienced is race conditions. My questions to the community are: What is the race condition? How do you detect them? How do you handle them? Finally, how do you prevent them from occurring?
stackexchange/codereview
Does anyone have any recommendations of tools that can be of assistance with moving literal values into resource files for localization? I've used a resharper plugin called RGreatX but was wondering if there is anything else out there. It's one heck of a long manual process for moving the strings across and think there...
stackexchange/codereview
With the increased power of JavaScript frameworks like YUI, JQuery, and Prototype, and debugging tools like Firebug, doing an application entirely in browser-side JavaScript looks like a great way to make simple applications like puzzle games and specialized calculators. Is there any downside to this other than exposin...
stackexchange/codereview
When writing multi-threaded applications, one of the most common problems experienced are deadlocks. My questions to the community are: What is a deadlock? How do you detect them? Do you handle them? And finally, how do you prevent them from occurring?
stackexchange/codereview
Is there a standard convention (like phpdoc or python's docstring) for commenting C# code so that class documentation can be automatically generated from the source code?
stackexchange/codereview
How do you sort an array of strings naturally in different programming languages? Post your implementation and what language it is in in the answer.
stackexchange/codereview
A semaphore is a programming concept that is frequently used to solve multi-threading problems. My question to the community: What is a semaphore and how do you use it?
stackexchange/codereview
Does anyone know how to get IntelliSense to work reliably when working in C/C++ projects? It seems to work for about 1 in 10 files. Visual Studio 2005 seems to be a lot better than 2008. Edit: Whilst not necessarily a solution, the work-around provided here: How to get IntelliSense to reliably work in Visual Studio 20...
stackexchange/codereview
Hello I have the following error by git-fsck, which cannot be cleaned by git-gc even in --aggressive mode. What can I do next to fix this repository error? $ git-fsck bad sha1 file: .git/objects/55/tmp_obj_a07724
stackexchange/codereview
In the How Can I Expose Only a Fragment of IList<> question one of the answers had the following code snippet: IEnumerable<object> FilteredList() { foreach(object item in FullList) { if(IsItemInPartialList(item)) yield return item; } } What does the yield keyword do there? I've seen it...
stackexchange/codereview
can you recommend some good ASP.NET tutorials or a good book? Should I jump right to ASP.NET MVC/html/javascript or learn web forms first? Thanks
stackexchange/codereview
I’m thinking about trying some development for the iPhone, is it possible to install Leopard inside VMWare? I already have a pretty high spec PC with a comfy setup that I’d like to use, or do I need to buy a real Mac?
stackexchange/codereview
A mutex is a programming concept that is frequently used to solve multi-threading problems. My question to the community: What is a mutex and how do you use it?
stackexchange/codereview
Does anyone know of anywhere I can find actual code examples of Software Phase Locked Loops (SPLLs) ? I need an SPLL that can track a PSK modulated signal that is somewhere between 1.1 KHz and 1.3 KHz. A Google search brings up plenty of academic papers and patents but nothing usable. Even a trip to the University lib...
stackexchange/codereview
In our project, SharpWired, we're trying to create a download component similar to the download windows in Firefox or Safari. That is, one single top down list of downloads which are custom controls containing progress bars, buttons and what not. The requirements are that there should be one single list, with one eleme...
stackexchange/codereview
I'm in the process of refactoring some code which includes moving folders around, and I would like to regularly merge to keep things current. What is the best way to merge after I've moved folders around in my working copy?
stackexchange/codereview
I want to log onto Stack Overflow using OpenID, but I thought I'd set up my own OpenID provider, just because it's harder :) How do you do this in Ubuntu? Edit: Replacing 'server' with the correct term OpenID provider (Identity provider would also be correct according to wikipedia).
stackexchange/codereview
A discussion about Singletons in PHP has me thinking about this issue more and more. Most people instruct that you shouldn't make a bunch of DB connections in one request, and I'm just curious as to what your reasoning is. My first thought is the expense to your script of making that many requests to the DB, but then I...
stackexchange/codereview
What are the advantages/disadvantages of keeping SQL in your C# source code or in Stored Procs? I've been discussing this with a friend on an open source project that we're working on (C# ASP.NET Forum). At the moment, most of the database access is done by building the SQL inline in C# and calling to the SQL Server DB...
stackexchange/codereview
I am currently aware that ASP.NET 2.0 is out and about and that there are 3.x versions of the .Net Framework. Is it possible to upgrade my ASP.NET web server to version 3.x of the .Net Framework? I have tried this, however, when selecting which version of the .Net framwork to use in IIS (the ASP.NET Tab), only version...
stackexchange/codereview
I can do an eval("something()"); to execute the code dynamically in JavaScript. Is there a way for me to do the same thing in C#? An example of what I am trying to do is: I have an integer variable (say i) and I have multiple properties by the names: "Property1", "Property2", "Property3", etc. Now, I want to perform so...
stackexchange/codereview
Example: I have two shared objects (same should apply to .dlls). The first shared object is from a third-party library, we'll call it libA.so. I have wrapped some of this with JNI and created my own library, libB.so. Now libB depends on libA. When webstarting, both libraries are places in some webstart working area. My...
stackexchange/codereview
It happens to me all the time. I accidentally version a file, I do not want to be versioned (i.e. developer/machine specific config-files). If I commit this file, I will mess up the paths on all the other developer machines - they will be unhappy. If I do delete the file from versioning, it will be deleted from the oth...
stackexchange/codereview
I have to develop an application which parses a log file and sends specific data to a server. It has to run on both Linux and Windows. The problem appears when I want to test the log rolling system (which appends .1 to the name of the creates a new one with the same name). On Windows (haven't tested yet on Linux) I ca...
stackexchange/codereview
I'm really asking this by proxy, another team at work has had a change request from our customer. The problem is that our customer doesn't want their employees to login with one user more than one at the same time. That they are getting locked out and sharing logins. Since this is on a web farm, what would be the best...
stackexchange/codereview
Obviously, that's 64-bit windows. Also, what's the maximum amount of memory a single 64-bit process can use? I was kind of counting on using it all... (Yes, I know what I'm doing, please don't tell me that if I need that much RAM i must be doing something wrong) Also, is this the same for a .Net 2.0 process? Or is the...
stackexchange/codereview
I need to modify the MBR of Windows, and I would really like to do this from Windows. Here are my questions. I know that I can get a handle on a physical device with a call to CreateFile. Will the MBR always be on \\.\PHYSICALDRIVE0? Also, I'm still learning the Windows API to read directly from the disk. Is readabsolu...
stackexchange/codereview