instruction_seed stringlengths 1 35.8k | _source stringclasses 1
value |
|---|---|
Javascript code can be tough to maintain.
I am looking for tools that will help me ensure a reasonable quality level.
So far I have found JsUNit, a very nice unit test framework for javascript. Tests can be run automatically from ant on any browser available.
I have not found yet some javascript equivalent of PMD, chec... | stackexchange/codereview |
Fedora Core 9 seems to have FCGID instead of FastCGI as a pre-built, YUM-managed module. [I'd rather not have to maintain a module outside of YUM; so no manual builds for me or my sysadmins.]
I'm trying to launch Django through the runfastcgi interface (per the FastCGI deployment docs).
What I'm seeing is the result... | stackexchange/codereview |
Is there any way that I can programmatically create (and I guess access) hidden folders on a storage device from within c#?
| stackexchange/codereview |
I am looking for a high-performance graphic library for .NET and Mono. I have taken a look at Tao framework and, while it is very complete, it's quite lacking in terms of usability. It should be cross-platform compatible.
What other alternatives worked for you?
| stackexchange/codereview |
Somehow my FireFox 2 got corrupted, and the status bar is about 3/4" above the bottom window border.
Anyone have an idea on how to get it back to being flush with the bottom window border?
| stackexchange/codereview |
Is there any easy to install/use (on unix) database migration tools like Rails Migrations? I really like the idea, but installing ruby/rails purely to manage my database migrations seems overkill.
| stackexchange/codereview |
Recently I've been experimenting with TDD while developing a GUI application in Python. I find it very reassuring to have tests that verify the functionality of my code, but it's been tricky to follow some of the recommened practices of TDD. Namely, writing tests first has been hard. And I'm finding it difficult to mak... | stackexchange/codereview |
Given this example:
<img class="a" />
<img />
<img class="a" />
<img class="a" id="active" />
<img class="a" />
<img class="a" />
<img />
<img class="a" />
(I've just used img tags as an example, that's not what it is in my code)
Using jQuery, how would you select the img tags with class "a" that are adjacent to #acti... | stackexchange/codereview |
Trying to make a MySQL-based application support MS SQL, I ran into the following issue:
I keep MySQL's auto_increment as unsigned integer fields (of various sizes) in order to make use of the full range, as I know there will never be negative values. MS SQL does not support the unsigned attribute on all integer types,... | stackexchange/codereview |
The question I want to ask is thus:
Is casting down the inheritance tree (ie. towards a more specialiased class) from inside an abstract class excusable, or even a good thing, or is it always a poor choice with better options available?
Now, the example of why I think it can be used for good.
I recently implemented Ben... | stackexchange/codereview |
Has anyone used ruby in 64-bit environments in various platforms (HP=UX, Solaris, AIX etc.) in a commercial production environment that heavily relies on database.
Have you faced any issues / bugs during these times?
I know that overall things look ok. Compilation, deployment etc.
I would like to know if you encountere... | stackexchange/codereview |
I need to store app specific configuration in rails. But it has to be:
reachable in any file (model, view, helpers and controllers
environment specified (or not), that means each environment can overwrite the configs specified in environment.rb
I've tried to use environment.rb and put something like
USE_USER_APP = tr... | stackexchange/codereview |
Are there any utilities or browser plugins that let you easily switch the version of the Flash player that is being used?
| stackexchange/codereview |
Is there an API call in .NET or a native DLL that I can use to create similar behaviour as Windows Live Messenger when a response comes from someone I chat with?
| stackexchange/codereview |
I am trying to scrape an html table and save its data in a database. What strategies/solutions have you found to be helpful in approaching this program.
I'm most comfortable with Java and PHP but really a solution in any language would be helpful.
EDIT: For more detail, the UTA (Salt Lake's Bus system) provides bus sch... | stackexchange/codereview |
I have an OpenGL ES game that I am hacking together. One part of it involves looking at a large "map-like" area and then double-tapping on one part to "zoom into" it. How would you use OpenGL ES to provide this effect (given that it may need to zoom in on different parts of the map).
I've heard of glScale and glO... | stackexchange/codereview |
The LinearGradientBrush in .net (or even in GDI+ as a whole?) seems to have a severe bug: Sometimes, it introduces artifacts. (See here or here - essentially, the first line of a linear gradient is drawn in the endcolor, i.e. a gradient from White to Black will start with a Black line and then with the proper White to ... | stackexchange/codereview |
String s = "";
for(i=0;i<....){
s = some Assignment;
}
or
for(i=0;i<..){
String s = some Assignment;
}
I don't need to use 's' outside the loop ever again.
The first option is perhaps better since a new String is not initialized each time. The second however would result in the scope of the variable being li... | stackexchange/codereview |
I'm fully aware that set division can be accomplished through a series of other operations, so my question is:
Is there a command for set division in SQL?
| stackexchange/codereview |
I want to use a specific foreign language font for a Blackberry application. How is such a font created and loaded onto the Blackberry device?
For example: ਪੰਜਾਬੀ
| stackexchange/codereview |
I'm receiving a recovery feed from an exchange for recovering data missed from their primary feed.
The exchange strongly recommends listening to the recovery feed only when data is needed, and leaving the multicast once I have recovered the data I need.
My question is, if I am using asio, and not reading from the NIC w... | stackexchange/codereview |
I am seeting up Apache server with TortoiseSVN for local source code repository. Currently on trial purpose I am setting only two users.
Is it possible for administrator to set up some thing so that file get compulsory locked once its checkout (copy to working directory) by some one.
Abhijit Dhopate
| stackexchange/codereview |
I have a div with two images and an h1. All of them need to be vertically aligned within the div, next to each other. One of the images needs to be absolute positioned within the div.
What is the CSS needed for this to work on all common browsers?
<div id="header">
<img src=".." ></img>
<h1>testing...</h1>
<img s... | stackexchange/codereview |
(sorry I should have been clearer with the code the first time I posted this. Hope this makes sense)
File "size_specification.rb"
class SizeSpecification
def fits?
end
end
File "some_module.rb"
require 'size_specification'
module SomeModule
def self.sizes
YAML.load_file(File.dirname(__FILE__) + '/size_... | stackexchange/codereview |
What is the best method to transfer data from sales table to sales history table in sql server 2005. sales history table will be used for reporting.
| stackexchange/codereview |
When using Linq to SQL and stored procedures, the class generated to describe the proc's result set uses char properties to represent char(1) columns in the SQL proc. I'd rather these be strings - is there any easy way to make this happen?
| stackexchange/codereview |
My application correctly handles different kind of character sets, but only internally - when it comes to displaying text in standard WinForms labels und textboxes, it seems to have problems with chinese characters.
The problem seems to be the font used (Tahoma), because when I copy&paste the text, or view it in the de... | stackexchange/codereview |
I'm trying to implement some retry logic if there is an exception in my code. I've written the code and now I'm trying to get Rhino Mocks to simulate the scenario. The jist of the code is the following:
class Program
{
static void Main(string[] args)
{
MockRepository repo = new MockRepos... | stackexchange/codereview |
I have an ASP.net application that works fine in the development environment but in the production environment throws the following exception when clicking a link that performs a postback. Any ideas?
Invalid postback or callback argument.
Event validation is enabled using
in configuration or <%@ Page
EnableE... | stackexchange/codereview |
I am taking on a maintenance team and would like to introduce tools like FxCop and StyleCop to help improve the code and introduce the developers to better programming techniques and standards. Since we are maintaining code and not making significant enhancements, we will probably only deal with a couple of methods/rou... | stackexchange/codereview |
Everything inherits from object. It's the basis of inheritance. Everything can be implicitly cast up the inheritance tree, ie.
object me = new Person();
Therefore, following this through to its logical conclusion, a group of People would also be a group of objects:
List<Person> people = new List<Person>();
people.Add(... | stackexchange/codereview |
I'm using ASP.NET Web Forms for blog style comments.
Edit 1: This looks way more complicated then I first thought. How do you filter the src?
I would prefer to still use real html tags but if things get too complicated that way, I might go a custom route. I haven't done any XML yet, so do I need to learn more about... | stackexchange/codereview |
I've never had much need for programming with databases. Since their use is so widespread it seems like a good thing for me to learn. SQL seems like the place to start, possibly SQLite and maybe the Python bindings. What would you recommend for someone new to this? Libraries, tools and project ideas are all welcome... | stackexchange/codereview |
How can I exclude the bin folder from SourceSafe in a Visual Studio 2008 web application? I want to be able to check in everything recursively from the solution node without picking up anything in the bin folder.
| stackexchange/codereview |
I am working on an application and one design approach involves extremely heavy use of the instanceof operator. While I know that OO design generally tries to avoid using instanceof, that is a different story and this question is purely related to performance. I was wondering if there is any performance impact? Is is j... | stackexchange/codereview |
I've looked for some other articles on this problem and even tried some of the ideas in this thread; however, nothing has solved the issue yet. So, on to the issue.
Something happens when working in Visual Studio (usually C#) that causes the IDE to become a bit wonky when saving a file. I will be working along just f... | stackexchange/codereview |
I know that with mysql you can write SQL statements into a .sql file and run the file from the mysql command line like this:
mysql> source script.sql
How do I pass a variable to the script? For example, if I want to run a script that retrieves all the employees in a department, I want to be able to pass in the number ... | stackexchange/codereview |
How to play WMV in a WindowMediaPlayer activeX controlled by a flash component?
I've seen it done here: http://sport5.co.il/
Does anyone know how?
| stackexchange/codereview |
We have the requirement to take a form submission and save some data, then redirect the user to a page offsite, but in redirecting, we need to "submit" a form with POST, not GET.
I was hoping there was an easy way to accomplish this, but I'm starting to think there isn't. I think I must now create a simple other page,... | stackexchange/codereview |
My company has a common code library which consists of many class libary projects along with supporting test projects. Each class library project outputs a single binary, e.g. Company.Common.Serialization.dll. Since we own the compiled, tested binaries as well as the source code, there's debate as to whether our consum... | stackexchange/codereview |
How do I get the id of my Java process?
I know there are several platform-dependent hacks, but I would prefer a more generic solution.
| stackexchange/codereview |
I have a VB6.0 project and I want to convert it in VB.Net.
In my VB6.0 application some of the MDI Child form’s height is 17000 and width is 13000. Now I want to set the same form size in VB.Net forms, but it allows maximum form width = 1036, height = 780 for resolution 1024x768.
How can I increase form size with same ... | stackexchange/codereview |
On Mac OS X, you can create a zip archive from the Finder by selecting some files and selecting "Compress" from the contextual menu or the File menu. Unfortunately, the resulting file is not identical to the archive created by the zip command (with the default options).
This distinction matters to at least one service... | stackexchange/codereview |
My question is related to the command pattern, where we have the following abstraction (C# code) :
public interface ICommand
{
void Execute();
}
Let's take a simple concrete command, which aims to delete an entity from our application. A Person instance, for example.
I'll have a DeletePersonCommand, which implemen... | stackexchange/codereview |
Is there a .NET performance counter to show the rate of p/invoke calls made? I've just noticed that the application I'm debugging was making a call into native code from managed land within a tight loop. The intended implementation was for a p/invoke call to be made once and then cached. I'm wondering if I could hav... | stackexchange/codereview |
This is one of the possible ways I come out:
struct RetrieveKey
{
template <typename T>
typename T::first_type operator()(T keyValuePair) const
{
return keyValuePair.first;
}
};
map<int, int> m;
vector<int> keys;
// Retrieve all keys
transform(m.begin(), m.end(), back_inserter(keys), RetrieveK... | stackexchange/codereview |
I'd like to make some custom MenuHeaders in WPF so I can have (for example), an icon and text in a menu item.
Normally using MenuItems, if you populate the Header field with straight text, you can add an accelerator by using an underscore. eg, _File
However, if I wanted to put in a UserControl, I believe this function ... | stackexchange/codereview |
So we've discussed logging in passing at my place of work and I was wondering if some of you guys here could give me some ideas of your approaches?
Typically our scenario is, no logging really at all, and mostly .NET apps, winforms/WPF clients talking through web services or direct to a db.
So, the real question is, wh... | stackexchange/codereview |
What's the current status of Mono's Platform Invoke implementation on Linux and on Solaris?
| stackexchange/codereview |
I've got a simple CakePHP site (1.2). I've got a page where you can edit and save a Person. So I have a Person model and controller.
Each Person has none or more comments, in the comment table. So I have a Comment model, and I have a hasMany association on my Person model to the Comment model. View is working great.
My... | stackexchange/codereview |
What is the difference between CodeFile="file.ascx.cs" and CodeBehind="file.ascx.cs" in the declaration of a ASP.NET user control?
Is one newer or recommended? Or do they have specific usage?
| stackexchange/codereview |
This is from an example accompanying the agsXMPP .Net assembly. I've read up on delegates, but am not sure how that fits in with this line of code (which waits for the logon to occur, and then sends a message. I guess what I'm looking for is an understanding of why delegate(0) accomplishes this, in the kind of simple... | stackexchange/codereview |
I try to use the Forms-Based authentication within an embedded Jetty 6.1.7 project.
That's why I need to serve servlets and html (login.html) under the same context
to make authentication work. I don't want to secure the hole application since
different context should need different roles. The jetty javadoc states that... | stackexchange/codereview |
I've always wondered this - why can't you declare variables after a case label in a switch statement? In C++ you can declare variables pretty much anywhere (and declaring them close to first use is obviously a good thing) but the following still won't work:
switch (val)
{
case VAL:
// This won't work
int new... | stackexchange/codereview |
I have a couple old services that I want to completely uninstall. How can I do this?
| stackexchange/codereview |
I am trying to solve numerically a set of partial differential equations in three dimensions. In each of the equations the next value of the unknown in a point depends on the current value of each unknown in the closest points.
To write an efficient code I need to keep the points close in the three dimensions close in ... | stackexchange/codereview |
can anyone please suggest a good code example of vb.net/c# code to put the application in system tray when minized.
| stackexchange/codereview |
We need to reliably get the Quick Launch folder for both All and Current users under both Vista and XP. I'm developing in C++, but this is probably more of a general Windows API question.
For reference, here is code to get the Application Data folder under both systems:
HRESULT hres;
CString basePath;
hre... | stackexchange/codereview |
The gnuplot docs have this to say about fonts:
Five basic fonts are supported directly by the gd library. These are
`tiny` (5x8 pixels), `small` (6x12 pixels), `medium`, (7x13 Bold),
`large` (8x16) or `giant` (9x15 pixels).
But when i try to use one:
gnuplot> set terminal png font tiny
I get:
Could... | stackexchange/codereview |
Prefixing variable and method names with an underscore is a common convention for marking things as private. Why does all the methods on the page tracker class in the Google Analytics tracking code (ga.js) start with an underscore, even the ones that are clearly public, like _getTracker and _trackPageView?
| stackexchange/codereview |
By default the webjump hotlist has the following which I use quite often:
M-x webjump RET Google
M-x webjump RET Wikipedia
How can I add 'Stackoverflow' to my list?
| stackexchange/codereview |
I have a rails model that looks something like this:
class Recipe < ActiveRecord::Base
has_many :ingredients
attr_accessor :ingredients_string
attr_accessible :title, :directions, :ingredients, :ingredients_string
before_save :set_ingredients
def ingredients_string
ingredients.join("\n")
end
... | stackexchange/codereview |
I have this setup where in my development copy I can commit changes on a certain file to the repository. Then in my production copy, which does checkouts only, I would normally edit this file because this contains references which are environment independent. Is there any way I can ignore this file on the subsequent ch... | stackexchange/codereview |
How can I make sure that a certain OLEDB driver is installed when I start my application? I use ADO from Delphi and would like to display a descriptive error message if the driver is missing. The error that's returned from ADO isn't always that user-friendly.
There are probably a nice little function that returns all i... | stackexchange/codereview |
Name of the option tells something but what Visual Studio/compiler really do and what are the real consequences?
Edit: If you search google you can find this address, but that is not really I am looking for. I wonder the real things happening. For example why do the loops get less time, etc.
| stackexchange/codereview |
What is the correct way to import a C++ class from a DLL? We're using Visual C++.
There's the dllexport/exports.def+LoadLibrary+GetProcAddress trifecta, but it doesn't work on C++ classes, only C functions. Is this due to C++ name-mangling? How do I make this work?
| stackexchange/codereview |
Scenario:
The user has two monitors.
Their browser is open on the secondary monitor.
They click a link in the browser which calls window.open() with a specific top and left window offset.
The popup window always opens on their primary monitor.
Is there any way in JavaScript to get the popup window to open on the same... | stackexchange/codereview |
What are some of the strategies that are used when implementing FxCop / static analysis on existing code bases with existing violations? How can one most effectively reduce the static analysis violations?
| stackexchange/codereview |
I have a SQL Server 2000, C# & ASP.net web app. We want to control access to it by using Active Directory groups. I can get authentication to work if the group I put in is a 'Global' but not if the group is 'Universal'.
How can I make this work with 'Universal' groups an well?
Here's my authorization block:
<auth... | stackexchange/codereview |
I'm building a project from the command line using WinCE platform builder, and I need RTTI to be enabled, so that my project works correctly. I tried setting the option RTTI="YES" in the sources and in the makefile of each dir, and I also tried to add it at the end of CDEFINES, but when I try to build the project, I g... | stackexchange/codereview |
I want to extend the basic ControlCollection in VB.NET so I can just add images and text to a self-made control, and then automaticly convert them to pictureboxes and lables.
So I made a class that inherits from ControlCollection, overrided the add method, and added the functionality.
But when I run the example, it giv... | stackexchange/codereview |
When defining a method on a class in Python, it looks something like this:
class MyClass(object):
def __init__(self, x, y):
self.x = x
self.y = y
But in some other languages, such as C#, you have a reference to the object that the method is bound to with the "this" keyword without declaring it as a... | stackexchange/codereview |
What's a quick and easy way to view and edit ID3 tags (artist, album, etc.) using C#?
| stackexchange/codereview |
Is there an easy way to return data to web service clients in JSON using Rails?
| stackexchange/codereview |
Are there any tools that can tell me what percentage of a XSL document get actually executed during tests?
UPDATE
I could not find anything better than Oxygen's XSL debugger and profiler, so I'm accepting Mladen's answer.
| stackexchange/codereview |
Given a HTML file with the structure html -> body -> a bunch of divs what is the correct groovy statement to find all of the divs with a non blank tags attribute?
The following is not working:
def nodes = html.body.div.findAll { it.@tags != null }
because it finds all the nodes.
| stackexchange/codereview |
I want to be able to create a VMWare image, by specifying the components that should go into it, preferably in a script, and then get VMWare, or some third process, to build the machine from the specs.
So I want to be able to say eg.
OS - Windows 2003, Apps - Visual Studio etc, and then it builds the machine automatica... | stackexchange/codereview |
Is there a way (or shortcut) to tell VS 2008 that it cuts a line like this:
Before:
Some Text here
This gets cut
Some Code there
After:
Some Text here
Some Code there
What I want:
Some Text here
Some Code there
PS: I don't want to select the whole line or something like this... only the text I want to cut.
| stackexchange/codereview |
How can you automatically import the latest build/revision number in subversion?
The goal would be to have that number visible on your webpage footer like SO does.
| stackexchange/codereview |
I'm looking at improving the performance of some SQL, currently CTEs are being used and referenced multiple times in the script. Would I get improvements using a table variable instead? (Can't use a temporary table as the code is within functions).
| stackexchange/codereview |
I've read the book Programming Collective Intelligence and found it fascinating. I'd recently heard about a challenge amazon had posted to the world to come up with a better recommendation engine for their system.
The winner apparently produced the best algorithm by limiting the amount of information that was being fe... | stackexchange/codereview |
I am trying to validate the WPF form against an object. The validation fires when I type something in the textbox lose focus come back to the textbox and then erase whatever I have written. But if I just load the WPF application and tab off the textbox without writing and erasing anything from the textbox, then it is n... | stackexchange/codereview |
I'm trying a very basic XPath on this xml (same as below), and it doesn't find anything.
I'm trying both .NET and this website, and XPaths such as //PropertyGroup, /PropertyGroup and //MSBuildCommunityTasksPath are simply not working for me (they compiled but return zero results).
Source XML:
<?xml version="1.0" encodi... | stackexchange/codereview |
How can I add Page transitions effects like IE in Safari for web pages?
| stackexchange/codereview |
I start up my application which uses a Jetty server, using port 9000.
I then shut down my application with Ctrl-C
I check with "netstat -a" and see that the port 9000 is no longer being used.
I restart my application and get:
[ERROR,9/19 15:31:08] java.net.BindException: Only one usage of each socket address (protoc... | stackexchange/codereview |
If you were running a news site that created a list of 10 top news stories, and you wanted to make tweaks to your algorithm and see if people liked the new top story mix better, how would you approach this?
Simple Click logging in the DB associated with the post entry?
A/B testing where you would show one version of ... | stackexchange/codereview |
Hey all, my Computational Science course this semester is entirely in Java. I was wondering if there was a good/preferred set of tools to use in ubuntu. Currently I use gedit with a terminal running in the bottom, but I'd like an API browser.
I've considered Eclipse, but it seems to bloated and unfriendly for quick pr... | stackexchange/codereview |
I'm trying to decide on the best way to store event times in a MySQL database. These should be as flexible as possible and be able to represent "single events" (starts at a certain time, does not necessarily need an end time), "all day" and "multi day" events, repeating events, repeating all day events, possibly "3rd S... | stackexchange/codereview |
How can you programmatically measure per-process (or better, per-thread) CPU usage under windows 95, windows 98 and windows ME?
If it requires the DDK, where can you obtain that?
Please note the Win9x requirement. It's easy on NT.
EDIT: I tried installing the Win95/98 version of WMI, but Win32_Process.KernelModeTime an... | stackexchange/codereview |
Looking to do a very small, quick 'n dirty side project. I like the fact that the Google App Engine is running on Python with Django built right in - gives me an excuse to try that platform... but my question is this:
Has anyone made use of the app engine for anything other than a toy problem? I see some good example a... | stackexchange/codereview |
Our security manager dynamically inserts a bit of javascript at the top of every html page when a page is requested by the client. It is inserted above the DOCTYPE statement. I think this might be the cause of the layout problems I am having.
Ideas anyone?
| stackexchange/codereview |
We need a good CMS that supports data clustering (managing and storing data on different servers). By "good" , I mean : reliable , minimum bugs , the faster the better. (Oh , and it should make coffee :) )
| stackexchange/codereview |
I have to admit that I always forgot the syntactical intracacies of the naming patterns for Nant (eg. those used in filesets). The double asterisk/single asterisk stuff seems to be very forgettable in my mind.
Can someone provide a definitive guide to the naming patterns?
| stackexchange/codereview |
I'd really like to handle this without monkey-patching but I haven't been able to find another option yet.
I have an array (in Ruby) that I need to sort by multiple conditions. I know how to use the sort method and I've used the trick on sorting using an array of options to sort by multiple conditions. However, in th... | stackexchange/codereview |
This is a 3 part question regarding embedded RegEx into SQL statements.
How do you embed a RegEx expression into an Oracle PL/SQL
select statement that will parse out
the “DELINQUENT” string in the text
string shown below?
What is the performance impact if used within a
mission critical business
transaction?
Since em... | stackexchange/codereview |
on Windows systems. I get the following NPE with the FileChooser. It is a known bug that is not fixed by sun yet. https://bugs.java.com/bugdatabase/view_bug?bug_id=6342301
Does somebody know a workaround to prevent this exception?
Thanks.
André
Exception in thread "AWT-EventQueue-2" java.lang.NullPointerException
at
j... | stackexchange/codereview |
I have a process in Linux that's getting a segmentation fault. How can I tell it to generate a core dump when it fails?
| stackexchange/codereview |
I am trying to include a link to my application in the Startup folder with a parameter passed to the program.
I think it would work if I created the shortcut locally and then added it to my source. After that I could copy it to the Startup folder on first run.
File.userDirectory.resolvePath("Start Menu\\Programs\\Star... | stackexchange/codereview |
I get asked this question a lot and I thought I'd solicit some input on how to best describe the difference.
| stackexchange/codereview |
If a user saves the password on the login form, ff3 is putting the saved password in the change password dialoge on the profile page, even though its not the same input name as the login. how can I prevent this?
| stackexchange/codereview |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.