instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I want to do something like this: const MyFirstConstArray: array[0..1] of string = ('Hi', 'Foo'); MySecondConstArrayWhichIncludesTheFirstOne: array[0..2] of string = MyFirstConstArray + ('Bar'); Basically I want the following result: MyFirstConstArray -> ('Hi', 'Foo'); MySecondConstArrayWhichIncludesTheFirst...
stackexchange/codereview
I have seen the following methods of putting JavaScript code in an <a> tag: function DoSomething() { ... return false; } <a href="javascript:;" onClick="return DoSomething();">link</a> <a href="javascript:DoSomething();">link</a> <a href="javascript:void(0);" onClick="return DoSomething();">link</a> <a href="#" onCli...
stackexchange/codereview
I've googled around and can't find a clear answer. I simply want to start some of my iis 6.0 websites via a script that will be run on start up. anyone got any tips for that?
stackexchange/codereview
Does anyone know how to tell VS(2008) where to save the obj folder when building the solution? We have it save the bin folder to another path in order to keep the source file folders small (ie. emailable), but can't find any way to tell it to do the same with obj...
stackexchange/codereview
How can we handel key pressed event in asp.net
stackexchange/codereview
I have a dialog where each entry in a JTree has its corresponding options in a different panel, which is updated when the selection changes. If options for one of the entries is set to an invalid state, when the user attempts to change to a different entry in the tree, I want there to be an error dialog and have the se...
stackexchange/codereview
So far I've been using public void run() {} methods to execute my code in Java. When/why might one want to use main() or init() instead of run()?
stackexchange/codereview
I'm running SQL Server 2000 and I need to export the SQL Statement from all the DTS objects so that they can be parsed and put into a wiki documentation if needed. Is there a way to do that? maybe dumping each DTS object out into a text file with the object name as the file name with the name of the process and the d...
stackexchange/codereview
i am using a WSDL file to create a the proxy class file, this service has a big Enumeration. the description for each enum value is in documentation section, how can i programatically read that section?
stackexchange/codereview
Has anyone used jQuery to populate an autocomplete list on a textbox using ASP.NET webforms? If so, can anyone recommend a good method? From my reading so far, it seems like most people are using delimited lists rather than JSON to bring the items back. I'm open to any ideas that will get me up and running rather quick...
stackexchange/codereview
So if I have to choose between a hash table or a prefix tree what are the discriminating factors that would lead me to choose one over the other. From my own naive point of view it seems as though using a trie has some extra overhead since it isn't stored as an array but that in terms of run time (assuming the longest ...
stackexchange/codereview
I have a vba macro which runs a loop for about 200 iterations, using up the ram page file as it runs. I need some kind of quick fix to clear the page file after every iteration. I know the best fix would be to clean up the code, but time is a constraint here.
stackexchange/codereview
I want to detect whether adobe reader is installed using VB6. Also if detected that it's not installed, what would be the best solution?
stackexchange/codereview
I have a variable unsigned char* data = MyFunction(); how to find the length of data?
stackexchange/codereview
I made a custom ValueObject class with properties (getters/setters) and I need this class for data binding of elements on form. So I want to drag it to "other components" on matisse editor so I can bind it - and nothing happens.... Any similar experiences? The same issue is happening both on NetBeans 6.5 and MyEclipse ...
stackexchange/codereview
I've been slowly working on a personnel project to run a webmud like game using extjs as my frontend. One of the design choices I made was to allow user-generated evaluated code for game logic. So when the player enters a new "room" a number of state scripts would be called along the lines of "has player been here be...
stackexchange/codereview
How are non-deterministic functions used in SQL partitioning functions and are they useful?
stackexchange/codereview
I just watched the Windows Azure intro video and it left me feeling like it was a front end shell for hosted IIS instances. Can anyone who know more (possibily that was part of the beta) shed on why you would use this vs. EC2. it seemed easy enough but really didnt give specifics on how it works, why it works or why yo...
stackexchange/codereview
I have OS X 10.5 set up with the precompiled versions of PHP 5 and Apache 2. I'm trying to set up the Zend Debugger, but with no luck. Here's what I did: I downloaded ZendDebugger-5.2.14-darwin8.6-uni.tar I created the directory /Developer/Extras/PHP and set the permissions to: Permissions: drwxrwxr-x Owner: root:...
stackexchange/codereview
I have a couple tables in which I created an object ID as either an Int or Bigint, and in both cases, they seem to autoincrement by 10 (ie, the first insert is object ID 1, the second is object ID 11, the third is object ID 21, etc). Two questions: Why does it do that? Is that a problem?
stackexchange/codereview
I'm interested in putting together my first online game using Flash as the client and writing a back-end application in C++ where the actual game state is kept. I've done lots of games in C++ before using SDL, SFML, Allegro, etc etc but never gotten around to using the network libraries. I was just interested in some h...
stackexchange/codereview
I've been exploring different strategies for running integration tests within some Nant build scripts. Typically a number of different scripts are chained in one monolithic build that has separate targets: staging (build a staging version, like build), build (just build the stuff), integration (build the stuff and run ...
stackexchange/codereview
I would like to know who is locking a file (win32). I know about WhoLockMe, but I would like a command-line tool which does more or less the same thing. I also looked at this question, but it seems only applicable for files opened remotely.
stackexchange/codereview
I recently read that using flexible array members in C was poor software engineering practice. However, that statement was not backed by any argument. Is this an accepted fact? (Flexible array members are a C feature introduced in C99 whereby one can declare the last element to be an array of unspecified size. For exam...
stackexchange/codereview
I'm trying to do the classic Insert/Update scenario where I need to update existing rows in a database or insert them if they are not there. I've found a previous question on the subject, but it deals with stored procedures, which I'm not using. I'd like to just use plain SQL SELECT, INSERT and UPDATE statements, unle...
stackexchange/codereview
Looking for a better Windows XP command-line interface. The Visual Studio Command Prompt isn't near as nice as the Linux/OSX terminals. Thoughts? edit: Answers: Console on Sourceforge, and the Windows Powershell. Thanks, I'll go dig them up and evaluate them. The Cygwin package is too much overhead for what I want. ed...
stackexchange/codereview
I'm looking for some good ideas for a simple 3d graphics program as my final project for an intro to computer graphics class. As for some background information, we'll be using opengl and will have a little over a month to work on it, so nothing too far-fetched. The simpler and "prettier" looking, the better. It doe...
stackexchange/codereview
I have a Trac project installed on top of a Subversion implementation (easy to do thanks to Webfaction's control panel), but now I have configuration work to do. With that in mind, are there easy ways to do the following in Trac: 1) Ensure that customers can only see a high level progress indicator. 2) Give daily summ...
stackexchange/codereview
After reading a couple of answers and comments on some SQL questions here, and also hearing that a friend of mine works at a place which has a policy which bans them, I'm wondering if there's anything wrong with using backticks around field names in MySQL. That is: SELECT `id`, `name`, `anotherfield` ... -- vs -- SELEC...
stackexchange/codereview
Is it possible to break at runtime when a particular file has been modified? ie. monitor the file and break into a debugger once a change has been made to it. This is for a windows app...is this possible in visual studio or windbg? edit: i should have mentioned that this is for a Win32 app..
stackexchange/codereview
We have a couple of web servers using load balancer. Machines are running IIS6 on port 81. Externally, site is accessable using port 80. External name and name of the machine are different. We're getting System.ServiceModel.EndpointNotFoundException: The message with To '<url>' cannot be processed at the receiver, due...
stackexchange/codereview
I work on a variety of projects using different languages and platforms. Parts of them I abstract out into their own separate projects, and I want to open some of these up to the public. What gets me stuck is the christening. So, does it matter? Should I just choose something and stick with it? And if it does matter, w...
stackexchange/codereview
I'm trying this: Type ThreadContextType = typeof(Application).GetNestedType("ThreadContext", System.Reflection.BindingFlags.NonPublic); MethodInfo FDoIdleMi = ThreadContextType.GetMethod("FDoIdle", BindingFlags.NonPublic | BindingFlags.Instance, null, new Type[] { typeof(Int32) }, null); ThreadContextType is ok bu...
stackexchange/codereview
So I have an IList of business entities that I loop through in a ListView into an unordered list. I created an extension method on this Entity in my presentation layer. In code behind, I can Response.Write the result of this extension method, but when I try to access it through the ListView I get an error. The method i...
stackexchange/codereview
I have a really long 3 column table. I would like to <table> <tr><td>Column1</td><td>Column2</td></tr> <tr><td>Column1</td><td>Column2</td></tr> <tr><td>Start</td><td>Hiding</td></tr> <tr><td>Column1</td><td>Column2</td></tr> <tr><td>Column1</td><td>Column2</td></tr> <tr><td>Column1</td><td>Col...
stackexchange/codereview
I am building a small system administration web application (think Web-Min, but in RoR) and I need to be able to access system parameters from my Ruby code. For instance, I want to allow the user to change the hostname, time zone, or network config of the server. My current thoughts are to have a separate setuid scr...
stackexchange/codereview
I'm applying for a masters in fall of next year and was wondering if anyone had suggestions for interesting/challenging master's degrees in CS. I think that even though picking the right university is important, it is even more important to pick a master's degree where you'll find talented/creative people to interact a...
stackexchange/codereview
I'm currently trying to build a simple component which should monitor, if the user opens a window with a specific URL (IE only). So I wrote this component and everything works fine, so I integrated it with the application, where it was needed. The problem is, in this application PerformanceCounters are used, and these ...
stackexchange/codereview
What exactly are the advantages and disadvantages to using a register-based virtual machine versus using a stack-based virtual machine? To me, it would seem as though a register based machine would be more straight-forward to program and more efficient. So why is it that the JVM, the CLR, and the Python VM are all sta...
stackexchange/codereview
I have two DataTables, A and B, produced from CSV files. I need to be able to check which rows exist in B that do not exist in A. Is there a way to do some sort of query to show the different rows or would I have to iterate through each row on each DataTable to check if they are the same? The latter option seems to b...
stackexchange/codereview
As far as I can tell there's no simple way of retrieving a character offset from a TextRange object in Internet Explorer. The W3C Range object has a node, and the offset into the text within that node. IE seems to just have pixel offsets. There are methods to create, extend and compare ranges, so it would be possible t...
stackexchange/codereview
I want to tune a production SQL server. After making adjustments (such as changing the degree of parallelism) I want to know if it helped or hurt query execution times. This seems like an obvious performance counter, but for the last half hour I've been searching Google and the counter list in perfmon, and I have not ...
stackexchange/codereview
I have a (Wordpress powered) website, and Google is indexing some of the sub-directories. How can I stop Apache from showing users the directory listing? I know I can edit .htaccess to password-protect a directory, but I would prefer a 403 / custom redirect if possible.
stackexchange/codereview
There's a cots (commercial off-the-shelf) application that I work on customizing, where a couple of pages take an extremely long time to load for certain distributions of data. (I'm talking approximately 3 minutes for a page to load in this instance... and the time is growing exponentially). Clearly this is unacceptab...
stackexchange/codereview
I'd like to write a MessageConverter class that can wrap another MessageConverter. This MessageConverter would call the child converter, which is assumed to generate a TextMessage. It would take the payload and GZIP compress it, creating a BytesMessage which is ultimately returned to the sender. The problem is in writi...
stackexchange/codereview
I need to control the data type when reading XML data in SAS. The XML data are written and accessed using the XML libname engine in SAS. SAS seems to guess the data type based on the contents of a column: If I write "20081002" to my XML data in a character column, it will be read back in as a numerical variable. An exa...
stackexchange/codereview
I am considering to adopt ZFS and I would be happy to know your experience in both production and testing environment.
stackexchange/codereview
I need to match something in the form <a href="pic/5" id="piclink"><img src="thumb/5" /></a> to find the number, in this case 5, using JavaScript. I have no idea how to use regexes, so I was wondering if anyone here could help out.
stackexchange/codereview
Most of the documentation available for building Python extension modules uses distutils, but I would like to achieve this by using the appropriate python autoconf & automake macros instead. I'd like to know if there is an open source project out there that does exactly this. Most of the ones I've found end up relying ...
stackexchange/codereview
Is there an algorithm for accurately multiplying two arbitrarily long integers together? The language I am working with is limited to 64-bit unsigned integer length (maximum integer size of 18446744073709551615). Realistically, I would like to be able to do this by breaking up each number, processing them somehow using...
stackexchange/codereview
My organization is starting to take SOA seriously but before we jump in one of the components we seem to be missing is a rock solid repository for tracking these services across the enterprise. Can anyone suggest a product that they have worked with? If the product is also an ESB please mention that in your answer.
stackexchange/codereview
I am trying to create an Xercesc DOM Parser in my code and for some reason and try to instiate an XercescDOM object I get a NULL pointer returned. I am using xercesc version 2.8 Here the code. using namespace xercesc; int main(int argc, char*argv[]) { try { XMLPlatformUtils::Initialize(); } catch (const XMLExceptio...
stackexchange/codereview
I'm currently working with Db2 Enterprise Server V 8.2 with FixPak 10 And I want to retrieve list of all the open active connections with an instance. In Oracle there is a utility program called "Top Session" which does the similar task. Is there any equivalent in DB2?
stackexchange/codereview
I have a large set of files, some of which contain special characters in the filename (e.g. ä,ö,%, and others). I'd like a script file to iterate over these files and rename them removing the special characters. I don't really mind what it does, but it could replace them with underscores for example e.g. Störung%20.doc...
stackexchange/codereview
Here's the situation: I have one VS2005 solution with two projects: MyDll (DLL), MyDllUnitTest (console EXE). In MyDll I have a class called MyClass which is internal to the DLL and should not be exported. I want to test it in MyDllUnitTest, so I added a test suite class called MyClassTest, where I create instances of ...
stackexchange/codereview
What is the command to match brackets in Emacs (the equivalent of the % command in Vim)?
stackexchange/codereview
We're using Perforce and Visual Studio. Whenever we create a branch, some projects will not be bound to source control unless we use "Open from Source Control", but other projects work regardless. From my investigations, I know some of the things involved: In our .csproj files, there are these settings: <SccProjectNam...
stackexchange/codereview
I want to place a combobox inside one column of a Xtragrid. I can bind the combobox to array values but how do you bind the combobox to the column?
stackexchange/codereview
What are the popular (ok, popular is relative) web frameworks for the various flavours of LISP?
stackexchange/codereview
Does anyone know how to get the MS Office 2007 .NET C# Interop libraries to work with Vista? I have a .NET C# application that I have setup to run as a Windows service. This program will open up a Word or Excel template depending on the situation and modify its contents and then save the document back out. All of ...
stackexchange/codereview
Is there a .dll version of the inclued extension for PHP? The manual's link for Inclued on PECL4WIN doesn't help. I don't have a compiler to build my own DLL. NOTE: The spelling "inclued" is correct! Edit: I don't have a compiler, but do know someone with one... that's really a last resort though.
stackexchange/codereview
My web application allows users to upload images of items they are planning on selling. I'm trying to find a good compromise between having the images large enough and detailed enough for buyers to get an idea of the condition of the item and having the images small enough so that they don't slow down the site substan...
stackexchange/codereview
I have developed an asp.net application and when using the publish tool in Visual Studio 2008, my changes don't get uploaded to the server (ie new css files). I made a thread about this on asp.net and was told to clear my local settings folder in my documents/application data, but because I am on a networked pc at work...
stackexchange/codereview
I have an application I am writing in PHP5, using the CodeIgniter framework. I have it running on both Windows (using Xampp) and Ubuntu (using standard Apache, PHP, MySQL stack). I have a form, that takes XML, parses it (using simpleXML) and posts the results into a database. On Windows - no problem, works as intended....
stackexchange/codereview
If I were to include .Net Framework setup file along with my apps (installation process is done by our own technician), to be install on a clean Windows (XP SP2/SP3 or Vista SP1) without prior installation of any framework, which of the .Net Framework setup do I need to install in sequence, to get to 3.5 SP1? Currently...
stackexchange/codereview
What is the best way to extract the MAC address from ifconfig's output? Sample output: bash-3.00# ifconfig eth0 eth0 Link encap:Ethernet HWaddr 1F:2E:19:10:3B:52 inet addr:127.0.0.66 Bcast:127.255.255.255 Mask:255.0.0.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 ...
stackexchange/codereview
I'm by no means a sysadmin so please correct me if I'm wrong. I want to run aspnet_regiis.exe -s. This requires the metabase path of my website. How do I find this metabase path?
stackexchange/codereview
I'm getting the following error when my win32 (c#) app is calling web services. The request failed with HTTP status 504: Gateway timeout server response timeout. I understand 'I think' that this is because the upstream request does not get a response in a timely fashion. But my question is this? How do I change the a...
stackexchange/codereview
I've got a WCF service that uses a LinqToSql DataContext to fetch some information out of a database. The return type of the operation is IEnumerable<DomainObject>, and I have a helper method that converts from the Table-derived LINQ object to a WCF data contract like so: [OperationContract] public IEnumerable<DomainOb...
stackexchange/codereview
Some APIs, like the WebClient, use the Event-based Async pattern. While this looks simple, and probably works well in a loosely coupled app (say, BackgroundWorker in a UI), it doesn't chain together very well. For instance, here's a program that's multithreaded so the async work doesn't block. (Imagine this is going i...
stackexchange/codereview
What is the best way to count the time between two datetime values fetched from MySQL when I need to count only the time between hours 08:00:00-16:00:00. For example if I have values 2008-10-13 18:00:00 and 2008-10-14 10:00:00 the time difference should be 02:00:00. Can I do it with SQL or what is the best way to do it...
stackexchange/codereview
Is there a way to drop a validation that was set in Rails plugin (or included module)? Let's say I have some model with module included in it: class User < ActiveRecord::Base include SomeModuleWithValidations # How to cancel validates_presence_of :something here? end module SomeModuleWithValidations def self.inc...
stackexchange/codereview
This query is related to this one I asked yesterday. I have a radio button list on my asp.net page defined as follows: <asp:RadioButtonList ID="rdlSortBy" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" AutoPostBack="True" > <asp:ListItem Selected="True">Name</asp:ListItem> <asp:ListI...
stackexchange/codereview
My goal is to integrate testing into my development environment (as post-build step). I don't want to interfere with the DLLs that are generated in debug and release, so i plan to create new configurations for the project. But i don't want to compile every source file i have twice - once for the DLL, once for the test ...
stackexchange/codereview
I'm trying to compile a program called ngrep, and when I ran configure, things seemed to go well, but when I run make, I get: ngrep.c: In function ‘process’: ngrep.c:544: error: ‘struct udphdr’ has no member named ‘source’ ngrep.c:545: error: ‘struct udphdr’ has no member named ‘dest’ make: *** [ngrep.o] Error 1 ...
stackexchange/codereview
Are there any popular Mysql rss feeds you guys can recommend? IBM has random articles but those are usually not enough
stackexchange/codereview
My style of coding includes the following idiom: class Derived : public Base { public : typedef Base super; // note that it could be hidden in // protected/private section, instead // Etc. } ; This enables me to use "super" as an alias to Base, for example, in constructo...
stackexchange/codereview
Has anyone used the Caching Application Block with SQLite to persist data? I'd like to get some details. Thanks
stackexchange/codereview
I'm using iptables under linux to NAT SNMP traffic. Some of the SNMP packets have VARBINDs that contain the (real) IP addresses of the devices that generated them. This confuses standard management tools, which need to see the NATted addresses in the VARBINDs. So I need to translate the addresses in the payload in a...
stackexchange/codereview
i would like to release a snapshot project 'foo-1.0-SNAPSHOT' using the maven release plugin. The project depends on a 3rd party module 'bar-1.0-SNAPSHOT' which is not released yet. I use the option 'allowTimestampedSnapshots' in my project's pom.xml to allow timestamped snapshots but i assume that the 3rd party module...
stackexchange/codereview
How to insert data into a particular cell in a Excel Work sheet in Asp.net
stackexchange/codereview
I would like to understand the way git works from a architects point of view. How are files stored, how are versions kept and how do changes happen (branches, merges, etc.)? I am not searching for information how to use it. (I already found a lot of pages with tutorials.) But I did not find any "behind the scenes" deta...
stackexchange/codereview
I have www.example.com and also store.example.com. (Yes they are subdomains of the same parent domain) store.example.com is on ASP.NET 1.1 www.example.com is on ASP.NET 3.5 I want to know what options are available for sharing 'session' data between the two sites. I need some kind of shared login and also the abiltity ...
stackexchange/codereview
I was wondering how to make a toolbar in MFC that used 24bit or 256 colour bitmaps rather than the horrible 16 colour ones. Can anyone point me in the direction of some simple code? Thanks
stackexchange/codereview
I'm trying to control the main timeline of my flash application from a MovieClip that is a child of the main stage. Apparently, in ActionScript 2, you could do that using _root, but using root (since _root no longer exists) now gives an error: root.play(); "1061: Call to a possibly undefined method play through a refe...
stackexchange/codereview
I have to create the sin function from scratch in my Comp Sci class, and I am getting close to a solution. However, I am still having a few problems. If I put in a value of .5PI or less it works, but otherwise I get the incorrect result. Here is the code I have so far: double i=1; double sinSoFar = 0; int term = 1; whi...
stackexchange/codereview
How do you go about finding unused icons, images, strings in .resx files that may have become 'orphaned' and are no longer required?
stackexchange/codereview
void f(cli::array<PointF> ^points){ PointF& a = points[0]; // and so on... } Compile error at line 2. .\ndPanel.cpp(52) : error C2440: 'initializing' : cannot convert from 'System::Drawing::PointF' to 'System::Drawing::PointF &' An object from the gc heap (element of a managed array) cannot be convert...
stackexchange/codereview
I have to refactor a large C# application, and I found a lot of functions that are never used. How can I check for unused code, so I can remove all the unused functions?
stackexchange/codereview
SQL Server 2005: I have a SiteVisit row which contains information about a users visit, for instance HttpRefer, whether or not they placed an order, browser, etc. Currently for reporting I am joining this table with SiteEvent which contains information about each 'section' visited. This then produces a view which shows...
stackexchange/codereview
Like many SO people, I'm in front of a computer almost all day. I like having a dark theme for Visual Studio (easier on the eyes), but since the rest of Windows and apps (explorer, dialogs, Outlook), have the full white background, it's even harder to switch between nice dark VS and sunshine bright Windows. I tried a U...
stackexchange/codereview
I have many instances of an application installed on an IIS 6.0, Windows Server 2003 box under the same application pool. They share many of the same assemblies and can not be joined in to a single application. I recently added a new instance of the application and obtained a System.OutOfMemoryException when I tried t...
stackexchange/codereview
SNTP is a simplification of the full NTP specification. I'd like to use a full NTP client against the internal SNTP server incorporated in Windows XP. Will that work or is a full NTP server required for the NTP client to work?
stackexchange/codereview
I have a HQL query that can generate either an IList of results, or an IEnumerable of results. However, I want it to return an array of the Entity that I'm selecting, what would be the best way of accomplishing that? I can either enumerate through it and build the array, or use CopyTo() a defined array. Is there any b...
stackexchange/codereview
I have seen some websites use the following tag: <meta type="title" content="Title of the page" /> Is it needed when you have a <title>? Also, what's the best formatting for a page title? Some ideas: Page Description :: Company Name Page Description - Company Name Page Description <> Company Name Company Name: Page D...
stackexchange/codereview
I've got a lot of similar oracle jobs I need to create, and I'd like to do it programatically. Where does the Oracle store the job library (schema/table)? (yes, I know I might be running with scissors)
stackexchange/codereview
I'm having a small problem in Java. I have an interface called Modifiable. Objects implementing this interface are Modifiable. I also have a ModifyCommand class (with the Command pattern) that receive two Modifiable objects (to swap them in a list further on - that's not my question, I designed that solution already). ...
stackexchange/codereview
Why does using Fiddler break my site sometimes on page transitions. After a server side redirect -- in the http response (as found in Fiddler) I get this: Object moved Object moved to here. The site is an ASP.NET 1.1 / VB.NET 1.1 [sic] site. Why doesnt Fiddler just go there for me? i dont get it. I'm fine with this i...
stackexchange/codereview
To implement "method-missing"-semantics and such in C# 4.0, you have to implement IDynamicObject: public interface IDynamicObject { MetaObject GetMetaObject(Expression parameter); } As far as I can figure out IDynamicObject is actually part of the DLR, so it is not new. But I have not been able to find much document...
stackexchange/codereview
I am currently looking into using Lucene.NET for powering the search functionality on a web application I am working on. However, the search functionality I am implementing not only needs to do full text searches, but also needs to rank the results by proximity to a specified address. Can Lucene.NET handle this requir...
stackexchange/codereview