instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
Folks, I'm working on a little piece of rich client software that I'd like to distribute for free. That is, I'd still like to make money on it, but I'd like the revenue to come from advertising. Do you know of an advertising platform that works well for client apps? I'd like the ads to be completely unobtrusive (like ...
stackexchange/codereview
I'm trying to find out what the performance of a large directory structure would be if deep directories were to be accessed on a shared, nfs filesystem. The structure would be excessively large, with 4 levels of nested directories, each level containing 1024 directories. (1024 at root, 1024 in a given subdirectory, and...
stackexchange/codereview
I have an application that is causing a lot of headaches. It's a .NET app connecting to SQL Server 2005 via a web service. The program has grid that is filled by a long running stored procedure that is prone to timing out. In the case when it does time out and a SqlException is thrown, there is no execption handling to...
stackexchange/codereview
I am writing an iPhone application and need to essentially implement something equivalent to the 'eyedropper' tool in photoshop, where you can touch a point on the image and capture the RGB values for the pixel in question to determine and match its color. Getting the UIImage is the easy part, but is there a way to co...
stackexchange/codereview
I need to concatenate two String arrays in Java. void f(String[] first, String[] second) { String[] both = ??? } Which is the easiest way to do this?
stackexchange/codereview
I've just built a basic ASP MVC web site for deployment on our intranet. It expects users to be on the same domain as the IIS box and if you're not an authenticated Windows User, you should not get access. I've just deployed this to IIS6 running on Server 2003 R2 SP2. The web app is configured with it's own pool with i...
stackexchange/codereview
I have written a lot of code in Python, and I am very used to the syntax, object structure, and so forth of Python because of it. What is the best online guide or resource site to provide me with the basics, as well as a comparison or lookup guide with equivalent functions/features in VBA versus Python. For example, I ...
stackexchange/codereview
what is an efficient way to get a certain time for the next day in Java? Let's say I want the long for tomorrow 03:30:00. Setting Calendar fields and Date formatting are obvious. Better or smarter ideas, thanks for sharing them! Okami
stackexchange/codereview
So, I'll be getting my T-Mobile G1 within a month or so, and I'm excited to start developing for it. Has anyone started using it yet? Is there a dev wiki or anything set up for it yet?
stackexchange/codereview
I have a super-simple WCF Service. I host it on my local machine using IIS7. When I add a service reference to my service, Visual Studio tells me there was an error. I can click a Details link, and that bring up a dialog box saying: Object reference not set to an instance of an object. I can build my WCF service with ...
stackexchange/codereview
I need to know how to turn on Code Coverage when running TFS builds on a solution with a .testrunconfig file. There is an option in the testrunconfig file that is for code coverage, but when running a TFS build there is no code coverage results. I am running my tests using the *Tests.dll mask and NOT using Test Lists...
stackexchange/codereview
I have 20 ips from my isp. I have them bound to a router box running centos. What commands, and in what order, do I set up so that the other boxes on my lan, based either on their mac addresses or 192 ips can I have them route out my box on specific ips. For example I want mac addy xxx:xxx:xxx0400 to go out 72.049.12.1...
stackexchange/codereview
I have a very large cascading menu system with over 300 items in it. (I know it's large but it's a requirement.) Currently, it's written in javascript so the external file is cached by browsers. To improve search engine results I need to convert this to a css menu system. I realize the browsers will also cache extern...
stackexchange/codereview
Does anybody know of a method for creating custom Performance Counters using ordinary unmanaged Visual C++? I know that it can be done easily using managed C++, but I need to do it using an unmanaged Windows service. I also know that you can retrieve performance counter data, but I need to create some custom counters a...
stackexchange/codereview
What is the best way, using Bash, to rename files in the form: (foo1, foo2, ..., foo1300, ..., fooN) With zero-padded file names: (foo00001, foo00002, ..., foo01300, ..., fooN)
stackexchange/codereview
The default asp.net membership provider uses a .mdf sql server database file in the app_code database. How scalable is this in terms of calling a flat file database instead of running it in a standard sql environment? Is this recommended only for small/medium traffic sites?
stackexchange/codereview
I have buy.php with a form where you enter items, quantity, shipping data, etc. When you click the Submit button, it posts back to buy.php ($_SERVER['PHP_SELF']) and does some data validation. If there are fields missing or errors, they are highlighted. If everything is correct, I save the $_POST data in $_SESSION va...
stackexchange/codereview
I want to run a web application on php and mysql, using the CakePHP framework. And to keep the threshold of using the site at a very low place, I want to not use the standard login with username/password. (And I don't want to hassle my users with something like OpenID either. Goes to user type.) So I'm thinking that th...
stackexchange/codereview
Does Apple's Xcode development environment provide any tools for memory leak detection? I am especially interested in tools that apply to the iPhone SDK. Currently my favourite platform for hobby programming projects Documentations/tutorials for said tools would be very helpful.
stackexchange/codereview
I'm setting up StructureMap and it seems like everything I want to do there are two ways to do it and it's unclear to me what the difference is between them. For instance, what's the difference between these two lines: StructureMapConfiguration.ForRequestedType<IConsumer>().AddConcreteType<Consumer>(); StructureMapCo...
stackexchange/codereview
In C, using the standard Windows API, what is the best way to read an unformatted disk? Specifically, I have an MMC or SD card with data, but no file system (not FAT16, not FAT32, just raw data). If there was a simple way to open the entire card for byte by byte binary access, that would be great. Thanks!
stackexchange/codereview
Math skills are becoming more and more essential, and I wonder where is a good place to brush up on some basics before moving on to some more CompSci specific stuff? A site with lots of video's as well as practice exercises would be a double win but I can't seem to find one.
stackexchange/codereview
I have a div and an iframe on the page the div has z-index: 0; the iframe has its content with a popup having a z-index of 1000 z-index: 1000; However, the div still overshadows the popup in IE (but works fine in Firefox). Does anyone know what I can do?
stackexchange/codereview
I am searching for a good system for PHP, which does UnitTesting, Subversion, Coding Standards. I would love to hear your suggestions and which one is the best and why. I will be running it on a debian server so anything which runs on mac or windows servers would be out of the question.
stackexchange/codereview
I'm wondering if mono.net is included in the default installation of Ubuntu, Kubuntu, and Fedora, and other popular distros? If so, does anyone have a good reason why NOT to use it to develop a new GUI application targeted mainly for linux?
stackexchange/codereview
I'd like to run a script that builds the documentation for my php project. It is basically just using wget to run phpdoc.
stackexchange/codereview
I am working on a very large scale computing library that is using STL heavily. The library is being built using MSVC2003 and it is using its STL implementation. I am looking for an alternative STL implementation that would help the library lower its memory requirements and increase its performance. It is not possible ...
stackexchange/codereview
We have a set of nightly builds that build of full suite of software using Embedded Visual C++ batch files. There is probably a total of 30 builds that are done. Every night at least one or two builds fail with something like the following error: c:\lc\trunk\server\can\svcangettracedrivelength.cpp(11) : fatal error ...
stackexchange/codereview
One of my DBs have grown closer to permitted size. Inorder to find out the table containing the max data, i used the following query: exec sp_MSforeachtable @command1="print '?' exec sp_spaceused '?'" It returned the culprit table comprising the max data. As a next step, i want to cleanup the rows based on the size. F...
stackexchange/codereview
On my blog I use some CSS classes which are defined in my stylesheet, but in RSS readers those styles don't show up. I had been searching for class="whatever" and replacing with style="something: something;". But this means whenever I modify my CSS I need to modify my RSS-generating code too, and it doesn't work for ...
stackexchange/codereview
I'm using GDI+ in C++. (This issue might exist in C# too). I notice that whenever I call Graphics::MeasureString() or Graphics::DrawString(), the string is padded with blank space on the left and right. For example, if I am using a Courier font, (not italic!) and I measure "P" I get 90, but "PP" gives me 150. I woul...
stackexchange/codereview
I'd like to install some presentation templates, but don't know where to put them... Thanks a lot
stackexchange/codereview
I am working on a legacy project in VC++/Win32/MFC. Recently it became a requirement that the application work on a tablet pc, and this ushered in a host of new issues. I have been able to work with, and around these issues, but am left with one wherein I could use some expert suggestions. I have a particular bug that ...
stackexchange/codereview
I have a multithreded application in perl for which I have to rely on several non-thread safe modules, so I have been using fork()ed processes with kill() signals as a message passing interface. The problem is that the signal handlers are a bit erratic (to say the least) and often end up with processes that get killed ...
stackexchange/codereview
When compressing a string "stream" the '/r' gets stripped out from '/r/n'. I am using the ICSharp.zip library for compression. Has any one else faced this problem, and if you have is there is a workaround?
stackexchange/codereview
Everyone has accidentally forgotten the WHERE clause on a DELETE query and blasted some un-backed up data once or twice. I was pondering that problem, and I was wondering if the solution I came up with is practical. What if, in place of actual DELETE queries, the application and maintenance scripts did something like:...
stackexchange/codereview
My question is, which version-naming scheme should be used for what type of project. Very common is major.minor.fix, but even this can lead to 4 number (i.e. Firefox 2.0.0.16). Some have a model that odd numbers indicate developer-versions and even numbers stable releases. And all sorts of additions can enter the mix, ...
stackexchange/codereview
I are working in a small development team of 4 people. We are trying develop "Agile style" - story points, small tasks, etc... Unfortunately, we are currently managing our tasks in a (shared) excel table. We looked at some available tools (Mingle, TFS, Scrum for Team System), but all of these looked like they would be ...
stackexchange/codereview
I am seeking a WinForm control that would provide an autocomplete behavior for multiple space-separated - exactly ala del.icio.us (or stackoverflow.com for that matter). Does anyone knows how to do that within a .NET 2.0 WinForm application?
stackexchange/codereview
The CSS rules visibility:hidden and display:none both result in the element not being visible. Are these synonyms?
stackexchange/codereview
I have some curious behavior that I'm having trouble figuring out why is occurring. I'm seeing intermittent timeout exceptions. I'm pretty sure it's related to volume because it's not reproducible in our development environment. As a bandaid solution, I tried upping the sql command timeout to sixty seconds, but as I...
stackexchange/codereview
I have a large legacy codebase with very complicated makefiles, with lots of variables. Sometimes I need to change them, and I find that it's very difficult to figure out why the change isn't working the way I expect. What I'd like to find is a tool that basically does step-through-debugging of the "make" process, wh...
stackexchange/codereview
For example, I want to populate a gridview control in an ASP.NET web page with only the data necessary for the # of rows displayed. How can NHibernate support this?
stackexchange/codereview
In C# WinForms, what's the proper way to get the backward/forward history stacks for the System.Windows.Forms.WebBrowser?
stackexchange/codereview
Is there a way to unfilter an NSPasteboard for what the source application specifically declared it would provide? I'm attempting to serialize pasteboard data in my application. When another application places an RTF file on a pasteboard and then I ask for the available types, I get eleven different flavors of said RT...
stackexchange/codereview
Dynamically creating a radio button using eg var radioInput = document.createElement('input'); radioInput.setAttribute('type', 'radio'); radioInput.setAttribute('name', name); works in Firefox but not in IE. Why not?
stackexchange/codereview
In JavaScript, you can use Lazy Function Definitions to optimize the 2nd - Nth call to a function by performing the expensive one-time operations only on the first call to the function. I'd like to do the same sort of thing in PHP 5, but redefining a function is not allowed, nor is overloading a function. Effectively w...
stackexchange/codereview
Is it just that nvarchar supports multibyte characters? If that is the case, is there really any point, other than storage concerns, to using varchars?
stackexchange/codereview
I haven't kept up lately with the C++ world. Exactly where do things stand these days regarding the standard? Is TR1 adopted? Is there a TR2? How do these relate to C++0x? Are the subsumed? Has a decision been reached on threading yet?
stackexchange/codereview
The title is pretty much self explanatory. Given two dates what is the best way of finding the number of week days using PHP? Week days being Monday to Friday. For instance, how would I find out that there are 10 week days in between 31/08/2008 and 13/09/2008?
stackexchange/codereview
Is there any good tool for working on Dabtabase apart from Toad which requires license and DBVisualiser not supportive
stackexchange/codereview
I am using httpresponse.Transmitfile to download files. If I, in the file download dialog, choose to save in a different folder than the suggested one, the download rate drops down to 10 - 20 kb. If I cancel, or always choose to download in the same folder, then transfer rate are 200 kb and more. Here are my code : pr...
stackexchange/codereview
I have a couple of header files, which boil down to: tree.h: #include "element.h" typedef struct tree_ { struct *tree_ first_child; struct *tree_ next_sibling; int tag; element *obj; .... } tree; and element.h: #include "tree.h" typedef struct element_ { tree *tree_parent; char *name; ...
stackexchange/codereview
I know this would be easy with position:fixed, but unfortanately I'm stuck with supporting IE 6. How can I do this? I would rather use CSS to be clean, but if I have to use Javascript, that's not the end of the world. In my current implementation I have a "floating footer" that floats above the main content area and...
stackexchange/codereview
Has anyone successfully built an Adobe Air application with Maven? If so, what are the steps to get it working? I have been trying to use flex-mojos to build an Air applications. When I set the packaging type to "aswf", as suggested in the DashboardSamplePom, Maven complains that aswf is an unknown packaging type. I...
stackexchange/codereview
I am going to hosting for files that user submits. I need to grab some data from the file and then move it to some directory. There two points of interest for the lifetime of this file. The first is when the data is being abstracted and the second is when the file is archived so that it can be shared. When data is bein...
stackexchange/codereview
Please consider both commercial and free debuggers. Would like to see also the pros and cons for each.
stackexchange/codereview
Is there a way to trigger a beep/alarm/sound when my breakpoint is hit? I'm using Visual Studio 2005/2008.
stackexchange/codereview
In ruby I am parsing a date in the following format: 24092008. I want to convert each section (year, month, date) into a number. I have split them up using a regex which produces three Strings which I am passing into the Integer constructor. date =~ /^([\d]{2})([\d]{2})([\d]{4})/ year = Integer($3) month = Intege...
stackexchange/codereview
I have to implement MPI system in a cluster. If anyone here has any experience with MPI (MPICH/OpenMPI), I'd like to know which is better and how the performance can be boosted on a cluster of x86_64 boxes.
stackexchange/codereview
Compiler, TASM 5 Architecture x86. For a random number generator algorithm, take tha clock as the seed. I found that solution: AcquireSeed PROC PUSH AX PUSH CX PUSH DX MOV Ah, 00h ; Int INT 1AH ; return the clock in CX:DX MOV seed, DL ; save the less significant byte of the clock at seed...
stackexchange/codereview
We have an application that works with MS Office and uses Microsoft.mshtml.dll. We use ClickOnce to deploy the application. The application deploys without issues on most machines, but sometimes we get errors saying "System Update Required, Microsoft.mshtl.dll should be in the GAC". We tried installing the PIA for Off...
stackexchange/codereview
There has been some talk of Website performance monitoring tools and services on stackoverflow, however, they seem fairly expensive for what they actually do. Are there any good opensource libraries for automating checking/monitoring the availability of a website?
stackexchange/codereview
Is there any way to automatically wrap comments at the 80-column boundary as you type them? ..or failing that, any way to display a faint line at the coulmn 80 boundary to make wrapping them manually a little easier? Several other IDEs I use have one or other of those functions and it makes writing comments that wrap i...
stackexchange/codereview
I'm going over some client code I've inherited for doing secure communication over HTTPS, and it seems that it's not checking the common name in the server certificate (eg. 'CN = "example.com"' against the actual URL that's being requested. This is probably deliberate, since our client app is required to talk to variou...
stackexchange/codereview
public class Test { public static void main(String[] args) { } } class Outer { void aMethod() { class MethodLocalInner { void bMethod() { System.out.println("Inside method-local bMethod"); } } } } Can someone tell me how to print the message fro...
stackexchange/codereview
I'd like to install Gentoo. I need it to develop GUI C++ applications using wxWidgets, so I need: build tools: make, automake, autoconf, etc. C++ compiler (GCC) X Window System for testing (Fluxbox or something minimal would be enough) Now, I have two options: download the small network installer (57MB) do a network...
stackexchange/codereview
More specifically, when the exception contains custom objects which may or may not themselves be serializable. Take this example: public class MyException : Exception { private readonly string resourceName; private readonly IList<string> validationErrors; public MyException(string resourceName, IList<strin...
stackexchange/codereview
I need to read selected files, matching on the file name, from a remote zip archive using Python. I don't want to save the full zip to a temporary file (it's not that large, so I can handle everything in memory). I've already written the code and it works, and I'm answering this myself so I can search for it later. But...
stackexchange/codereview
What are the best approaches / tools to test browser extensions? In my case I work on an IE Browser Helper Object (C#) which has a small UI of its own and a good deal of database interaction. Up till now we've used automated unit tests for testing our model/business objects but manual testing for the UI/scenario testin...
stackexchange/codereview
I'm processing a huge file with (GNU) awk, (other available tools are: Linux shell tools, some old (>5.0) version of Perl, but can't install modules). My problem: if some field1, field2, field3 contain X, Y, Z I must search for a file in another directory which contains field4, and field5 on one line, and insert some d...
stackexchange/codereview
I have a FlowDocument in a standard WPF application window where I have some text, and in this text some hyperlinks and buttons. The problem is, if I put this FlowDocument inside anything except a FlowDocumentPageViewer the hyperlinks and buttons are disabled ("grayed out"). <FlowDocumentScrollViewer> <FlowDocument> ...
stackexchange/codereview
How to set all the values in a std::map to the same value, without using a loop iterating over each value?
stackexchange/codereview
I am considering adding OpenID to our customer facing admin and control panel areas... 1 - Associating OpenID's With Existing Accounts For customers that already have accounts with us, I'm thinking they would need to login using their existing account number that we issue and then I'd have a mechanism to associate thei...
stackexchange/codereview
When multiple scanf() statements are encountered in the code, then, except the first scanf() statement, all others are skipped, that is, there is no prompt for input for those scanf() statements when the code is run. I have a tried a few suggestions. For eg, use of flushall() was suggested on some site, but that gives ...
stackexchange/codereview
I need to "merge" two XML documents, overwriting the overlapsed attributes and elements. For instance if I have document1: <mapping> <key value="assigned"> <a/> </key> <whatever attribute="x"> <k/> <j/> </whatever> </mapping> and document2: <mapping> <key value="identity"> ...
stackexchange/codereview
A couple of days ago, I read a blog entry (http://ayende.com/Blog/archive/2008/09/08/Implementing-generic-natural-language-DSL.aspx) where the author discuss the idea of a generic natural language DSL parser using .NET. The brilliant part of his idea, in my opinion, is that the text is parsed and matched against classe...
stackexchange/codereview
How do i store a directory / hierarchy / tree structure in the database? Namely MSSQL Server. @olavk: Doesn't look like you've seen my own answer. The way i use is way better than recursive queries :) p.p.s. This is the way to go!
stackexchange/codereview
I am creating a standalone asp.net page that needs to be embedded into a sharepoint site using the Page Viewer Web Part. The asp.net page is published to the same server on a different port, giving me the URL to embed. The requirement is that after a user is authenticated using Sharepoint authentication, they navigate...
stackexchange/codereview
I've recently had to dust off my Perl and shell script skills to help out some colleagues. The colleagues in question have been tasked with providing some reports from an internal application with a large Oracle database backend, and they simply don't have the skills to do this. While some might question whether I have...
stackexchange/codereview
I'm having trouble developing a reverse proxy in Twisted. It works, but it seems overly complex and convoluted. So much of it feels like voodoo. Are there any simple, solid examples of asynchronous program structure on the web or in books? A sort of best practices guide? When I complete my program I'd like to be able t...
stackexchange/codereview
While refactoring some old code I have stripped out a number of public methods that should actually of been statics as they a) don't operate on any member data or call any other member functions and b) because they might prove useful elsewhere. This led me to think about the best way to group 'helper' functions togethe...
stackexchange/codereview
Here is the situation I'd like to create: www.blah.com/priv - protected by Apache HTTP Basic Auth, realm "foo" www.blah.com/application - protected by Tomcat/Servlet HTTP Basic Auth, realm "foo" User access /priv, apache requests login info, they provide and are given access Same user then requests /application. Sinc...
stackexchange/codereview
For some reason the combination of swfobject.js and script.aculo.us Ajax.Autocompleter on the same page causes the latter to fail. Autocompleter doesn't make its Ajax request. A separate Ajax control on the same page that uses Ajax.Updater doesn't seem to have the same problem.
stackexchange/codereview
Although the PDF specification is available from Adobe, it's not exactly the simplest document to read through. PDF allows documents to be encrypted so that either a user password and/or an owner password is required to do various things with the document (display, print, etc). A common use is to lock a PDF so that e...
stackexchange/codereview
I deleted a branch in TFS and just found out that I need the changes that were on it. How do I recover the branch or the changes done on it?
stackexchange/codereview
We have an application that has to be flexible in how it displays it's main form to the user - depending on the user, the form should be slightly different, maybe an extra button here or there, or some other nuance. In order to stop writing code to explicitly remove or add controls etc, I turned to visual inheritance ...
stackexchange/codereview
I'm trying to deploy a .war trough the server's web interface. Getting the same error when deploying it as an exploded directory with IDEA. What is the solution to this problem?
stackexchange/codereview
Puzzled by the Lua 5.0 documentation references to things like _LOADED, LUA_PATH, _ALERT and so on (that I could not use in Lua 5.1), I discovered all of those have been removed and the functionality put elsewhere. Am I right in thinking that the only one global variable left in Lua 5.1 is _VERSION?
stackexchange/codereview
I've done some research on using tags from social bookmarking sites for web search, but I'd like to learn more about other ways in which users might use tags for information retrieval. Do you use the tags on sites like Stack Overflow for navigation? Do you think of them like filters (narrowing down a large list of q...
stackexchange/codereview
I'm using firefox3 to run a Java Applet (on Linux). normally, when the JVM launches the Java Console window opens so I can see output from the Applet (stack traces etc.). However, if I close the console there appears to be no way of getting it back short of restarting Firefox (I have to close the console because it mak...
stackexchange/codereview
So I've got some C code: #include <stdio.h> #include <string.h> /* putting one of the "char*"s here causes a segfault */ void main() { char* path = "/temp"; char* temp; strcpy(temp, path); } This compiles, runs, and behaves as it looks. However, if one or both of the character pointers is declared as global var...
stackexchange/codereview
What is the proper technique to have ThreadA signal ThreadB of some event, without having ThreadB sit blocked waiting for an event to happen? i have a background thread that will be filling a shared List<T>. i'm trying to find a way to asynchronously signal the "main" thread that there is data available to be picked up...
stackexchange/codereview
I would like to encrypt strings which could potentially only be about three or four characters but run to about twenty characters. A hashing function (md5, sha1, crypt etc) is not suitable as I would like to be able to decrypt the information as well. The mcrypt extension has a thoroughly daunting array of possibilitie...
stackexchange/codereview
I have a 2D model where each row represents a frame in a video, and each column represents an object. The object can have different states on each frame, and this is stored in the model. Then I have a QTableView that shows this data. The model has header data, so each row has a header like "frame k" and each column has...
stackexchange/codereview
Rails comes with RESTful resources out of the box, but do you use those for your actual public API? If so, how would you accomplish versioning of your API i.e. example.com/api/v2/foo/bar?
stackexchange/codereview
Could any one give an explanation on how a DHT works? Nothing too heavy, just the basics.
stackexchange/codereview
I am trying to write a web-app to manage references for my PhD thesis. I used to manage this information inside a personal Confluence (fantastic tool! - http://www.atlassian.com/software/confluence/) instance however I'm fed-up with the opening of PDF's and cutting and pasting values into fields that I wish to record. ...
stackexchange/codereview
I'm looking for pseudocode, or sample code, to convert higher bit ascii characters (like, Ü which is extended ascii 154) into U (which is ascii 85). My initial guess is that since there are only about 25 ascii characters that are similar to 7bit ascii characters, a translation array would have to be used. Let me know i...
stackexchange/codereview
Events are synchronous in C#. I have this application where my main form starts a thread with a loop in it that listens to a stream. When something comes along on the stream an event is fired from the loop to the main form. If the main form is slow or shows a messagebox or something the loop will be suspended. What is...
stackexchange/codereview