instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I have several applications that are part of a suite of tools that various developers at our studio use. these applications are mainly command line apps that open a DOS cmd shell. These apps in turn start up a GUI application that tracks output and status (via sockets) of these command line apps. The command line app...
stackexchange/codereview
How can I, as the wiki admin, enter scripting (Javascript) into a Sharepoint wiki page? I would like to enter a title and, when clicking on that, having displayed under it a small explanation. I usually have done that with javascript, any other idea?
stackexchange/codereview
OK-- thanks to Mike, I was able to get Wincrypt to generate a Diffie-Hellman keypair. I figured out out to export the public key, and how to import the other party's public key. According to the docs, upon import of the other party's public key, the shared secret has been computed. Great. I now need to get ahold of ...
stackexchange/codereview
How do I go about programmatically creating audio streams using Cocoa on the Mac. To make, say a white-noise generator using core frameworks on Mac OSX in Cocoa apps?
stackexchange/codereview
Is there a tool or script which easily merges a bunch of JAR files into one JAR file? A bonus would be to easily set the main-file manifest and make it executable. The concrete case is a Java restructured text tool. I would like to run it with something like: java -jar rst.jar As far as I can tell, it has no dependen...
stackexchange/codereview
I was wondering if there is a better way to cope with MS-Access' inability to handle NULL for boolean-values other than change the column-data-type to integer.
stackexchange/codereview
For example, right now I have a roll-my-own solution that uses data files that include blocks like: PlayerCharacter Fighter Hitpoints 25 Strength 10 StartPosition (0, 0, 0) Art Model BigBuffGuy Footprint LargeFootprint end InventoryItem Sword InventoryItem Shield InventoryItem HealthPotion end ...
stackexchange/codereview
I have been sick and tired Googling the solution for doing case-insensitive search on Sybase ASE (Sybase data/column names are case sensitive). The Sybase documentation proudly says that there is only one way to do such search which is using the Upper and Lower functions, but the adage goes, it has performance problems...
stackexchange/codereview
I know the combination Ctrl+A to jump to the beginning of the current command, and Ctrl+E to jump to the end. But is there any way to jump word by word, like Alt+←/→ in Cocoa applications does?
stackexchange/codereview
I have an ETL process that involves a stored procedure that makes heavy use of SELECT INTO statements (minimally logged and therefore faster as they generate less log traffic). Of the batch of work that takes place in one particular stored the stored procedure several of the most expensive operations are eager spools ...
stackexchange/codereview
The question says it all basically. I want in a class MyClass to listen to a routed event. Can it be done ?
stackexchange/codereview
How do people usually detect the MIME type of an uploaded file using ASP.NET?
stackexchange/codereview
I re-image one of my machines regularly; and have a script that I run after the OS install completes to configure my machine; such that it works how I like. I happen to have my data on another drive...and I'd like to add code to my script to change the location of the Documents directory from "C:\Users\bryansh\Document...
stackexchange/codereview
PL/SQL is not my native tongue. Oracle supports writing stored procedures in Java. What are the advantages of doing this over writing the stored procedures in PL/SQL
stackexchange/codereview
I'm new to Ruby, so I'm having some trouble understanding this weird exception problem I'm having. I'm using the ruby-aaws gem to access Amazon ECS: http://www.caliban.org/ruby/ruby-aws/. This defines a class Amazon::AWS:Error: module Amazon module AWS # All dynamically generated exceptions occur within this name...
stackexchange/codereview
Is there a pattern that is good to use when saving and loading different file formats? For example, I have a complicated class hierarchy for the document, but I want to support a few different file formats. I thought about the Strategy pattern, but I'm not convinced because of the need to access every part of the objec...
stackexchange/codereview
struct foo { unsigned x:1; } f; printf("%d\n", (int)sizeof(f.x = 1)); What is the expected output and why? Taking the size of a bitfield lvalue directly isn't allowed. But by using the assignment operator, it seems we can still take the size of a bitfield type. What is the "size of a bitfield in bytes"? Is it the si...
stackexchange/codereview
I have a webservice that that uses message layer security with X.509 certificates in WSE 3.0. The service uses a X509v3 policy to sign various elements in the soapheader. I need to do some custom checks on the certificates so I've tried to implement a custom X509SecurityTokenManager and added a section in web.config. W...
stackexchange/codereview
Can anyone recommend some decent resources for a .NET developer who wishes to get a high level overview of the Delphi Programming Language? We are about acquire a small business whose main product is developed in Delphi and I am wanting to build up enough knowledge to be able to talk the talk with them. Books, websites...
stackexchange/codereview
How does one convert a .Net DateTime into a valid HTTP-formatted date string?
stackexchange/codereview
Is there a Ruby equivalent for Python's "is"? It tests whether two objects are identical (i.e. have the same memory location).
stackexchange/codereview
I need some help with ASP.NET MVC routes. I need to create 2 routes for a cms type application. One route will be for category level URLS, and the other route will be for the actual page content. categories, always ends in a '/' www.example.com/category/ www.example.com/category/subcategory/ www.example.com/category...
stackexchange/codereview
I'm interested in using Office 2007 to convert between the pre-2007 binary formats (.doc, .xls, .ppt) and the new Office Open XML formats (.docx, .xlsx, .pptx) How would I do this? I'd like to write a simple command line app that takes in two filenames (input and output) and perhaps the source and/or destination types,...
stackexchange/codereview
If I had 20 directories under trunk/ with lots of files in each and only needed 3 of those directories, would it be possible to do a Subversion checkout with only those 3 directories under trunk?
stackexchange/codereview
Is the real benefit in TDD the actual testing of the application, or the benefits that writing a testable application brings to the table? I ask because I feel too often the conversation revolves so much around testing, and not the total benefits package.
stackexchange/codereview
The log4j network adapter sends events as a serialised java object. I would like to be able to capture this object and deserialise it in a different language (python). Is this possible? NOTE The network capturing is easy; its just a TCP socket and reading in a stream. The difficulty is the deserialising part
stackexchange/codereview
In Ruby, trying to print out the individual elements of a String is giving me trouble. Instead of seeing each character, I'm seeing their ASCII values instead: >> a = "0123" => "0123" >> a[0] => 48 I've looked online but can't find any way to get the original "0" back out of it. I'm a little new to Ruby to I know it ...
stackexchange/codereview
I'm designing my database and LINQ To SQL ASP.NET web application. Imagine I have two types of pages: normal and root. Some pages are roots. Some pages are not. I have a Page database table and a RootPage database table: Page ---- PK PageId HtmlTitle PageHeading MetaDescription ...
stackexchange/codereview
For debugging and testing I'm searching for a JavaScript shell with auto completion and if possible object introspection (like ipython). The online JavaScript Shell is really nice, but I'm looking for something local, without the need for an browser. So far I have tested the standalone JavaScript interpreter rhino, spi...
stackexchange/codereview
Anyone got a working example of using ruby to post to a presigned URL on s3
stackexchange/codereview
Has anyone integrated an "Open in Google Docs" in their web app yet? Gmail has this for opening attachments. How about any other sightings of this in a non-google web app?
stackexchange/codereview
I.e., a web browser client would be written in C++ !!!
stackexchange/codereview
Is it possible to create an instance of a generic type in Java? I'm thinking based on what I've seen that the answer is no (due to type erasure), but I'd be interested if anyone can see something I'm missing: class SomeContainer<E> { E createContents() { return what??? } } EDIT: It turns out that S...
stackexchange/codereview
If you have a statically allocated array, the Visual Studio debugger can easily display all of the array elements. However, if you have an array allocated dynamically and pointed to by a pointer, it will only display the first element of the array when you click the + to expand it. Is there an easy way to tell the de...
stackexchange/codereview
Here's a very simple Prototype example. All it does is, on window load, an ajax call which sticks some html into a div. <html> <head> <script type="text/javascript" src="scriptaculous/lib/prototype.js"></script> <script type="text/javascript"> Event.observe(window, 'load', function(){ ...
stackexchange/codereview
In C#, when you implement an interface, all members are implicitly public. Wouldn't it be better if we could specify the accessibility modifier (protected, internal, except private of course), or should we just use an abstract class instead?
stackexchange/codereview
Word wrap is one of the must-have features in a modern text editor. How word wrap be handled? What is the best algorithm for word-wrap? If text is several million lines, how can I make word-wrap very fast? Why do I need the solution? Because my projects must draw text with various zoom level and simultaneously beautifu...
stackexchange/codereview
What is the best way to keep a PHP script running as a daemon, and what's the best way to check if needs restarting. I have some scripts that need to run 24/7 and for the most part I can run them using nohup. But if they go down, what's the best way to monitor it so it can be automatically restarted?
stackexchange/codereview
How are people unit testing their business applications? I've seen a lot of examples of unit testing with "simple to test" examples. Ex. a calculator. How are people unit testing data-heavy applications? How are you putting together your sample data? In many cases, data for one test may not work at all for another test...
stackexchange/codereview
How can I use the nifty JavaScript date and time widgets that the default admin uses with my custom view? I have looked through the Django forms documentation, and it briefly mentions django.contrib.admin.widgets, but I don't know how to use it? Here is my template that I want it applied on. <form action="." method="PO...
stackexchange/codereview
I want to take a QTMovie that I have and export it with the audio fading in and fading out for a predetermined amount of time. I want to do this within Cocoa as much as possible. The movie will likely only have audio in it. My research has turned up a couple of possibilities: Use the newer Audio Context Insert APIs. h...
stackexchange/codereview
I have a big string (let's call it a CSV file, though it isn't actually one, it'll just be easier for now) that I have to parse in C# code. The first step of the parsing process splits the file into individual lines by just using a StreamReader object and calling ReadLine until it's through the file. However, any given...
stackexchange/codereview
I am running MAMP locally on my laptop, and I like to test as much as I can locally. Unfortunately, since I work on e-commerce stuff (PHP), I normally force ssl in most of the checkout forms and it just fails on my laptop. Is there any easy configuration that I might be missing to allow "https" to run under MAMP? Pleas...
stackexchange/codereview
I recently came across an IE7 only bug that I thought I'd share so when I come to this site 6 months from now to figure out the same thing, I'll have it on hand. I believe the easiest way to recreate this bug would be the following html in a page with a declared doctype (it works correctly in "quirks mode" / no-doctyp...
stackexchange/codereview
Using Oracle 10g with our testing server what is the most efficient/easy way to backup and restore a database to a static point, assuming that you always want to go back to the given point once a backup has been created. A sample use case would be the following install and configure all software Modify data to the bas...
stackexchange/codereview
I want to create a code/knowledge base where I can save my vb.net/c#.net/sqlserver code snippets for use later. I've tried setting the ValidateRequest property to false in my page directive, and encoding the value with HttpUtility.HtmlEncode (c#.net), but I still get errors. thoughts?
stackexchange/codereview
Suppose you're developing a software product that has periodic releases. What are the best practices with regard to branching and merging? Slicing off periodic release branches to the public (or whomever your customer is) and then continuing development on the trunk, or considering the trunk the stable version, tagging...
stackexchange/codereview
I am using D2007 and am trying to document my source code, using the HelpInsight feature (provided since D2005). I am mainly interested in getting the HelpInsight tool-tips working. From various Web-surfing and experimentation I have found the following: Using the triple slash (///) comment style works more often th...
stackexchange/codereview
I'm using OLEDB provider for ADO.Net connecting to an Oracle database. In my loop, I am doing an insert: insert into ps_tl_compleave_tbl values('2626899', 0, TO_DATE('01/01/2002', 'MM/DD/YYYY'), 'LTKN', 'LTKN', '52', TO_DATE('01/01/2002', 'MM/DD/YYYY'), 16.000000, 24.000)insert into ps_tl_compleave_tbl values('4327142...
stackexchange/codereview
How can I construct a MSBuild ItemGroup to exclude .svn directories and all files within (recursively). I've got: <ItemGroup> <LibraryFiles Include="$(LibrariesReleaseDir)\**\*.*" Exclude=".svn" /> </ItemGroup> At the moment, but this does not exclude anything!
stackexchange/codereview
I need to create sql dependency on a table in sql server 2000 in my asp.net 2.0 pages. What are the required actions and what is the best way? Thanks..
stackexchange/codereview
I am writing a simple checkers game in Java. When I mouse over the board my processor ramps up to 50% (100% on a core). I would like to find out what part of my code(assuming its my fault) is executing during this. I have tried debugging, but step-through debugging doesn't work very well in this case. Is there any too...
stackexchange/codereview
I am working on a web application where I want the content to fill the height of the entire screen. The page has a header, which contains a logo, and account information. This could be an arbitrary height. I want the content div to fill the rest of the page to the bottom. I have a header div and a content div. At the m...
stackexchange/codereview
I'm interested in writing eclipse plugins where do I start? What resources have helped you? I'm looking for: 1. Tutorials 2. Sites devoted to plugin development 3. Books
stackexchange/codereview
My gcc build toolchain produces a .map file. How do I display the memory sections using memory map graphically?
stackexchange/codereview
In C++ Windows app, I launch several long running child processes (currently I use CreateProcess(...) to do this. I want the child processes to be automatically closed if my main processes crashes or is closed. Because of the requirement that this needs to work for a crash of the "parent", I believe this would need to...
stackexchange/codereview
The .NET System.Security.Cryptography namespace has a rather bewildering collection of algorithms that I could use for encryption of credit card details. Which is the best? It clearly needs to be secure for a relatively short string. EDIT: I'm in the UK, where I understand we're OK storing encrypted credit card detail...
stackexchange/codereview
How can I use .NET DataSet.Select method to search records that match a DateTime? What format should I use to enter my dates in?
stackexchange/codereview
I'm trying to make it so when a user scrolls down a page, click a link, do whatever it is they need to do, and then come back to the pages w/ links, they are at the same (x-y) location in the browser they were before. How do I do that? I'm a DOM Newbie so I don't know too much about how to do this. Target Browsers: ...
stackexchange/codereview
I've just run into a display glitch in IE6 with the ExtJS framework. - Hopefully someone can point me in the right direction. In the following example, the bbar for the panel is displayed 2ems narrower than the panel it is attached to (it's left aligned) in IE6, where as in Firefox it is displayed as the same width as ...
stackexchange/codereview
I need a pseudorandom number generator algorithm for a assembler program assigned in a course, and I would prefer a simple algorithm. However, I cannot use an external library. What is a good, simple pseudorandom number generator algorithm for assembly?
stackexchange/codereview
I am attempting to set an asp.net textbox to a SQL 2005 money data type field, the initial result displayed to the user is 40.0000 instead of 40.00. In my asp.net textbox control I would like to only display the first 2 numbers after the decimal point e.g. 40.00 What would be the best way to do this? My code is below: ...
stackexchange/codereview
I have a asp.net 2.0 web site with numerous asp:DropDownList controls. The DropDownList control contains the standard info city, state, county etc... info. In addition to the standard codes the site also has custom codes that the users can configure themselves. For example a animal dropdown may contain the values Dog, ...
stackexchange/codereview
How do I make diff ignore temporary files like foo.c~? Is there a configuration file that will make ignoring temporaries the default? More generally: what's the best way to generate a "clean" patch off a tarball? I do this rarely enough (submitting a bug fix to an OSS project by email) that I always struggle with it......
stackexchange/codereview
In the past I had to develop a program which acted as a rule evaluator. You had an antecedent and some consecuents (actions) so if the antecedent evaled to true the actions where performed. At that time I used a modified version of the RETE algorithm (there are three versions of RETE only the first being public) for th...
stackexchange/codereview
In a web application, I have a page that contains a DIV that has an auto-width depending on the width of the browser window. I need an auto-height for the object. The DIV starts about 300px from the top screen, and its height should make it stretch to the bottom of the browser screen. I have a max height for the cont...
stackexchange/codereview
I've got a search results page that basically consists of a repeater with content in it. What I need is a way to paginate the results. Getting paginated results isn't the problem, what I'm after is a web control that will display a list of the available paged data, preferably by providing the number of results and a ...
stackexchange/codereview
We have hundreds of websites which were developed in asp, .net and java and we are paying lot of money for an external agency to do a penetration testing for our sites to check for security loopholes. Are there any (good) software (paid or free) to do this? or.. are there any technical articles which can help me deve...
stackexchange/codereview
I'm attracted to the neatness that a single file database provides. What driver/connector library is out there to connect and use SQLite with Java. I've discovered a wrapper library, http://www.ch-werner.de/javasqlite, but are there other more prominent projects available?
stackexchange/codereview
If the major axis of the ellipse is vertical or horizontal, it's easy to calculate the bounding box, but what about when the ellipse is rotated? The only way I can think of so far is to calculate all the points around the perimeter and find the max/min x and y values. It seems like there should be a simpler way. If the...
stackexchange/codereview
I have a simple SQL 'Select' query, and I'd like to dump the results into an Excel file. I'm only able to save as .csv and converting to .xls creates some super ugly output. In any case, as far as I can tell (using Google) this doesn't seem to be so straight forward. Any help would be greatly appreciated.
stackexchange/codereview
Can anyone tell me what is the memory usage overhead associated with PHP opcode cache? I've seen a lot of reviews of opcode cache but all of them only concentrate on the performance increase. I have a small entry level VPS and memory limits are a concern for me.
stackexchange/codereview
We have concurrent edits happening on Word documents and I want to make sure that Subversion can handle merging .doc files. Do you know if Subversion handles merges of Word documents well?
stackexchange/codereview
What is the difference between different optimization levels in GCC? Assuming I don't care to have any debug hooks, why wouldn't I just use the highest level of optimization available to me? does a higher level of optimization necessarily (i.e. provably) generate a faster program?
stackexchange/codereview
In an embedded application, we have a table describing the various address ranges that are valid on our target board. This table is used to set up the MMU. The RAM address range is marked as cacheable, but other regions are not. Why is that?
stackexchange/codereview
I'm trying to remotely control a Macintosh computer. I know that in the Windows world, you can use Remote Desktop to connect from one Windows computer to another Windows computer. This works relatively well. I know that you can use a VNC server but this isn't always the most secure or give the best performance. Are ...
stackexchange/codereview
Today I discovered that my fresh installation of Apache HTTP Server is able to serve files from my C:\uploads\ directory. I have two folders in C:\uploads: C:\uploads\templates C:\uploads\sites Both folders contain testimage.jpg. I found that Apache will serve the files from the templates folder if I request: http:...
stackexchange/codereview
I am pretty sure that the settings that I am using are correct, so all possible things can be wrong which I should check out so that I can make authentication with our Active Directory work.
stackexchange/codereview
What CSS should I use to make a cell's border appear even if the cell is empty? IE 7 specifically.
stackexchange/codereview
I want to create dynamic content based on this. I know it's somewhere, as web analytics engines can get this data to determine how people got to your site (referrer, search terms used, etc.), but I don't know how to get at it myself.
stackexchange/codereview
I need to get some information that is contained in the MFT on a Windows machine, and I'm hoping that there is some super-secret API for getting this information. I need to be able to get to this information programmatically, and because of legal concerns I might not be able to use the tools provided by the company for...
stackexchange/codereview
This question is about removing sequences from an array, not duplicates in the strict sense. Consider this sequence of elements in an array; [0] a [1] a [2] b [3] c [4] c [5] a [6] c [7] d [8] c [9] d In this example I want to obtain the following... [0] a [1] b [2] c [3] a [4] c [5] d Notice that duplicate elements ...
stackexchange/codereview
I want to create a list of columns in SQL Server 2005 that have identity columns and their corresponding table in T-SQL. Results would be something like: TableName, ColumnName
stackexchange/codereview
I've got a solution with several different projects in it, some are pure class libraries and some are web app projects. If I want my default types to be available to all projects, where should I put the config file for the container?
stackexchange/codereview
My boss has come to me and asked how to enure a file uploaded through web page is safe. He wants people to be able to upload pdfs and tiff images (and the like) and his real concern is someone embedding a virus in a pdf that is then viewed/altered (and the virus executed). I just read something on a procedure that cou...
stackexchange/codereview
How can one detect being in a chroot jail without root privileges? Assume a standard BSD or Linux system. The best I came up with was to look at the inode value for "/" and to consider whether it is reasonably low, but I would like a more accurate method for detection. [edit 20080916 142430 EST] Simply looking around...
stackexchange/codereview
In C/C++, what an unsigned char is used for? How is it different from a regular char?
stackexchange/codereview
As an example in pseudocode: if ((a mod 2) == 0) { isEven = true; } else { isEven = false; }
stackexchange/codereview
I want to let users specify a date that may or may not include a day and month (but will have at least the year.) The problem is when it is stored as a datetime in the DB; the missing day/month will be saved as default values and I'll lose the original format and meaning of the date. My idea was to store the real forma...
stackexchange/codereview
I found an example in the VS2008 Examples for Dynamic LINQ that allows you to use a SQL-like string (e.g. OrderBy("Name, Age DESC")) for ordering. Unfortunately, the method included only works on IQueryable<T>. Is there any way to get this functionality on IEnumerable<T>?
stackexchange/codereview
I want my website to join some webcam recordings in FLV files (like this one). This needs to be done on Linux without user input. How do I do this? For simplicity's sake, I'll use the same flv as both inputs in hope of getting a flv that plays the same thing twice in a row. That should be easy enough, right? There's ev...
stackexchange/codereview
I'm using the ASP.NET Login Controls and Forms Authentication for membership/credentials for an ASP.NET web application. It keeps redirecting to a Login.aspx page at the root of my application that does not exist. My login page is within a folder.
stackexchange/codereview
I'm building an application that is targeting Windows, Mac and Linux soon. I was wondering where should I keep application data such as settings, etc. Application's installation folder is the easiest choice, but I think that might be a problem with new Vista security model. Besides, users might want different settings....
stackexchange/codereview
Was considering the System.Collections.ObjectModel ObservableCollection<T> class. This one is strange because it has an Add Method which takes one item only. No AddRange or equivalent. the Notification event arguments has a NewItems property, which is a IList (of objects.. not T) My need here is to add a batch of ...
stackexchange/codereview
Am I right in thinking the full name of the LSP is the Liskoff Substitution Principle? I'm having trouble finding an [online] source to cite for any information on this... it seems to be a cornerstone of OOP, and yet I'm having trouble finding definitions.
stackexchange/codereview
I want to use XML instead of SQLServer for a simple website. Are their any good tutorials, code examples, and/or tools available to make a (prefer VB.NET) wrapper class to handle the basic list, insert, edit, and delete (CRUD) code? The closest one I found was on a Telerik Trainer video/code for their Scheduler compon...
stackexchange/codereview
How can I resize an image, with the image quality unaffected?
stackexchange/codereview
Is it possible to open a project in Visual Studio 2008 without opening all the files that were previously opened last time I had the project open. I have a habit of keeping many files open as I am working on them, so next time I open the project, it (very slowly) loads up a bunch of files into the editor that I may no...
stackexchange/codereview
I want to scrape some information off a football (soccer) web page using simple python regexp's. The problem is that players such as the first chap, ÄÄRITALO, comes out as &#196;&#196;RITALO! That is, html uses escaped markup for the special characters, such as &#196; Is there a simple way of reading the html into the...
stackexchange/codereview
Given a reference to a method, is there a way to check whether the method is bound to an object or not? Can you also access the instance that it's bound to?
stackexchange/codereview