instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
What are the naming conventions that you use while coding?
stackexchange/codereview
I am actually working on SP in SQL 2005. Using SP i am creating a job and am scheduling it for a particular time. These jobs take atleast 5 to 10 min to complete as the database is very huge. But I am not aware of how to check the status of the Job. I want to know if it has got completed successfully or was there any e...
stackexchange/codereview
I have Excel add-in which I add so many class modules that it is now very bulky. I want to convert it into a type library or a COM package so that I can re-use it for the other apps in the MS Office suite. I ported the add-in to Visual Studio as a class library project but Excel Automation doesn't recognize the classes...
stackexchange/codereview
I recently started using Eclipse at work for my Java servlet projects. I've been using jEdit for years, which is a uber-powerful text editor. It has syntax highlighting, but it doesn't have any language-specific features like code completion and intelligent refactoring. I'm finding that's hindering my productivity. ...
stackexchange/codereview
I have a Website that is really slow and "feels" really bad when using it. The server is fine, it's a clientside issue, I assume because too much JavaScript or Image Requests, but since it's not my own Website, I wonder if there is a way to show and profile the Page from within IE. In Firefox, I would use Firebug, Y!Sl...
stackexchange/codereview
Looking for suggestions on file system management tools. We have several terabytes of images, pdfs, excel sheets, etc. We're looking at some sort of software that will help us to manage, archive, etc the images. We don't store all the files information in a database but some are and we were hoping to maybe find an app...
stackexchange/codereview
I'm developing a Mac App in Java that logs into any one of our client's databases. My users want to have several copies of this program running so they can log into a couple clients at the same time, rather than logging out and logging back in. How can I allow a user to open several copies of my App at once? I'm using...
stackexchange/codereview
In my PHP web app, I want to be notified via email whenever certain errors occur. I'd like to use my Gmail account for sending these. How could this be done?
stackexchange/codereview
I've encountered multiple third party .Net component-vendors that use a licensing scheme. On an evaluation copy, the components show up with a nag-screen or watermark or some such indicator. On a licensed machine, a Licenses.licx is created - with what appears to be just the assembly full name/identifiers. This file ha...
stackexchange/codereview
Do you know of any compilers that only requires one or two clicks on the source code to compile? Having to configure it to do it doesn't count, nor does having to go to a terminal and write a word or two. Extra points are given if you can give your own view as to why so few compilers have a gui included, or just a send...
stackexchange/codereview
I want to create a stored procedure with one argument which will return different sets of records depending on the argument. What is the way to do this? Can I call it from plain SQL?
stackexchange/codereview
I'm running Django 1.0 and I'm close to deploying my app. As such, I'll be changing the DEBUG setting to False. With that being said, I'd still like to include the stacktrace on my 500.html page when errors occur. By doing so, users can copy-and-paste the errors and easily email them to the developers. Any thoughts o...
stackexchange/codereview
I open a connection like this: Using conn as New OdbcConnection(connectionString) conn.Open() //do stuff End Using If connection pooling is enabled, the connection is not physically closed but released to the pool and will get reused. If it is disabled, it will be physically closed. Is there any way of knowing...
stackexchange/codereview
I have a table that contains tasks and I want to give these an explicit ordering based on the priority of the task. The only way I can think to do this is via an unique int column that indexes where the task is in term of the priority (i.e. 1 is top 1000 is low). The problem is that say I wanted to update task and set ...
stackexchange/codereview
So, I've been reading through and it appears that the Boost libraries get used a lot in practice (not at my shop, though). Why is this? and what makes it so wonderful?
stackexchange/codereview
I'm a pretty inexperienced programmer (can make tk apps, text processing, sort of understand oop), but Python is so awesome that I would like to help the community. What's the best way for a beginner to contribute?
stackexchange/codereview
I basically need to highlight a particular word in a block of text. For example, pretend I wanted to highlight the word "dolor" in this text: <p> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. </p> <p> Quisque bibendum sem ut lacus. Integer dolor ullamcorper libero. Aliquam rhoncus eros at augue....
stackexchange/codereview
For one and a half years, I have been keeping my eyes on the git community in hopes of making the switch away from SVN. One particular issue holding me back is the inability to lock binary files. Throughout the past year I have yet to see developments on this issue. I understand that locking files goes against the fu...
stackexchange/codereview
In prior versions of Windows before Vista you could have a Windows Service interact with the current logged in desktop user to easy display information on the screen from the service. In Windows Vista Session 0 was added for security to isolate the services from the desktop. What is an easy way to communicate between a...
stackexchange/codereview
What is the best practice of Unicode processing in C++?
stackexchange/codereview
I'm going to be implementing a PHP/mySQL setup to store credit card information. It seems like AES_ENCRYPT/AES_DECRYPT is the way to go, but I'm still confused on one point: How do I keep the encryption key secure? Hardwiring it into my PHP scripts (which will live on the same server as the db) seems like a major secur...
stackexchange/codereview
I'm converting an old app that records folder sizes on a daily basis. The legacy app uses the Scripting.FileSystemObject library: Set fso = CreateObject("Scripting.FileSystemObject") Set folderObject = fso.GetFolder(folder) size = folderObject.Size There isn't an equivalent mechanism on the System.IO.Directory and Sys...
stackexchange/codereview
I am maintaining .net 1.1 and .net 3.5 c# code at once. For this purpose I created two csproject files, one for .net 1.1 and another for .net 3.5. Now, in my source code I am adding new features that are only available in .net 3.5 version, but I also want the code to compile in VS 2003, without the new features. Is the...
stackexchange/codereview
There is a way to know the flash player version installed on the computer that runs our SWF file with Action Script 3.0?
stackexchange/codereview
We have some legacy code that needs to identify in the Page_Load which event caused the postback. At the moment this is implemented by checking the Request data like this... if (Request.Form["__EVENTTARGET"] != null && (Request.Form["__EVENTTARGET"].IndexOf("BaseGrid") > -1 // BaseGrid event ( e.g. sort)        || Requ...
stackexchange/codereview
Using the zip function, Python allows for loops to traverse multiple sequences in parallel. for (x,y) in zip(List1, List2): Does MATLAB have an equivalent syntax? If not, what is the best way to iterate over two parallel arrays at the same time using MATLAB?
stackexchange/codereview
I'd like my program to be able to email me error reports. How can I do this without hard-coding a username/password/SMTP server/etc. into the code? (Doing so would allow users to decompile the program and take over this email account.) I've been told you could do some stuff with telneting to port 25, but I'm very fuzzy...
stackexchange/codereview
Does anybody know (or know of a resource that contains) a list of frame start codes for common video formats (MPEG-1/2/4, .wmv, .mov etc.). For example, an MPEG-1 video frame will (I think) always start with "00 00 01 00". In essence I'd like to know these so that I could write a program that can automatically find th...
stackexchange/codereview
I want to practice my skills away from a keyboard (i.e. pen and paper) and I'm after simple practice questions like Fizz Buzz, Print the first N primes. What are your favourite simple programming questions?
stackexchange/codereview
Boost is meant to be the standard non-standard C++ library that every C++ user can use. Is it reasonable to assume it's available for an open source C++ project, or is it a large dependency too far?
stackexchange/codereview
this is my first question to stackoverflow so here it goes... I use cruise control for my continuous integration scheme, i want to use obfuscation in order to add another protection layer to my assemblies. The thing is that i don't know how to go about it since i couldn't find articles describing about this. Suggestion...
stackexchange/codereview
I need to write code in python language for comparing the text of document using fingerprint techniques. I do not know to take fingerprint of a document or to generate fingerprint of a document. I'm asking if anyone knows the method or has source code for generating fingerprints of documents which is stored in bits for...
stackexchange/codereview
I'm working on a project that will be distributed with GNU autoconf/automake, and I have a set of bash scripts which call awk scripts. I would like the bash scripts to end up in the $PATH, but not the awk scripts. How should I insert these into the project? Should they be put in with other binaries? Also, is there a...
stackexchange/codereview
Unable to find a SQL diff tool that meets my needs, I am writing my own. Between the INFORMATION_SCHEMA and sys tables, I have a mostly-complete working version. But one thing I can't find in the metadata is the definition of a trigger, you know, the actual SQL code. Am I overlooking something? Thanks. Thanks, Pete...
stackexchange/codereview
I have a web application that receives messages through an HTTP interface, e.g.: http://server/application?source=123&destination=234&text=hello This request contains the ID of the sender, the ID of the recipient and the text of the message. This message should be processed like: finding the matching User object for ...
stackexchange/codereview
I have some scheduled SSRS reports (integrated mode) that get emailed by subscription. All of a sudden the reports have stopped being emailed. I get the error: Failure sending mail: Report Server has encountered a SharePoint error. I don't even know where to start to look as I can't get into SSRS and my Sharepoint kn...
stackexchange/codereview
I'm working on a C#/ASP.NET web application, and I have a number of situations where I need to do locking. Ideally, I want the locks to act independently, since they have nothing to do with each other. I've been considering [MethodImpl(MethodImplOptions.Synchronized)] and a few ways of using lock(), but I have a few ...
stackexchange/codereview
Ok, my web application is at C:\inetpub\wwwroot\website The files I want to link to are in S:\someFolder Can I make a link in the webapp that will direct to the file in someFolder?
stackexchange/codereview
I have a menu running off of a sitemap which one of the SiteMapNode looks like this: <siteMapNode title="Gear" description="" url=""> <siteMapNode title="Armor" description="" url="~/Armor.aspx" /> <siteMapNode title="Weapons" description="" url="~/Weapons.aspx" /> </siteMapNode> I also have a Skin applied to th...
stackexchange/codereview
I'm working on an app that requires no user input, but I don't want the iPhone to enter the power saving mode. Is it possible to disable power saving from an app?
stackexchange/codereview
I'm trying to put several images together into one big image, and am looking for an algorithm which determines the placing most optimally. The images can't be rotated or resized, but the position in the resulting image is not important. edit: added no resize constraint
stackexchange/codereview
The question of whether P=NP is perhaps the most famous in all of Computer Science. What does it mean? And why is it so interesting? Oh, and for extra credit, please post a proof of the statement's truth or falsehood. :)
stackexchange/codereview
I have an Interbase DB. How can I convert it to SQL Server?
stackexchange/codereview
I need to be able to change the users' password through a web page (in a controlled environment). So, for that, I'm using this code: <?php $output = shell_exec("sudo -u dummy passwd testUser testUserPassword"); $output2 = shell_exec("dummyPassword"); echo $output; echo $output2; echo "done"; ?> My problem is that this...
stackexchange/codereview
A coworker of mine has this problem, apparently after installing Re#, which seems totally irrelevant. But perhaps it isn't. Could not load file or assembly "SqlManagerUi, Version=9.0.242.0..." or one of its dependencies. The module was expected to contain an assembly manifest. (mscorlib). Why is this? Thanks
stackexchange/codereview
Is anyone aware of a reasonably well documented example of simulated annealing in Visual Basic that I can examine and adapt?
stackexchange/codereview
In WPF you can setup validation based on errors thrown in your Data Layer during Data Binding using the ExceptionValidationRule or DataErrorValidationRule. Suppose you had a bunch of controls set up this way and you had a Save button. When the user clicks the Save button, you need to make sure there are no validation ...
stackexchange/codereview
Apart from commercial tools like Dundas, are there any open source or cheaper (and decent) 3rd party charting tools/controls for reporting services out there?
stackexchange/codereview
I want to call a web service, but I won't know the url till runtime. Whats the best way to get the web reference in, without actually committing to a url. What about having 1 client hit the same web service on say 10 different domains?
stackexchange/codereview
When providing a link to a PDF file on a website, is it possible to include information in the URL (request parameters) which will make the PDF browser plugin (if used) jump to a particular bookmark instead of just opening at the beginning? Something like: http://www.somehost.com/user-guide.pdf?bookmark=chapter3 ? If n...
stackexchange/codereview
Is it correct to link a static library (.lib) compiled with VS 2005 with a program which is compiled with VS 2008? Both library and my program are written in C++. This program is run on Windows Mobile 6 Professional emulator. This seems to work, there are no linking errors. However the program crashes during startup be...
stackexchange/codereview
In my database, I have an entity table (let's call it Entity). Each entity can have a number of entity types, and the set of entity types is static. Therefore, there is a connecting table that contains rows of the entity id and the name of the entity type. In my code, EntityType is an enum, and Entity is a Hibernate-ma...
stackexchange/codereview
I'm sick of remembering all the passwords for different logins. Lately I found the interesting tool password composer which lets you generate passwords base on the hostname and a secret master password. But I don't want to use a website or installing software to generate my passwords. So I'm looking for a simple one wa...
stackexchange/codereview
I have a SQL query (MS Access) and I need to add two columns, either of which may be null. For instance: SELECT Column1, Column2, Column3+Column4 AS [Added Values] FROM Table where Column3 or Column4 may be null. In this case, I want null to be considered zero (so 4 + null = 4, null + null = 0). Any suggestions as to ...
stackexchange/codereview
What books or online resource would you recommend for learning how to do advanced charts and dashboard design with Reporting Services?
stackexchange/codereview
At run time I want to dynamically build grid columns (or another display layout) in a WPF ListView. I do not know the number and names of the columns before hand. I want to be able to do: MyListView.ItemSource = MyDataset; MyListView.CreateColumns();
stackexchange/codereview
I need to determine if a Class object representing an interface extends another interface, ie: package a.b.c.d; public Interface IMyInterface extends a.b.d.c.ISomeOtherInterface{ } according to the spec Class.getSuperClass() will return null for an Interface. If this Class represents either the Object cl...
stackexchange/codereview
How do you clear the IRB console screen?
stackexchange/codereview
I found this guide for using the flash parameters, thought it might be useful to post here, since Flash CS3 lacks a usage example for reading these parameters. See answers for the link
stackexchange/codereview
I really want to write .NET apps that run on any platform (PC, Linux and Mac). I am not really concerned about UI capabilities because these are mostly background services. I have heard of MONO and that it allows you to write .NET apps that run on Mac and Linux, but I want to be able to write a single app that when c...
stackexchange/codereview
Is there anything out there (for Java specifically) that allow you to automatically test the behavior of an interface? As an example, let's say I have a bunch of tests for the Comparable interface, that should apply to anything that implements Comparable. What I'd like is to be able to include "ComparableTests" automat...
stackexchange/codereview
I have a procedure with a lot of i := i +1; in it and I think inc(i); looks a lot better. Is there a performance difference or does the function call just get inlined by the compiler? I know this probably doesn't matter at all to my app, I'm just curious. EDIT: I did some gauging of the performance and found the...
stackexchange/codereview
I just started learning JSP technology, and came across a wall. How do you output HTML from a method in <%! ... %> JSP declaration block? This doesn't work: <%! void someOutput() { out.println("Some Output"); } %> ... <% someOutput(); %> Server says there's no “out”. U: I do know how to rewrite code with this met...
stackexchange/codereview
I hope someone might be able to help me here. I've tried to simplify my example as best I can. I have an absolutely positioned DIV, which for this example I've made fill the browser window. This div has the overflow:auto attribute to provide scroll bars when the content is too big for the DIV to display. Within the DIV...
stackexchange/codereview
Occasionally I come accross a unit test that doesn't Assert anything. The particular example I came across this morning was testing that a log file got written to when a condition was met. The assumption was that if no error was thrown the test passed. I personally don't have a problem with this, however it seems to be...
stackexchange/codereview
Looking at the processmodel element in the Web.Config there are two attributes. maxWorkerThreads="25" maxIoThreads="25" What is the difference between worker threads and I/O threads?
stackexchange/codereview
How can I delete a line form a bound DataGridView when pressing the Delete key?
stackexchange/codereview
I have the following html code: <h3 id="headerid"><span onclick="expandCollapse('headerid')">&uArr;</span>Header title</h3> I would like to toggle between up arrow and down arrow each time the user clicks the span tag. function expandCollapse(id) { var arrow = $("#"+id+" span").html(); // I have tried with .t...
stackexchange/codereview
I'm creating a small database application to teach myself the following concepts C# programming .Net 3.5 framework WPF LINQ ORM I want to use Microsoft Access as the database but I can't seem to find any mention of whether its possible to use SQLMetal to generate the ORM code from a Microsoft Access database. Does an...
stackexchange/codereview
I have to load a PDF within a page. Ideally I would like to have a loading animated gif which is replaced once the PDF has loaded.
stackexchange/codereview
Does anyone know of any problems with using WCF to expose a SOAP interface for non .NET clients? For example incompatibilities with other SOAP libraries? This is so that the SOAP interface can be exposed for third parties to integrate with our software.
stackexchange/codereview
I am using setInterval(fname, 10000); to call a function every 10 seconds in JavaScript. Is it possible to stop calling it on some event? I want the user to be able to stop the repeated refresh of data.
stackexchange/codereview
Is there a built-in method in Python to get an array of all a class' instance variables? For example, if I have this code: class hi: def __init__(self): self.ii = "foo" self.kk = "bar" Is there a way for me to do this: >>> mystery_method(hi) ["ii", "kk"] Edit: I originally had asked for class variables erro...
stackexchange/codereview
I saw some code like the following in a JSP <c:if test="<%=request.isUserInRole(RoleEnum.USER.getCode())%>"> <li>user</li> </c:if> My confusion is over the "=" that appears in the value of the test attribute. My understanding was that anything included within <%= %> is printed to the output, but surely the value a...
stackexchange/codereview
I have an EAR file that contains two WARs, war1.war and war2.war. My application.xml file looks like this: <?xml version="1.0" encoding="UTF-8"?> <application version="5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee...
stackexchange/codereview
I'm using browser automation for testing web sites but I need to verify HTTP requests from the browser (i.e., images, external scripts, XmlHttpRequest objects). Is there a way to programmatically instantiate a proxy or packet sniffer for the browser to use in order to see what its sending? I'm already using Fiddler to ...
stackexchange/codereview
Needs to be secure and able to handle thousands of users.
stackexchange/codereview
A battery powered (2 x AA) Arduino LilyPad should switch a BlueSmirf v2.11 Bluetooth modem to/from command mode (see source code below). The BlueSmirf has been set to 9600 baud. If the PC connects via Bluetooth (see source code below), the Arduino program runs fine at the beginning (sending multiple "ping\n"). After so...
stackexchange/codereview
I recently discovered the genshi.builder module. It reminds me of Divmod Nevow's Stan module. How would one use genshi.builder.tag to build an HTML document with a particular doctype? Or is this even a good thing to do? If not, what is the right way?
stackexchange/codereview
I am using bash in os X Terminal app, and my custom $PS1 breaks when I scroll through my history. PS1="${BLUE}\u${CYAN}@${RED}\h${BLUE}\w\n\[${red}\$${NC}\]" also tried PS1="${BLUE}\u${CYAN}@${RED}\h${BLUE}\w\r\n[${red}\$${NC}]" The problem seems to be in the newline. I have used this bash prompt on Slackware n...
stackexchange/codereview
What is the best way to access a running mono application via the command line (Linux/Unix)? Example: a mono server application is running and I want to send commands to it using the command line in the lightest/fastest way possible, causing the server to send back a response (e.g. to stdout).
stackexchange/codereview
I have a collection of non-overlapping rectangles that cover an enclosing rectangle. What is the best way to find the containing rectangle for a mouse click? The obvious answer is to have an array of rectangles and to search them in sequence, making the search O(n). Is there some way to order them by position so that t...
stackexchange/codereview
I am a programmer at a financial institute. I have recently been told to enforce that all new user id's to have at least one alpha and one numeric. I immediately thought that this was a horrible idea and I would rather not implement it, as I believe this is an anti-feature and of poor user experience. The problem is...
stackexchange/codereview
This is kind of a weird question and more of an annoyance than technical brick wall. When I'm adding tables and such using the Linq-to-SQL designer and I want to create an association using the dialogs. I right click on one of the target tables and choose Add > Association as normal and I am presented with the Associat...
stackexchange/codereview
When a branch is reintegrated to the trunk, is that branch effectively dead? Can you make modifications to the branch after the reintegration and merge those back into the trunk at a later date?
stackexchange/codereview
When commiting to SVN I can add a top level commit message to detail what is being committed, but I would ideally like a means to comment on the individual files and what has changed within them. I have seen something similar in previous employment, but this was using CVS (and I can't recall whether this was achieved ...
stackexchange/codereview
Before, I have found the "Cost" in the execution plan to be a good indicator of relative execution time. Why is this case different? Am I a fool for thinking the execution plan has relevance? What specifically can I try to improve v_test performance? Thank you. Using Oracle 10g I have a simple query view defined below ...
stackexchange/codereview
When do we use client side reporting and when do we use server side reporting? Which reporting is best practice (client/server)? This pertains to SSRS reporting.
stackexchange/codereview
Following Jonathan Holland's suggestion in his comment for my previous question: Is there any way in .NET to programmatically listen to HTTP traffic? I've made a separate (but not exactly a duplicate) question for what I really want to know: How do I automate a web proxy in .NET for unit tests (including set up and tea...
stackexchange/codereview
In C#.Net WPF During UserControl.Load -> What is the best way of showing a whirling circle / 'Loading' Indicator on the UserControl until it has finished gathering data and rendering it's contents?
stackexchange/codereview
I have here 300 lines long NAnt file and it is quite a messy. I am wondering if there is a any style guide for writing NAnt scripts and what are the best practices for doing so. Any tips?
stackexchange/codereview
I have the following XAML: <TextBlock Text="{Binding ElementName=EditListBox, Path=SelectedItems.Count}" Margin="0,0,5,0"/> <TextBlock Text="items selected"> <TextBlock.Style> <Style TargetType="{x:Type TextBlock}"> <Style.Triggers> <DataTrigger Binding="{Binding ElementName=...
stackexchange/codereview
I have a working copy of my project, checked out using Subversion 1.5.1. When I attempt to run StatSVN against it, I get the following error: Sep 18, 2008 12:25:22 PM net.sf.statsvn.util.JavaUtilTaskLogger info INFO: StatSVN - SVN statistics generation Sep 18, 2008 12:25:22 PM net.sf.statsvn.util.JavaUtilTaskLogger ...
stackexchange/codereview
I have an image of a basic game map. Think of it as just horizontal and vertical walls which can't be crossed. How can I go from a png image of the walls to something in code easily? The hard way is pretty straight forward... it's just if I change the image map I would like an easy way to translate that to code. Than...
stackexchange/codereview
I have a asp:menu object which I set up to use a SiteMapDataSource but everytime I try to run the site, I get a yellow screen from firefox saying it cannot find the web.sitemap. Here's the code for the sitemapdatasource and the menu. The Web.sitemap file is sitting in the root directory of the website. <div> <asp:...
stackexchange/codereview
From my own "key logger like" process I figured out that another process Locale is wrong (i.e. by sniffing few keys, I figured out that the foreground process Locale should be something while it is set to another). What's the best way to do this?
stackexchange/codereview
I've got two tables: TableA ------ ID, Name TableB ------ ID, SomeColumn, TableA_ID (FK for TableA) The relationship is one row of TableA - many of TableB. Now, I want to see a result like this: ID Name SomeColumn 1. ABC X, Y, Z (these are three different rows) 2. MNO R, S This won't wo...
stackexchange/codereview
Is it possible to run an external process from Perl, capture its stderr, stdout AND the process exit code? I seem to be able to do combinations of these, e.g. use backticks to get stdout, IPC::Open3 to capture outputs, and system() to get exit codes. How do you capture stderr, stdout, and the exit code all at once?
stackexchange/codereview
I created a program using dev-cpp and wxwidgets which solves a puzzle. The user must fill the operations blocks and the results blocks, and the program will solve it. I'm solving it using brute force, I generate all non-repeated 9 length number combinations using a recursive algorithm. It does it pretty fast. Up to her...
stackexchange/codereview
I use maxframe.el to maximize my Emacs frames. It works great on all three major platforms, except on my dual-head Mac setup (Macbook Pro 15-inch laptop with 23-inch monitor). When maximizing an Emacs frame, the frame expands to fill the width of both monitors and the height of the larger monitor. Obviously, I would ...
stackexchange/codereview