instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I'm currently developing for a handheld device running Windows XP Professional (not Tablet PC edition). The device allows users to switch from the standard widescreen landscape display format to a portrait one. I would like to know if there are any VB.NET code snippets to help me along with this task.
stackexchange/codereview
I am having the problem that I cannot select a specific XML node which needs to be deleted. I have already tried to select the node by using the XPath which works fine for some XML files but I cannot figure out the correct XPath for a node in a more complex file. Does anybody know a freeware tool which can load a XML f...
stackexchange/codereview
I have a Windows Form app written in C#. Its job is to send messages to a list of users. While those messages are being sent, I'd like to display status of the operation for each user. What I am doing (for each user) is creating a Label control and adding it to Panel. This works without a problem for a small set of ...
stackexchange/codereview
Here's the very dumb way: def divisorGenerator(n): for i in xrange(1,n/2+1): if n%i == 0: yield i yield n The result I'd like to get is similar to this one, but I'd like a smarter algorithm (this one it's too much slow and dumb :-) I can find prime factors and their multiplicity fast enough. I've an g...
stackexchange/codereview
Okay, so I'm doing my first foray into using the ADO.NET Entity Framework. My test case right now includes a SQL Server 2008 database with 2 tables, Member and Profile, with a 1:1 relationship. I then used the Entity Data Model wizard to auto-generate the EDM from the database. It generated a model with the correct as...
stackexchange/codereview
There are a lot of webs still using classic ASP instead of ASP.NET but that is not the question - "never change a running project". The question is if it is still a first choice as a base for a new web-project or would it be worth to switch to ASP.NET? Would you recommend a classic ASP programmer another language to sw...
stackexchange/codereview
I want to attach an xslt stylesheet to an XML document that I build with XMLBuilder. This is done with a Processing Instruction that looks like <?xml-stylesheet type='text/xsl' href='/stylesheets/style.xslt' ?> Normally, I'd use the instruct! method, but :xml-stylesheet is not a valid Ruby symbol. XMLBuilder has a so...
stackexchange/codereview
I'm using a custom winforms 2.0 designer (i.e. my apps hosting the designer) which is being used for a small internal project. So far all the controls have their properties edited via the property grid - but I'd like to make it a little more user-friendly by allowing in-line editing - does anyone know of an example of ...
stackexchange/codereview
What is the easiest way to copy the all the values from a column in a table to another column in the same table?
stackexchange/codereview
Any good ones? So far I have found IZWebFileManager, OXFileManager and AWS File Picker. The file manager should be able to delete, copy, rename, download & upload files.
stackexchange/codereview
I'm still learning RegEx at the moment, but for the time being could someone help me out with this? I have a few special requirements for formatting the string: No directories. JUST the file name. File name needs to be all lowercase. Whitespaces need to be replaced with underscores. Shouldn't be hard, but I'm press...
stackexchange/codereview
Keeping the GUI responsive while the application does some CPU-heavy processing is one of the challenges of effective GUI programming. Here's a good discussion of how to do this in wxPython. To summarize, there are 3 ways: Use threads Use wxYield Chunk the work and do it in the IDLE event handler Which method have yo...
stackexchange/codereview
I have an ASP .NET 2.0 website connected to a SQL Server 2005 database. The site is pretty simple and stores information about staff, including salary. What is the best way to encrypt the salary value so no-one (including myself) can ever see what it is, except for the authorised staff using the web-app? I don't want ...
stackexchange/codereview
I have been using ASP.NET for years, but I can never remember when using the # and = are appropriate. For example: <%= Grid.ClientID %> or <%# Eval("FullName")%> Can someone explain when each should be used so I can keep it straight in my mind? Is # only used in controls that support databinding?
stackexchange/codereview
I've been developing a site over the past few weeks using CodeIgniter as the framework. I've been thinking of the best way to accomplish something, which in a lot of other frameworks in other languages is relatively simple: sortable tables. CodeIgniter switches off query strings by default, because your URLs contain me...
stackexchange/codereview
I've asked this question over on the MSDN forums also and haven't found a resolution: http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=3686852&SiteID=1 The basic problem here as I see it is that an interop assembly doesn't actually contain any IL that can be instrumented (except for maybe a few delegates). So, alt...
stackexchange/codereview
On occasion, I find myself wanting to search the text of changelist descriptions in Perforce. There doesn't appear to be a way to do this in P4V. I can do it by redirecting the output of the changes command to a file... p4 changes -l > p4changes.txt ...(the -l switch tells it to dump the full text of the changelist ...
stackexchange/codereview
I'm running a SharePoint Application on a MOSS 2007 with a form based user authentication without using the MySite feature. So all the settings on the SSP administration site which only concern the user profile on the MySites should normally not affect the user profile of the application as these should be managed from...
stackexchange/codereview
I have three divs: <div id="login" /> <div id="content" /> <div id="menu" /> How would I define the CSS styles (without touching the HTML) to have the menu-div as the left column, the login-div in the right column and the content-div also in the right column but below the login-div. The width of every div is fixed...
stackexchange/codereview
I've created a VB 2008 program to track work requests. It all works perfectly on a VISTA box, but I am having an issue with the program on an XP environment with adding new records. Basically I've got 2 tabs: TAB 1 holds a datagridview with limited info and a calendar. Selecting dates on the calendar change the info...
stackexchange/codereview
I am looking to use a PHP library for uploading pictures to a web server so that I can use something that has been tested and hopefully not have to design one myself. Does anyone know of such a library? Edit: I am aware that file uploads are built into PHP, I am looking for a library that may make the process simpler ...
stackexchange/codereview
I've recently installed the MVC CTP5 and VS is now crashing on me when I try to open an aspx, I get the following error in event viewer: .NET Runtime version 2.0.50727.3053 - Fatal Execution Engine Error (7A035E00) (80131506) I was able to find This post on the asp.net forums relating to the same issue but nobody has ...
stackexchange/codereview
Does any body know what powers Google Charts? I have been using it for a while but not sure what Google used to build it.
stackexchange/codereview
I'm trying to figure out the best way to parse a GE Logician MEL trace file to make it easier to read. It has segments like >{!gDYNAMIC_3205_1215032915_810 = (clYN)} execute>GDYNAMIC_3205_1215032915_810 = "Yes, No" results>"Yes, No" execute>end results>"Yes, No" >{!gDYNAMIC_3205_1215032893_294 = (clYN)} execute>GD...
stackexchange/codereview
What tools do you use for Automated Builds / Automated Deployments? Why? What tools do you recommend?
stackexchange/codereview
How do I correct for floating point error in the following physical simulation: Original point (x, y, z), Desired point (x', y', z') after forces are applied. Two triangles (A, B, C) and (B, C, D), who share edge BC I am using this method for collision detection: For each Triangle If the original point is in fron...
stackexchange/codereview
I have this modeless MFC dialog which embeds an Internet Explorer web browser control. The control is derived straight from CWnd with ActiveX wrappers generated by Visual Studio, and I map it to the CDialog using only a DDX_Control(pDX, IDC_EXPLORER, m_explorer);. I have 2 problems. Problem #1: Being modeless, I start ...
stackexchange/codereview
I've been hearing conflicting facts about this topic. What is correct?
stackexchange/codereview
I'm doing some research into databases and I'm looking at some limitations of relational DBs. I'm getting that joins of large tables is very expensive, but I'm not completely sure why. What does the DBMS need to do to execute a join operation, where is the bottleneck? How can denormalization help to overcome this expe...
stackexchange/codereview
I would like to save data in cookies (user name, email address, etc...) but I don't the user to easily read it or modify it. I need to be able able to read the data back. How can I do that with php 5.2+? It would be used for "welcome back bob" kind of feature. It is not a replacement for persistence or session storage....
stackexchange/codereview
Please, provide code examples in a language of your choice. Update: No constraints set on external storage. Example: Integers are received/sent via network. There is a sufficient space on local disk for intermediate results.
stackexchange/codereview
I need your advice regarding migration. I want to migrate existing project to ASP.NET MVC and I can figure out the proccess except of url rewriting issue: for example how can I make following route: http://www.eireads.com/ireland/mayo/cars-3/1263-used-cars-citroen-c5-for-sale.aspx Or maybe I could somehow keep support...
stackexchange/codereview
I want to create a class which implements IEnumerable<T> but, using reflection, generates T's and returns them via IEnumerable<T>, where T' is a entirely constructed subclass of T with some properties hidden and others read-only. Okay., that might not be very clear. Let me explain this via the medium of code - I'd l...
stackexchange/codereview
From managed C++, I am calling an unmanaged C++ method which returns a double. How can I convert this double into a managed string?
stackexchange/codereview
How can I test for the EOF flag in R? For example: f <- file(fname, "rb") while (???) { a <- readBin(f, "int", n=1) }
stackexchange/codereview
It appears the Python signal module doesn't have anything similar to the sighold and sigrelse functions found in C, using signal.h. Are there Python equivalents of any sort? Many thanks!
stackexchange/codereview
I'm working on a something related to roughset right now. The project uses alot of sets operation and manipulation. I've been using string operations as a stop gap measure for set operation. It has worked fine until we need to process some ungodly amount of data ( 500,000 records with about 40+ columns each ) through t...
stackexchange/codereview
Suppose I use the [RemoteClass] tag to endow a custom Flex class with serialization intelligence. What happens when I need to change my object (add a new field, remove a field, rename a field, etc)? Is there a design pattern for handling this in an elegant way?
stackexchange/codereview
I've read in one of my AI books that popular algorithms (A-Star, Dijkstra) for path-finding in simulation or games is also used to solve the well-known "15-puzzle". Can anyone give me some pointers on how I would reduce the 15-puzzle to a graph of nodes and edges so that I could apply one of these algorithms? If I were...
stackexchange/codereview
In C# and in Java (and possibly other languages as well), variables declared in a "try" block are not in scope in the corresponding "catch" or "finally" blocks. For example, the following code does not compile: try { String s = "test"; // (more code...) } catch { Console.Out.WriteLine(s); //Java fans: think "Sy...
stackexchange/codereview
Can anyone recommend a good XML diff and merge tool?
stackexchange/codereview
first post don't hurt me :) I am using a BorderLayout with the usual North, West, Center, South Panels. On the West ContentPanel, I've got a Tree. If an event (OnClick)occurs I want a particular dialog box displayed on the Center ContentPanel. What is the best way for me to do this? Currently I'm using a function calle...
stackexchange/codereview
Anyone have any idea? And any open source sofware which also seens to perform this kind of functionality?
stackexchange/codereview
I've searched a lot for an answer for this question in the web: they say it's true, SBCL doesn't work under Vista. But I really need to work with lisp on my home Vista laptop and VM doesn't help really... And CL is not so interesting because of speed... If you have any recommendation, please share!
stackexchange/codereview
I miss it so much (used it a lot in C#). can you do it in C++?
stackexchange/codereview
Anyone have any idea? And any open source sofware which also seens to perform this kind of functionality?
stackexchange/codereview
Can share with me any of this script?
stackexchange/codereview
What's the best way to get a string containing a folder name that I can be certain does not exist? That is, if I call DirectoryInfo.Exists for the given path, it should return false. EDIT: The reason behind it is I am writing a test for an error checker, the error checker tests whether the path exists, so I wondered al...
stackexchange/codereview
I recently deploy one web application in one of my development servers. I'm using oracle, asp.net and c#. When I run the application in the server everything works fine, but when I try to run the application outside of the server (using my pc, for example) i get this error: ORA-12154: TNS:could not resolve the connect ...
stackexchange/codereview
I have a database with user 'dbo' that has a login name "domain\xzy". How do I change it from "domain\xzy" to "domain\abc".
stackexchange/codereview
I know that a SQL Server full text index can not index more than one table. But, I have relationships in tables that I would like to implement full text indexes on. Take the 3 tables below... Vehicle Veh_ID - int (Primary Key) FK_Atr_VehicleColor - int Veh_Make - nvarchar(20) Veh_Model - nvarchar(50) Veh_LicensePlate -...
stackexchange/codereview
I would like to know if there is some way to share a variable or an object between two or more Servlets, I mean some "standard" way. I suppose that this is not a good practice but is a easier way to build a prototype. I don't know if it depends on the technologies used, but I'll use Tomcat 5.5 I want to share a Vector...
stackexchange/codereview
I read this article and try to do the exercise in D Programming Language, but encounter a problem in the first exercise. (1) Display series of numbers (1,2,3,4, 5....etc) in an infinite loop. The program should quit if someone hits a specific key (Say ESCAPE key). Of course the infinite loop is not a big prob...
stackexchange/codereview
ZeroC's ICE (www.zeroc.com) looks interesting and I am interested in looking at it and comparing it to our existing software that uses WCF. In particular, our WCF app uses server callbacks (via HTTP). Anybody who's compared them? How did it go? I'm particularly interested in the performance aspect, since interoperabili...
stackexchange/codereview
I've looked at this explanation on Wikipedia, specifically the C++ sample, and fail to recognize the difference between just defining 3 classes, creating instances and calling them, and that example. What I saw was just placing two other classes into the process and cannot see where there would be a benefit. Now I'm su...
stackexchange/codereview
Using NHibernate from C# and only HQL (not SQL) in a way that is compatible with MS SQL Server 2005/2008 (and preferably Oracle). Is there a way to write the order by clause so that nulls will sort at the end of the query results while the non-null results will be sorted in ascending order? Based on the answer to the q...
stackexchange/codereview
What is the best way to maniupulate richtext / *.rtf data in SQL server 2005 / 2008 I have looked at ocx solutions. Maybe creating some CLR stored procs?? The problem is that I have several notes written in richtext that need to be combined for ease of reporting. Like SELECT @Notes = @Notes + RTFColumn FROM Notestable ...
stackexchange/codereview
Flex has built in drag-n-drop for list controls, and allows you to override this. But they don't cover this in examples. The built-in functionality automatically drags the list-item, if you want to override this you find the handlers are being set up on the list itself. What I specifically want to do, is my TileList sh...
stackexchange/codereview
Here's the code that I'm attempting to do: public IList<IOperator> GetAll() { using (var c = new MyDataContext()) { return c.Operators.ToList(); } } Operator implements IOperator, but I'm getting the following compilation error: Cannot implicitly convert type 'System.Collections.Generic.Lis...
stackexchange/codereview
I've installed owfs and am trying to read the data off a iButton temperature logger. owfs lets me mount the iButton as a fuse filesystem and I can see all the data. I'm having trouble figuring out what is the best way to access the data though. I can get individual readings by catting the files, e.g. cat onewire/{dev...
stackexchange/codereview
I've been searching around, and I haven't found how I would do this from C#. I was wanting to make it so I could tell Google Chrome to go Forward, Back, Open New Tab, Close Tab, Open New Window, and Close Window from my C# application. I did something similar with WinAmp using [DllImport("user32", EntryPoint = "SendMes...
stackexchange/codereview
As I understand it, .bat is the old 16-bit naming convention, and .cmd is for 32-bit Windows, i.e., starting with NT. But I continue to see .bat files everywhere, and they seem to work exactly the same using either suffix. Assuming that my code will never need to run on anything older than NT, does it really matter whi...
stackexchange/codereview
What is the keyboard-shortcut that expands the menu, from the little red line, and offers the option to have the necessary using statement appended to the top of the file?
stackexchange/codereview
Consider a hypothetical method of an object that does stuff for you: public class DoesStuff { BackgroundWorker _worker = new BackgroundWorker(); ... public void CancelDoingStuff() { _worker.CancelAsync(); //todo: Figure out a way to wait for BackgroundWorker to be cancelled. } } ...
stackexchange/codereview
In bash, environmental variables will tab-expand correctly when placed after an echo command, for example: echo $HOME But after cd or cat, bash places a \ before the $ sign, like so: cd \$HOME If I use a variable as the second argument to a command, it won't expand at all: cp somefile $HOM What mysterious option do ...
stackexchange/codereview
At the moment we use HSQLDB as an embedded database, but we search for a database with less memory footprint as the data volume grows. Derby / JavaDB is not an option at the moment because it stores properties globally in the system properties. So we thought of h2. While we used HSQLDB we created a Server-object, set t...
stackexchange/codereview
Do anyone do this in ANT Build. Meaning everytimie a certain target is called e.g. build-sit. A tag will be created in the svn respositoyr to reference to that particular sit version. Any idea how to do about doing that?
stackexchange/codereview
I am trying to read an Http response stream twice via the following: HttpWebResponse response = (HttpWebResponse)request.GetResponse(); stream = response.GetResponseStream(); RssReader reader = new RssReader(stream); do { element = reader.Read(); if (element is RssChannel) { feed.Channels.Add((RssChannel)elem...
stackexchange/codereview
When it comes to organizing python modules, my Mac OS X system is a mess. I've packages lying around everywhere on my hdd and no particular system to organize them. How do you keep everything manageable?
stackexchange/codereview
How would you design and implement OpenID components? (Was "How does OpenId work") I realize this question is somewhat of a duplicate, and yes, I have read the spec and the wikipedia article. After reading the materials mentioned above, I still don't have a complete picture in my head of how each step in the process is...
stackexchange/codereview
Is anyone out there still using DataFlex? If so, what are you favorite tips and tricks for this venerable 4GL?
stackexchange/codereview
We have a VXML project that a 3rd party parses to provide us with a phone navigation system. We require them to enter an id code to leave a message, which is later reviewed by our company. We currently have this working as follows: Response.Cache.SetCacheability(HttpCacheability.NoCache); Stream m = new MemoryStream();...
stackexchange/codereview
I am using Installshield 2008 Premier to edit some XML files which are already on the targetsystem. This process does work fine with the "XML file changes" function. My problem is, that Installshield does not remove these changes on uninstall. I have set the "Remove element on uninstall" checkbox within the added eleme...
stackexchange/codereview
I'm looking for a query which will return me an extra column at the end of my current query which is the count of all columns within the return set which contain a null column. For example: Col 1 - Col 2 - Col 3 A B 0 A NULL 1 NULL NULL 2 Is there a simple way to get this return set based on...
stackexchange/codereview
Question says it all, really. My application is a time tracker. It's currently written as a spreadsheet, but there's just too much data and I would like to impose a bit more structure on it. SQLite seems like a neat way to go. I would be open to other suggestions, too.
stackexchange/codereview
In this MSDN article, MS explains how to specify other delimiters besides commas for csv-type exports from SSRS 2005, however, literal tab characters are stripped by the config file parser, and it doesn't appear that MS has provided a workaround. This entry on Microsoft Connect seems to confirm this. Has anyone develop...
stackexchange/codereview
We run a medium-size site that gets a few hundred thousand pageviews a day. Up until last weekend we ran with a load usually below 0.2 on a virtual machine. The OS is Ubuntu. When deploying the latest version of our application, we also did an apt-get dist-upgrade before deploying. After we had deployed we noticed that...
stackexchange/codereview
I'd like to get comments from people who have used or evaluated Coverity for statically analysing Java-code. I know it's popular in C/C++ world, but is it worth spending the money for Java analysis or am I better off with PMD, Findbugs and other Open Source tools?
stackexchange/codereview
I would have thought that it would be clear cut whether memory allocation is faster in managed code than in native code - but there seems to be some controversy. Perhaps memory management under a Virtual Machine be faster because of no context-swapping calls to the OS, but then I see that the VM would itself need to m...
stackexchange/codereview
Due to the legacy nature of some of our code, we're still using Microsoft Visual 6.0 (SP6). When I attach to a running process to debug it for the first time, it has no knowledge of where the source files are located when I break into the process. It therefore asks me to navigate to the appropriate directory in my sour...
stackexchange/codereview
I am trying to use VBScript to do an XSLT transform on an XML object. The XSL file I'm translating includes the <xsl:import href="script.xsl"/> directive. If I use the absolute URL (http://localhost/mysite/script.xsl), it imports the style sheet fine; however, if I use the relative path (script.xsl) it reports "resourc...
stackexchange/codereview
I've updated my TortoiseSVN client and now I'm getting the error when trying to update or commit to different repositories: The requested name is valid, but no data of the requested type was found Any ideas on how I can solve this? Internet Explorer shows up appropriate URL just fine. TortoiseSVN 1.5.3, Build 13783...
stackexchange/codereview
Are there LaTeX packages for (more or less) easily drawing Gantt diagrams? Thanks.
stackexchange/codereview
(The original question was asked there : http://www.ogre3d.org/phpBB2/viewtopic.php?t=44832 ) Someone asked : "While I would like to build everything in vs2008 (VC9), the PhysX SDK is built with vs2005 (VC8). Would this cause any problems, using all vc9 compiled libs and used in combination with this vc8 lib?" I answe...
stackexchange/codereview
For example, I rarely need: using System.Text; but it's always there by default. I assume the application will use more memory if your code contains unnecessary using directives. But is there anything else I should be aware of? Also, does it make any difference whatsoever if the same using directive is used in only on...
stackexchange/codereview
I have a function that passes an array to another function as an argument, there will be multiple data types in this array but I want to know how to pass a function or a reference to a function so the other function can call it at any time. ex. function A: add(new Array("hello", some function)); function B: public fun...
stackexchange/codereview
I have an .Net MVC application which runs fine if I use the build in Visual Studio Webserver. If I use the projects property pages to switch to IIS as the webserver and create a virtual directory for my project, any request I send to the server results in a "Directory listing denied" failure. Does anyone know a solutio...
stackexchange/codereview
I know how to draw basic objects using JOGL or LWJGL to connect to OpenGL. What I would like is something that can generate some kind of geometry for trees, similar to what SpeedTree is famous for. Obviously I don't expect the same quality as SpeedTree. I want the trees to not look repetitive. Speed is not a concern, I...
stackexchange/codereview
I'm already using SVN 1.5, both sever(VisualSVN 1.5.1) and client-side(TortoiseSVN 1.5.1) but we are using a fairly lengthy SVN Branch-Merge dance. How ready is the Merge-Tracking facility of SVN 1.5.x and is it yet possible to use it from TortoiseSVN?
stackexchange/codereview
in sharepoint webservices, I can use getListItems() to obtain the child elements of a list. In a document library, sometimes the element is a folder. "ows_FSObjType = 1" Is there any way to ask SP for the child elements of this folder? Querying with getListItems() using the folder ID gives me a SOAP Exception. Edit: ...
stackexchange/codereview
My client has a multi-page PDF file. They need it split by page. Does anyone know of a way to do this - preferably in C#.
stackexchange/codereview
I'm a big fan of the Jadclipse plugin and I'd really like to upgrade to Eclipse 3.4 but the plugin currently does not work. Are there any other programs out there that let you use jad to view source of code you navigate to from Eclipse? (Very useful when delving into ambiguous code in stack traces).
stackexchange/codereview
Ruby's standard popen3 module does not work on Windows. Is there a maintained replacement that allows for separating stdin, stdout, and stderr?
stackexchange/codereview
I have a UIScrollView that shows vertical data, but where the horizontal component is no wider than the screen of the iPhone. The problem is that the user is still able to drag horizontally, and basically expose blank sections of the UI. I have tried setting: scrollView.alwaysBounceHorizontal = NO; scrollView.direction...
stackexchange/codereview
If I safe an Array and reload it, is there a possibility to get the size if its unknown? Thanks
stackexchange/codereview
A TextBox is set to AutoPostback as changing the value should cause a number of (display-only) fields to be recalculated and displayed. That works fine. However, when the field is tabbed out of, the focus briefly moves on to the next field, then disappears when the page is redrawn so there is no focus anywhere. I want...
stackexchange/codereview
I asked a question about Lua perfromance, and on of the responses asked: Have you studied general tips for keeping Lua performance high? i.e. know table creation and rather reuse a table than create a new one, use of 'local print=print' and such to avoid global accesses. This is a slightly different question from Lua...
stackexchange/codereview
I am creating an RSS reader as a hobby project, and at the point where the user is adding his own URL's. I was thinking of two things. A plaintext file where each url is a single line SQLite where i can have unique ID's and descriptions following the URL Is the SQLite idea to much of an overhead or is there a better ...
stackexchange/codereview
I have a plug-in to an Eclipse RCP application that has a view. After an event occurs in the RCP application, the plug-in is instantiated, its methods are called to populate the plug-in's model, but I cannot find how to make the view appear without going to the "Show View..." menu. I would think that there would be so...
stackexchange/codereview
I need a complete Object Pascal syntax (preferably Delphi 2009). Some of the syntax is given by the help files, but not all information is provided. So I started collecting loose bits of information. Recently I added these to a more or less complete syntax description (EBNF like). Although it looks extensive, there are...
stackexchange/codereview