instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I have a filter in a combobox with a number of entries. Instead of filtering the datagrid with an exact match, I would like to take the selected value and only display records where the selected value is contained in the datafield. For example: the user selects a value of "New" and the datagrid displays records where t...
stackexchange/codereview
You can have different naming convention for class members, static objects, global objects, and structs. Some of the examples of them are as below. _member m_member or in Java case, the usage of this.member. But is there any good technique or naming convention for function variables scope that conveys when a single va...
stackexchange/codereview
I'm looking to try out JRuby and JRuby on Rails. I'm having trouble finding information on what's difference between JRuby on Rails and Ruby on Rails. What's the differences I need to look out for?
stackexchange/codereview
I would like to sort a matrix according to a particular column. There is a sort function, but it sorts all columns independently. For example, if my matrix data is: 1 3 5 7 -1 4 Then the desired output (sorting by the first column) would be: -1 4 1 3 5 7 But the output of sort(data) is: -1...
stackexchange/codereview
I'm looking for a plugin or way to simply go from any namespace, type, method, property, etc in my .Net code to the MSDN page that covers it via a context menu item or hyperlink-like mechanism. Does anyone know of anything that will do that? The "Go to Definition" option when you right click almost covers this, but ...
stackexchange/codereview
To do an unattended installation of any MSI package, one can simply use the following command: msiexec /qn /i package.msi However, this triggers an asynchronous installation: if you happen to chain 2 dependent installations, you will have to wait somehow for the 1st installation to complete. Is there a way to do this ...
stackexchange/codereview
I want to delete a folder that contains thousands of files and folders. If I use Windows Explorer to delete the folder it can take 10-15 minutes (not always, but often). Is there a faster way in Windows to delete folders? Other details: I don't care about the recycle bin. It's an NTFS drive.
stackexchange/codereview
I am a total Groovy newbie. I saw the following code here. def beforeInterceptor = [action:this.&auth,except:'login'] How would I expand this to also include a second exception, say, if the action was 'login2'?
stackexchange/codereview
What criteria should I use to decide whether I write VBA code like this: Set xmlDocument = New MSXML2.DOMDocument or like this: Set xmlDocument = CreateObject("MSXML2.DOMDocument") ?
stackexchange/codereview
Have you refactored from an ActiveRecord to a DataMapper pattern? What conditions prompted the switch? I'm primarily interested in web based applications, but would like to know the challenges that accompany such a move in any environment.
stackexchange/codereview
My website makes a lot of requests. I often need to cancel all current requests, so that the browser is not blocking relevant new requests. I have 3 kinds of requests: Ajax inserted script-tags (which do JSONP-Communication) inserted image-tags (which cause the browser to request data from various servers) For Ajax i...
stackexchange/codereview
If I want to call Bar() instead of Foo(), does Bar() return me a copy (additional overhead) of what Foo() returns, or it returns the same object which Foo() places on the temporary stack? vector<int> Foo(){ vector<int> result; result.push_back(1); return result; } vector<int> Bar(){ return F...
stackexchange/codereview
Is there a course that can help non OO programmers how to develop in .NET in a good way? I don't mean just the syntax and how to design a class and the relationship between class but how organize a solution into projects (naming, what to put on each one) what method is more suitable to access data (dataobjects, remotin...
stackexchange/codereview
I'm currently trying to pass a mono threaded program to multithread. This software do heavy usage of "refCounted" objects, which lead to some issues in multithread. I'm looking for some design pattern or something that might solve my problem. The main problem is object deletion between thread, normally deletion only de...
stackexchange/codereview
I have a web page where I'd like to remap Ctrl+N to a different behavior. I followed YUI's example of register Key Listeners and my function is called but Firefox still creates a new browser window. Things seem to work fine on IE7. How do I stop the new window from showing up? Example: var kl2 = new YAHOO.util.KeyListe...
stackexchange/codereview
Anyone know of a link to a good article/tutorial for getting started using jQuery for AJAX calls rather than ASP.NET AJAX? I'm trying to avoid using UpdatePanels entirely in this app, which I haven't been able to accomplish in the past.
stackexchange/codereview
We have a customer that is trying to call our web service written in C# from PHP code. The web service call takes a long as parameter. This call works fine for other customers calling from C# or Java but this customer is getting an error back from the call. I haven't debugged their specific call but I am guessing that ...
stackexchange/codereview
I want to store the data returned by $_SERVER["REMOTE_ADDR"] in PHP into a DB field, pretty simple task, really. The problem is that I can't find any proper information about the maximum length of the textual representation of an IPv6 address, which is what a webserver provides through $_SERVER["REMOTE_ADDR"]. I'm not...
stackexchange/codereview
In PHP, which is quicker; using include('somefile.php') or querying a MySQL database with a simple SELECT query to get the same information? For example, say you had a JavaScript autocomplete search field which needed 3,000 terms to match against. Is it quicker to read those terms in from another file using include or ...
stackexchange/codereview
I want to deploy my web application (asp.net mvc), and I need to remove all the codebehind files from my project. Any scripts that you guys know of to do this? I prefer using a script since I can tweak it if need be.
stackexchange/codereview
We have implmented a REST-style get service Using WCF in .Net 3.5. This service retrieves research documents. The string 'synopsis' indicated in the code bolow contains non-english characteres which the browser deliveres as "????????". private void ReturnSynopsisInfo(IApiWebOperationContext context, OutgoingWebRespons...
stackexchange/codereview
Has anyone had this problem. You install Silverlight 2 RTW, and open your old project. Everything loads fine in the designer. You have to change a few properties of your DataGrid because "DisplayMemberBinding" was changed to "Binding". Press F5, and receive a Win32 exception in IEXPLORE.EXE. You go check out the e...
stackexchange/codereview
I am writing a command-line tool for Windows that uses libcurl to download files from the internet. Obviously, the downloading doesn't work when the user is behind a proxy server, because the proxy needs to be configured. I want to keep my tool as simple as possible however, and not have to burden the user with having ...
stackexchange/codereview
I'm moving from Java Development to a MSFT environment. The app is currently written in VB6 and while its going to go to VB.NET/C# in the future, I need to find a way to pick up VB6 now. I'm told its old, and there will be no books on it available these days. Any tips? Sites?
stackexchange/codereview
I'm using System.Reflection.Emit for a while now, and find it (who don't?) as painful as bug prone. Do you know if there is a good wrapper around the IL Generator, something that I can rely on to emit IL in a more safe and easier manner than with playing directly with SRE? Edit: I know that manipulating expression tree...
stackexchange/codereview
Can anyone recommend a ready-to-use class/library compatible with C/C++/MFC/ATL that would parse iCal/vCal/Google calendar files (with recurrences)? It can be free or commercial.
stackexchange/codereview
My application contains a piece of code that executes inside of Component Services, so we need to register our business rules layer (and its dependencies) in the GAC. One of those dependencies is FooCore.dll, which contains classes and services visible to the entire app. Everything was working fine, until I added a new...
stackexchange/codereview
How do you get a pointer to the .text section of memory for a program from within that program? I also need the length of the section to do a "Flash to Memory" compare as part of a continuous selftest that runs in the background. The toolset automatically generates the linker .cmd file for the tools I'm using, and the...
stackexchange/codereview
I recall there is a difference between some methods/properties called directly on the DataTable class, and the identically named methods/properties on the DataTable.Rows property. (Might have been the RowCount/Count property for which I read this.) The difference is one of them disregards DataRow.RowState, and the othe...
stackexchange/codereview
I am re-designing an application for a ASP.NET CMS that I really don't like. I have made som improvements in performance only to discover that not only does this CMS use MS SQL but some users "simply" use MS Access database. The problem is that I have some tables which I inner join, that with the MS Access version are ...
stackexchange/codereview
Assuming a fluid layout is not an option (since that is a different discussion all together), what is the recommended width for a site layout? What are the pros and cons of different sizes?
stackexchange/codereview
So I understand what a static method or field is, I am just wondering when to use them. That is, when writing code what design lends itself to using static methods and fields. One common pattern is to use static methods as a static factory, but this could just as easily be done by overloading a constructor. Correct? F...
stackexchange/codereview
How can I scale the content of an iframe (in my example it is an HTML page, and is not a popup) in a page of my web site? For example, I want to display the content that appears in the iframe at 80% of the original size.
stackexchange/codereview
I am an Ajax developer and I want to build a Flash application. Given my previous experience with JavaScript, what do you thing will be the easiest way to learn ActionScript and what are the obstacles I might encounter?
stackexchange/codereview
A python script is running two parallel python processes ( created via os.fork() ) each of which eventually tries to check out a subversion repository leaf into the same working copy dir. Before running 'svn co ...' command in a sub-process ( via python subprocess module ) the parent python code checks if the working c...
stackexchange/codereview
Scenario: Attempting to import many (>100), large(>1M recs) flat-files (csv). Problem: Many records are missing field delimiters. Asking: Is there a parsing tool that will attempt to define and validate the file and allow you to make "in-line" corrections? ETA: I'm attempting to import this files to MS SQL Server using...
stackexchange/codereview
For customer service week this year, I have the privileged task of creating a technology themed gift basket. I'm trying to keep the basket under $50 as I have a bluetooth keyboard/mouse combo that I'll be adding to it. Besides canned air and monitor wipes, are there any other recommendations for a PC based basket? I wa...
stackexchange/codereview
I am migrating a struts application from Websphere to Tomcat 6 and my application has support for Russian language. In Websphere we use to pass the JVM param -Dclinet.encoding.override=cp1251 but when I tried this with tomcat by passing the JVM argument -DFile.encoding=cp1251, the system doesnt accept input (I an any t...
stackexchange/codereview
I thought people would be working on little code projects together, but I don't see them, so here's an easy one: Code that validates a valid US Zip Code. I know there are ZIP code databases out there, but there are still uses, like web pages, quick validation, and also the fact that zip codes keep getting issued, so yo...
stackexchange/codereview
Here's the situation: I'm developing a simple application with the following structure: FormMain (startup point) FormNotification CompleFunctions Right? Well, in FormMain I have the following function: private void DoItInNewThread(ParameterizedThreadStart pParameterizedThreadStart, object pParameters, ThreadPriority ...
stackexchange/codereview
I have a list of objects, each containing an Id, Code and Description. I need to convert this list into a Hashtable, using Description as the key and Id as the value. This is so the Hashtable can then be serialised to JSON. Is there a way to convert from List<Object> to Hashtable without writing a loop to go through ea...
stackexchange/codereview
I'm currently looking at indexing an ASP website from Sharepoint and I need to replicate the old "advanced search" schema that the users are familiar with. In order to do this I need to index a few meta tags from the web pages. This is easily done and for the text fields I can use them in the search as well. However fo...
stackexchange/codereview
I'm currently using the sun preverifier to preverify my MIDlet. I'm finding that it can be a bit slow, doesnt give any decent error messages and is only available as a windows exe. Are there any better preverifiers around that will work cross platform (linux specifically)
stackexchange/codereview
Is it possible to create in a table of database a foreign key to a column of table in another database in SQL 2005 ?
stackexchange/codereview
I start using the visual studio c++ express 2008 at home but there is no ATL in it. How can I add ATL to visual studio c++ express 2008?
stackexchange/codereview
I need to have a working web browser in a fullscreen Direct3D application. For example, Valve's Source-based games (sort of) do it in the MotD window when you join a server. Any tips on where to look?
stackexchange/codereview
I'm writing a little debug app for a bit of kit we're developing and I'd like to roll it out to a few users to see if they can provoke any crashes. Does anyone know a way of effectively wrapping a wxPython app to catch any and all unhandled exceptions that would cause the app to crash? Ideally I'd want to capture all o...
stackexchange/codereview
I have a couple Perl scripts I'm taking public soon, and I want to make sure they'll run under mod_fcgid in order to keep the server load as low as possible. Previously, I've only ever run scripts that test FastCGI (ie, while ( my $q = new CGI::Fast ) { $count++; echo $count;}) or taken advantage of larger Perl packag...
stackexchange/codereview
I'll regularly get an extract from a DB/2 database with dates and timestaps formatted like this: 2002-01-15-00.00.00.000000 2008-01-05-12.36.05.190000 9999-12-31-24.00.00.000000 Is there an easier way to convert this into the Excel date format than decomposing with substrings? DB2date = DateValue(Left(a, 4) + "/" + Mi...
stackexchange/codereview
I might be an exception here but I have never worked on a team with more than three developers and / or five people. Still we could manage to get the job done (somehow). Is there a software development process which fits this "extreme" scenario? And, if you work as a standalone programmer is there something you can ada...
stackexchange/codereview
I've used DJ Java Decompiler, which has a handy GUI, but it seems as if the latest version is only a trial and forces you to purchase the software after some period of days (I recall using an earlier free version about a year ago at a previous job). I'm aware of Jad and Jadclipse, but what I loved about DJ Java Decompi...
stackexchange/codereview
I'm trying to create a named_scope that uses a join, but although the generated SQL looks right, the result are garbage. For example: class Clip < ActiveRecord::Base named_scope :visible, { :joins => "INNER JOIN series ON series.id = clips.owner_id INNER JOIN shows on shows.id = series.show_id", :condi...
stackexchange/codereview
I would like to declare a dropdown box in a view in an ASP.NET MVC application, for letting the user select a lookup value. I know how to declare plain text boxes but is there an official helper for declaring dropdown boxes (date time pickers and the rest)?. I also don't know what structure I should pass to my view for...
stackexchange/codereview
neither <?php system('php file.php'); ?> nor <?php system('/usr/bin/php file.php'); ?> worked. Why? I tried with -q, with !#/usr/bin/php etc.
stackexchange/codereview
Where is the location of my oracle event log (on a default Linux installation)?
stackexchange/codereview
I have a project in subversion, which I'm developing using Eclipse. I did the original checkout from the svn repository from inside Eclipse. All was well for some weeks then for some unknown reason, Eclipse (specifically: subclipse in Ganymede) no longer recognizes my project as being under svn control. The team contex...
stackexchange/codereview
I would like to upload a file asynchronously with jQuery. $(document).ready(function () { $("#uploadbutton").click(function () { var filename = $("#file").val(); $.ajax({ type: "POST", url: "addFile.do", enctype: 'multipart/form-data', data...
stackexchange/codereview
We are using a software program at our school to enter IEPs (Individualized Education Programs). When entering goals and objectives for a student, users are provided with a Save and a Close button. Close is meant for users not wishing to save the goal they just chose. However, our users are sometimes wanting to back...
stackexchange/codereview
Is it possible to create custom events in C++? For example, say I have the variable X, and the variable Y. Whenever X changes, I would like to execute a function that sets Y equal to 3X. Is there a way to create such a trigger/event? (triggers are common in some databases)
stackexchange/codereview
I'm looking to write a config file that allows for RESTful services in WCF, but I still want the ability to 'tap into' the membership provider for username/password authentication. The below is part of my current config using basicHttp binding or wsHttp w/out WS Security, how will this change w/ REST based services? ...
stackexchange/codereview
class Foo(models.Model): title = models.CharField(max_length=20) slug = models.SlugField() Is there a built-in way to get the slug field to autopopulate based on the title? Perhaps in the Admin and outside of the Admin.
stackexchange/codereview
I have a Selenium test case that enters dates into a date selector made up of three pulldowns (year, month, and day). select validity_Y label=2008 select validity_M label=08 select validity_D label=08 This part gets repeated a lot throughout the test case. I'd like to reduce it by defining my custom action "selectVal...
stackexchange/codereview
I'd like the web service proxy class to wait more than 2 minutes
stackexchange/codereview
Trying to update some gems on a Windows machine and I continually get this error output for gems that do not have pre-compiled binaries: Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=...
stackexchange/codereview
I have been using Ruby for a while now and I find, for bigger projects, it can take up a fair amount of memory. What are some best practices for reducing memory usage in Ruby? Please, let each answer have one "best practice" and let the community vote it up.
stackexchange/codereview
What is the best way to write bytes in the middle of a file using Java?
stackexchange/codereview
Before I begin, I want to clarify that this is not a command-line tool, but an application that accepts commands through it's own command-line interface. Edit: I must apologize about my explanation from before, apparently I didn't do a very good job at explaining it. One more time... I am building a command-line interf...
stackexchange/codereview
Specifically, I want to listen to when programs are run and record information such as: timestamp, executable, windows name and user.
stackexchange/codereview
Error message: "Virtual Server was unable to commit the changes made during the current session of "". A likely cause of this problem is the parent virtual hard disk cannot be opened for read/write or it might be in use or the user has no read/write/modify permissions. The data in the undo disk is retained." I can star...
stackexchange/codereview
Tcl/Tk is a simple way to script small GUIs. Can anyone give a nice example with a button and a text widget. When the button is pressed should a shell command be executed and the output piped to the text widget. If you have other nice and clean examples for useful tasks, please add them too.
stackexchange/codereview
What you want is for users to just type in their search criteria just like they would in Google. Some words, maybe some quoted phrases, maybe a few operators, and have it just work. A .Net solution is available here: http://ewbi.blogs.com/develops/2007/05/normalizing_sql.html I am looking for a pure T-SQL version with ...
stackexchange/codereview
What is the best or most concise method for returning a string repeated an arbitrary amount of times? The following is my best shot so far: function repeat(s, n){ var a = []; while(a.length < n){ a.push(s); } return a.join(''); }
stackexchange/codereview
I am trying to remotely run a DTSX package from a bat file with this command: DTEXEC /DTS "\File System\MY_PACKAGE_NAME" /SERVER MY_SERVER_NAME /MAXCONCURRENT " -1 " /CHECKPOINTING OFF /REPORTING V This is working fine locally but failing remotely (I do have admin rights on the machine I am pointing to and I have SQL...
stackexchange/codereview
I have a large number of NSIS install scripts (.nsi files) that simply define a bunch of constants and then the main installer logic resides an include file (.nsh) which is common to each of the installers. One of the include files looks like this: !ifdef ABC_SUBFOLDER RMDir /r "$ABCPath\Data\${ABC_SUBFOLDER}" ...
stackexchange/codereview
This is what I currently have: CREATE OR REPLACE TRIGGER MYTRIGGER AFTER INSERT ON SOMETABLE FOR EACH ROW DECLARE v_emplid varchar2(10); BEGIN SELECT personnum into v_emplid FROM PERSON WHERE PERSONID = :new.EMPLOYEEID; dbms_output.put(v_emplid); /* INSERT INTO SOMEOTHERTABLE USING v_emplid and some o...
stackexchange/codereview
I have two scripts that often need to be run with the same parameter: $ populate.ksh 9241 && check.ksh 9241 When I need to change the parameter (9241 in this example), I can go back and edit the line in history. But since I need to change the number in two places, I sometimes make a typo. I'd like to be able to chan...
stackexchange/codereview
Is there a way to configure an assembly in GAC? I want to add a custom configuration to my assembly with System.Configuration. Mher
stackexchange/codereview
Is it possible to use oracle instant client for application that use oraoledb driver for connecting to oracle 9i DB.
stackexchange/codereview
How can I combine the followings to fight spam and at the same time minimize annoyance imposed to the user? In registration page, sending an email to verify the email address In registration page, use CAPTCHA In every post page, use CAPTCHA Feel free to add new items to the list, and please tell your suggested scheme...
stackexchange/codereview
I have a flash project that I'm trying to export as a single SWF. There's a main SWF file that loads about 6 other SWFs, and both the main and the child SWFs reference other external assets (images, sounds, etc). I'd like to package everything as a single .swf file so I don't have to tote the other assets around with...
stackexchange/codereview
Is there an Oracle equivalent to MS SQL's full text search service? If so, has anyone implemented it and had good / bad experiences?
stackexchange/codereview
Is it possible to set a default value for columns in JPA, and if, how is it done using annotations?
stackexchange/codereview
What is the difference between <% %> and <%= %> in ASP.NET MVC? And when to use which?
stackexchange/codereview
Now that shared_ptr is in tr1, what do you think should happen to the use of std::auto_ptr? They both have different use cases, but all use cases of auto_ptr can be solved with shared_ptr, too. Will you abandon auto_ptr or continue to use it in cases where you want to express explicitly that only one class has ownershi...
stackexchange/codereview
I hope not everyone is using Rational Purify. So what do you do when you want to measure: time taken by a function peak memory usage code coverage At the moment, we do it manually [using log statements with timestamps and another script to parse the log and output to excel. phew...) What would you recommend? Pointin...
stackexchange/codereview
I have 150+ SQL queries in separate text files that I need to analyze (just the actual SQL code, not the data results) in order to identify all column names and table names used. Preferably with the number of times each column and table makes an appearance. Writing a brand new SQL parsing program is trickier than is se...
stackexchange/codereview
I have been writing Flex applications for a few months now and luckily have not needed a full debugger as of yet, so far I have just used a few Alert boxes... Is there an available debugger that is included in the free Flex SDK? I am not using FlexBuilder (I have been using Emacs and compiling with ant). If not, how do...
stackexchange/codereview
How do I determine if an object reference is null in C# w/o throwing an exception if it is null? i.e. If I have a class reference being passed in and I don't know if it is null or not.
stackexchange/codereview
I'm working on a project in C#. The previous programmer didn't know object oriented programming, so most of the code is in huge files (we're talking around 4-5000 lines) spread over tens and sometimes hundreds of methods, but only one class. Refactoring such a project is a huge undertaking, and so I've semi-learned to ...
stackexchange/codereview
<Grid.Triggers> <EventTrigger RoutedEvent="Border.Loaded"> <EventTrigger.Actions > <BeginStoryboard> <Storyboard x:Name="MyStoryboard" AutoReverse="True" RepeatBehavior="Forever"> <ColorAnimationUsingKeyFrames BeginT...
stackexchange/codereview
Is there any substantial difference between those two terms?. I understand that JDK stands for Java Development Kit that is a subset of SDK (Software Development Kit). But specifying Java SDK, it should mean the same as JDK.
stackexchange/codereview
I'm using the jQuery slideToggle function on a site to reveal 'more information' about something. When I trigger the slide, the content is gradually revealed, but is located to the right by about 100 pixels until the end of the animation when it suddenly jumps to the correct position. Going the other way, the content...
stackexchange/codereview
I am currently building an Excel 2007 Add-in using VSTO (latest version + sp1) and .Net 3.5 The code simply takes the position a chart using the Top and Left properties and stores it in an XML file. The problem im facing is that when the xml is generated using a Vista Ultimate + Excel 2007 + English environment the cod...
stackexchange/codereview
Is it possible to access the Abstract Syntax Tree(AST) inside the javac.exe programmatically? Could you provide an example?
stackexchange/codereview
What is the most efficient way of turning the list of values of a dictionary into an array? For example, if I have a Dictionary where Key is String and Value is Foo, I want to get Foo[] I am using VS 2005, C# 2.0
stackexchange/codereview
I have had to do this several times, usually when trying to find in what files a variable or a function is used. I remember using xargs with grep in the past to do this, but I am wondering if there are any easier ways.
stackexchange/codereview
(function() { //codehere } )(); What is special about this kind of syntax? What does ()(); imply?
stackexchange/codereview
I'm looking for a technique (javascript, CSS, whatever ???) that will let me control the amount of a string that is displayed. The string is the result of a search (and therefore not initially known). A simple Character count approach is trivial, but not acceptable, as it needs to handle proportional fonts. In otherwor...
stackexchange/codereview
I am interested in what methods of logging is frequent in an Oracle database. Our method is the following: We create a log table for the table to be logged. The log table contains all the columns of the original table plus some special fields including timestamp, modification type (insert, update, delete), modifier's i...
stackexchange/codereview
Could you provide an example of accessing the Eclipse Abstract Syntax Tree programmatically for a given piece of code? eg getting the AST for: Class1.java package parseable; public class Class1 { /** * @param args */ public static void main(String[] args) { System.out.println("Hello world!"); } }
stackexchange/codereview