instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I'm trying to develop specialized audio player for windows mobile devices (Professional ones). And I've ran into the problem an once. There no compressed audio APIs on WM or I was unable to found house in documentation. Yes there are WM6 Sound API but it cannot even pause playback or seek to specified position. There a...
stackexchange/codereview
I am doing an e-commerce solution in ASP.NET which uses PayPal's Website Payments Standard service. Together with that I use a service they offer (Payment Data Transfer) that sends you back order information after a user has completed a payment. The final thing I need to do is to parse the POST request from them and pe...
stackexchange/codereview
In terms of performance and optimizations: When constructing a table in SQL Server, does it matter what order I put the columns in? Does it matter if my primary key is the first column? When constructing a multi-field index, does it matter if the columns are adjacent? Using ALTER TABLE syntax, is it possible to specif...
stackexchange/codereview
I'm displaying a set of images as an overlay using Google Maps. Displaying these images should be in an endless loop but most most browsers detect this, and display a warning. Is there a way to make a endless loop in JavaScript so that it isn't stopped or warned against by the browser?
stackexchange/codereview
Using NSURLRequest, I am trying to access a web site that has an expired certificate. When I send the request, my connection:didFailWithError delegate method is invoked with the following info: -1203, NSURLErrorDomain, bad server certificate My searches have only turned up one solution: a hidden class method in NSURLR...
stackexchange/codereview
I need to check programmatically (in .NET) whether a given user (domain account) is a member of the built-in Administrators group on a current computer (the one where the application gets executed). Is it possible?
stackexchange/codereview
I'm using FBOs in my OpenGL code and I'm seeing compilation errors on GL\_FRAMEBUFFER\_INCOMPLETE\_DUPLICATE\_ATTACHMENT\_EXT. What's the cause of this and how do I fix it?
stackexchange/codereview
For example; with the old command prompt it would be: cmd.exe /k mybatchfile.bat
stackexchange/codereview
Using VS2005 and VB.NET. I have a project that is an API for a data-store that I created. When compiled creates api.dll. I have a second project in the same solution that has a project reference to the API project which when compiled will create wrapper.dll. This is basically a wrapper for the API that is specific to a...
stackexchange/codereview
Is there any Visual Studio Express plug ins for source versioning? I am starting a project on my own and only have the Express version of Visual Studio 2008.
stackexchange/codereview
We're attemtping to merge our DLL's into one for deployment, thus ILMerge. Almost everything seems to work great. We have a couple web controls that use ClientScript.RegisterClientScriptResource and these are 404-ing after the merge (These worked before the merge). For example one of our controls would look like name...
stackexchange/codereview
The command line interface to MySQL works perfectly well in itself, but when using my local copy I'm forced to interact with it using the old-fashioned DOS windows. Is there some way I can redirect it through a better shell?
stackexchange/codereview
I've joined a team that works on a product. This product has been around for ~5 years or so, and uses ASP.NET WebForms. Its original architecture has faded over time, and things have become relatively disorganized throughout the solution. It's by no means terrible, but definitely can use some work; you all know what I ...
stackexchange/codereview
"Microsoft SQL Server Profiler is a graphical user interface to SQL Trace for monitoring an instance of the Database Engine or Analysis Services." I find using SQL Server Profiler extremely useful during development, testing and when I am debugging database application problems. Does anybody know if there is an equival...
stackexchange/codereview
I have a bunch of classes I want to rename. Some of them have names that are small and that name is reused in other class names, where I don't want that name changed. Most of this lives in Python code, but we also have some XML code that references class names. Simple search and replace only gets me so far. In my ca...
stackexchange/codereview
I've been told that I should include PAD files with the freeware applications I distribute so hosting sites can list the information correctly and check for updates, etc. Can you give me some info on using PAD files? Here are general questions which come to mind: Is it worth the effort? Do you use PADGen or an online...
stackexchange/codereview
It looks like we'll be adding CAPTCHA support to Stack Overflow. This is necessary to prevent bots, spammers, and other malicious scripted activity. We only want human beings to post or edit things here! We'll be using a JavaScript (jQuery) CAPTCHA as a first line of defense: http://docs.jquery.com/Tutorials:Safer_Cont...
stackexchange/codereview
I'm integrating .NET support into our C++ application. It's an old-school MFC application, with 1 extra file compiled with the "/clr" option that references a CWinFormsControl. I'm not allowed to remove the linker flag "/NODEFAULTLIB". (We have our own build management system, not Visual Studio's.) This means I have to...
stackexchange/codereview
How can I create rounded corners using CSS?
stackexchange/codereview
There is a legacy CVS repository, which contains a large number of directories, sub-directories, and paths. There is also a large number of branches and tags that do not necessarilly cover all paths & files - usually a subset. How can I find out, which branch / tag covers, which files and paths? CVS log already provide...
stackexchange/codereview
We have a number of users with Windows Mobile 6 and need to apply minor changes. eg. update a registry setting. One option is push and execute an executable file using our device management software. I'd like this to be a little more friendly for the admins who are familiar with scripting in VBScript/JScript etc. What ...
stackexchange/codereview
Where are some good sources of information on binary file layout structures? If I wanted to pull in a BTrieve index file, parse MP3 headers, etc. Where does one get reliable information?
stackexchange/codereview
Have you ever seen any of there error messages? -- SQL Server 2000 Could not allocate ancillary table for view or function resolution. The maximum number of tables in a query (256) was exceeded. -- SQL Server 2005 Too many table names in the query. The maximum allowable is 256. If yes, what have you done? Given up? C...
stackexchange/codereview
I have never worked with web services and rails, and obviously this is something I need to learn. I have chosen to use hpricot because it looks great. Anyway, _why's been nice enough to provide the following example on the hpricot website: #!ruby require 'hpricot' require 'open-uri' # load the RedHanded home page ...
stackexchange/codereview
My university is part of MSDNAA, so I downloaded it a while back, but I just got around to installing it. I guess part of it replaces FrontPage for web editing, and there appears to be a video editor and a vector graphics editor, but I don't think I've even scratched the surface of what it is and what it can do. Could ...
stackexchange/codereview
What is the best and/or easiest way to replace the missing BufferedImage functionality for a Java project I am converting to .NET with IKVM? I'm basically getting "cli.System.NotImplementedException: BufferedImage" exceptions when running the application, which otherwise runs fine.
stackexchange/codereview
If I call finalize() on an object from my program code, will the JVM still run the method again when the garbage collector processes this object? This would be an approximate example: MyObject m = new MyObject(); m.finalize(); m = null; System.gc() Would the explicit call to finalize() make the JVM's garbage collec...
stackexchange/codereview
Wrote the following in PowersHell as a quick iTunes demonstration: $iTunes = New-Object -ComObject iTunes.Application $LibrarySource = $iTunes.LibrarySource foreach ($PList in $LibrarySource.Playlists) { write-host $PList.name } This works well and pulls back a list of playlist names. However on trying to close iTun...
stackexchange/codereview
Regarding Agile development, what are the best practices for testing security per release? If it is a monthly release, are there shops doing pen-tests every month?
stackexchange/codereview
I had been happily coding along on a decent sized solution (just over 13k LOC, 5 projects) which utilizes Linq to Sql for it's data access. All of sudden I performed a normal build and I received a sweet, sweet ambiguous message: Error 1 Build failed due to validation errors in C:\xxx\xxx.dbml. Open the file and resolv...
stackexchange/codereview
We are a small team of 3 developers (2 experienced but new to this particular business sector) developing a functionally complex product. We're using Scrum and have a demo at the end of each sprint. Its clear that the functional team have plenty of ideas but these are not well communicated to the development team an...
stackexchange/codereview
I prefer SlickEdit for my IDE but the only way I can get it to update the tag files to incorporate code changes is to recreate the project and/or run start a re-tag manually. Is there a way to setup Slick Edit so that it automatically incorporates changes in the code base that happen after project creation. This proble...
stackexchange/codereview
I've just started developing an ExtJS application that I plan to support with a very lightweight JSON PHP service. Other than that, it will be standalone. My question is, what is the best way to organize the files and classes that will inevitably come into existence? Anyone have any experience with large ExtJS projec...
stackexchange/codereview
Sorry for the subject line sounding like an even nerdier Harry Potter title. I'm trying to use AS3's Socket class to write a simple FTP program to export as an AIR app in Flex Builder 3. I'm using an FTP server on my local network to test the program. I can successfully connect to the server (the easy part) but I can...
stackexchange/codereview
I've been looking for a decent guide to Haskell for some time, but haven't been able to find one that seems interesting enough to read through and/or makes sense. I've had prior exposure to Haskell a few years back, but I can't remember much about it. I remember the "Aha!"-feeling was incredible when I finally got it, ...
stackexchange/codereview
Saw a post about hidden features in C# but not a lot of people have written linq/lambdas example so... I wonder... What's the coolest (as in the most elegant) use of the C# LINQ and/or Lambdas/anonymous delegates you have ever saw/written? Bonus if it has went into production too!
stackexchange/codereview
MySQL has this incredibly useful yet proprietary REPLACE INTO SQL Command. Can this easily be emulated in SQL Server 2005? Starting a new Transaction, doing a Select() and then either UPDATE or INSERT and COMMIT is always a little bit of a pain, especially when doing it in the application and therefore always keeping ...
stackexchange/codereview
Does anybody know if there is a way to create an SQLite database based on an XSD DataSet? In the past, I've just used a basic SQLite manager, but I want to fuse things a bit more with my .NET development if possible.
stackexchange/codereview
What is the best way to record statistics on the number of visitors visiting my site that have set their browser to block ads?
stackexchange/codereview
I have a sproc that puts 750K records into a temp table through a query as one of its first actions. If I create indexes on the temp table before filling it, the item takes about twice as long to run compared to when I index after filling the table. (The index is an integer in a single column, the table being indexed...
stackexchange/codereview
I'm translating my C# code for YouTube video comments into PHP. In order to properly nest comment replies, I need to re-arrange XML nodes. In PHP I'm using DOMDocument and DOMXPath which closely corresponds to C# XmlDocument. I've gotten pretty far in my translation but now I'm stuck on getting the parent node of a DOM...
stackexchange/codereview
I'm a very experienced Java programmer who has spent my entire time working with Java 1.4 and earlier. Where can I find a quick reference that will give me everything I need to know about the new features in Java5 and later in a quick reference?
stackexchange/codereview
Has anybody got this to actually work? Documentation is non existent on how to enable this feature and I get missing attribute exceptions despite having a 3.5 SP1 project.
stackexchange/codereview
I have a little game written in C#. It uses a database as back-end. It's a trading card game, and I wanted to implement the function of the cards as a script. What I mean is that I essentially have an interface, ICard, which a card class implements (public class Card056: ICard) and which contains a function that is ca...
stackexchange/codereview
I have been trying to implement Win32's MessageBox using GTK. The app uses SDL/OpenGL, so this isn't a GTK app. I handle the initialization (gtk_init) sort of stuff inside the MessageBox function as follows: int MessageBox(HWND hwnd, const char* text, const char* caption, UINT type) { GtkWidget *window = NULL; ...
stackexchange/codereview
What's the optimal level of concurrency that the C++ implementation of BerkeleyDB can reasonably support? How many threads can I have hammering away at the DB before throughput starts to suffer because of resource contention? I've read the manual and know how to set the number of locks, lockers, database page size, e...
stackexchange/codereview
Using the same sort command with the same input produces different results on different machines. How do I fix that?
stackexchange/codereview
I'm looking for a tool which can generate a Makefile for a C/C++ project for different compilers (GCC, Microsoft Visual C++, C++Builder, etc.) and different platforms (Windows, Linux, and Mac).
stackexchange/codereview
Well, i've got a nice WPF book its called Sams Windows Presentation Foundation Unleashed. I really like to read and learn with it. Are there any other WPF books you could recommend?
stackexchange/codereview
I'm having a weird issue with Visual Studio 2008. Every time I fire it up, the solution explorer is about an inch wide. It's like it can't remember it's layout settings. Every un-docked window is in the position I place it. But if I dock a window, it's position is saved, but it's size will be reset to very-narrow (arou...
stackexchange/codereview
What are the best practices for checking in BIN directories in a collaborative development environment using SVN? Should project level references be excluded from checkin? Is it easier to just add all bin directories? I develop a lot of DotNetNuke sites and it seems that in a multi-developer environment, it's always ...
stackexchange/codereview
I often have to sort a dictionary (consisting of keys & values) by value. For example, I have a hash of words and respective frequencies that I want to order by frequency. There is a SortedList which is good for a single value (say frequency), that I want to map back to the word. SortedDictionary orders by key, not val...
stackexchange/codereview
My HTML is all marked up, ready to make it rain CSS. The problem is that I have to go back and find out what all my id and class names are so I can get started. What I need is a tool that parses my HTML and spits out a stylesheet with all the possible elements ready to be styled (maybe even with some defaults). Does...
stackexchange/codereview
I'm trying to compile over 100 java classes from different packages from a clean directory (no incremental compiles) using the following ant tasks: <target name="-main-src-depend"> <depend srcdir="${src.dir}" destdir="${bin.dir}" cache="${cache.dir}" closure="true"/> </target> ...
stackexchange/codereview
I am reading a binary file into a parsing program. I will need to iterate through the file and look for certain markers so I can split the file up and pass those parts into their respective object’s constructors. Is there an advantage to holding the file as a stream, either MemoryStream or FileStream, or should it be ...
stackexchange/codereview
For years I have been using the DEBUG compiler constant in VB.NET to write messages to the console. I've also been using System.Diagnostics.Debug.Write in similar fashion. It was always my understanding that when RELEASE was used as the build option, that all of these statements were left out by the compiler, freeing...
stackexchange/codereview
I've been able to find details on several self-balancing BSTs through several sources, but I haven't found any good descriptions detailing which one is best to use in different situations (or if it really doesn't matter). I want a BST that is optimal for storing in excess of ten million nodes. The order of insertion ...
stackexchange/codereview
With the rise of multicore CPUs on the desktop, multithreading skills will become a valuable asset for programmers. Can you recommend some good resources (books, tutorials, websites, etc.) for a programmer who is looking to learn about threaded programming?
stackexchange/codereview
What is actually the difference between these two casts? SomeClass sc = (SomeClass)SomeObject; SomeClass sc2 = SomeObject as SomeClass; Normally, shouldn't they both be explicit casts to the specified type?
stackexchange/codereview
Jeff mentioned the concept of 'Progressive Enhancement' when talking about using JQuery to write stackoverflow. After a quick Google, I found a couple of high-level discussions about it. Can anyone recommend a good place to start as a programmer. Specifically, I have been writing web apps in PHP and would like to use Y...
stackexchange/codereview
I'm currently designing a program that will involve some physics (nothing too fancy, a few balls crashing to each other) What's the most exact datatype I can use to represent position (without a feeling of discrete jumps) in c#? Also, what's the smallest ammount of time I can get between t and t+1? One tick? EDIT: Clar...
stackexchange/codereview
I have a large text template which needs tokenized sections replaced by other text. The tokens look something like this: ##USERNAME##. My first instinct is just to use String.Replace(), but is there a better, more efficient way or is Replace() already optimized for this?
stackexchange/codereview
How does one go about authoring a Regular Expression that matches against all strings that are valid URIs, while failing to match against all strings that are invalid URIs? To be specific about what I am referencing when I say URI, I have added a link below for the most current URI RFC standard. It defines the entity t...
stackexchange/codereview
I often run into the following problem. I work on some changes to a project that require new tables or columns in the database. I make the database modifications and continue my work. Usually, I remember to write down the changes so that they can be replicated on the live system. However, I don't always remember what I...
stackexchange/codereview
What are some guidelines for maintaining responsible session security with PHP? There's information all over the web and it's about time it all landed in one place!
stackexchange/codereview
I am working on a collection of classes used for video playback and recording. I have one main class which acts like the public interface, with methods like play(), stop(), pause(), record() etc... Then I have workhorse classes that do the video decoding and video encoding. I just learned about the existence of nested ...
stackexchange/codereview
I'm trying to set the group type for a new Active Directory Entry via VB.NET and DirectoryServices to create a distribution list. How do I access the ADS_GROUP_TYPE enumerations? Specifically I'm after ADS_GROUP_TYPE_GLOBAL_GROUP.
stackexchange/codereview
Suppose we have a table A: itemid mark 1 5 2 3 and table B: itemid mark 1 3 3 5 I want to join A*B on A.itemid=B.itemid both right and left ways. i.e. result: itemid A.mark B.mark 1 5 3 2 3 NULL 3 NULL 5 Is there a way to do it in one query in MySQL?
stackexchange/codereview
I need to display some interactive (attaching with DOM listeners etc. and event handling) vector graphics in web site I am working on. There is a W3C recommendation for SVG though this format is still not recognized by Internet Explorer support of which is a must (for a public website). IE handles VML though and there ...
stackexchange/codereview
When using a Zend_Form, the only way to validate that an input is not left blank is to do $element->setRequired(true); If this is not set and the element is blank, it appears to me that validation is not run on the element. If I do use setRequired(), the element is automatically given the standard NotEmpty validator. ...
stackexchange/codereview
I have an NHibernate session. In this session, I am performing exactly 1 operation, which is to run this code to get a list: public IList<Customer> GetCustomerByFirstName(string customerFirstName) { return _session.CreateCriteria(typeof(Customer)) .Add(new NHibernate.Expression.EqExpression("FirstName", customerFir...
stackexchange/codereview
When is it appropriate to use an unsigned variable over a signed one? What about in a for loop? I hear a lot of opinions about this and I wanted to see if there was anything resembling a consensus. for (unsigned int i = 0; i < someThing.length(); i++) { SomeThing var = someThing.at(i); // You get the idea....
stackexchange/codereview
I am about to build a piece of a project that will need to construct and post an XML document to a web service and I'd like to do it in Python, as a means to expand my skills in it. Unfortunately, whilst I know the XML model fairly well in .NET, I'm uncertain what the pros and cons are of the XML models in Python. ...
stackexchange/codereview
I'm creating an application that will store a hierarchical collection of items in an XML file and I'm wondering about the industry standard for storing collections in XML. Which of the following two formats is preferred? (If there is another option I'm not seeing, please advise.) Option A <School> <Student Name="Ja...
stackexchange/codereview
I have an SQL server database that I am querying and I only want to get the information when a specific row is null. I used a where statement such as: WHERE database.foobar = NULL and it does not return anything. However, I know that there is at least one result because I created an instance in the database where 'foo...
stackexchange/codereview
How would I go about generating a list of all possible permutations of a string between x and y characters in length, containing a variable list of characters. Any language would work, but it should be portable.
stackexchange/codereview
What is the the best JavaScript compressor available? I'm looking for a tool that: is easy to use has a high compression rate Produce reliable end results (doesn't mess up the code)
stackexchange/codereview
In other words, is this Singleton implementation thread safe: public class Singleton { private static Singleton instance; private Singleton() { } static Singleton() { instance = new Singleton(); } public static Singleton Instance { get { return instance; } } }
stackexchange/codereview
If you create an ASP.NET web file project you have direct access to the Profile information in the web.config file. If you convert that to a Web App and have been using ProfileCommon etc. then you have to jump through a whole bunch of hoops to get your web app to work. Why wasn't the Profile provider built into the ASP...
stackexchange/codereview
I have to create something similiar to Google Calendar, so I created an events table that contains all the events for a user. The hard part is handling re-occurring events, the row in the events table has an event_type field that tells you what kind of event it is, since an event can be for a single date only, OR a re-...
stackexchange/codereview
we're developing a web app to cover all aspects of a printing company from finances, to payroll, to job costing. Its important to be able to control who can access what parts of these applications. Don't want a line employee giving himself a raise, etc... I've heard of the concept of ACL & ACO, but haven't found a go...
stackexchange/codereview
This is a tricky one and I've always relied on techniques, such as permission-based emails (i.e. only sending to people you have permission to send to) and not using blatantly spamish terminology. Of late, some of the emails I send out programmatically have started being shuffled into people's spam folder automatically...
stackexchange/codereview
I'm currently working at a small web development company, we mostly do campaign sites and other promotional stuff. For our first year we've been using a "server" for sharing project files, a plain windows machine with a network share. But this isn't exactly future proof. SVN is great for code (it's what we use now), b...
stackexchange/codereview
I'm having problems using textures that are larger than the OpenGL window or the display size as non-display render targets. What's the solution for this problem?
stackexchange/codereview
The topic says the most of it - what is the reason for the fact that static methods can't be declared in an interface? public interface ITest { public static String test(); } The code above gives me the following error (in Eclipse, at least): "Illegal modifier for the interface method ITest.test(); only public & a...
stackexchange/codereview
I'd like to know the standard way to benchmark a SQL Sever Query, preferably I'd like to know about the tools that come with SQL Server rather than 3rd Party tools.
stackexchange/codereview
In the PHP manual, to show the syntax for functions with optional parameters, they use brackets around each set of dependent optional parameter. For example, for the date() function, the manual reads: string date ( string $format [, int $timestamp = time() ] ) Where $timestamp is an optional parameter, and when left b...
stackexchange/codereview
Here is the scenario: I'm writing an app that will watch for any changes in a specific directory. This directory will be flooded with thousands of files a minute each with an "almost" unique GUID. The file format is this: GUID.dat where GUID == xxxxxxxxxxxxxxxxxxxxxxxxxxxxx (the internal contents aren't relevant, but ...
stackexchange/codereview
What is the meaning of the Java warning? Type safety: The cast from Object to List<Integer> is actually checking against the erased type List I get this warning when I try to cast an Object to a type with generic information, such as in the following code: Object object = getMyList(); List<Integer> list = (List<Integ...
stackexchange/codereview
In Lucene if you had multiple indexes that covered only one partition each. Why does the same search on different indexes return results with different scores? The results from different servers match exactly. i.e. if I searched for : Name - John Smith DOB - 11/11/1934 Partition 0 would return a score of 0.345 Parti...
stackexchange/codereview
I'm writing a simple OpenGL application that uses GLUT. I don't want to roll my own font rendering code, instead I want to use the simple bitmap fonts that ship with GLUT. What are the steps to get them working?
stackexchange/codereview
I need debug some old code that uses a Hashtable to store response from various threads. I need a way to go through the entire Hashtable and print out both keys and the data in the Hastable. How can this be done?
stackexchange/codereview
Please note that this question is from 2008 and now is of only historic interest. What's the best way to create an iPhone application that runs in landscape mode from the start, regardless of the position of the device? Both programmatically and using the Interface Builder.
stackexchange/codereview
User equals untrustworthy. Never trust untrustworthy user's input. I get that. However, I am wondering when the best time to sanitize input is. For example, do you blindly store user input and then sanitize it whenever it is accessed/used, or do you sanitize the input immediately and then store this "cleaned" version? ...
stackexchange/codereview
Part of my everyday work is maintaining and extending legacy VB6 applications. A common engine is written in C/C++ and VB6 uses these functions in order to improve performance. When it comes to asynchronous programming, a C interface is not enough and we rely on COM controls to fire events to VB6. My problem is that w...
stackexchange/codereview
Is there any way to launch IE Mobile's "Favorites" screen directly by specifying any command line parameter?
stackexchange/codereview
My Rails-app has a sign in box with a "remember me" checkbox. Users who check that box should remain logged in even after closing their browser. I'm keeping track of whether users are logged in by storing their id in the user's session. But sessions are implemented in Rails as session cookies, which are not persistent...
stackexchange/codereview
I'm experimenting with Linq and am having trouble figuring out grouping. I've gone through several tutorials but for some reason can't figure this out. As an example, say I have a table (SiteStats) with multiple website IDs that stores a count of how many visitors by type have accessed each site in total and for the pa...
stackexchange/codereview
The manual page for XML::Parser::Style::Objects is horrible. A simple hello world style program would really be helpful. I really wanted to do something like this: (not real code of course) use XML::Parser; my $p = XML::Parser->new(Style => 'Objects', Pkg => 'MyNode'); my $tree = $p->parsefile('foo.xml'); $tree->doSom...
stackexchange/codereview
Is there anything similar to rails' scaffolding for pylons? I've been poking around google, but only found this thing called dbsprockets, which is fine, although probably way too much for my needs. What I really need is a basic CRUD that is based on the SQLAlchemy model.
stackexchange/codereview