instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
When I am running the following statement: @filtered = map {s/ //g} @outdata; it is returning an empty list instead of the filtered list that I expected. What I am trying to do is remove every occurrence of   from an array of string (which is an XML file). Obviously, I am not understanding something. Can a...
stackexchange/codereview
We were having a problem with our build server not checking out modifications from source control despite recognizing that there had been changes. It was traced to the control folder (not sure what it's real name is), the existing working builds were using _svn. Clearing the working folder forced a new complete checkou...
stackexchange/codereview
Say I have an ASMX web service, MyService. The service has a method, MyMethod. I could execute MyMethod on the server side as follows: MyService service = new MyService(); service.MyMethod(); I need to do similar, with service and method not known until runtime. I'm assuming that reflection is the way to go about ...
stackexchange/codereview
I might be missing something really obvious. I'm trying to write a custom Panel where the contents are laid out according to a couple of dependency properties (I'm assuming they have to be DPs because I want to be able to animate them.) However, when I try to run a storyboard to animate both of these properties, Silver...
stackexchange/codereview
In Visual Studio 2005, whenever I would view a file in the main editor, the Solution Explorer would find and highlight that file. Some time ago, this stopped working and the Solution Explorer would do nothing. This has become quite a pain since following a chain of "Go To Definition"s can lead you all over your soluti...
stackexchange/codereview
What's the most useful hack you've discovered for Mozilla's new Ubiquity tool? ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
stackexchange/codereview
If you've used Oracle, you've probably gotten the helpful message "ORA-00942: Table or view does not exist". Is there a legitimate technical reason the message doesn't include the name of the missing object? Arguments about this being due to security sound like they were crafted by the TSA. If I'm an attacker, I'd kno...
stackexchange/codereview
What's the best way to delete all rows from a table in sql but to keep n number of rows on the top?
stackexchange/codereview
It's big problem to convert mod_rewrite rules to lighttpd format
stackexchange/codereview
What are the advantages/disadvantages between MS VS C++ 6.0 and MSVS C++ 2008? The main reason for asking such a question is that there are still many decent programmers that prefer using the older version instead of the newest version. Is there any reason the might prefer the older over the new?
stackexchange/codereview
Exceptions in C++ don't need to be caught (no compile time errors) by the calling function. So it's up to the developer's judgment whether to catch them using try/catch (unlike in Java). Is there a way one can ensure that the exceptions thrown are always caught using try/catch by the calling function?
stackexchange/codereview
Given that indexing is so important as your data set increases in size, can someone explain how indexing works at a database-agnostic level? For information on queries to index a field, check out How do I index a database column.
stackexchange/codereview
I downloaded and installed the Aptana Studio free version. But apparently, to install the Radrails plugin for ruby on rails development you have to connect to the internet. I don't have internet on my machine right now. So is there a way I could download the installer from another machine and copy it over my existing A...
stackexchange/codereview
A reliable coder friend told me that Python's current multi-threading implementation is seriously buggy - enough to avoid using altogether. What can said about this rumor?
stackexchange/codereview
I am making a simple game in order to learn a new language. I am in the process of collecting some music for the game and would like to use the MIDI format so that I can control the flow of the track (i.e., I would like to have an introduction that only plays once and does not play again when the song loops.) I am hav...
stackexchange/codereview
With SharePoint Server 2007, there is also a Search Feature and a Crawler. However, the Crawler is somewhat limited in that it only supports Basic Auth when crawling external sites and that there is no way to tell it to ignore no-index,no-follow attributes. Now, there is a site i'd like to index, unfortunately this sit...
stackexchange/codereview
I have a Flex ComboBox that gets populated by a dataprovider all is well... I would now like to add a default " -- select a item --" option at the 0 index, how can I do this and still use a dataprovider? I have not seen any examples of such, but I can't imagine this being hard...
stackexchange/codereview
I'm working on a side project that would be a simple web application to maintain a list of classes and their upcoming schedules. I would really like to use Linq to SQL for this project, but unfortunately the server environment I'm developing for only has MySql available. I've dabbled briefly with Subsonic but it just d...
stackexchange/codereview
How can I get line numbers to print in Visual Studio 2005 when printing code listings?
stackexchange/codereview
One simple method I've used in the past is basically just creating a second table whose structure mirrors the one I want to audit, and then create an update/delete trigger on the main table. Before a record is updated/deleted, the current state is saved to the audit table via the trigger. While effective, the data in ...
stackexchange/codereview
We are developing a middleware SDK, both in C++ and Java to be used as a library/DLL by, for example, game developers, animation software developers, Avatar developers to enhance their products. What I would like to know is this: Are there standard "Best Practices" for the development of these types of API? I am thinki...
stackexchange/codereview
The reason I ask is that Stack Overflow has been Slashdotted, and Redditted. First, what kinds of effect does this have on the servers that power a website? Second, what can be done by system administrators to ensure that their sites remain up and running as best as possible?
stackexchange/codereview
I am overriding a lot of SAP's Portal functionality in my current project. I have to create a custom fixed width framework, custom iView trays, custom KM API functionality, and more. With all of these custom parts, I will not be using a lot of the style functionality implemented by SAP's Theme editor. What I would li...
stackexchange/codereview
Working with a SqlCommand in C# I've created a query that contains a IN (list...) part in the where clause. Instead of looping through my string list generating the list I need for the query (dangerous if you think in sqlInjection). I thought that I could create a parameter like: SELECT blahblahblah WHERE blahblahblah ...
stackexchange/codereview
I erroneously delete all the rows from a MS SQL 2000 table that is used in merge replication (the table is on the publisher). I then compounded the issue by using a DTS operation to retrieve the rows from a backup database and repopulate the table. This has created the following issue: The delete operation marked the r...
stackexchange/codereview
I've been studying the Google authentication API (AuthSub)... My question is, how do I get the user's account information (at least their Gmail address) after the authentication has passed? Because currently, all I get back from the authentication process is a token granting me access to which ever Google service I h...
stackexchange/codereview
Back in the old days, Help was not trivial but possible: generate some funky .rtf file with special tags, run it through a compiler, and you got a WinHelp file (.hlp) that actually works really well. Then, Microsoft decided that WinHelp was not hip and cool anymore and switched to CHM, up to the point they actually axe...
stackexchange/codereview
I seem right now to be embroiled in a debate with another programmer on this project who thinks that views have no merits. He proposes a system that PHP looks something like this: $draw = new Draw; $nav = $draw->wideHeaderBox(). $draw->left(). $draw->image(). Image::get($image,60,array('id'=>'header_image'...
stackexchange/codereview
What is the RegEx pattern for DateTime (2008-09-01 12:35:45 ) ? I get this error: No ending delimiter '^' found Using: preg_match('(?n:^(?=\d)((?<day>31(?!(.0?[2469]|11))|30(?!.0?2)|29(?(.0?2)(?=.{3,4}(1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|(16|[2468][048]|[3579][26])00))|0?[1-9]|1\d|2[0-8])(?<sep>[/.-])(?<mo...
stackexchange/codereview
I've tried to write a string replace function in C, which works on a char *, which has been allocated using malloc(). It's a little different in that it will find and replace strings, rather than characters in the starting string. It's trivial to do if the search and replace strings are the same length (or the replace...
stackexchange/codereview
When a java based application starts to misbehave on a windows machine, you want to be able to kill the process in the task manager if you can't quit the application normally. Most of the time, there's more than one java based application running on my machine. Is there a better way than just randomly killing java.exe ...
stackexchange/codereview
Rather than rewriting the entire contents of an xml file when a single element is updated, is there a better alternative to updating the file?
stackexchange/codereview
Is it possible to change how Ctrl + Tab and Shift + Ctrl + Tab work in Visual Studio? I have disabled the popup navigator window, because I only want to switch between items in the tab control. My problem is the inconsistency of what switching to the next and previous document do. Every other program that uses a tab co...
stackexchange/codereview
Is is possible to construct a regular expression that rejects all input strings?
stackexchange/codereview
I have looked in vain for a good example or starting point to write a java based facebook application... I was hoping that someone here would know of one. As well, I hear that facebook will no longer support their java API is this true and if yes does that mean that we should no longer use java to write facebook apps...
stackexchange/codereview
I am having a problem with the speed of accessing an association property with a large number of records. I have an XAF app with a parent class called MyParent. There are 230 records in MyParent. MyParent has a child class called MyChild. There are 49,000 records in MyChild. I have an association defined between MyPare...
stackexchange/codereview
I have been looking for a way to utilize a simple markup language, or just plain HTML, when displaying text in WinForm applications. I would like to avoid embedding a web browser control since in most of the case I just want to highlight a single word or two in a sentence. I have looked at using a RTFControl but I beli...
stackexchange/codereview
I recently encountered a problem where a value was null if accessed with Request.Form but fine if retrieved with Request.Params. What are the differences between these methods that could cause this?
stackexchange/codereview
When I'm working with DataBound controls in ASP.NET 2.0 such as a Repeater, I know the fastest way to retrieve a property of a bound object (instead of using Reflection with the Eval() function) is to cast the DataItem object to the type it is and then use that object natively, like the following: <%#((MyType)Container...
stackexchange/codereview
I'm tired of being in the middle of typing something, having a pop-up with a question appear, and hitting enter before reading it... (it also happens with some windows that are not pop-ups) Do you know if there's some setting I could touch for this not to happen?
stackexchange/codereview
I load some XML from a servlet from my Flex application like this: _loader = new URLLoader(); _loader.load(new URLRequest(_servletURL+"?do=load&id="+_id)); As you can imagine _servletURL is something like http://foo.bar/path/to/servlet In some cases, this URL contains accented characters (long story). I pass the unesc...
stackexchange/codereview
Tomcat fails to start even if i remove all my applications from the WEBAPPS directory leaving everything just like after the OS installation. The log (catalina.out) says: Using CATALINA_BASE: /usr/share/tomcat5 Using CATALINA_HOME: /usr/share/tomcat5 Using CATALINA_TMPDIR: /usr/share/tomcat5/temp Using JRE_HOME: ...
stackexchange/codereview
I'm sure you have all been there, you take on a project where there is a creaky old code base which is barely fit for purpose and you have to make the decision to either re-write it from scratch or repair what already exists. Conventional wisdom tends to suggest that you should never attempt a re-write from scratch a...
stackexchange/codereview
I used the jQuery Form plugin for asynchronous form submission. For forms that contain files, it copies the form to a hidden iframe, submits it, and copies back the iframe's contents. The problem is that I can't figure out how to find what HTTP status code was returned by the server. For example, if the server returns ...
stackexchange/codereview
When using the Net.Sockets.TcpListener, what is the best way to handle incoming connections (.AcceptSocket) in seperate threads? The idea is to start a new thread when a new incoming connection is accepted, while the tcplistener then stays available for further incoming connections (and for every new incoming connectio...
stackexchange/codereview
Hopefully, I can get answers for each database server. For an outline of how indexing works check out: How does database indexing work?
stackexchange/codereview
I am writing a perl script to parse a mysql database schema and create C++ classes when necessary. My question is a pretty easy one, but us something I haven't really done before and don't know common practice. Any object of any of classes created will need to have "get" methods to populate this information. So my q...
stackexchange/codereview
Internet Explorer has a file download limit of 4GB (2 GB on IE6). Firefox does not have this problem (haven't tested safari yet) (More info here: http://support.microsoft.com/kb/298618) I am working on a site that will allow the user to download very large files (up to and exceeding 100GB) What is the best way to do t...
stackexchange/codereview
I'm using namespaces in a project and Eclipse PDT, my IDE of choice, recognizes them as syntax errors. Not only it renders its convenient error checking unusable, but it also ruins Eclipse's PHP explorer. 5.3 features are coming to PDT 2.0 scheduled for release in December. Are there any alternatives for the present mo...
stackexchange/codereview
I am receiving SOAP requests from a client that uses the Axis 1.4 libraries. The requests have the following form: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-in...
stackexchange/codereview
I'm trying to write a stored procedure to select employees who have birthdays that are upcoming. SELECT * FROM Employees WHERE Birthday > @Today AND Birthday < @Today + @NumDays This will not work because the birth year is part of Birthday, so if my birthday was '09-18-1983' that will not fall between '09-18-2008' an...
stackexchange/codereview
I have a decimal number (let's call it goal) and an array of other decimal numbers (let's call the array elements) and I need to find all the combinations of numbers from elements which sum to goal. I have a preference for a solution in C# (.Net 2.0) but may the best algorithm win irrespective. Your method signature mi...
stackexchange/codereview
What JavaScript keywords (function names, variables, etc) are reserved?
stackexchange/codereview
The first time I load the website in the production web server, it start very slow, subsequent pages load very quickly (included the home page). I precompiled the site, but nothing changes. I don't have any code at Application start. I don't have cached items. Any ideas? How can I find out what is happening?
stackexchange/codereview
I'm using an XmlSerializer to deserialize a particular type in mscorelib.dll XmlSerializer ser = new XmlSerializer( typeof( [.Net type in System] ) ); return ([.Net type in System]) ser.Deserialize( new StringReader( xmlValue ) ); This throws a caught FileNotFoundException when the assembly is loaded: "Could not load...
stackexchange/codereview
I am developing an application that controls an Machine. When I receive an error from the Machine the users should be able to directly notice it, one way that is done is Flashing the tray on the taskbar. When the machine clears the error the tray should stop flashing. There's one little annoyance using the FlashWindowE...
stackexchange/codereview
Nokia has stopped offering its Developer's Suite, relying on other IDEs, including Eclipse. Meanwhile, Nokia changed its own development tools again and EclipseMe has also changed. This leaves most documentation irrelevant. I want to know what does it take to make a simple Hello-World? (I already found out myself, so ...
stackexchange/codereview
I need to write a program used internally where different users will have different abilities within the program. Rather than making users have a new username and password, how do I tie into an existing domain server's login system? Assume .NET (C#, VB, ASP, etc) -Adam
stackexchange/codereview
I have a asp.net page, and would like to know whether "script1" is already registered as a startup script or not?
stackexchange/codereview
I have a number of tracks recorded by a GPS, which more formally can be described as a number of line strings. Now, some of the recorded tracks might be recordings of the same route, but because of inaccurasies in the GPS system, the fact that the recordings were made on separate occasions and that they might have been...
stackexchange/codereview
I need to remotely install windows service on number of computers, so I use CreateService() and other service functions from winapi. I know admin password and user name for machines that I need access to. In order to gain access to remote machine I impersonate calling process with help of LogonUser like this: //all...
stackexchange/codereview
A database application that I'm currently working on, stores all sorts of settings in the database. Most of those settings are there to customize certain business rules, but there's also some other stuff in there. The app contains objects that specifically do a certain task, e.g., a certain complicated calculation. Tho...
stackexchange/codereview
For example: Updating all rows of the customer table because you forgot to add the where clause. What was it like, realizing it and reporting it to your coworkers or customers? What were the lessons learned?
stackexchange/codereview
I installed VS SP1 and played around with Entity Framework. I created a schema from an existing database and tried some basic operations. Most of it went well, except the database schema update. I changed the database in every basic way: added a new table deleted a table added a new column to an existing table deleted...
stackexchange/codereview
I've got an Active Directory synchronization tool (.NET 2.0 / C#) written as a Windows Service that I've been working on for a while and have recently been tasked with adding the ability to drive events based on changes in group membership. The basic scenario is that users are synchronized with a security database and,...
stackexchange/codereview
Is it possible to convert floating point exceptions (signals) into C++ exceptions on x86 Linux? This is for debugging purposes, so nonportability and imperfection is okay (e.g., if it isn't 100% guaranteed that all destructors are called).
stackexchange/codereview
OK, so I don't want to start a holy-war here, but we're in the process of trying to consolidate the way we handle our application configuration files and we're struggling to make a decision on the best approach to take. At the moment, every application we distribute is using it's own ad-hoc configuration files, whether...
stackexchange/codereview
How, if you have a database per client of a web application instead of one database used by all clients, do you go about providing updates and enhancements to all databases efficiently? How do you roll out changes to schema and code in such a scenario?
stackexchange/codereview
I have thus far avoided the nightmare that is testing multi-threaded code since it just seems like too much of a minefield. I'd like to ask how people have gone about testing code that relies on threads for successful execution, or just how people have gone about testing those kinds of issues that only show up when tw...
stackexchange/codereview
Is there a better windows command line shell other than cmd which has better copy paste between Windows' windows and console windows?
stackexchange/codereview
Why are pointers such a leading factor of confusion for many new, and even old, college-level students in C or C++? Are there any tools or thought processes that helped you understand how pointers work at the variable, function, and beyond level? What are some good practice things that can be done to bring somebody to...
stackexchange/codereview
Is there any way to include the SVN repository revision number in the version string of a .NET assembly? Something like Major.Minor.SVNRev I've seen mention of doing this with something like CC.NET (although on ASP.NET actually), but is there any way to do it without any extra software? I've done similar things in C/...
stackexchange/codereview
I am working in Visual Basic 6 and need to sort by multiple columns in a ListView. For example, sorting a list of music tracks by artist, then album, then track number. As far as I know, VB6 does not support this out of the box. Here are the suggestions I have already heard: Sort the data in a SQL table first and d...
stackexchange/codereview
I have a Question class: class Question { public int QuestionNumber { get; set; } public string Question { get; set; } public string Answer { get; set; } } Now I make an ICollection of these available through an ObjectDataSource, and display them using a Repeater bound to the DataSource. I use <%#Eval("Qu...
stackexchange/codereview
I was looking for a tree or graph data structure in C#, but I guess there isn't one provided. An Extensive Examination of Data Structures Using C# 2.0 a bit about why. Is there a convenient library which is commonly used to provide this functionality? Perhaps through a strategy pattern to solve the issues presented i...
stackexchange/codereview
Using Firebug v1.20b7 with Firefox v3.0.1 I use firebug a lot for web devlopment. I have very often the problem that Firebug won't show its web console for seeing the POSTs and GETs. I can view all the other tabs, including the NET tab that gives me a lot of the same information that the CONSOLE tab does. Curious if an...
stackexchange/codereview
I'm writing some data acquisition software and need a gui plotting library that is fast enough to do realtime updated graphs. I've been using Nplot which is pretty good for a free library, but I'm wondering if there are any better libraries (preferably free or cheap).
stackexchange/codereview
I am using CCNET on a sample project with SVN as my source control. CCNET is configured to create a build on every check in. CCNET uses MSBuild to build the source code. I would like to use the latest revision number to generate AssemblyInfo.cs while compiling. How can I retrieve the latest revision from subversion and...
stackexchange/codereview
What's the most efficient way to concatenate strings?
stackexchange/codereview
Programming languages had several (r)evolutionary steps in their history. Some people argue that model-driven approaches will be The Next Big Thing. There are tools like openArchitectureWare, AndroMDA, Sculptor/Fornax Platform etc. that promise incredible productivity boosts. However, I made the experience that it is e...
stackexchange/codereview
Does anyone know of a good way to display hierarchical data with columns? It has to be virtualizing, as it must be able to handle several million records. It should also be multi-select, most treeview controls are not. Winforms preferred, but will ElementHost WPF if necessary.
stackexchange/codereview
In a JSP page, I created a <h:form enctype="multipart/form-data"> with some elements: <t:inputText>, <t:inputDate>, etc. Also, I added some <t:message for="someElement"> And I wanted to allow the user upload several files (one at a time) within the form (using <t:inputFileUpload> ) At this point my code works fine. Th...
stackexchange/codereview
What's the best way to asynchronously load an BitmapImage in C# using WPF?
stackexchange/codereview
I need to be able to manipulate a large (10^7 nodes) graph in python. The data corresponding to each node/edge is minimal, say, a small number of strings. What is the most efficient, in terms of memory and speed, way of doing this? A dict of dicts is more flexible and simpler to implement, but I intuitively expect a l...
stackexchange/codereview
While CtrlX works fine in vim under windows, CtrlA selects all (duh). Is there a way to increment a number with a keystroke under windows?
stackexchange/codereview
Short version: I want to trigger the Form_Load() event without making the form visible. This doesn't work because Show() ignores the current value of the Visible property: tasksForm.Visible = false; tasksForm.Show(); Long version: I have a WinForms application with two forms: main and tasks. The main form is always di...
stackexchange/codereview
I'm looking to find alternatives to Solr from the Apache Software Foundation. For those that don't know, Solr is an enterprise search server. A client application uses a web-services like interface to submit documents for indexing and also to perform search queries. Solr has other features built in like caching and re...
stackexchange/codereview
So you have a String that is retrieved from an admin web UI (so it is definitely a String). How can you find out whether this string is an IP address or a hostname in Java? Update: I think I didn't make myself clear, I was more asking if there is anything in the Java SDK that I can use to distinguish between IPs and ho...
stackexchange/codereview
I have a list of 2-item tuples and I'd like to convert them to 2 lists where the first contains the first item in each tuple and the second list holds the second item. For example: original = [('a', 1), ('b', 2), ('c', 3), ('d', 4)] # and I want to become... result = (['a', 'b', 'c', 'd'], [1, 2, 3, 4]) Is there a bui...
stackexchange/codereview
Can anyone recommend some good resources that highlight the differences between Oracle and the AS/400 database? I am trying to help someone with a lot of AS/400 experience implement an Oracle installation, and they need some guidance. A book or online resource would be ideal.
stackexchange/codereview
I just moved over to the Visual Basic team here at work. What is the equivalent keyword to break in Visual Basic, that is, to exit a loop early but not the method?
stackexchange/codereview
We are automating Excel using VB.Net, and trying to place multiple lines of text on an Excel worksheet that we can set to not print. Between these we would have printable reports. We can do this if we add textbox objects, and set the print object setting to false. (If you have another way, please direct me) The code to...
stackexchange/codereview
I am looking to allow users to control of subdomain of an app I am toying with, much like Basecamp where it is customusername.seework.com. What is required on the DNS end to allow these to be created dynamically and be available instantly. And how do you recommend dealing with this in the logic of the site? Htaccess r...
stackexchange/codereview
One of the sites I maintain relies heavily on the use of ViewState (it isn't my code). However, on certain pages where the ViewState is extra-bloated, Safari throws a "Validation of viewstate MAC failed" error. This appears to only happen in Safari. Firefox, IE and Opera all load successfully in the same scenario.
stackexchange/codereview
I'm just in the process of parsing some text and can't remember what the escape character is for a tab in C#?
stackexchange/codereview
In Ruby, I'm trying to do the following. def self.stats(since) return Events.find(:all, :select => 'count(*) as this_count', :conditions => ['Date(event_date) >= ?', (Time.now - since)]).first.this_count end where "since" is a string representing an amount of time ('1 hour', '1 day', '3 days') and so on. Any suggest...
stackexchange/codereview
I'd like to find the different ways to solve a real life problem I had: imagine to have a contest, or a game, during which the users collect points. You have to build a query to show the list of users with the best "n" scores. I'm making an example to clarify. Let's say that this is the Users table, with the points ea...
stackexchange/codereview
I just started using GNU Emacs as my text editor and I am concerned about getting afflicted with "Emacs Pinky" by having to constantly press the control key with my pinky finger as is required when using Emacs. How can I avoid potentially getting this type of repetitive strain injury?
stackexchange/codereview
A friend and I were discussing C++ templates. He asked me what this should do: #include <iostream> template <bool> struct A { A(bool) { std::cout << "bool\n"; } A(void*) { std::cout << "void*\n"; } }; int main() { A<true> *d = 0; const int b = 2; const int c = 1; new A< b > (c) > (d); } The l...
stackexchange/codereview
I have three tables: page, attachment, page-attachment I have data like this: page ID NAME 1 first page 2 second page 3 third page 4 fourth page attachment ID NAME 1 foo.word 2 test.xsl 3 mm.ppt page-attachment ID PAGE-ID ATTACHMENT-ID 1 2 1 2 2 2 3 3...
stackexchange/codereview