instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
This is a shared hosting environment. I control the server, but not necessarily the content. I've got a client with a Perl script that seems to run out of control every now and then and suck down 50% of the processor until the process is killed. With ASP scripts, I'm able to restrict the amount of time the script can...
stackexchange/codereview
I need to provide statistics on how many lines of code (LOC) associated with a system. The application part is easy but I need to also include any code residing within the SQL Server database. This would apply to stored procedures, functions, triggers, etc. How can I easily get that info? Can it be done (accurately) w...
stackexchange/codereview
I know that we shouldn't being using the registry to store Application Data anymore, but in updating a Legacy application (and wanting to do the fewest changes), what Registry Hives are non-administrators allowed to use? Can I access all of HKEY_CURRENT_USER (the application currently access HKEY_LOCAL_MACHINE) witho...
stackexchange/codereview
In trying to figure out this problem (which is still unsolved and I still have no clue what is going on), I am wondering if maybe an external reference to the table in question is causing the problem. For example, a trigger or view or some other such thing. Is there an easy way to find all references to a given databa...
stackexchange/codereview
What do you use to capture webpages, diagram/pictures and code snippets for later reference?
stackexchange/codereview
I'm about to start a project that will record and edit audio files, and I'm looking for a good library (preferably Ruby, but will consider anything other than Java or .NET) for on-the-fly visualization of waveforms. Does anybody know where I should start my search?
stackexchange/codereview
How can I get an image to stretch the height of a DIV class? Currently it looks like this: However, I would like the DIV to be stretched so the image fits properly, but I do not want to resize the `image. Here is the CSS for the DIV (the grey box): .product1 { width: 100%; padding: 5px; margin: 0px 0px 15p...
stackexchange/codereview
While answering Static class variables in Python I noticed that PythonWin PyWin32 build 209.2 interpreter seems to evaluate twice? PythonWin 2.5 (r25:51908, Mar 9 2007, 17:40:28) [MSC v.1310 32 bit (Intel)] on win32. Portions Copyright 1994-2006 Mark Hammond - see 'Help/About PythonWin' for further copyright informat...
stackexchange/codereview
I'm wanting to change my movie clips to actionscript classes in AS3. Is there a standard list of things I need to do to make sure the classes work?
stackexchange/codereview
Are there any ports to WPF of Silverlight's MultiScaleImage (aka DeepZoom)? Have Microsoft road-mapped this at all for WPF? I want to move from WinForms to WPF and require something like DeepZoom, using Silverlight isn't an option.
stackexchange/codereview
What does "Client-only Framework subset" in Visual Studio 2008 do?
stackexchange/codereview
How do I load a Python module given its full path? Note that the file can be anywhere in the filesystem where the user has access rights. See also: How to import a module given its name as string?
stackexchange/codereview
We have a web application that uses SQL Server 2008 as the database. Our users are able to do full-text searches on particular columns in the database. SQL Server's full-text functionality does not seem to provide support for hit highlighting. Do we need to build this ourselves or is there perhaps some library or knowl...
stackexchange/codereview
Update: giving a much more thorough example. The first two solutions offered were right along the lines of what I was trying to say not to do. I can't know location, it needs to be able to look at the whole document tree. So a solution along these lines, with /Books/ specified as the context will not work: SELECT x.q...
stackexchange/codereview
I am interested in choosing a good structure for an online message board-type application. I will use SO as an example, as I think it's an example that we are all familiar with, but my question is more general; it is about how to achieve the right balance between organization and flexibility in online message boards. ...
stackexchange/codereview
I learned today that NetBeans 6.5 should have an on-the-fly compilation of (single) Java files. This feature is well known from Eclipse: Simply store the file and the compiled class is stored, too. Is NetBeans working the same way? If not, how is it ticking?
stackexchange/codereview
What methods are available for backing up repositories in a Windows environment?
stackexchange/codereview
what I'm after is something I can feed a number into and it will return the highest order bit. I'm sure there's a simple way. Below is an example output (left is the input) 1 -> 1 2 -> 2 3 -> 2 4 -> 4 5 -> 4 6 -> 4 7 -> 4 8 -> 8 9 -> 8 ... 63 -> 32
stackexchange/codereview
Given: e = 'a' + 'b' + 'c' + 'd' How do I write the above in two lines? e = 'a' + 'b' + 'c' + 'd'
stackexchange/codereview
After working for a while developing games, I've been exposed to both variable frame rates (where you work out how much time has passed since the last tick and update actor movement accordingly) and fixed frame rates (where you work out how much time has passed and choose either to tick a fixed amount of time or sleep ...
stackexchange/codereview
I'm trying to create a deployment tool that will install software based on the hardware found on a system. I'd like the tool to be able to determine if the optical drive is a writer (to determine if burning software sould be installed) or can read DVDs (to determine if a player should be installed). I tried uing the fo...
stackexchange/codereview
I am writing a small application that will receive messages to process over smtp port 25. I am looking for an .NET assembly that I can incorporate that will listen to port 25 and talk SMTP. I invision that when a message arrives some event is triggered where I can read the message and process it. Esstentilly I need ...
stackexchange/codereview
Is there any benefit in using a <blockquote> element over a <div>? I was looking at a website's markup to learn CSS and I couldn't figure out why the <blockquote> was being used. EDIT: Yeah sorry I didn't clarify, it was used to hold the <div> tag with username as 'text' and an input tag. There was clearly no quote.
stackexchange/codereview
What database should a beginner use in the C language? Can I use MySQL? Thanks
stackexchange/codereview
I want to fire up a flash presentation inside Powerpoint 2007. I am calling the Win32 ShellExecute() routine. When I run this from a location whose path is a UNC path (\myserver\myfolder\sample.ppt) it does not work. The ShellExecute routine expects 6 arguments, one of which is the path to run it from. I've tried to se...
stackexchange/codereview
I have an XML that I want to load to objects, manipulate those objects (set values, read values) and then save those XMLs back. It is important for me to have the XML in the structure (xsd) that I created. One way to do that is to write my own serializer, but is there a built in support for it or open source in C# that...
stackexchange/codereview
What is the best approach to implement distributed caching with .NET? Edit: I was looking for a general caching schema for internal and external applications
stackexchange/codereview
Also, how do LEFT OUTER JOIN, RIGHT OUTER JOIN, and FULL OUTER JOIN fit in?
stackexchange/codereview
I'd like to write a script/batch that will bunch up my daily IIS logs and zip them up by month. ex080801.log which is in the format of exyymmdd.log ex080801.log - ex080831.log gets zipped up and the log files deleted. The reason we do this is because on a heavy site a log file for one day could be 500mb to 1gb so we zi...
stackexchange/codereview
For my C# app, I don't want to always prompt for elevation on application start, but if they choose an output path that is UAC protected then I need to request elevation. So, how do I check if a path is UAC protected and then how do I request elevation mid-execution?
stackexchange/codereview
How do you create a weak reference to an object in Python?
stackexchange/codereview
I'm using Helicon's ISAPI Rewrite 3, which basically enables .htaccess in IIS. I need to redirect a non-www URL to the www version, i.e. example.com should redirect to www.example.com. I used the following rule from the examples but it affects subdomains: RewriteCond %{HTTPS} (on)? RewriteCond %{HTTP:Host} ^(?!www\.)...
stackexchange/codereview
Programming in vim I often go search for something, yank it, then go back to where I was, insert it, modify it. The problem is that after I search and find, I need to MANUALLY find my way back to where I was. Is there an automatic way to go back to where I was when I initiated my last search?
stackexchange/codereview
I'm trying to produce sheets of photographs with captions arranged in a grid using XSLT and XSL-FO. The photo URLs and captions are produced using a FOR XML query against an SQL Server database, and the number of photos returned varies from sheet to sheet. I want to lay the photos out in four columns, filling the grid ...
stackexchange/codereview
A J2ME client is sending HTTP POST requests with chunked transfer encoding. When ASP.NET (in both IIS6 and WebDev.exe.server) tries to read the request it sets the Content-Length to 0. I guess this is ok because the Content-length is unknown when the request is loaded. However, when I read the Request.InputStream to th...
stackexchange/codereview
We're using the Eclipse CDT 5 C++ IDE on Windows to develop a C++ application on a remote AIX host. Eclipse CDT has the ability to perform remote debugging using gdbserver. Unfortunately, gdbserver is not supported on AIX. Is anyone familiar with a way to debug remotely using Eclipse CDT without gdbserver? Perhaps us...
stackexchange/codereview
Why does the linux kernel generate a segfault on stack overflow? This can make debugging very awkward when alloca in c or fortran creation of temporary arrays overflows. Surely it mjust be possible for the runtime to produce a more helpful error.
stackexchange/codereview
Selecting a large amount of text that extends over many screens in an IDE like Eclipse is fairly easy since you can use the mouse, but what is the best way to e.g. select and delete multiscreen blocks of text or write e.g. three large methods out to another file and then delete them for testing purposes in Vim when usi...
stackexchange/codereview
I'm using a table to design the layout of my web page. I want the table to fill the page even if it doesn't contain much content. Here's the CSS I'm using: html, body { height: 100%; margin: 0; padding: 0; } #container { min-height: 100%; width: 100%; } And I place something like this in the pag...
stackexchange/codereview
Ok, so i'm working on a regular expression to search out all the header information in a site. I've compiled the regular expression: regex = re.compile(r''' <h[0-9]>\s? (<a[ ]href="[A-Za-z0-9.]*">)?\s? [A-Za-z0-9.,:'"=/?;\s]*\s? [A-Za-z0-9.,:'"=/?;\s]? ''', re.X) When i run this in python reg ex. test...
stackexchange/codereview
The application I'm writing is almost complete and I'd like people who speak different languages to use it. I'm not sure where to start, what's the difference between globalisation and culture in regards to programming? How does one take uncommon phrases such as "this application was built to do this and that" instead ...
stackexchange/codereview
I'm using the following html to load dojo from Google's hosting. <script src="http://www.google.com/jsapi"></script> <script type="text/javascript">google.load("dojo", "1.1.1");</script> <script type="text/javascript"> dojo.require("dojox.gfx"); ... This errors out on the requre line with an error like dojox.gfx is un...
stackexchange/codereview
I have a file (fasta file to be specific) that I would like to index, so that I can quickly locate any substring within the file and then find the location within the original fasta file. This would be easy to do in many cases, using a Trie or substring array, unfortunately the strings I need to index are 800+ MBs whic...
stackexchange/codereview
I'm trying to modify my GreaseMonkey script from firing on window.onload to window.DOMContentLoaded, but this event never fires. I'm using FireFox 2.0.0.16 / GreaseMonkey 0.8.20080609 This is the full script that I'm trying to modify, changing: window.addEventListener ("load", doStuff, false); to window.addEventListen...
stackexchange/codereview
When using MediaWiki's markup language, the only thing that I hate is creating numbered lists. The only way I know to create a list is to do something like this: #Item1 #Item2 However, if I want to add spaces or some other text between those lines, the numbering gets lost. For example, the following will create text t...
stackexchange/codereview
Businesses Analyst from my team keeps sending us the updated Requirements documents often and I end up hunting the recent changes by comparing the old version. Is their a good way of comparing the Word documents? Note: We have the track changes option ON, but now the documents looks like a blood bath, complicating it ...
stackexchange/codereview
On my current project, we've been using Struts 1 for the last few years, and ... ahem ... Struts is showing its age. We're slowly migrating our front-end code to an Ajax client that consumes XML from the servers. I'm wondering if any of you have migrated a legacy Struts application to a different framework, and what ch...
stackexchange/codereview
Is there a way to call an external script or program from Flash CS3 every time it builds a SWF file? I'd like to add subversion information using subwcrev - the SVN keywords don't work because they only update when the version class file is updated.
stackexchange/codereview
I've configured (at least I've tried to configure) Lighty to enable the WebDAV plugin when I go to a certain URL. I don't get any errors, so it seems to be working. How, then, do I configure it to serve my subversion repositories (of which I have many)?
stackexchange/codereview
I just want an ASP.NET DropDownList with no selected item. Setting SelectedIndex to -1 is of no avail, so far. I am using Framework 3.5 with AJAX, i.e. this DropDownList is within an UpdatePanel. Here is what I am doing: protected void Page_Load (object sender, EventArgs e) { this.myDropDownList.Selecte...
stackexchange/codereview
Need some advice on working out the team velocity for a sprint. Our team normally consists of about 4 developers and 2 testers. The scrum master insists that every team member should contribute equally to the velocity calculation i.e. we should not distinguish between developers and testers when working out how much we...
stackexchange/codereview
The printf function takes an argument type, such as %d or %i for a signed int. However, I don't see anything for a long value.
stackexchange/codereview
I know and have Xcode, but I was wondering if there were any other complete development environments that support Objective-C? I'm not looking for solutions with vim or emacs, nor editors like BBEdit that support syntax highlighting, but a full fledged IDE with: code completion compilation debugging refactoring Extra...
stackexchange/codereview
I'm creating a web site where all pages hang off a database-driven tree-hierarchy. All but one node has a parent node. Nodes may have role-based read permissions. Some nodes may have special rules (such as: don't display within navigation menus). Nodes may represent links to other nodes (like a shortcut in Windows). ...
stackexchange/codereview
I would like to offer a database connection prompt to the user. I can build my own, but it would be nice if I can use something that somebody else has already built (maybe something built into Windows or a free library available on the Internet). Anybody know how to do this in .Net? EDIT: I found this and thought it wa...
stackexchange/codereview
I have a table in MySQL that has 3 fields and I want to enforce uniqueness among two of the fields. Here is the table DDL: CREATE TABLE `CLIENT_NAMES` ( `ID` int(11) NOT NULL auto_increment, `CLIENT_NAME` varchar(500) NOT NULL, `OWNER_ID` int(11) NOT NULL, PRIMARY KEY (`ID`), ) ENGINE=InnoDB DEFAULT CHARSET=utf8; Th...
stackexchange/codereview
I find myself doing this sort of thing all the time. I've been considering writing a macro/function to make this sort of thing easier, but it occurs to me that I'm probably reinventing the wheel. Is there an existing function that will let me accomplish this same sort of thing more succinctly? (defun remove-low-words ...
stackexchange/codereview
Is .NET 3.5 SP1 Required on the server to use Dynamic Data? It looks like it generates a lot of code and therefore wouldn't require anything special on the server side. I ask because I would like to use it but the shared hosting provider my client is using only have 3.5 installed and not 3.5 SP1.
stackexchange/codereview
Possible Duplicate: What Ruby IDE do you prefer? I've generally been doing stuff on Microsoft .NET out of college almost 2 years ago. I just started looking at Ruby on Rails. So what editor should I use? I'm using Notepad++ right now but can I get debugging etc. somehow?
stackexchange/codereview
I have been mulling over writing a peak-fitting library for a while. I know Python fairly well and plan on implementing everything in Python to begin with but envisage that I may have to re-implement some core routines in a compiled language eventually. IIRC, one of Python's original remits was as a prototyping languag...
stackexchange/codereview
Which built in (if any) tool can I use to determine the allocation unit size of a certain NTFS partition ?
stackexchange/codereview
Is there some way to block access from a referrer using a .htaccess file or similar? My bandwidth is being eaten up by people referred from http://www.dizzler.com which is a flash based site that allows you to browse a library of crawled publicly available mp3s. Edit: Dizzler was still getting in (probably wasn't indic...
stackexchange/codereview
Can I store a database connection in the Session object?
stackexchange/codereview
I have a DTS package with a data transformation task (data pump). I’d like to source the data with the results of a stored procedure that takes parameters, but DTS won’t preview the result set and can’t define the columns in the data transformation task. Has anyone gotten this to work? Caveat: The stored procedure us...
stackexchange/codereview
I'm looking for a way to extract the audio part of a FLV file. I'm recording from the user's microphone and the audio is encoded using the Nellymoser Asao Codec. This is the default codec and there's no way to change this.
stackexchange/codereview
I'm using a winforms webbrowser control to display some content in a windows forms app. I'm using the DocumentText property to write the generated HTML. That part is working spectacularly. Now I want to use some images in the markup. (I also would prefer to use linked CSS and JavaScript, however, that can be worked...
stackexchange/codereview
I have heard using PDB files can help diagnose where a crash occurred. My basic understanding is that you give Visual studio the source file, the pdb file and the crash information (from Dr Watson?) Can someone please explain how it all works / what is involved? (Thank you!)
stackexchange/codereview
I'm developing a multi-threaded application for a Linux embedded platform. At the moment I'm setting the stack size for each thread (via pthread_set_attr) to a fairly large default value. I would like to fine tune that value for each thread to something smaller to reduce my application's memory usage. I could go throug...
stackexchange/codereview
I have a classic client/server (fat client and database) program written in Delphi 2006. When certain conditions are met in the client, I need to notify all the other clients very quickly. Up until now this has been done using UDP broadcasts, but this is no longer viable as clients now connect from outside the LAN and ...
stackexchange/codereview
Did Installing OneCare cause a "Generating user instances in SQL Server is disabled" error? The only change that I've made to my computer is uninstalling AVG and installing the trial for Microsoft OneCare. Did OneCare change the SQLServer installation somehow? This is a very "odd" question but is something I would post...
stackexchange/codereview
I'd like to be able to write a ruby program that can restart without dropping it's socket connections.
stackexchange/codereview
I'm using Eclipse 3.4 (Ganymede) with CDT 5 on Windows. When the integrated spell checker doesn't know some word, it proposes (among others) the option to add the word to a user dictionary. If the user dictionary doesn't exist yet, the spell checker offers then to help configuring it and shows the "General/Editors/Text...
stackexchange/codereview
Is there a redistributable .Net 3.5 installation package that is a silent installer? Or alternatively, is there a switch that can be passed to the main redistributable .Net 3.5 installer to make it silent?
stackexchange/codereview
I'm looking for a light version of REST for a Java web application I'm developing. I've looked at RESTlet (www.restlet.org) and the REST plugin for Struts 2, but I haven't made up my mind. I'm leaning towards RESTlet, as it seems to be lighter. Has anyone implemented a RESTful layer without any of the the frameworks o...
stackexchange/codereview
In Delphi, the application's main help file is assigned through the TApplication.HelpFile property. All calls to the application's help system then use this property (in conjunction with CurrentHelpFile) to determine the help file to which help calls should be routed. In addition to TApplication.HelpFile, each form als...
stackexchange/codereview
I have recently run into an issue where I wanted to add a folder to the directory structure of my project that would become the new 'root' directory for the previously housed files. I've been getting help in a related thread but I wanted to put out a more open ended question to see what a best practice might be. Essen...
stackexchange/codereview
Can anyone suggest some good browser add-on tools/extensions to help with development? I have firebug installed in Firefox which is great for dealing with CSS, HTML and javascript; any other suggestions? Firebug
stackexchange/codereview
How do I create a button control (with CreateWindow of a BUTTON window class) that has a standard system-wide size (especially height) that's consistent with the rest of Windows applications? I should of course take DPI into account and probably other settings. Remark: Using USE_CW_DEFAULT for width and height results...
stackexchange/codereview
How do I make an MD5 hash of a string with Delphi?
stackexchange/codereview
I like Doxygen to create documentation of C or PHP code. I have an upcoming Python project and I think I remember that Python doesn't have /* .. */ comments, and also has its own self-documentation facility which seems to be the pythonic way to document. Since I'm familiar with Doxygen, how can I use it to produce my P...
stackexchange/codereview
What is the best way to refactor the attached code to accommodate multiple email addresses? The attached HTML/jQuery is complete and works for the first email address. I can setup the other two by copy/pasting and changing the code. But I would like to just refactor the existing code to handle multiple email address fi...
stackexchange/codereview
What options / methods / software are available to convert a JAR file to a managed .NET assembly? Please provide all commercial and non-commercial methods in the answer. These don't include solutions which require Java to be installed on the host machine.
stackexchange/codereview
Can someone describe what a symbol table is within the context of C and C++?
stackexchange/codereview
I was planning to use url routing for a Web Forms application. But, after reading some posts, I am not sure if it is an easy approach. Is it better to use the URL Rewrite module for web forms? But, it is only for IIS7. Initially, there was some buzz that URL routing is totally decoupled from Asp.Net MVC and it could be...
stackexchange/codereview
I want to be able to do this. MyInterface interface = new ServiceProxyHelper<ProxyType>(); Here's the object structure MyTypeThatImplementsMyInterface : MyInterface Will this work? public class ProxyType : MyInterface {} public class ServiceProxyHelper<ProxyType> : IDisposable, MyInterface {}
stackexchange/codereview
I understand about race conditions and how with multiple threads accessing the same variable, updates made by one can be ignored and overwritten by others, but what if each thread is writing the same value (not different values) to the same variable; can even this cause problems? Could this code: GlobalVar.property = 1...
stackexchange/codereview
Is there a fast and clean way of returning a JSON hash back from any node in a Ruby on Rails' acts_as_nested_set without using recursion? Here's the recursive solution for reference: class Node < ActiveRecord::Base has_many :products def json_hash if children.size > 0 children.collect { |node| { node.name...
stackexchange/codereview
A Sprint cellular modem plugs into a laptop - often the PCMCIA slot. To connect, the user opens a program called the Connection Manager. This program has a menu option to display the serial number and phone number of the modem that's currently inserted. Does that imply that the serial/phone number of the modem could be...
stackexchange/codereview
The question is how to make the similar thing like symlink in windows like in *nix. It's really hard to write whole path to the file in console (even using [tab], it's not the way if you need to change language). Adding everything in PATH is tiring too. It'll be great to make a symlink running one command. Actually I'm...
stackexchange/codereview
Why can't you do this and is there are work around? You get this error. Msg 2714, Level 16, State 1, Line 13 There is already an object named '#temptable' in the database. declare @x int set @x = 1 if (@x = 0) begin select 1 as Value into #temptable end else begin select 2 as Value into #temptable end select ...
stackexchange/codereview
Today I had a coworker suggest I refactor my code to use a label statement to control flow through 2 nested for loops I had created. I've never used them before because personally I think they decrease the readability of a program. I am willing to change my mind about using them if the argument is solid enough however....
stackexchange/codereview
Looking to get your take on an automated testing tool (voting should bring good ones to the top) Ideal tool would: Eliminate the need to present a set of values to a method. employ techniques such as Interactive Exploratory Testing where the code is examined to determine what values are required to exercise all code ...
stackexchange/codereview
I have a Visual Studio application with a splash screen image cut into "slices". The positions are specified in the Form Designer so they line up properly on the screen. However, the images are out of place when the application is run on the Chinese version of Windows XP. It looks as if the image slices were "exploded"...
stackexchange/codereview
Let me use the following example to explain my question: public string ExampleFunction(string Variable) { return something; } string WhatIsMyName = "Hello World"; string Hello = ExampleFunction(WhatIsMyName); When I pass the variable WhatIsMyName to the ExampleFunction, I want to be able to get a string of the or...
stackexchange/codereview
Reading over the responses to this question Disadvantages of Test Driven Development? I got the impression there is alot of misunderstanding on what TDD is and how it should be conducted. It may prove useful to address these issues here.
stackexchange/codereview
Lets say that you have websites www.xyz.com and www.abc.com. Lets say that a user goes to www.abc.com and they get authenticated through the normal ASP .NET membership provider. Then, from that site, they get sent to (redirection, linked, whatever works) site www.xyz.com, and the intent of site www.abc.com was to pass...
stackexchange/codereview
Using C++ (and Qt), I need to process a big amount of 3D coordinates. Specifically, when I receive a 3D coordinate (made of 3 doubles), I need to check in a list if this coordinate has already been processed. If not, then I process it and add it to the list (or container). The amount of coordinates can become very big,...
stackexchange/codereview
If all you see is the ugly no-char boxes, what tools or strategies do you use to figure out what went wrong? (The specific scenario I'm facing is no-char boxes within a <select> when it should be showing Japanese chars.)
stackexchange/codereview
Every time I need to work with date and/or timstamps in Java I always feel like I'm doing something wrong and spend endless hours trying to find a better way of working with the APIs without having to code my own Date and Time utility classes. Here's a couple of annoying things I just ran into: 0-based months. I rea...
stackexchange/codereview
So I have a "large" number of "very large" ASCII files of numerical data (gigabytes altogether), and my program will need to process the entirety of it sequentially at least once. Any advice on storing/loading the data? I've thought of converting the files to binary to make them smaller and for faster loading. Should ...
stackexchange/codereview