instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I'm trying to get a PHP site working in IIS on Windows Server with MySQL. I'm getting this error… Fatal error: Call to undefined function mysql_connect() in C:\inetpub...\adodb\drivers\adodb-mysql.inc.php on line 363 Update… This link outlines the steps I followed to install PHP on my server: How do I get PHP and MySQ...
stackexchange/codereview
We need to be able to change the default selected print tray of a given printer. Does anyone have VC++/win32 code for doing this? In case it matters, I believe we have to change the default setting for the printer. Our print jobs are executed by an application other than ours, so we can't make these kinds of changes ...
stackexchange/codereview
I have a list of times in a database column (representing visits to a website). I need to group them in intervals and then get a 'cumulative frequency' table of those dates. For instance I might have: 9:01 9:04 9:11 9:13 9:22 9:24 9:28 and i want to convert that into 9:05 - 2 9:15 - 4 9:25 - 6 9:30 - 7 How can I do t...
stackexchange/codereview
I'm not completely sure I understand the workflow way of doing things, but if it's a pipeline n filter style model I should be able to pass data (even strings) from one activity to another. Does anyone know how to do this? Bonus points for a video! I hope this is possible. If WF were the same as my idea of it then it ...
stackexchange/codereview
I'm trying to parse objects to XML in Delphi, so I read about calling the object's ClassInfo method to get its RTTI info. The thing is, this apparently only works for TPersistent objects. Otherwise, I have to specifically add a compiler directive {$M+} to the source code for the compiler to generate RTTI info. So I hap...
stackexchange/codereview
I want to use a template engine in a struts application and would like to know if using TILES can be recommended instead of FREEMARKER or VELOCITY.
stackexchange/codereview
I am currently working on a leave application (which is a subset of my e-scheduler project) and I have my database design as follows: event (event_id, dtstart, dtend... *follows icalendar standard*) event_leave (event_id*, leave_type_id*, total_days) _leave_type (leave_type_id, name, max_carry_forward) _leave_alloca...
stackexchange/codereview
I'm using an XYPlot in JFreeChart. All the lines on it are XYSeries objects. Both axes are NumberAxis objects. The Y-Axis range is from 0-1, with ticks every .1. Along with displaying the numbers though, I'd like to display text on the Y-Axis, like High/Medium/Low. High would cover .7-1, etc. What is the best way to go...
stackexchange/codereview
Curious what is recognized as a solid algorithm/approach for judging the strength of a directed acyclic graph - particularly the strength of certain nodes. The main question I have about this can be boiled down to the following two graphs: (if graph doesn't show up, click here or visit this link: http://www.flickr.co...
stackexchange/codereview
I'm trying to find about ALL the possible options that I can set in web.config. Surprisingly, I can't find this at all. I expected it to be somewhere inside MSDN. I know I can technically add "anything" to web.config, what I'm looking for is the things that the .NET Framework "as shipped" uses. In particular, right now...
stackexchange/codereview
My customer is replacing MS Office with OpenOffice in some workstations. My program export a file to Excel using the .xml extension (using open format) and opens it using the current associated program (using ShellExecute) The problem is that OpenOffice does not register the .xml extension associated with it. Manually ...
stackexchange/codereview
I need to change the permissions of a directory to be owned by the Everyone user with all access rights on this directory. I'm a bit new to the Win32 API, so I'm somewhat lost in the SetSecurity* functions.
stackexchange/codereview
I have a set of configuration items I need to persist to a "human readable" file. These items are in a hierarchy: Device 1 Name Channel 1 Name Size ... Channel N Name ... Device M Name Channel 1 Each of these item could be stored in a Dictionary with a string Key and a value. They c...
stackexchange/codereview
I'd like to find the base url of my application, so I can automatically reference other files in my application tree... So given a file config.php in the base of my application, if a file in a subdirectory includes it, knows what to prefix a url with. application/config.php application/admin/something.php application/...
stackexchange/codereview
I'm trying to write a Mono C# daemon for linux. I'd like to do a starts and stops of it when its done processing instead of just killing the process. Does anyone have any examples of this? Edit: I figured out how to use start-stop-daemon --background in debian, so I think I'll just use that for now. Edit: I'm implement...
stackexchange/codereview
I've seen second one in another's code and I suppose this length comparison have been done to increase code productivity. It was used in a parser for a script language with a specific dictionary: words are 4 to 24 letters long with the average of 7-8 lettets, alphabet includes 26 latin letters plus "@","$" and "_". Le...
stackexchange/codereview
I would like invoke a function call in a one shot manner. What's the best way to do this in Boost / C++? I would like to pass it two parameters and do not need a result.
stackexchange/codereview
I'm looking to implement a function that retrieves a single frame from an input video, so I can use it as a thumbnail. Something along these lines should work: // filename examples: "test.avi", "test.dvr-ms" // position is from 0 to 100 percent (0.0 to 1.0) // returns a bitmap byte[] GetVideoThumbnail(string filename,...
stackexchange/codereview
I am a member of a team that is about to launch a beta of a python (Django specifically) based web site and accompanying suite of backend tools. The team itself has doubled in size from 2 to 4 over the past few weeks and we expect continued growth for the next couple of months at least. One issue that has started to ...
stackexchange/codereview
I have an SDI that I'm loading Excel into using OLE. I want to add a toolbar to this that I can use to have a very prominent and evident "import" button (and a few others). The toolbars I add through MFC are all hidden or otherwise removed from the interface when Excel becomes active. Is there a way to keep a toolbar...
stackexchange/codereview
I'm trying to understand the concepts behind DDD, but I find it hard to understand just by reading books as they tend to discuss the topic in a rather abstract way. I would like to see some good implementations of DDD in code, preferably in C#. Are there any good examples of projects practicing DDD in the open source w...
stackexchange/codereview
What are ways to draw animations in C++? GDI+? OpenGL? Would you recommend a class pattern in particular to get the drawing and redrawing done? Do you know of any open source project where animations are made so I can take a peek at the code? Where would you start if you wanted to code geometrical animations? Do you k...
stackexchange/codereview
When indenting java code with annotations, vim insists on indenting like this: @Test public void ... I want the annotation to be in the same column as the method definition but I can't seem to find a way to tell vim to do that, except maybe using an indent expression but I'm not sure if I can use that together wit...
stackexchange/codereview
Suppose I have the following C code. unsigned int u = 1234; int i = -5678; unsigned int result = u + i; What implicit conversions are going on here, and is this code safe for all values of u and i? (Safe, in the sense that even though result in this example will overflow to some huge positive number, I could cast it ...
stackexchange/codereview
I am looking at using a custom template for a set of categories. Is it possible to use a category template (like category-4.php) on a parent category and have the children use that template as well? So based on the answer so far, is there a way to accomplish this? I want to add text and images to all categories within ...
stackexchange/codereview
Is there a documented max to the length of the string data you can use in the send method of an XMLHttpRequest for the major browser implementations? I am running into an issue with a JavaScript XMLHttpRequest Post failing in FireFox 3 when the data is over approx 3k. I was assuming the Post would behave the same as a ...
stackexchange/codereview
How can I connect a system to a network and sniff for virus/spyware related traffic? I'd like to plug in a network cable, fire up an appropriate tool sand have it scan the data for any signs of problems. I don't expect this to find everything, and this is not to prevent initial infection but to help determine if ther...
stackexchange/codereview
Lets assume my classes are loaded from a compressed .war file or loaded elsewhere, how can I discover all the resources in a given package? Enumerating files will not really work, since this is a war file. Most likely this will involve using the current classloader? Is there a library out there that does something l...
stackexchange/codereview
So which is better. Do we start letting Tests design our code. Do we start introducing constructor injection for dependencies just to make code testable? or do we use the "override" protected method & sub class the class under test.
stackexchange/codereview
Is it possible to receive DllMain like notifications about thread attach/detach in stand-alone exe without using any extra dlls? Edit: This is just a theoretical question that has to do with some testing I'm doing. not a real life situation.
stackexchange/codereview
I was looking for a pattern to model something I'm thinking of doing in a personal project and I was wondering if a modified version of the decorator patter would work. Basicly I'm thinking of creating a game where the characters attributes are modified by what items they have equiped. The way that the decorator stacks...
stackexchange/codereview
MySQL 5.0.45 What is the syntax to alter a table to allow a column to be null, alternately what's wrong with this: ALTER mytable MODIFY mycolumn varchar(255) null; I interpreted the manual as just run the above and it would recreate the column, this time allowing null. The server is telling me I have syntactical erro...
stackexchange/codereview
I have a django application that I'd like to add some rest interfaces to. I've seen http://code.google.com/p/django-rest-interface/ but it seems to be pretty simplistic. For instance it doesn't seem to have a way of enforcing security. How would I go about limiting what people can view and manipulate through the res...
stackexchange/codereview
I would like to set up a web application with good modularity and would like to use an AJAX Toolkit/Framework like GWT or ZK for its VIEW. Component information should be load from various modules-JAR. Which AJAX Toolkit/Framework is able to do this?
stackexchange/codereview
What do you think of this kind of code-to-files-mapping? ~/proj/MyClass.ext ~/proj/MyClass:constructors.ext ~/proj/MyClass:properties.ext ~/proj/MyClass:method-one.ext ~/proj/MyClass:method-two:int.ext ~/proj/MyClass:method-two:string.ext In a language which is more functional-oriented: ~/proj/definitions.ext ...
stackexchange/codereview
Ideally, something cross-platform.
stackexchange/codereview
What I want to do is the following: read in multiple line input from stdin into variable A make various operations on A pipe A without losing delimiter symbols (\n,\r,\t,etc) to another command The current problem is that, I can't read it in with read command, because it stops reading at newline. I can read stdin wit...
stackexchange/codereview
I am trying to help someone write a program that I thought would be easy, but of course it never is :) I am trying to take a class roster (usually between 10-20 students) and effectivly uniquely pair off each classmate to another to make unique groups. Therefore in a class of 10 people, you can have 9 groups. It needs ...
stackexchange/codereview
Can I have a custom service providing the storage of the models I use in Django? That service would not be speaking SQL. I would like to build a web frontend to a system that consists of multiple services linked with a network based IPC, one of which provides an interface to commonly used, persistent objects (stored in...
stackexchange/codereview
I have a scenario in a system which I've tried to simplify as best as I can. We have a table of (lets call them) artefacts, artefacts can be accessed by any number of security roles and security roles can access any number of artefacts. As such, we have 3 tables in the database - one describing artefacts, one describin...
stackexchange/codereview
I Have an old vbs script file being kicked off by an AutoSys job. Can I, and how do I, return an int return value to indicate success or failure?
stackexchange/codereview
I am using MailLogger to send a message about a failed/successful release. I would like to make the mail body simple and easy to read. How can I suppress output for some particular tasks?
stackexchange/codereview
I would like to know what kind of toolkits, languages, libraries exist for agent-based modeling and what are the pros/cons of them? Some examples of what I am thinking of are Swarm, Repast, and MASS.
stackexchange/codereview
I have implemented what I thought was a pretty decent representation of MVC in several web applications but since having joined crackoverflow, I'm finding that perhaps my initial definitions were a bit simplistic and thus I'd really like some clarification on the differences between the Data Access Layer and the Model ...
stackexchange/codereview
I can't seem to find an easy to use, .net native way to get Comboboxes on .net winforms to display one value and return another based on the selection without creating my own helper class, with the knowledge that winforms is going to display the ToString method on the object that you put in it. This is how I'm doing it...
stackexchange/codereview
I'm trying to host a PHP web site that was given to me. I see this warning: Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is ...
stackexchange/codereview
Does anyone have a good algorithm for re-sorting an array of values (already pre-sorted) so that they can be displayed in multiple (N) columns and be read vertically? This would be implemented in .Net but I'd prefer something portable and not some magic function. A good example of it working is the ASP.Net CheckBoxList...
stackexchange/codereview
Is there a portable way of getting thread and/or process identifier (string, int, ...) with C++?
stackexchange/codereview
I'm using GDI+ in a C++/MFC application and I just can't seem to avoid flickering whenever the window is resized. I have already tried these steps: returned TRUE on OnEraseBkGnd(); returned NULL on OnCtlColor(); used double buffering according to this code: void vwView::OnDraw(CDC* pDC) { CRect rcClient; GetC...
stackexchange/codereview
I am using tinyMCE as my text editor on my site and i want to reformat the text before saving it to my database (changing the &rsquo; tags into ' then in to &#39;). I cannot find a simple way of doing this using tinyMCe and using htmlentities() changes everything including <>. Any ideas?
stackexchange/codereview
I'm trying to run an ASP.NET 2.0 application on an XP machine. As far as I know, everything is configured correctly. However, I receive the following message: Server Application Unavailable And two events appear in the Application event log each time: aspnet_wp.exe (PID: 3352) stopped unexpectedly. Failed to exec...
stackexchange/codereview
Ok so the obvious answer is, because the flow of a composite control demands my childcontrols to be created at a certain point in time. I got a problem i think other people must have had as well. My control is a composite "container/collection" control. It will be fed with an object and based on that objects data it wi...
stackexchange/codereview
I would like to send a (as yet undetermined) SIGnal from a bash script to a Gambas program when a specific file has been changed. How can I get my Gambas program to process this SIGnal?
stackexchange/codereview
I googled a lot, and could not find a single open source implementation of SFTP in .NET. All i got is 3rd party component for SFTP. can anyone help me with SFTP implenetation in .NET ?
stackexchange/codereview
I have created an item swapper control consisting in two listboxes and some buttons that allow me to swap items between the two lists. The swapping is done using javascript. I also move items up and down in the list. Basically when I move the items to the list box on the right I store the datakeys of the elements (GUI...
stackexchange/codereview
I have G729 encoded audio files. I need to programmatically convert them to WAV PCM (16bit 8kHz mono) in the flow of a tool that is doing other thing too. I have an executable that will do that for me. But spawning that external process every time I convert is too heavy on resources. Especially if I need many of them b...
stackexchange/codereview
I need a way to build C++ code from UML diagrams and vice versa. Should be simple too hopefully. I don't mind paying too much.
stackexchange/codereview
How can I get tab completion to work for selecting CVS modules under Linux (preferably using bash) ? For example, "cvs co " + tab would list the modules I can checkout. I've heard it's easy to do using zsh, but still I didn't manage to get it working either. Also, how can I list all available modules (or repositories?...
stackexchange/codereview
I have a URL, and I'm trying to match it to a regular expression to pull out some groups. The problem I'm having is that the URL can either end or continue with a "/" and more URL text. I'd like to match URLs like this: http://server/xyz/2008-10-08-4 http://server/xyz/2008-10-08-4/ http://server/xyz/2008-10-08-4/123/m...
stackexchange/codereview
I'm doing some research into using log4net, and I found the IObjectRenderer interface interesting. It would allow us to control how types are logged and provide a different, possibly more user-friendly ToString() implementation. I just started looking at log4net though, and can't seem to find a logical way to program...
stackexchange/codereview
the function addresses (Rva+Base) in my MAP-file from visual studio doesn't match the one I see in the debugger (or when I manually inspect my stack frame). What could be causing this? /A.B.
stackexchange/codereview
Does anyone know of a whirlwind tour of Eclipse that would help a (former) Visual Studio user get up to speed with it? I just want something that tells me where all the basic features are and what all the cool stuff I've heard so much about is? So far I've been using it mostly as a text editor and have had some luck co...
stackexchange/codereview
Situation: Some Bank has an old legacy ABS (Automatic bank system). Bank wants to: notify old legacy CRM system about client's account changes (Publish operation). check PIN codes of client cards (Request/Response operation) - in synchronious mode. ABS is implemented in very old private technologies with StoredProce...
stackexchange/codereview
What is the easiest way to do this? Is it possible with managed code?
stackexchange/codereview
I am wondering what is the best way to construct a common utilities library that can be used in different projects. I am using .Net and C#. Should I create a separate project for each utility such as Logging, Authentication, Excel etc. and release them separately along with dependencies or should i include all utilitie...
stackexchange/codereview
I have the simple class using auto-implemented properies: Public Class foo { public foo() { } public string BarName {get; set;} } I obviously use the variable BarName throughout my class and now need to add logic when the property value is set (it must be all upper case, go figure). Does this mean that I...
stackexchange/codereview
From one apache server file_get_contents returns the contents of a url straight away. On another apache server file_get contents won't return the contents of the same url until the keep-alive limit of the server hosting that url has been expired. The 2 php servers are retrieving the same url but through different net...
stackexchange/codereview
Every software development professional (and especially project managers) has to deal with a never ending stream of e-mails. What is the best way of organising them in MS Outlook? Obviously some fancy issue tracking tools give more flexibility but I am interested in plain vanilla approach that can be deployed within mo...
stackexchange/codereview
I'm looking for for a Jabber library for Delphi, I can see some COM based jabber components. But I'm looking for a real VCL library. Somebody knows one?
stackexchange/codereview
I'm setting up an online ordering system but I'm in Australia and for international customers I'd like to show prices in US dollars or Euros so they don't have to make the mental effort to convert from Australian dollars. Does anyone know if I can pull up to date exchange rates off the net somewhere in an easy-to-parse...
stackexchange/codereview
After switching back and forth between several scripting languages this week, I found myself thinking how similar they all are. Yet I'm always reaching for Google (or nowadays SO) to remember details like what the local equivalents of "instanceof" and "endswith" are, or the right syntax to declare an interface, or wha...
stackexchange/codereview
I'm writing an editor for large archive files (see below) of 4GB+, in native&managed C++. For accessing the files, I'm using file mapping (see below) like any sane person. This is absolutely great for reading data, but a problem arises in actually editing the archive. File mapping does not allow resizing a file while i...
stackexchange/codereview
I have a need to work with Windows executables which are made for x86, x64, and IA64. I'd like to programmatically figure out the platform by examining the files themselves. My target language is PowerShell but a C# example will do. Failing either of those, if you know the logic required that would be great.
stackexchange/codereview
Hoi! I have a form I wish to submit, but I need to add the PHPSESSID, because some clients allow no cookies. There are several javascript functions on my page which displays a list of users (search, sort, open details), the page is generated by PHP. Now I am looking for an elegant way to have the PHPSESSID included in ...
stackexchange/codereview
In Flash, there seem to be two sets of mouse click events: onMouseUp, onMouseDown onPress, onRelease Is there any actual difference between these events? I can't tell from the documentation, and I haven't noticed anything in actual usage, but it seems odd to have two different sets of names for the same basic events...
stackexchange/codereview
Is there a better way to profile code then: $start1 = microtime(TRUE); for($i=0;$i<count($array);$i++) { //do something } $time1 = microtime(TRUE) - $start1;
stackexchange/codereview
Which other restrictions are there on names (beside the obvious uniqueness within a scope)? Where are those defined?
stackexchange/codereview
Do you suggest Mapstraction (library) as a layer to access Google maps? Is it an actively maintained project? Do I stand to again/ lose anything by using this library apart from the primary reason that its provider independent?
stackexchange/codereview
I have some problems on a site with the concurrent access to a list. This list keeps a cart of items, and multiple deletes are crashing the site. Which is the best method to sync them? Is a lock enough? The lock option seems to be ugly because the code is spread all over the place and is pretty messy. Update: This is ...
stackexchange/codereview
This is a for a Silverlight project that isn't anchored to an .aspx file, so right clicking, etc. is a bit out of the question. Any ideas? Edit: Add an .html file, then click it. Really dumb. Last time I ask a question at three in the morning.
stackexchange/codereview
In order to verify the data coming from the Google Safe Browsing API, you can calculate a Message Authentication Code (MAC) for each update. The instructions to do this (from Google) are: The MAC is computed from an MD5 Digest over the following information: client_key|separator|table data|separator|client_key....
stackexchange/codereview
After using Hudson for continuous integration with a prior project, I want to set up a continuous integration server for the iPhone projects I'm working on now. After doing some research it looks like there aren't any CI engines designed specifically for Xcode, but one guy has had success using Cruise Control combined ...
stackexchange/codereview
I have some data grouped in a table by a certain criteria, and for each group it is computed an average —well, the real case is a bit more tricky— of the values from each of the detail rows that belong to that group. This average is shown in each group footer rows. Let's see this simple example: What I want now is to ...
stackexchange/codereview
How do I display a leading zero for all numbers with less than two digits? 1 → 01 10 → 10 100 → 100
stackexchange/codereview
Does .NET Compact Framework 3.5 work on Windows Mobile 2003 SE without limitations?
stackexchange/codereview
I have a multi-user ASP.NET app running against SQL Server and want to have StoredProcA create a #temptable temp table - not a table variable - to insert some data, then branch to StoredProcB, StoredProcC, and StoredProcD to manipulate the data in #temptable per business rules. The web app uses connection pooling when...
stackexchange/codereview
How do you compare two instances of structs for equality in standard C?
stackexchange/codereview
This seems like it should be simple but after a couple hours of googling I have not figured it out. I know I can add iCal links using ICS files, but this does not work on the iPhone. BTW, when I say iPhone I would like it to work on the touch also. Anyone have any luck with this?
stackexchange/codereview
I have over a TB of home movies with horrible file names. Finding what you want is impossible. I would like to rename all files to the time they were originally recorded (not the file time they were placed on my computer). Some applications (like Ulead Video Studio) can access this information, which I believe is embe...
stackexchange/codereview
The following code was produced by a consultant working for my group. I'm not a C++ developer (worked in many languages, though) but would like some independent opinions on the following code. This is in Visual Studio C++ 6.0. I've got a gut reaction (not a good one, obviously), but I'd like some "gut reactions" fro...
stackexchange/codereview
I've created a program in Delphi that uses Google's AJAX Search API to evaluate search phrase occurrences on specific sites, mine included. What surprised me was it doesn't appear Google is indexing some words on my pages, or I am forming my search queries via the API incorrectly. For example the search site:www.del...
stackexchange/codereview
I'm trying to write a Windows cmd script to perform several tasks in series. However, it always stops after the first command in the script. The command it stops after is a maven build (not sure if that's relevant). How do I make it carry on and run each task in turn please? Installing any software or configuring the r...
stackexchange/codereview
Im using NCover 1.5.8, and its doesn't seem to produce and metrics relating to my website applications. The ncover output indicates the tests relating to the website have been run. Is there anything special I need to do for website dlls?
stackexchange/codereview
I'm primarily interested in pgsql for this, but I was wondering if there is a way in any RDBMS to do an insert operation, without disabling and re-enabling any FOREIGN KEY or NOT NULL constraints, on two tables that refer to each other. (You might think of this as a chicken that was somehow born from its own egg.) For...
stackexchange/codereview
I would like something that I can use as follows var msg = new NonStaticMessageBox(); if(msg.Show("MyMessage", "MyCaption", MessageBoxButtons.OkCancel) == DialogResult.Ok) {....} But specifically non-static (I need to pass a reference to it around) does anyone know if/where such an object exists?
stackexchange/codereview
I have a questionable coding practice. When I need to iterate through a small list of items whose count limit is under 32000, I use Int16 for my i variable type instead of Integer. I do this because I assume using the Int16 is more efficient than a full blown Integer. Am I wrong? Is there no effective performance dif...
stackexchange/codereview
I have some integration points where I want to test various responses - where do you think should I store these artifacts in my spec/ directory of my rails application?
stackexchange/codereview
A lot of programming languages and frameworks do/allow/require something that I can't seem to find the name for, even though there probably is one in computer science. What they basically do is bind to a variable/object/class/function by name. Flex example ("selectAll()"): <mx:Button click="selectAll()" label="Select ...
stackexchange/codereview
When working on a VS2005 project that involves referencing Microsoft.SharePoint.dll, building the project causes Microsoft.SharePoint.Search.dll to be copied to my bin folder. Why is this? Okay, maybe it's just a bug, but I want to know the mechanism. [Edit: Copy local is most definitely turned off -- Microsoft.SharePo...
stackexchange/codereview
I would like to host a silverlight control in winforms via a winforms browser, but for it to work I need some way for the forms to talk to the silverlight, and also the other way around. Would it be possible to somehow have the two interact with each other using JavaScript as a middleman? I.e., have the form speak to...
stackexchange/codereview