instruction_seed stringlengths 1 35.8k | _source stringclasses 1
value |
|---|---|
I need to create a database to store simulation results. What resources are out there to help me design this?
EDIT: For those who want more details...
We work with a discrete event simulation used by the military. Important simulation events are thus when weapons are fired, when kills occur, and also when weapons fai... | stackexchange/codereview |
I have a Windows Form project that I've just started. On the form I have a listbox that I'm loading with Products. When someone double clicks a Product, I want it to raise a ProductChanged event. Other things in my project will subscribe to this event and update things like other parts of the GUI when the Product chang... | stackexchange/codereview |
I'm just wondering what the optimal solution is here.
Say I have a normalized database. The primary key of the whole system is a varchar. What I'm wondering is should I relate this varchar to an int for normalization or leave it? It's simpler to leave as a varchar, but it might be more optimal
For instance I can have
... | stackexchange/codereview |
I am using Flex to connect to a Rest service. To access order #32, for instance, I can call the URL http://[service]/orders/32.
The URL must be configured as a destination - since the client will connect to different instances of the service. All of this is using the Blaze Proxy, since it involves GET, PUT, DELETE and ... | stackexchange/codereview |
How can i check in JavaScript if a variable is defined in a page? Suppose I want to check if a variable named "x" is defined in a page, if I do if(x != null), it gives me an error.
| stackexchange/codereview |
How unique is the php session id? I got the impression from various things that I've read that I should not rely on two users never getting the same sessionid. Isn't it a GUID?
| stackexchange/codereview |
is it possible to extend vim functionality via custom extension (preferably, written in Python)?
What I need ideally is custom command when in command mode. E.g.
ESC
:do_this
:do_that
| stackexchange/codereview |
I'm getting ORA-01031: insufficient privileges when creating a package my own schema. Shouldn't I have complete control over my schema. If this is not the case, what privileges does my schema need?
| stackexchange/codereview |
Wondering if there is any Text to Speech software available as a plug in for IE or Firefox.
| stackexchange/codereview |
While trying to generate classes from a xsd, i got this error:
java.lang.IllegalArgumentException: Illegal class inheritance loop. Outer class OrderPropertyList may not subclass from inner class: OrderPropertyList
My xsd define a element to group a unbounded element like this:
<element minOccurs="0" name="orderProp... | stackexchange/codereview |
I was reading a question about the Python global statement ( "Python scope" ) and I was remembering about how often I used this statement when I was a Python beginner (I used global a lot) and how, nowadays, years later, I don't use it at all, ever. I even consider it a bit "un-pythonic".
Do you use this statement in P... | stackexchange/codereview |
What is Big O notation? Do you use it?
I missed this university class I guess :D
Does anyone use it and give some real life examples of where they used it?
See also:
Big-O for Eight Year Olds?
Big O, how do you calculate/approximate it?
Did you apply computational complexity theory in real life?
| stackexchange/codereview |
How does C handle converting between integers and characters? Say you've declared an integer variable and ask the user for a number but they input a string instead. What would happen?
| stackexchange/codereview |
How can I make this work?
switch(property.PropertyType){
case typeof(Boolean):
//doStuff
break;
case typeof(String):
//doOtherStuff
break;
default: break;
}
I don't want to use the name since string comparing for types is just awfull and can be subject to change.
| stackexchange/codereview |
Although I do understand the serious implications of playing with this function (or at least that's what I think), I fail to see why it's becoming one of these things that respectable programmers wouldn't ever use, even those who don't even know what it is for.
Let's say I'm developing an application where memory usage... | stackexchange/codereview |
Summary for the impatient:
What I want to know is what you want to have in a new gui language. About the short answers mentioning $your_favorite_one; I assume you mean that, such a language should look like $your_favorite_one. These are not helpful. Resist the temptation.
I'm thinking on the user friendliness of XML ba... | stackexchange/codereview |
I'm building a project using a GNU tool chain and everything works fine until I get to linking it, where the linker complains that it is missing/can't find crti.o. This is not one of my object files, it seems to be related to libc but I can't understand why it would need this crti.o, wouldn't it use a library file, e.g... | stackexchange/codereview |
I'm one of the people involved in the Test Anything Protocol (TAP) IETF group (if interested, feel free to join the mailing list). Many programming languages are starting to adopt TAP as their primary testing protocol and they want more from it than what we currently offer. As a result, we'd like to get feedback from... | stackexchange/codereview |
I need to present the user with a matrix of which one column is editable. What is the most appropriate control to use?
I can't use a ListView because you can only edit the first column (the label) and that's no good to me.
Is the DataGridView the way to go, or are there third party alternative components that do a bett... | stackexchange/codereview |
I have a sparse array in Jscript, with non-null elements occuring at both negative and positive indices. When I try to use a for in loop, it doesn't traverse the array from the lowest (negative) index to the highest positive index. Instead it returns the array in the order that I added the elements. Enumeration doesn't... | stackexchange/codereview |
I'm writing a program (for Mac OS X, using Objective-C) and I need to create a bunch of .webloc files programmatically.
The .webloc file is simply file which is created after you drag-n-drop an URL from Safari's location bar to some folder.
Generally speaking, I need an approach to create items in a filesystem which po... | stackexchange/codereview |
I know in php you can embed variables inside variables, like:
<? $var1 = "I\'m including {$var2} in this variable.."; ?>
But I was wondering how, and if it was possible to include a function inside a variable.
I know I could just write:
<?php
$var1 = "I\'m including ";
$var1 .= somefunc();
$var1 = " in this variable..... | stackexchange/codereview |
My macro updates a large spreadsheet with numbers, but it runs very slowly as excel is rendering the result as it computes it. How do I stop excel from rendering the output until the macro is complete?
| stackexchange/codereview |
I'm writing a pretty straightforward e-commerce app in asp.net, do I need to use transactions in my stored procedures?
Read/Write ratio is about 9:1
| stackexchange/codereview |
As part of a JavaScript Profiler for IE 6/7 I needed to load a custom debugger that I created into IE. I got this working fine on XP, but couldn't get it working on Vista (full story here: http://damianblog.com/2008/09/09/tracejs-v2-rip/).
The call to GetProviderProcessData is failing on Vista. Anyone have any sugges... | stackexchange/codereview |
The method signature of a Java mainmethod is:
public static void main(String[] args) {
...
}
Is there a reason why this method must be static?
| stackexchange/codereview |
Is is possible to configure a server to allow using links with and without using the .aspx extention.
If yes, how could I go about setting this up.
I'm working on a client site who is using umbraco. I know it has built in friendly URL capibility. Unfortunatly the site is already live and turning the feature on for the... | stackexchange/codereview |
Multiple approaches exist to write your unit tests when using Rhino Mocks:
The Standard Syntax
Record/Replay Syntax
The Fluent Syntax
What is the ideal and most frictionless way?
| stackexchange/codereview |
Sending a message from the Unix command line using mail TO_ADDR results in an email from $USER@$HOSTNAME. Is there a way to change the "From:" address inserted by mail?
For the record, I'm using GNU Mailutils 1.1/1.2 on Ubuntu (but I've seen the same behavior with Fedora and RHEL).
[EDIT]
$ mail -s Testing chris@examp... | stackexchange/codereview |
UPDATED: I'm asking this from a development perspective, however to illustrate, a canoical non-development example that comes to mind is that if it costs, say, $10,000
to keep a uptime rate of 99%, then it theoretically can cost $100,000 to keep a rate
of 99.9%, and possibly $1,000,000 to keep a rate of 99.99%.
Some... | stackexchange/codereview |
I am a totally blind programmer who would like to learn Python. Unfortunately the fact that code blocks are represented with different levels of indentation is a major stumbling block. I was wondering if there were any tools available that would allow me to write code using braces or some other code block delimiter and... | stackexchange/codereview |
What is the best way to import a website into a Visual Sourcesafe 2005 database?
I tried opening a the VSS database and drag-n-drop the folder but it started prompting me for a comment on each folder. Is there a better way or someway to have it only ask onces for any files or folders that are being processed?
| stackexchange/codereview |
I have a WCF service which includes UI components, which forces me to be in STA mode.
How do I set the service behaviour to STA-mode?
The service uses a reference to a WPF DLL file which opens a UI window (used as view port) for picture analysis. When the service is trying to create an instance of that item (inherits ... | stackexchange/codereview |
I'm just about wrapped up on a project where I was using a commercial SVN provider to store the source code. The web host the customer ultimately picked includes a repository as part of the hosting package, so, now that the project is over, I'd like to relocate the repository to their web host and discontinue the comme... | stackexchange/codereview |
Does beautiful soup work with iron python?
If so with which version of iron python?
How easy is it to distribute a windows desktop app on .net 2.0 using iron python (mostly c# calling some python code for parsing html)?
| stackexchange/codereview |
I am building a physics simulation engine and editor in Windows. I want to build the editor part using Qt and I want to run the engine using SDL with OpenGL.
My first idea was to build the editor using only Qt and share as much code with the engine (the resource manager, the renderer, the maths). But, I would also like... | stackexchange/codereview |
There is no summary available of the big O notation for operations on the most common data structures including arrays, linked lists, hash tables etc.
| stackexchange/codereview |
I'm working on a music writing application and would like to add the functionality to import Finale music files. Right now, the only thing I know is that they are enigma binary files.
Does anyone have any suggestions on where I could start so that I could be able to parse through these types of files?
| stackexchange/codereview |
What's the best way to enumerate a set of files and folders using FinalBuilder?
The context of my question is, I want to compare a source folder with a destination folder, and replace any matching files in the destination folder that are older than the source folder.
Any suggestions?
| stackexchange/codereview |
anyone out there have a moodle module for dotnetnuke, or some kind of integration setup that at least allows SSO?
| stackexchange/codereview |
In C++, what alternatives do I have for exposing a collection, from the point of view of performance and data integrity?
My problem is that I want to return an internal list of data to the caller, but I don't want to generate a copy. Thant leaves me with either returning a reference to the list, or a pointer to the lis... | stackexchange/codereview |
I'm looking for a groovy equivalent on .NET
http://boo.codehaus.org/
So far Boo looks interesting, but it is statically typed, yet does include some of the metaprogramming features I'd be looking for.
Can anyone comment on the experience of using Boo and is it worth looking into for more than hobby purposes at a 1.0 Ve... | stackexchange/codereview |
I want to load a different properties file based upon one variable.
Basically, if doing a dev build use this properties file, if doing a test build use this other properties file, and if doing a production build use yet a third properties file.
| stackexchange/codereview |
Does anyone know of existing software or algorithms to calculate a package size for shipping multiple items?
I have a bunch of items in our inventory database with length, width and height dimesions defined. Given these dimensions I need to calculate how many of the purchased items will fit into predefined box sizes.
| stackexchange/codereview |
Based on a few posts I've read concerning version control, it seems people think pessimistic locking in a version control system is a bad thing. Why? I understand that it prevents one developer from submitting a change while another has the file checked out, but so what? If your code files are so big that you consta... | stackexchange/codereview |
I need to add a specific column if it does not exist. I have something like the following, but it always returns false:
IF EXISTS(SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'myTableName'
AND COLUMN_NAME = 'myColumnName')
How can I check if a column exists in a ... | stackexchange/codereview |
I've got a Sharepoint WebPart which loads a custom User Control. The user control contains a Repeater which in turn contains several LinkButtons.
In the RenderContent call in the Webpart I've got some code to add event handlers:
ArrayList nextPages = new ArrayList();
//populate nextPages ....
A... | stackexchange/codereview |
Suppose you have a fairly large (~2.2 MLOC), fairly old (started more than 10 years ago) Windows desktop application in C/C++. About 10% of modules are external and don't have sources, only debug symbols.
How would you go about reducing application's memory footprint in half? At least, what would you do to find out whe... | stackexchange/codereview |
Suppose there are two scripts Requester.php and Provider.php, and Requester requires processing from Provider and makes an http request to it (Provider.php?data="data"). In this situation, Provider quickly finds the answer, but to maintain the system must perform various updates throughout the database. Is there a way ... | stackexchange/codereview |
I often have data in Excel or text that I need to get into SqlServer. I can use ODBC to query the Excel file and I can parse the text file. What I want though is some tool that will just grab the data and put it into tables with little / no effort. Does anyone know of such a tool?
| stackexchange/codereview |
Has anyone had any recent requirements for programming automated DOS Batch style tasks on a Windows box?
I've got some automation to do and I'd rather not sit and write a pile of .BAT files in Notepad if there is a better way of automating these tasks: mainly moving of files under certain date and time conditions, as w... | stackexchange/codereview |
I'm planning to write a program in Ruby to analyse some data which has come back from an online questionnaire. There are hundreds of thousands of responses, and each respondent answers about 200 questions. Each question is multiple-choice, so there are a fixed number of possible responses to each.
The intention is to u... | stackexchange/codereview |
I am using Oracle SQL (in SQLDeveloper, so I don't have access to SQLPLUS commands such as COLUMN) to execute a query that looks something like this:
select assigner_staff_id as staff_id, active_flag, assign_date,
complete_date, mod_date
from work where assigner_staff_id = '2096';
The results it give me look somethi... | stackexchange/codereview |
I am a developer for a .net application that uses ClickOnce for deployment. I have deployed it over 60 times and computers have not had any issues downloading the latest release. However, when I deployed this morning, the following error occurs when computers with Office 2007 installed tries to start the application:
... | stackexchange/codereview |
I have a new object with a collection of new objects within it on some property as an IList. I see through sql profiler two insert queries being executed.. one for the parent, which has the new guid id, and one for the child, however, the foreign-key on the child that references the parent, is an empty guid. Here is my... | stackexchange/codereview |
My goal here is to create a very simple template language. At the moment, I'm working on replacing a variable with a value, like this:
This input:
The Web
Should produce this output:
The Web This Is A Test Variable
I've got it working. But looking at my code, I'm running multiple identical regexes on the same st... | stackexchange/codereview |
Why does a user needs privileges over his own schema to create packages and triggers?
| stackexchange/codereview |
I need to convert a (possibly) null terminated array of ascii bytes to a string in C# and the fastest way I've found to do it is by using my UnsafeAsciiBytesToString method shown below. This method uses the String.String(sbyte*) constructor which contains a warning in it's remarks:
"The value parameter is assumed to po... | stackexchange/codereview |
I am trying to find a way to determine at run-time how much memory a given class is using in .NET. Using Marshal.SizeOf() is out, as it only works on value types. Is there a way to check exactly how much memory a class uses?
| stackexchange/codereview |
Why is it wrong to use std::auto_ptr<> with standard containers?
| stackexchange/codereview |
I want to write a word addin that does some computations and updates some ui whenever the user types something or moves the current insertion point. From looking at the MSDN docs, I don't see any obvious way such as an TextTyped event on the document or application objects.
Does anyone know if this is possible without ... | stackexchange/codereview |
What is the easiest cross platform widget toolkit? I'm looking for one that minimally covers Windows, OSX, and Linux with a C or C++ interface.
| stackexchange/codereview |
I am looking for a tool that can take a unit test, like
IPerson p = new Person();
p.Name = "Sklivvz";
Assert.AreEqual("Sklivvz", p.Name);
and generate, automatically, the corresponding stub class and interface
interface IPerson // inferred from IPerson p = new Person();
{
string Name
{
get; ... | stackexchange/codereview |
In static languages like Java you need interfaces because
otherwise the type system just won't let you do certain things.
But in dynamic languages like PHP and Python you just take
advantage of duck-typing.
PHP supports interfaces.
Ruby and Python don't have them.
So you can clearly live happily without them.
I've been... | stackexchange/codereview |
What is the easiest way to call a web service from Excel (I am using version 2002)? Please, no third party tools or libraries. This has to be easy with some VBA that I can paste there, use it, and ever touch.
| stackexchange/codereview |
I am building a small website for fun/learning using a fairly standard Web/Service/Data Access layered design.
To save me from constantly having to create instances of my service layer/data access layer classes, I have made the methods in them all static. I shouldn't get concurrency issues as they use local variables e... | stackexchange/codereview |
I want to get the size of an http:/.../file before I download it. The file can be a webpage, image, or a media file. Can this be done with HTTP headers? How do I download just the file HTTP header?
| stackexchange/codereview |
I’ve got a problem with Visual Basic (6) in combination with LDAP. When I try to connect to an LDAP store, I always get errors like ‘Bad Pathname’ or ‘Table does not exist’ (depending on what the code looks like).
This is the part of the code I wrote to connect:
path = "LDAP://xx.xxx.xxx.xxx:xxx/"
Logging.WriteToLogFil... | stackexchange/codereview |
I am a AS3 novice learning PureMVC and want to write code following best practices so that any other AS3 developer can pick up my code and easily understand what I did, I am tempted to do stuff as I would in JavaScript or Asp.Net/C#, but I have a feeling that might not be the best approach.
Thoughts? Links?
| stackexchange/codereview |
Anyone know if it is possible to write an app that uses the Java Sound API on a system that doesn't actually have a hardware sound device?
I have some code I've written based on the API that manipulates some audio and plays the result but I am now trying to run this in a server environment, where the audio will be reco... | stackexchange/codereview |
Is there a built in dll that will give me a list of links from a string. I want to send in a string with valid html and have it parse all the links. I seem to remember there being something built into either .net or an unmanaged library.
I found a couple open source projects that looked promising but I thought there wa... | stackexchange/codereview |
As a follow up to my previous question, I am wondering how to use transparent windows correctly. If I have set my window to use transparency, the UI will occasionally appear to stop responding. What is actually happening is that the UI simply is not updating as it should. Animations do not occur, pages do not appear... | stackexchange/codereview |
Does anyone know if the JBoss 4.2.3 release that is compiled for Java 6 still supports EJB 2? I'm having issues where it can't cast a class to a certain interface where I never had this problem before and the code hasn't changed.
| stackexchange/codereview |
I would like to automatically increment a field named `incrementID' anytime any field in any row within the table named 'tb_users' is updated.
Currently I am doing it via the sql update statement.
i.e "UPDATE tb_users SET name = @name, incrementID = incrementID + 1 .....WHERE id = @id;
I'm wondering how I can do this a... | stackexchange/codereview |
I'm trying to match elements with a name that is 'container1$container2$chkChecked', using a regex of '.+\$chkChecked', but I'm not getting the matches I expect when the element name is as described. What am I doing wrong?
| stackexchange/codereview |
I am considering using Postsharp framework to ease the burden of application method logging.
It basically allows me to adorn methods with logging attribute and at compile time injects the logging code needed into the il. I like this solution as it keeps the noise out of the deign time code environment.
Any thoughts, ex... | stackexchange/codereview |
How do I deploy an ADF business component to the middle tier and call it using RMI?
I just cannot find any good documentation on this!
| stackexchange/codereview |
I'm looking for a suite of plugins that can help me finally switch over to vim full-time.
Right now I'm using Komodo with some good success, but their vim bindings have enough little errors that I'm tired of it.
What I do love in Komodo, though, is the code completion. So, here's what I'm looking for (ordered by import... | stackexchange/codereview |
I'm in the process of learning Erlang. As an exercise I picked up the Sieve of Eratosthenes algorithm of generating prime numbers. Here is my code:
-module(seed2).
-export([get/1]).
get(N) -> WorkList = lists:duplicate(N, empty),
get(2, N, WorkList, []).
get(thats_the_end, _N, _WorkList, ResultList) -> list... | stackexchange/codereview |
Should entities have behavior? or not?
Why or why not?
If not, does that violate Encapsulation?
| stackexchange/codereview |
I have a few models that need to have custom find conditions placed on them. For example, if I have a Contact model, every time Contact.find is called, I want to restrict the contacts returned that only belong to the Account in use.
I found this via Google (which I've customized a little):
def self.find(*args)
with_... | stackexchange/codereview |
I am running a mysql server. I would like to somehow make sure that the whole DB is loaded into the ram as I heard it would be alot faster.
Is this true? and how do I vertify it?
| stackexchange/codereview |
I have an Events list in sharepoint and need to disallow users from having the ability to create meeting workspaces in the new event form. Shy of customizing the new event form (which breaks attachment support), how can this be done?
| stackexchange/codereview |
I've got many assemblies/projects in the same c#/.net solution. A setting needs to be saved by people using the web application gui, and then a console app and some test projects need to access the same file. Where should I put the file and how to access it?
I've tried using "AppDomain.CurrentDomain.BaseDirectory" but ... | stackexchange/codereview |
/etc/init.d/*
/etc/rc{1-5}.d/*
| stackexchange/codereview |
Code I have:
cell_val = CStr(Nz(fld.value, ""))
Dim iter As Long
For iter = 0 To Len(cell_val) - 1 Step 1
If Asc(Mid(cell_val, iter, 1)) > 127 Then
addlog "Export contains ascii character > 127"
End If
Next iter
This code doesn't work. Anyone know how to do this? I've simply got no idea with VB or VBA.... | stackexchange/codereview |
I'd like to be able to write a PHP class that behaves like an array and uses normal array syntax for getting & setting.
For example (where Foo is a PHP class of my making):
$foo = new Foo();
$foo['fooKey'] = 'foo value';
echo $foo['fooKey'];
I know that PHP has the _get and _set magic methods but those don't let you... | stackexchange/codereview |
We have a live MySQL database that is 99% INSERTs, around 100 per second. We want to archive the data each day so that we can run queries on it without affecting the main, live database. In addition, once the archive is completed, we want to clear the live database.
What is the best way to do this without (if possible)... | stackexchange/codereview |
What are the common algorithms being used to measure the processor frequency?
| stackexchange/codereview |
I'm evaluating Server 2008. My C++ executable is getting this error. I've seen this error on MSDN that seems to have required a hot-fix for several previous OSes. Anyone else seen this? I get the same results for the 32 & 64 bit OS.
Code snippet:
HRESULT GroupStart([in] short iClientId, [in] VARIANT GroupDataArray,
... | stackexchange/codereview |
I've been looking into making applications suitable for multiple languages in C# since I need to work on a small project where this is the case. I have found basically two ways to do this:
Set a form's Localizable property to true, set the Language property, fill all the labels and such, and you're 'done'. The major dr... | stackexchange/codereview |
From my experience with OpenID, I see a number of significant downsides:
Adds a Single Point of Failure to the site
It is not a failure that can be fixed by the site even if detected. If the OpenID provider is down for three days, what recourse does the site have to allow its users to login and access the information ... | stackexchange/codereview |
I am using jQuery. I call a JavaScript function with next html:
<li><span><a href="javascript:uncheckEl('tagVO-$id')">$tagname</a></span></li>
I would like to remove the li element and I thought this would be easy with the $(this) object. This is my JavaScript function:
function uncheckEl(id) {
$("#"+id+"").attr("... | stackexchange/codereview |
What are futures? It's something to do with lazy evaluation.
| stackexchange/codereview |
Microsoft WPF? Adobe AIR/Flex? Adobe Flash? Curl programming language?
How does AJAX fit in?
Given a server written in C++ .NET.
| stackexchange/codereview |
From what I know, the em keyword in CSS means the current size of a font.
So if you put 1.2 em, it means 120% of the font height.
It doesn't seem right though that em is used for setting the width of divs etc like YUI grids does:
margin-right:24.0769em;*margin-right:23.62em;
Everytime I read about em, I forget what it... | stackexchange/codereview |
Is there any C#/F# performance comparison available on web to show proper usage of new F# language?
| stackexchange/codereview |
What is the best way to disable the warnings generated via _CRT_SECURE_NO_DEPRECATE that allows them to be reinstated with ease and will work across Visual Studio versions?
| stackexchange/codereview |
Say I have the following C++:
char *p = new char[cb];
SOME_STRUCT *pSS = (SOME_STRUCT *) p;
delete pSS;
Is this safe according to the C++ standard? Do I need to cast back to a char* and then use delete[]? I know it'll work in most C++ compilers, because it's plain-ordinary-data, with no destructors. Is it guaranteed t... | stackexchange/codereview |
Let me first say, we validate every field on the server side, so this a question
about client-side usability.
What is the conventional wisdom on exactly when to validate and format html form input fields using javascript?
As an example, we have a phone number field. We allow numbers, spaces, parentheses, and hyphens. ... | stackexchange/codereview |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.