instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
My initial installation for the MySQL had no password for root. I assigned a password for root and everything worked fine. Due to some reason (don't ask why) I had to revert back to the original settings where root didn't have any password. I changed the root password to '' (empty string). The problem now is that MySQL...
stackexchange/codereview
I have a stub Qt application and I keep getting compiler errors #include <QApplication> int main(int argc, char *argv[]) { return 0; } I used qmake -project and qmake commands and as far as I can tell they did their job correctly. When I subsequently call make at the command line I get the following error: g+...
stackexchange/codereview
I've seen several products that will track the sales rank of an item on Amazon. Does Amazon have any web-services published that I can use to get the sales rank of a particular item? I've looked through the AWS and didn't see anything of that nature.
stackexchange/codereview
I have been trying to make a case for using Python at my work. We use C# and ASP.NET for basically all of our development. 80% or more of our projects are web applications. It seems natural that we would look at some of the nice dynamic web languages (Ruby, Python, etc), and with things like IronRuby and IronPython, I ...
stackexchange/codereview
I just want to know how to validate (or clean) user input in ASP.NET MVC so that an HttpRequestValidationException will not be thrown regardless of the values submitted. For example, with a text input, if the user inputs <BR/>, it will cause an exception and the Yellow Screen of Death will be shown. I don't want that...
stackexchange/codereview
I have a database table with 6 columns. The primary key is a composite key made up of 5 of the 6 columns I am trying to use the SqlClient.SqlCommandBuilder.GetDeleteCommand to delete the row. However I am getting the following error: "System.InvalidOperationException : Dynamic SQL generation for the DeleteCommand is...
stackexchange/codereview
Given a simple switch statement switch (int) { case 1 : { printf("1\n"); break; } case 2 : { printf("2\n"); } case 3 : { printf("3\n"); } } The absence of a break statement in case 2, implies that execution will continue inside the code for case 3...
stackexchange/codereview
When I download my program from my website to my windows 2003 machine, it has a block on it and you have to right click on the exe, then properties, then select the button "Unblock". I would like to add detection in my installer for when the file is blocked and hence doesn't have enough permissions. But I can't eaisl...
stackexchange/codereview
The official documentation seems to be light on explanations of 'how to understand the SproutCore way' e. g., why things are done the way they are, how to intuit what to do from where you're at, etc.
stackexchange/codereview
I want to convert an XML document containing many elements within a node (around 150) into another XML document with a slightly different schema but mostly with the same element names. Now do I have to manually map each element/node between the 2 documents. For that I will have to hardcode 150 lines of mapping and elem...
stackexchange/codereview
I'm sure there are a million posts about this out there, but surprisingly I'm having trouble finding something. I have a simple script where I want to set the onClick handler for an <A> link on initialization of the page. When I run this I immediately get a 'foo' alert box where I expected to only get an alert when I ...
stackexchange/codereview
What is the latest version of the Boost library that is compatible with Microsoft Visual C++ 6? And can you provide a link to download it directly? The Downloads link at http://www.boost.org only gives a download for version 1.36.0, and the documentation for that version lists Visual C++ 7.1 as the lowest version of M...
stackexchange/codereview
Besides the DateTime ctor (new DateTime(year, month, day)) , is there any other way to truncate a date?
stackexchange/codereview
In C++, what's the generic way to convert any floating point value (float) to fixed point (int, 16:16 or 24:8)? EDIT: For clarification, fixed-point values have two parts to them: an integer part and a fractional part. The integer part can be represented by a signed or unsigned integer data type. The fractional part ...
stackexchange/codereview
This has been bugging me for a long time -- how do I properly resolve a merge conflict within the SVN properties set on a directory? Say for instance there are two developers working on a project where svn:ignore is set on some directory. If both developers make changes to this property, when the second one updates, ...
stackexchange/codereview
So I feel I pretty well understand the application layer, and everything below (and including) the transport layer. The session and presentation layers, though, I don't fully understand. I've read the simplistic descriptions in Wikipedia, but it doesn't have an example of why separating out those layers is useful. So:...
stackexchange/codereview
We have a form that allows a user to dynamically add inputs for fields. For example if you have a form for tracking projects, you want to dynamically add tasks to that project. Just to clarify my language: you dynamically add inputs for the task field. The problem is, we have 50 of those fields. Our current solution pr...
stackexchange/codereview
I am looking for a piece of software that I can schedule to check that our web apps are up and running. I've used HP open view years ago, but remember it being quite expensive, I'm looking for something open source or cheap. So it would login in and do some simple actions maybe submit form and check for some text on ...
stackexchange/codereview
I would like to stress test a win32 application by sending a lot of random keystrokes to it, and I wonder if anyone could point me to some software I could use. Ideally, I should be able to specify which keystrokes can be sent, and control rate (random min/max).
stackexchange/codereview
My situation: I have several components, which sometimes have changes to them, and are shared across a lot of different projects. Each project puts these in a subfolder called /depends. The depends holds a bunch of svn externals for all of our common components. svn:externals is causing me a lot of time and pain. S...
stackexchange/codereview
I'm trying to convert some strings that are in French Canadian and basically, I'd like to be able to take out the French accent marks in the letters while keeping the letter. (E.g. convert é to e, so crème brûlée would become creme brulee) What is the best method for achieving this?
stackexchange/codereview
From a HTML application (.hta file), you can drag any image and drop it into the desktop for example. Does anybody know how to disable this capability? I want the .hta files to have the same behavior as the .html files.
stackexchange/codereview
I am having a great deal of trouble getting named queries to work with nHibernate. My latest problem is getting the error message "could not execute query" with no additional information. Are there any complete examples I can download from somewhere because all the tutorials and documentation examples provide code snip...
stackexchange/codereview
This is a question that's been nagging me for some time. I always thought that C++ should have been designed so that the delete operator (without brackets) works even with the new[] operator. In my opinion, writing this: int* p = new int; should be equivalent to allocating an array of 1 element: int* p = new int[1]; ...
stackexchange/codereview
I'm using c#, and have an open tcpip connection receiving data. Is it possible to save the stream to an ms sql server database as I'm receiving it, instead of receiving all the data then saving it all? If the stream could be sent to the database as it's being received, you wouldn't have to keep the entire chunk of da...
stackexchange/codereview
How can I calculate the number of work days between two dates in SQL Server? Monday to Friday and it must be T-SQL.
stackexchange/codereview
Is http/1.0 able to handle deflated and gzip content? I've finished to implement deflate and gzip in my minimalist web server and I don't really know if browsers with http/1.0 are capable to handle deflate and gzip compressed content.
stackexchange/codereview
Is it possible to set the position of the tabs to be at the bottom of the tabcontainer using the AjaxToolkit? You do have some control over the CSS but I'm not au-fait enough with CSS to see whether it's feasible? Thanks
stackexchange/codereview
I have a website where clients pay for a service but have to out the money upfront via escrow, I'm very proficient with PHP (this is what the website is coded in) how would I go about implementing an escrow system that would work automatically?
stackexchange/codereview
It's my understanding that a corelet is a Motorola-ism, but does anyone know what the difference is? Do corelets have certain abilities that midlets don't?
stackexchange/codereview
So I just love it when my application is working great in Firefox, but then I open it in IE and... Nope, please try again. The issue I'm having is that I'm setting a CSS display property to either none or table-cell with JavaScript. I was initially using display: block, but Firefox was rendering it weird without the ta...
stackexchange/codereview
I have a Django model with a large number of fields and 20000+ table rows. To facilitate human readable URLs and the ability to break down the large list into arbitrary sublists, I would like to have a URL that looks like this: /browse/<name1>/<value1>/<name2>/<value2>/ .... etc .... where 'name' maps to a model attr...
stackexchange/codereview
Ok, so at some point in time, somebody checked in some files with names that require a case sensitive file system into the trunk of a repository that I constantly check out. This of course leads to my local working copy locking up when I try to check it out (on my Windows computer). Is there any way that I can set my...
stackexchange/codereview
I've just started playing with Django and am loosely following the tutorial with my own set of basic requirements. The models I've sketched out so far are a lot more comprehensive than the tutorial, but they compile fine. Otherwise, everything should have been the same. My problem is with the admin application. I can l...
stackexchange/codereview
I'm using $.post() to call a servlet using Ajax and then using the resulting HTML fragment to replace a div element in the user's current page. However, if the session times out, the server sends a redirect directive to send the user to the login page. In this case, jQuery is replacing the div element with the contents...
stackexchange/codereview
I have a VB.NET ClickOnce application that I am trying to install on my computer. Previously, I was able to install and run these apps without issue. Now when I install the application, I can see the flash of a window opening, and then nothing. (There are also no processes left hanging or anything when viewed with th...
stackexchange/codereview
The CSS syntax highlighting in vim is not entirely optimal. For example: div.special_class stops the highlighting at the _. Is there an improved highlighter that doesn't bite on an underscore? Update: I'm using VIM - Vi IMproved 7.1 (2007 May 12, compiled Jun 17 2008 15:22:40) and the header of my css.vim is: " Vim ...
stackexchange/codereview
I need to model a system where by there will be a team who will consist of users who perform roles in the team and have skills assigned to them. i.e. a team A 5 members, one performs the team leader role, all perform the reply to email role, but some have an extra skill to answer the phone I'm trying to determine how I...
stackexchange/codereview
I have a query: UPDATE choices SET votes = votes + 1 WHERE choice_id = '$user_choice' But when I execute it in my script, the votes field is updated twice, so the votes will go from 4 to 6 instead to 5. It doesn't seem that it is getting called twice because I echo out stuff to test this and only get one echo. Is there...
stackexchange/codereview
How do I truncate output in BASH? For example, if I "du file.name" how do I just get the numeric value and nothing more? later addition: all solutions work perfectly. I chose to accept the most enlightning "cut" answer because I prefer the simplest approach in bash files others are supposed to be able to read.
stackexchange/codereview
We ship Java applications that are run on Linux, AIX and HP-Ux (PA-RISC). We seem to struggle to get acceptable levels of performance on HP-Ux from applications that work just fine in the other two environments. This is true of both execution time and memory consumption. Although I'm yet to find a definitive article on...
stackexchange/codereview
Trying to get an ASP application deployed; it worked for a while but then started coming up with errors whenever the page is accessed: Server Error in '/AppNameHere' Application. Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this appl...
stackexchange/codereview
If I define a constant in a Perl module, how do I use that constant in my main program? (Or how do I call that constant in the main program?)
stackexchange/codereview
In the (otherwise) excellent book C++ Coding Standards, Item 44, titled "Prefer writing nonmember nonfriend functions", Sutter and Alexandrescu recommend that only functions that really need access to the members of a class be themselves members of that class. All other operations which can be written by using only mem...
stackexchange/codereview
I have not developed web services applications that publicly faced the Internet. As I begin to consider the issues of exposing schema definitions to a wide audience, I believe a certain amount of consideration should be spent on properly formatting the schema namespaces. Has anybody come across a guideline document tha...
stackexchange/codereview
I have this function in my Javascript Code that updates html fields with their new values whenever it is called. The problem cannot be with the function itself because it works brilliantly in every section except for one. Here is the JS function: function updateFields() { document.getElementById('bf').innerHTML...
stackexchange/codereview
I tried GNUBOX which use bluetooth to connect to my computer then to the internet. It's very painful to set up (under windows more than under linux, but it's still painful, it works 1 time on 3). I own a Nokia 6630 so there is no WLAN support. Is there any emulator? I'd need to know something like max width, max heigh...
stackexchange/codereview
I have started using Presentation Model w/ ASP.NET webforms and like the pattern quite a bit. What I am really having an issue with is where to instantiate some of my classes, mostly the presentation model, my business object, and things like the data for drop down lists. So I could use some tips or a complete example ...
stackexchange/codereview
I'm interested in learning C. I have read K & R, and I have even done some simple C extension work in R and Python. What's a worthwhile project idea for doing something more substantial with C? Any good online resources, similar to Dive Into Python? In particular, resources focused on programmers that already know ...
stackexchange/codereview
I'm trying to collect wifi Bssid and Rssi information on Windows, and am looking for the most reliable way to do that across as many versions of Windows as possible. With Vista it's easy using Win32 calls with the Wireless LAN API. That API exists on XP SP2 (sometimes) and SP3, but as far as I can tell it doesn't suppo...
stackexchange/codereview
I'm using SimpleDateFormat with the pattern EEE MM/dd hh:mma, passing in the date String Thu 10/9 08:15PM and it's throwing an Unparseable date exception. Why? I've used various patterns with SimpleDateFormat before so I'm fairly familiar with its usage. Maybe I'm missing something obvious from staring at it too long...
stackexchange/codereview
If two users are accessing same database table, how do we prevent users from overwriting each other’s data?
stackexchange/codereview
My current app needs to store address information for a user. I'm currently debating whether to use the customary street address / city / state / zip textboxes and dropdowns or to go with Google's method of simply having everything on one line. Any thoughts on the pros/cons of storing address information in either of...
stackexchange/codereview
First, a couple operating parameters: .NET development using Visual Studio 2005/2008 TortoiseSVN client I've only primarily worked with Visual Source Safe and SourceGear Vault source control systems. In each, I map the root of the repository to a local working directory. For example: $/ --> C:\source As long as ...
stackexchange/codereview
I have a custom application with a simple app.config specifying SQL Server name and Database, I want to prompt the user on application install for application configuration items and then update the app.config file. I admit I'm totally new to setup projects and am looking for some guidance. Thank You Mark Koops
stackexchange/codereview
Is there a way to control where Resharper puts its backing fields? currently it tries to put them at the top of the class. Id like them to go right above the property.
stackexchange/codereview
I have a simple GtkStatusBar created with glade,and want to add a simple message with the date of the last update of the database (just a simple and plain date). I don't want to use the whole stacks, context and all the other things that gtk developers put on the statusbar code. (I could simply use a label but I would ...
stackexchange/codereview
I am working on a business problem in C#.NET. I have two classes, named C and W that will be instantiated independently at different times. An object of class C needs to contain references to 0 ... n objects of class W, i.e. a C object can contain up to n W objects. Each W object needs to contain a reference to exactl...
stackexchange/codereview
I have some tables that I build as a part of my report rollup. I don't need them afterwards at all. Someone mentioned to truncate them as it would be faster.
stackexchange/codereview
Which is the best way to go forward while building a localized aspx web application, .resx files of satellite assemblies? Is there any performance comparisons available any where on web?
stackexchange/codereview
A bunch of CSS files were pulled in and now I'm trying to clean things up a bit. How can I efficiently identify unused CSS definitions in a whole project?
stackexchange/codereview
Let's collect some tips for evaluating the appropriate use of global.asax.
stackexchange/codereview
For example, how much memory is required to store a list of one million (32-bit) integers? alist = range(1000000) # or list(range(1000000)) in Python 3.0
stackexchange/codereview
I have a two-level hierarchy displayed in a WPF TreeView, but I only want the child nodes to be selectable - basically the top level nodes are for categorisation but shouldn't be selectable by themselves. Can I achieve this? Thanks...
stackexchange/codereview
What's the most elegant way of implementing a DropDownList in ASP.NET that is editable without using 3rd party components. As a last resort I will probably try using a TextBox with an AutoCompleteExtender with an image to 'drop down' the list; or a TextBox overlapping a HTML Select with some JavaScript to fill values f...
stackexchange/codereview
How can you programmatically tell an HTML select to drop down (for example, due to mouseover)?
stackexchange/codereview
My Program overrides public void paint(Graphics g, int x, int y); in order to draw some stings using g.drawString(someString, x+10, y+30); Now someString can be quite long and thus, it may not fit on one line. What is the best way to write the text on multiple line. For instance, in a rectangle (x1, y1, x2, y2)?
stackexchange/codereview
I just, quite anxiously, downloaded the spankin new WCF REST starter kit. The installed failed. Anyone else had this problem? http://msdn.microsoft.com/en-us/netframework/cc950529.aspx Edit: The install fails during the template installation. The VS JIT debugger window pops up. Nothing else is running the PC, I am runn...
stackexchange/codereview
What is meant by "Constant Amortized Time" when talking about time complexity of an algorithm?
stackexchange/codereview
I want to set some attributes just before the object is serialized, but as it can be serialized from several locations, is there a way to do this using the OnSerializing method (or similar) for Xml serialization - my class is largely like this - but the On... methods are not being called...: [Serializable] [XmlRoot(Ele...
stackexchange/codereview
I have two multidimensional arrays (well actually they're only 2D) which have inferred size. How do I deep clone them? Here's what I have gotten so far: public foo(Character[][] original){ clone = new Character[original.length][]; for(int i = 0; i < original.length; i++) clone[i] = (Character[]) origi...
stackexchange/codereview
I'm looking for a tool that can be installed on our monitoring server and which allows us to perform scheduled requests to our web sites in order to keep them from shutting down (asp.net). I don't want to use a web service since we already have a dedicated monitoring server. Our monitoring software doesn't really have ...
stackexchange/codereview
I have the in my opinion odd request to close a wizard form as Done or OK if Enter was pressed on the keyboard even if the OK/DONE button is not focused. In my opinion that would be a usability mistake. For example: In the wizard you may have multiple controls, buttons, check boxes, multiple line controls and they all ...
stackexchange/codereview
Is there any reason something like this would not work? This is the logic I have used many times to update a record in a table with LINQ: DataClasses1DataContext db = new DataClasses1DataContext(); User updateUser = db.Users.Single(e => e.user == user); updateUser.InUse = !updateUser.InUse; db.Log = new System.IO.S...
stackexchange/codereview
I need a webserver to serve up very simple POST/GET requests as JSON. I don't need MVC, Rails, Django. I need something that takes up very little memory, preferrably around 5K per reqeust. The webserver will talk to backend services like Scribe using Facebook Thrift. Each http request will also access a SQLLite dat...
stackexchange/codereview
Is it possible to set the data in a ContentPlaceHolder through code? This is what I am thinking of: dim oCPH as new ContentPlaceHolder oCPH.id = "column1" 'this id is the one that corresponds with the ID I set on the page oCPH.content = "content here" '<-- not real code Obviously that is not correct syntax, I hope th...
stackexchange/codereview
Languages like C and even C# (which technically doesn't have a preprocessor) allow you to write code like: #DEFINE DEBUG ... string returnedStr = this.SomeFoo(); #if DEBUG Debug.WriteLine("returned string =" + returnedStr); #endif This is something I like to use in my code as a form of scaffolding, and I'm wonder...
stackexchange/codereview
I'm building a .NET client application (C#, WinForms) that uses a web service for interaction with the database. The client will be run from remote locations using a WAN or VPN, hence the idea of using a web service rather than direct database access. The issue I'm grappling with right now is how to handle database con...
stackexchange/codereview
This post is similar to this previously asked question. I really want to set up my SVN repository in TTB format, but when creating a project in Visual Studio 2008 (ASP.NET/VB.NET), the structure created tends to be incompatible when considering the solution file, project files, folders for projects, multiple projects ...
stackexchange/codereview
I have a map in Java. I would like to compare a source string against all items in the map and return the best match based on a levenshtein ratio algorithm. I am wondering what the optimal way to perform this check on every element in the list would be. Thanks, Matt
stackexchange/codereview
WCFTestClient tool doesn't seem to work if the size of maxNameTableCharCount is greater than default value (16384). Is there any way to modify the settings of the config file generated by this tool, BEFORE the tool generates it? I can modify the config file contents after the service connection is established. But I a...
stackexchange/codereview
I'm working with a small FAT16 filesystem, and I want to generate CRC values for indidual XML files which store configuration information. In case the data changes or is corrupted, I want to be able to check the CRC to determine that the file is still in it's original state. The question is, how do I put the CRC value ...
stackexchange/codereview
I'd love a good native Python library to write XLS, but it doesn't seem to exist. Happily, Jython does. So I'm trying to decide between jexcelapi and Apache HSSF: http://www.andykhan.com/jexcelapi/tutorial.html#writing http://poi.apache.org/hssf/quick-guide.html (I can't use COM automation because I'm not on Windows, ...
stackexchange/codereview
Just as in title. Is suspect it is, but I couldn't find it anywhere explicitly stated. And for this property I wouldn't like to rely on speculations.
stackexchange/codereview
When loading XML into an XmlDocument, i.e. XmlDocument document = new XmlDocument(); document.LoadXml(xmlData); is there any way to stop the process from replacing entities? I've got a strange problem where I've got a TM symbol (stored as the entity #8482) in the xml being converted into the TM character. As far as I...
stackexchange/codereview
I'm a VMware user and far too often I use keyboard shortcuts while programming. However, this has proved to be quite distressing as sometimes the VMware gets hold of it and turns off / pauses (Ctrl+Z) the virtual machine. Is there a way to disable keyboard shortcuts on VMware? Has anyone here ever found a workaround?
stackexchange/codereview
I have a basic quiz/survey type application I'm working on, and I'd like to give the user a prompt before they submit if they haven't answered all the questions. All the questions are multiple choice using radio buttons: <div class="question"> Q1: What is the second letter of the alphabet? <div class="choices">...
stackexchange/codereview
I'm looking for a relativity cheap .NET Micro Framework development board for use on a personal robotics project. I'd don't need much for I/O, but I want at least one serial port and one Ethernet port. I would prefer not to have to spend more than US$300 on the board, but if there is an obvious reason to get a better ...
stackexchange/codereview
When extending classes, I find it very descriptive to use the base (MyBase in VB) keyword when accessing methods in the base-class. And the this (Me in VB) keyword when accessing functions in the class extending the base-class. That goes for a "flat" structure with no inheritance as well. I find it easier to read this:...
stackexchange/codereview
Is there any way instead of a JS hack where I can post from an iframe to another page outside the iframe? the iframe is posting data to a 3rd party and then just responding back with a URL which is the redirection URl thus we cannot set the form target. We are PCI compliant and thus we cannot use window.parent.location...
stackexchange/codereview
I'm writing a command line tool to help my web app. It needs a password to connect to the service. I'd like the script to show a password prompt so I don't have to pass it as a command line argument. That's easy enough, but I'd like it to not echo the password to the screen as it's typed. How can I do this with PHP? ...
stackexchange/codereview
I am preparing to use continuous integration for the first time. I will be using Nant for the automated build and testing tasks, and am trying to find the appropriate CI tool to poll the repository and execute the Nant script. I have so far loosely researched the following: Hudson Cruise Control Draco My sense so fa...
stackexchange/codereview
I have this: public string Log { get { return log; } protected set { if (log != value) { MarkModified(PropertyNames.Log, log); log = value; } } } And my utility class...
stackexchange/codereview
ffdshow has this awesome little API for controlling playback of video files. It allows you to change subtitles, fast forward, get the name of the file playing, etc... Its implemented as a windows message loop that accepts user messages and posts data back using WM_COPYDATA. I would like a c#/vb class that will allow me...
stackexchange/codereview
I'm a fan of extension methods in C#, but haven't had any success adding an extension method to a static class, such as Console. For example, if I want to add an extension to Console, called 'WriteBlueLine', so that I can go: Console.WriteBlueLine("This text is blue"); I tried this by adding a local, public static met...
stackexchange/codereview
I have an app where I create many uiviews and add them to the self.view of the UIViewController. My app is running really slowly. I am releasing all of my objects and have no memory leaks (I ran the performance tool). Can anyone tell me what could be making my app so slow? (code is below) [EDIT] The array has around 30...
stackexchange/codereview
What are the problems that calling this method can help with? Do you ever use it in debugging you data access?
stackexchange/codereview
Which of these pieces of code is faster? if (obj is ClassA) {} if (obj.GetType() == typeof(ClassA)) {} Edit: I'm aware that they don't do the same thing.
stackexchange/codereview
Is there a way in C# to play audio (for example, MP3) direcly from a System.IO.Stream that for instance was returend from a WebRequest without saving the data temporarily to the disk? Solution with NAudio With the help of NAudio 1.3 it is possible to: Load an MP3 file from a URL into a MemoryStream Convert MP3 data i...
stackexchange/codereview
When upgrading MySQL, I first create a backup of the database. Then I will uninstall the current version installed, and delete all the files that were left by the installer. Then I install the latest GA version, and restore the created back-up, using the MySQL Administrator. Is there a better way of doing an upgrade of...
stackexchange/codereview