instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
one of the most frequent requests I get is to create XY report for YZ App. These apps are normally built on PHP, so far I have manually created most of this reports, and while I enjoy the freedom of building it as I want, it usually becomes pretty tedious to calculate subtotals, averages, exporting to different formats...
stackexchange/codereview
How would you go about proving that two queries are functionally equivalent, eg they will always both return the same result set. As I had a specific query in mind when I was doing this, I ended up doing as @dougman suggested, over about 10% of rows the tables concerned and comparing the results, ensuring there was no...
stackexchange/codereview
I'm deploying to Ubuntu slice on slicehost, using Rails 2.1.0 (from gem) If I try mongrel_rails start or script/server I get this error: Rails requires RubyGems >= 0.9.4. Please install RubyGems When I type gem -v I have version 1.2.0 installed. Any quick tips on what to look at to fix?
stackexchange/codereview
Maybe this is a dumb question, but is there any way to convert a boolean value to a string such that 1 turns to "true" and 0 turns to "false"? I could just use an if statement, but it would be nice to know if there is a way to do that with the language or standard libraries. Plus, I'm a pedant. :)
stackexchange/codereview
quick question: my customer has a situation where he has his database with a varchar field and the corresponding jdbc code is storing/retrieving a boolean. I guess that the boolean values false and true are going to be translated to "0" and "1" but I would like to have a confirmation of this (I can't find the precise b...
stackexchange/codereview
Can anyone explain what is windows workflow and how can we use in the work organization.
stackexchange/codereview
Has anyone been able to get a variable record length text file (CSV) into SQL Server via SSIS? I have tried time and again to get a CSV file into a SQL Server table, using SSIS, where the input file has varying record lengths. For this question, the two different record lengths are 63 and 326 bytes. All record lengt...
stackexchange/codereview
Since Rails is not multithreaded (yet), it seems like a threaded web framework would be a better choice for a Facebook application. (reason being is cuz each Rails process can only handle one request at a time, and facebook actions tend to be slow, because there is a lot of network communication between your app and f...
stackexchange/codereview
I'm developing a .NET 3.5 XBAP application that runs perfectly fine in FF3 and IE6/7 etc. I'm just wondering if its possible to get these to run under other browsers, specifically (as its in the limelight at the moment) Google Chrome.
stackexchange/codereview
How do you randomly select a table row in T-SQL based on an applied weight for all candidate rows? For example, I have a set of rows in a table weighted at 50, 25, and 25 (which adds up to 100 but does not need to), and I want to select one of them randomly with a statistical outcome equivalent to the respective weight...
stackexchange/codereview
Is there an algorithm or some heuristic to decide whether digital audio data is clipping?
stackexchange/codereview
I'd like to render to svg data in a swf at runtime (not in Flex - not using degrafa) - how would I go about doing that?
stackexchange/codereview
I'd like to add dvd burning functionality to my .Net app (running on Windows Server 2003), are there any good components available? I've used the NeroCOM sdk that used to come with Nero but they no longer support the sdk in the latest versions of Nero. I learned that Microsoft has created an IMAPI2 upgrade for Window...
stackexchange/codereview
Many people use Mock Objects when they are writing unit tests. What is a Mock Object? Why would I ever need one? Do I need a Mock Object Framework?
stackexchange/codereview
I would like to give a class a unique ID every time a new one is instantiated. For example with a class named Foo i would like to be able to do the following dim a as New Foo() dim b as New Foo() and a would get a unique id and b would get a unique ID. The ids only have to be unique over run time so i would just lik...
stackexchange/codereview
I am working on a simple chat application using a System.Windows.Forms.WebBrowser Control to display the messages between the user and the recipient. How do I get the control to automatically scroll to the bottom every time I update the DocumentText of the control?
stackexchange/codereview
I want to delete all but the 4 newest directories in my parent directory. How would you do this in Bash?
stackexchange/codereview
What is the best C++ IDE for a *nix envirnoment? I have heard the C/C++ module of Eclipse is decent as well as Notepad++ but beyond these two I have no real idea. Any thoughts or comments?
stackexchange/codereview
For example, if I have a page located in Views/Home/Index.aspx and a JavaScript file located in Views/Home/Index.js, how do you reference this on the aspx page? The example below doesn't work even though the compiler says the path is correct <script src="Index.js" type="text/javascript"></script> The exact same issue ...
stackexchange/codereview
What techniques do you know\use to create user-friendly GUI ? I can name following techniques that I find especially useful: Non-blocking notifications (floating dialogs like in Firefox3 or Vista's pop-up messages in tray area) Absence of "Save" button MS OneNote as an example. IM clients can save conversation hist...
stackexchange/codereview
I'm looking for something that can copy (preferably only changed) files from a development machine to a staging machine and finally to a set of production machines. A "what if" mode would be nice as would the capability to "rollback" the last deployment. Database migrations aren't a necessary feature. UPDATE: A fre...
stackexchange/codereview
I'm looking into sending regular automated text-messages to a list of subscribed users. Having played with Windows Mobile devices, I could easily implement this using the compact .Net framework + a device hooked up to usb and send the messages through this. I would like to explore other solutions like having a server o...
stackexchange/codereview
I'm a long-time emacs user, and I'm now working about 1/2 time in Java. What are the best emacs libraries for Debugging Java Code Completion/Intellisense Javadoc browsing ?
stackexchange/codereview
Nevrona Designs' Rave Reports is a Report Engine for use by Embarcadero's Delphi IDE. This is what I call the Rave Endless Loop bug. In Rave Reports version 6.5.0 (VCL10) that comes bundled with Delphi 2006, there is a nortorious bug that plagues many Rave report developers. If you have a non-empty dataset, and the dat...
stackexchange/codereview
We created a tool which converts a language called P2, a language similar to assembly which I think exists only in Japan, to C#. There are at least a hundred modules written in P2 and we want to verify if the conversion to C# is right? How can we test this?
stackexchange/codereview
I have been reading through the C++ FAQ and was curious about the friend declaration. I personally have never used it, however I am interested in exploring the language. What is a good example of using friend? Reading the FAQ a bit longer I like the idea of the << >> operator overloading and adding as a friend of tho...
stackexchange/codereview
Does anyone see server-side JavaScript taking off? There are a couple of implementations out there, but it all seems to be a bit of a stretch (as in, "doing it BECAUSE WE CAN" type of attitude). I'm curious to know if anyone actually writes JavaScript for the server-side and what their experiences with it have been to...
stackexchange/codereview
I'm using NHibernate on a project and I need to do data auditing. I found this article on codeproject which discusses the IInterceptor interface. What is your preferred way of auditing data? Do you use database triggers? Do you use something similar to what's dicussed in the article?
stackexchange/codereview
Let's say the first N integers divisible by 3 starting with 9. I'm sure there is some one line solution using lambdas, I just don't know it that area of the language well enough yet.
stackexchange/codereview
I'm trying to get the GWTShell mode to load my context.xml file in which my database is described. The only usable info can be found here, but this doesn't seem to work for the context.xml part.
stackexchange/codereview
In C# is there a shorthand way to write this: public static bool IsAllowed(int userID) { return (userID == Personnel.JohnDoe || userID == Personnel.JaneDoe ...); } Like: public static bool IsAllowed(int userID) { return (userID in Personnel.JohnDoe, Personnel.JaneDoe ...); } I know I could also use switch, bu...
stackexchange/codereview
I've been utilizing the command pattern in my Flex projects, with asynchronous callback routes required between: whoever instantiated a given command object and the command object, the command object and the "data access" object (i.e. someone who handles the remote procedure calls over the network to the servers) that...
stackexchange/codereview
I have a table with an XML column. This column is storing some values I keep for configuring my application. I created it to have a more flexible schema. I can't find a way to update this column directly from the table view in SQL Management Studio. Other (INT or Varchar for example) columns are editable. I know I can ...
stackexchange/codereview
I have a file that I want to include in Python but the included file is fairly long and it'd be much neater to be able to split them into several files but then I have to use several include statements. Is there some way to group together several files and include them all at once?
stackexchange/codereview
When running any kind of server under load there are several resources that one would like to monitor to make sure that the server is healthy. This is specifically true when testing the system under load. Some examples for this would be CPU utilization, memory usage, and perhaps disk space. What other resource should ...
stackexchange/codereview
As popular as Ruby and Rails are, it seems like this problem would already be solved. JRuby and mod_rails are all fine and dandy, but why isn't there an Apache mod for just straight Ruby?
stackexchange/codereview
Which OS do you prefer to program on? Client or Server There is a school of though that if you are doing (mostly) web programming (or other server based code), you should use a server OS for your dev machine, since that's closer to the environment where your app will be running. Update: I should add, this is really dir...
stackexchange/codereview
I need a very fast algorithm for the following task. I have already implemented several algorithms that complete it, but they're all too slow for the performance I need. It should be fast enough that the algorithm can be run at least 100,000 times a second on a modern CPU. It will be implemented in C++. I am working wi...
stackexchange/codereview
In your experience, how often should Oracle database statistics be run? Our team of developers recently discovered that statistics hadn't been run our production box in over 2 1/2 months. That sounds like a long time to me, but I'm not a DBA.
stackexchange/codereview
When working with tables in Oracle, how do you know when you are setting up a good index versus a bad index?
stackexchange/codereview
How to make sure that all derived C++/CLI classes will override the ICloneable::Clone() method of the base class? Do you think I should worry about this? Or this is not a responsibility of the base class' writer? Amendment: Sorry, I forgot to mention that the base class is a non-abstract class.
stackexchange/codereview
Visual Studio Solution files contain two GUID's per project entry. I figure one of them is from the AssemblyInfo.cs Does anyone know for sure where these come from, and what they are used for?
stackexchange/codereview
Is the Sql Server 2008 control available for download? Does it yet support the 2008 RDL schema?
stackexchange/codereview
I have found that skin files only work if they are placed at the root theme folder in the App_Themes folder. For example, if you have 2 themes in the App_Themes folder, you cannot add another sub folder to the theme folder and place a seperate skin file in that subfolder. It's not much of a limitation, but it would g...
stackexchange/codereview
Assume I have an "images" folder directory under the root of my application. How can I, from within a .css file, reference an image in this directory using an ASP.NET app relative path. Example: When in development, the path of ~/Images/Test.gif might resolve to /MyApp/Images/Test.gif while, in production, it might ...
stackexchange/codereview
Continuing the "Hidden features of ..." meme, let's share the lesser-known but useful features of Ruby programming language. Try to limit this discussion with core Ruby, without any Ruby on Rails stuff. See also: Hidden features of C# Hidden features of Java Hidden features of JavaScript Hidden features of Ruby on Rai...
stackexchange/codereview
When launching a process from Java, both stderr and stdout can block on output if I don't read from the pipes. Currently I have a thread that pro-actively reads from one and the main thread blocks on the other. Is there an easy way to join the two streams or otherwise cause the subprocess to continue while not losing ...
stackexchange/codereview
I want to put a copyright notice in the footer of a web site, but I think it's incredibly tacky for the year to be outdated. How would I make the year update automatically with PHP
stackexchange/codereview
Is there an easy way to set the zoom level for a windows form in C#? In VBA there was a zoom property of the form.
stackexchange/codereview
What's the best way to go about validating that a document follows some version of HTML (prefereably that I can specify)? I'd like to be able to know where the failures occur, as in a web-based validator, except in a native Python app.
stackexchange/codereview
Doug McCune had created something that was exactly what I needed (http://dougmccune.com/blog/2007/05/10/analyze-your-actionscript-code-with-this-apollo-app/) but alas - it was for AIR beta 2. I just would like some tool that I can run that would provide some decent metrics...any idea's?
stackexchange/codereview
Is there a difference between NULL and null in PHP? Sometimes they seem to be interchangeable and sometimes not. edit: for some reason when I read the documentation linked to in the answer (before posting this question) I read it as "case sensitive" instead of "case insensitive" which was the whole reason I posted this...
stackexchange/codereview
Obviously there are security reasons to close a wireless network and it's not fun if someone is stealing your bandwidth. That would be a serious problem? To address the first concern: Does a device on the same wireless network have any special privileges or access that an other device on the internet has? Assumptions ...
stackexchange/codereview
I'm using Ruby on Rails for an internal site. Different users of the site have access to a wide variety of data and highly disparate perspectives of the data. Within those different classes of users, there needs to be levels of access. Within the levels of access I need to be able to add features from other classes of ...
stackexchange/codereview
I've had a little search and I was wondering if there is back compatibility for the .NET framework. The real question is, if there's a program that uses .NET Framework 1.1, can I install 3.5 and be done, or do I have to install 1.1 and then if something uses 3.5 I have to install 3.5 as well?
stackexchange/codereview
Is it possible to bypass @GeneratedValue for an ID in Hibernate, we have a case where, most of the time we want the ID to be set using GeneratedValue, but in certain cases would like to set the ID manually. Is this possible to do?
stackexchange/codereview
I have Visual Studio web test attached nicely to a data source, but I need to be able to iterate over each entry in the data source. How should I do this?
stackexchange/codereview
Are there any free tools that implement evidence-based scheduling like Joel talks about? There is FogBugz, of course, but I am looking for a simple and free tool that can apply EBS on some tasks that I give estimates (and actual times which are complete) for.
stackexchange/codereview
Using the Windows API, how can I get a list of domains on my network?
stackexchange/codereview
What are the characteristics of a multitasking operating system? What makes it multitasking? Are there non-multitasking operating systems?
stackexchange/codereview
In a VB6 application, I have a Dictionary whose keys are Strings and values are instances of a custom class. If I call RemoveAll() on the Dictionary, will it first free the custom objects? Or do I explicitly need to do this myself? Dim d as Scripting.Dictionary d("a") = New clsCustom d("b") = New clsCustom ' Are th...
stackexchange/codereview
I'm currently working on upgrading a product for the Chinese market. The target is a ARMTDMI7 with a QVGA display. Most resources I've located on the net are targeted at desktop or web programming rather than embedded devices. Can anyone suggest some tools and resources that might be useful? What are the best techniqu...
stackexchange/codereview
Normally I would just use: HttpContext.Current.Server.UrlEncode("url"); But since this is a console application, HttpContext.Current is always going to be null. Is there another method that does the same thing that I could use?
stackexchange/codereview
I use this tool called Lazy C++ which breaks a single C++ .lzz file into a .h and .cpp file. I want Makepp to expect both of these files to exist after my rule for building .lzz files, but I'm not sure how to put two targets into a single build line.
stackexchange/codereview
In a project I'm working on FxCop shows me lots of (and I mean more than 400) errors on the InitializeComponent() methods generated by the Windows Forms designer. Most of those errors are just the assignment of the Text property of labels. I'd like to suppress those methods in source, so I copied the suppression code g...
stackexchange/codereview
Does anyone know of any free or open source terminal emulators that will emulate an IBM 3151 terminal or an HFT terminal (aixterm)? We have some offshore contractors that need access to some of our systems that need a 3151 or hft emulation, but are having issues transferring licenses of Hummingbird HostExplorer to In...
stackexchange/codereview
After downloading all .NET framework symbols and sources using NetMassDownloader, is it possible to setup the VS.NET 2005 for debugging into .NET 2.0 source files?
stackexchange/codereview
Currently, WScript pops up message box when there is a script error. These scripts are called by other processes, and are ran on a server, so there is nobody to dismiss the error box. What I'd like is for the error message to be dumped to STDOUT, and execution to return the calling process. Popping as a MSGBox just ha...
stackexchange/codereview
I wrote an application that currently runs against a local instance of MySql. I would like to centralize the DB somewhere on the Net, and share my application. But, I'm cheap, and don't want to pay for it. Does anyone know of a free on-line relational DB service that I could connect to via C#?
stackexchange/codereview
Phppgadmin comes with instructions for creating a reports database on the system for use with phppgadmin. The instructions describe how to set it up, but do not really give any indication of what its purpose is, and the phppgadmin site was not very helpful either. It seems to allow you to store SQL queries, so is it fo...
stackexchange/codereview
Does anyone know IF, WHEN or HOW I can get Memcached running on a Windows 64bit environment? I'm setting up a new hosting solution and would much prefer to run a 64bit OS, and since it's an ASP.Net MVC solution with SQL Server DB, the OS is either going to be Windows Server 2003 or (hopefully!) 2008. I know that this ...
stackexchange/codereview
For reasons I won't go into, I wish to ban an entire company from accessing my web site. Checking the remote hostname in php using gethostbyaddr() works, but this slows down the page load too much. Large organizations (eg. hp.com or microsoft.com) often have blocks of IP addresses. Is there anyway I get the full list, ...
stackexchange/codereview
I suppose it allows for moving changes from one branch to the next but that's what cherry picking is for and if you're not making a commit of your changes, perhaps you shouldn't be moving them around? I have on occasion applied the wrong stash at the wrong branch, which left me wondering about this question.
stackexchange/codereview
I've been trying to implement a C#-like event system in C++ with the tr1 function templates used to store a function that handles the event. I created a vector so that multiple listeners can be attached to this event, i.e.: vector< function<void (int)> > listenerList; I'd like to be able to remove a handler from the...
stackexchange/codereview
I was following along with the railscast regarding the restful_authentication plugin. He recommended running the command: script/generate authenticated user session Which I did, and everything generated "fine", but then sessions wouldn't work. Checking the site again, he mentions a naming standard and listed updated co...
stackexchange/codereview
Is there a tool that will find for me all the css classes that I am referencing in my HTML that don't actually exist? ie. if I have <ul class="topnav" /> in my HTML and the topnav class doesn't exist in any of the referenced CSS files. This is similar to SO#33242, which asks how to find unused CSS styles. This isn't a ...
stackexchange/codereview
Is there a program or API I can code against to extract individual files from a Windows Vista Complete PC Backup image? I like the idea of having a complete image to restore from, but hate the idea that I have to make two backups, one for restoring individual files, and one for restoring my computer in the event of a c...
stackexchange/codereview
When attempting to understand how a SQL statement is executing, it is sometimes recommended to look at the explain plan. What is the process one should go through in interpreting (making sense) of an explain plan? What should stand out as, "Oh, this is working splendidly?" versus "Oh no, that's not right."
stackexchange/codereview
I'd rather not have to resort to calling the command line. I'm looking for code that can map/disconnect a drive, while also having exception handling. Any ideas?
stackexchange/codereview
I have a form like this: <form name="mine"> <input type=text name=one> <input type=text name=two> <input type=text name=three> </form> When user types a value in 'one', I sometimes want to skip the field 'two', depending on what he typed. For example, if user types '123' and uses Tab to move to next field,...
stackexchange/codereview
I'm having trouble connecting (via the Socket and XMLSocket classes) to a TCP listener after a connect timeout. I have a flash applet that needs to maintain a TCP connection to a server. I have implemented timeouts using Timers, a ping-pong system, etc. However, there's a problem. Upon calling Socket.connect(), the fla...
stackexchange/codereview
With VMWare Server running under Linux (Debain), I would like to have the following setup: 1st: NIC being used by many of the images running under VMWare, as well as being used by the Linux OS 2nd: NIC being used by only 1 image and to be unused by the Linux OS (as its part of a DMZ) Although the second NIC won't be...
stackexchange/codereview
Is there a way to enforce/limit the types that are passed to primitives? (bool, int, string, etc.) Now, I know you can limit the generic type parameter to a type or interface implementation via the where clause. However, this doesn't fit the bill for primitives (AFAIK) because they do not all have a common ground (apar...
stackexchange/codereview
I was reading googlebooks on chrome, where they talk about why they decided to spin up a process to host browser tab, every time you created a new tab.' So 2 tabs = 2 chrome processes 3 tabs = 3 chrome processes and so on .. right?? But i opened up some 20 or so tabs, but in task manager, i could only find 3 chrome pr...
stackexchange/codereview
Is there a maintained package I can use to retrieve and set MP3 ID3 metadata using Python?
stackexchange/codereview
We have a SharePoint WSS site and some of our users on on the Mac OSX platform. Are there any tips or tricks to get a similar experience to Windows with document shares and calendars on the Mac? Edit: Browsing a SharePoint WSS site on a Mac, whether using Firefox or Safari, has a very similar look and feel as it does ...
stackexchange/codereview
Generally, how bad of a performance hit is storing a file in a database (specifically mssql) as opposed to the file system? I can't come up with a reason outside of application portability that I would want to store my files as varbinaries in SQL Server.
stackexchange/codereview
Wikipedia says SQL Server Express Edition is limited to "one processor, 1 GB memory and 4 GB database files". Does anyone have practical experience with how well this scales?
stackexchange/codereview
I'm looking to push my domain model into a WCF Service API and wanted to get some thoughts on lazy loading techniques with this type of setup. Any suggestions when taking this approach? when I implemented this technique and step into my app, just before the server returns my list it hits the get of each property that ...
stackexchange/codereview
Using Terminal.app on OS X 10.5, often you see the commands get garbled when you do a reverse-search with Bash. Is there some kind of termcap or perhaps a bash shopt command that can fix this? It is very annoying. Steps to reproduce: Open Terminal.app, reverse-search to a longish command. Hit <ctrl>-E once you've...
stackexchange/codereview
Where is the best tutorial for getting Ruby On Rails working on a windows box with Mongrel? I'm a complete novice at server management, so the more detailed the better!
stackexchange/codereview
We are using classic asp to call a C# dll and in the C# dll we are using System.Drawing.Printing.PrinterSettings.InstalledPrinters to get a list of availabe printers. If the printers are not shared they will not show up when a user trys to print. The Local System account can see and print to them from a VB6 dll and Adm...
stackexchange/codereview
Can databases (MySQL in particular, any SQL--MS, Oracle, Postgres--in general) do mass updates, and figure out on their own what the new value should be? Say for example I've got a database with information about a bunch of computers, and all of these computers have drives of various sizes--anywhere from 20 to 250 GB. ...
stackexchange/codereview
I found What are mvp and mvc and what is the difference but it didn't really answer this question. I've recently started using MVC because it's part of the framework that myself and my work-partner are going to use. We chose it because it looked easy and separated process from display, are there advantages besides this...
stackexchange/codereview
How can I get the MAC Address using only the compact framework?
stackexchange/codereview
I want to implement a paperless filing system and was looking to use WIA with C# for the image acquisition. There are quite a few sample projects on CodeProject, etc. However, after downloading every one of them that I can find, I have run into a problem. In each and every one of them, the reference to WIALib is broken...
stackexchange/codereview
We need to add WorkFlow to our Spring managed application. Does anyone have any useful experience in using any of the myriad of OSS Work Flow solutions? Which one is best? Which one integrates with Spring best? Which ones should we avoid?
stackexchange/codereview
I find myself writing delegates occasionally for really simple functions (take no arguments and return void for example) and am wondering if anyone knows someplace that has compiled a list of all the predefined delegates already available in the .NET framework so I can reuse them? To be clear I am looking for something...
stackexchange/codereview
In Visual Studio 2008 add a new DataGridView to a form Edit Columns Add a a new DataGridViewImageColumn Open the CellStyle Builder of this column (DefaultCellStyle property) Change the NullValue from System.Drawing.Bitmap to null Try to add a new Row to the DataGridView at runtime (dataGridView1.Rows.Add();) You get t...
stackexchange/codereview
I am using the webbrowser control in winforms and discovered now that background images which I apply with css are not included in the printouts. Is there a way to make the webbrowser print the background of the displayed document too? Edit: Since I wanted to do this programatically, I opted for this solution: using Mi...
stackexchange/codereview