instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
What is a good (and preferably simple) way to test the rendering performance of WPF custom controls? I have several complex controls in which rendering performance is highly crucial. I want to be able to make sure that I can have lots of them drawwing out in a designer with a minimal impact on performance.
stackexchange/codereview
I want to get whois information of a domain name from my c#/java programs. Is there a simple way to do this?
stackexchange/codereview
Here's a scenario I'm sure you're all familiar with. You have a fairly "hands off" customer, who really doesn't want to get too involved in the decision making despite your best efforts. An experienced development team spend hours discussing the pros and cons of a particular approach to a problem and come up with an...
stackexchange/codereview
I'm currently generating an 8-character pseudo-random uppercase string for "A" .. "Z": value = ""; 8.times{value << (65 + rand(25)).chr} but it doesn't look clean, and it can't be passed as an argument since it isn't a single statement. To get a mixed-case string "a" .. "z" plus "A" .. "Z", I changed it to: value = ...
stackexchange/codereview
When I press F5 in Visual Studio 2008, I want Google Chrome launched as the browser that my ASP.NET app runs in. May I know how this can be done?
stackexchange/codereview
So I have an object which has some fields, doesn't really matter what. I have a generic list of these objects. List<MyObject> myObjects = new List<MyObject>(); myObjects.Add(myObject1); myObjects.Add(myObject2); myObjects.Add(myObject3); So I want to remove objects from my list based on some criteria. For instance, my...
stackexchange/codereview
I am using Qt Dialogs in one of my application. I need to hide/delete the help button. But i am not able to locate where exactly I get the handle to his help button. Not sure if its a particular flag on the Qt window.
stackexchange/codereview
I'd like to build a query string based on values taken from 5 groups of radio buttons. Selecting any of the groups is optional so you could pick set A or B or both. How would I build the querystring based on this? I'm using VB.NET 1.1 The asp:Radiobuttonlist control does not like null values so I'm resorting to normal ...
stackexchange/codereview
I'm building the world's simplest library application. All I want to be able to do is scan in a book's UPC (barcode) using a typical scanner (which just types the numbers of the barcode into a field) and then use it to look up data about the book... at a minimum, title, author, year published, and either the Dewey Deci...
stackexchange/codereview
Is there a way to read a locked file across a network given that you are the machine admin on the remote machine? I haven't been able to read the locked file locally, and attempting it over the network adds another layer of difficulty.
stackexchange/codereview
What would be the best way to develop a text box that remembers the last x number of entries that were put into it. This is a standalone app written with C#.
stackexchange/codereview
Can you please tell me how much is (-2) % 5? According to my Python interpreter is 3, but do you have a wise explanation for this? I've read that in some languages the result can be machine-dependent, but I'm not sure though.
stackexchange/codereview
I recently asked a question about what I called "method calls". The answer referred to "messages". As a self-taught hobby programmer trying to phrase questions that don't make me look like an idiot, I'm realizing that the terminology that I use reveals a lot about how I learned to program. Is there a distinction betwee...
stackexchange/codereview
I am currently developing a .NET application, which consists of 20 projects. Some of those projects are compiled using .NET 3.5, some others are still .NET 2.0 projects (so far no problem). The problem is that if I include an external component I always get the following warning: Found conflicts between different vers...
stackexchange/codereview
Is it possible to see the history of changes to a particular line of code in a Subversion repository? I'd like, for instance, to be able to see when a particular statement was added or when that statement was changed, even if its line number is not the same any more.
stackexchange/codereview
Your backend could be PHP or Python but you want to use the controls from the ASP.NET toolkit is there a successful way to do this?
stackexchange/codereview
I have a class: class MyClass: def __init__(self, foo): if foo != 1: raise Error("foo is not equal to 1!") and a unit test that is supposed to make sure the incorrect arg passed to the constructor properly raises an error: def testInsufficientArgs(self): foo = 0 self.assertRaises((Error), myClass =...
stackexchange/codereview
Does ELMAH logged exceptions even when they do not bubble up to the application? I'd like to pop up a message when an exception occurs and still log the exception. Currently I've been putting everything in try catch blocks and spitting out messages, but this gets tedious.
stackexchange/codereview
I would like to execute an OS command from my ruby script but I want to add an argument from a ruby variable. I know that's possible by using keyword system like that : #!/usr/bin/env ruby directory = '/home/paulgreg/' system 'ls ' + directory but is that possible by using the "backquotes or backticks syntax" ? (I mea...
stackexchange/codereview
I have two threads, one needs to poll a bunch of separate static resources looking for updates. The other one needs to get the data and store it in the database. How can thread 1 tell thread 2 that there is something to process?
stackexchange/codereview
What's the difference between the inner workings of Java's JVM and .NET's CLR? Perhaps a starting point would be, are they basically the same thing in their respective environments (Java > JVM > Machine code) (C# > CLR > IL). Update: Several people have alluded to the points I was trying to cover: Garbage Collection...
stackexchange/codereview
Any recommendations for a javascript form validation library. I could try and roll my own (but I'm not very good at javascript). Needs to support checking for required fields, and preferably regexp validation of fields.
stackexchange/codereview
I'm trying to debug into a C dll that is invoked on a Windows Mobile device using CeRapiInvoke() (Technically RAPI.Invoke() from OpenNETCF) from a Windows box. I'm very familiar with attaching to a process that is already running to debug a loaded dll (I've done it many time with Windows Mobile services) but I can't s...
stackexchange/codereview
I have a repeatable business process that I execute every week as part of my configuration management responsibilities. The process does not change: I download change details into Excel, open the spreadsheet and copy out details based on a macro, create a Word document from an agenda template, update the agenda with th...
stackexchange/codereview
this is a bit of a philosophical question. I am adding a small feature to my software which I assume will be used by most users but only maybe 10% of the times they use the software. In other words, the software has been fine without it for 3 months, but 4 or 5 users have asked for it, and I agree that it should be the...
stackexchange/codereview
When I try to compile code on VS 2005 and it fails, the line which causes the error gets underlined blue, and mouse-hovering over it displays the error message. Fine, but you can't see object types or whatever, because Intellisense will show the error message, and not object info. In this image, I wanted to see what ty...
stackexchange/codereview
Are there any free (non-GPL) libraries for .NET that provide IMAP4 server side functionality? E.g. handles the socket level and message handshaking so that an IMAP4 client (such as outlook) can retrieve, read, edit and/or delete messages. I am not trying to connect to an IMAP4 server, I'd like the assistance to imple...
stackexchange/codereview
I'm trying to run some queries to get rid of XSS in our database using Web Data Administrator but I keep running into this Potentially Dangerous Request crap. How do I disable validation of the query in Web Data Administrator?
stackexchange/codereview
I have a WCF service that gets called from client side JavaScript. The call fails with a Service is null JavaScript error. WebDevelopment helper trace shows that the calls to load the jsdebug support file results in a 404 (file not found) error. Restarting IIS or clearing out the Temp ASP.Net files or setting batch="f...
stackexchange/codereview
What is the best way to keep an asp:button from displaying it's URL on the status bar of the browser? The button is currently defines like this: <asp:button id="btnFind" runat="server" Text="Find Info" onclick="btnFind_Click"> </asp:button> Update: This appears to be specific to...
stackexchange/codereview
I have a custom component where I have implemented INotifyPropertyChanged and IBindableComponent. However, when I try to databind a property, the designer adds this line: this.component11.TestString = global::WindowsFormsApplication2.Properties.Settings.Default.Setting; instead of creating a binding as it does with a ...
stackexchange/codereview
is there any way to leave a time delay between the execution of two lines of code?
stackexchange/codereview
I have a VB6 program that someone recently helped me convert to VB.NET In the program, when saving files, I stamp them with the date which I was getting by calling the Today() function. When I try to run the new VB.NET code in Vista it throws a permission exception for the Today() . If I run Visual Studio Express (thi...
stackexchange/codereview
I'm trying to find if there is a reliable way (using SQLite) to find the ID of the next row to be inserted, before it gets inserted. I need to use the id for another insert statement, but don't have the option of instantly inserting and getting the next row. Is predicting the next id as simple as getting the last id an...
stackexchange/codereview
I'm working on a product feature that will allow the user to export data from a SQL CE database on one copy of my application and re-import it into SQL CE on the other end. This data is not whole tables, but the result of queries. I had hoped to take advantage of .net's built-in XML-based serialization like in DataTabl...
stackexchange/codereview
The following question answers how to get large memory pages on Windows : "how do i run my app with large pages in windows". The problem I'm trying to solve is how do I configure it on Vista and 2008 Server. Normally you just allow a specific user to lock pages in memory and you are done. However on Vista and 2008 this...
stackexchange/codereview
Possible Duplicate: Pre-build task - deleting the working copy in CruiseControl.NET I would like to delete my working directory during the cruisecontrol build process...I'm sure this is easy, but I have been unable to find an example of it... If you know how to create a directory, that would be useful as well. Thank...
stackexchange/codereview
I have a web report that uses a Django form (new forms) for fields that control the query used to generate the report (start date, end date, ...). The issue I'm having is that the page should work using the form's initial values (unbound), but I can't access the cleaned_data field unless I call is_valid(). But is_valid...
stackexchange/codereview
I need to create a batch file which starts multiple console applications in a Windows .cmd file. This can be done using the start command. However, the command has a path in it. I also need to pass paramaters which have spaces as well. How to do this? E.g. batch file start "c:\path with spaces\app.exe" param1 "param...
stackexchange/codereview
Has anyone written an 'UnFormat' routine for Delphi? What I'm imagining is the inverse of SysUtils.Format and looks something like this UnFormat('a number %n and another %n',[float1, float2]); So you could unpack a string into a series of variables using format strings. I've looked at the 'Format' routine in SysUti...
stackexchange/codereview
Imagine I have String in C#: "I Don’t see ya.." I want to remove (replace to nothing or etc.) these "’" symbols. How do I do this?
stackexchange/codereview
What is the best (hopefully free or cheap) way to detect and then, if necessary, remove a rootkit found on your machine?
stackexchange/codereview
I have a JSP page that contains a scriplet where I instantiate an object. I would like to pass that object to the JSP tag without using any cache. For example I would like to accomplish this: <%@ taglib prefix="wf" uri="JspCustomTag" %> <% Object myObject = new Object(); %> <wf:my-tag obj=myObject /> I'm tryin...
stackexchange/codereview
There are a couple of different .NET XSLT functions that I see used in the out of the box SharePoint web parts (RSS Viewer and Data View web part). <xsl:stylesheet xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:rssaggwrt="http://schemas.microsoft.com/WebParts/v3/rssagg/runtime" ...
stackexchange/codereview
I'm working in a team environment where each developer works from their local desktop and deploys to a virtual machine that they own on the network. What I'm trying to do is set up the Visual Studio solution so that when they build the solution each projects deployment is handled in the post-build event to that develo...
stackexchange/codereview
or "How do I answer questions on SO in Firefox using gVim inside the textboxes?"
stackexchange/codereview
How do I dump the data, and only the data, not the schema, of some SQLite3 tables of a database (not all the tables)? The dump should be in SQL format, as it should be easily re-entered into the database later and should be done from the command line. Something like sqlite3 db .dump but without dumping the schema and ...
stackexchange/codereview
How can I convert a uniform distribution (as most random number generators produce, e.g. between 0.0 and 1.0) into a normal distribution? What if I want a mean and standard deviation of my choosing?
stackexchange/codereview
Can anyone suggest a way of getting version information into a Web Service? (VB.NET) I would like to dynamically use the assembly version in the title or description, but the attributes require constants. Is manually writing the version info as a string the only way of displaying the information on the .asmx page?
stackexchange/codereview
I've writen an Excel-based, database reporting tool. Currentely, all the VBA code is associated with a single XLS file. The user generates the report by clicking a button on the toolbar. Unfortunately, unless the user has saved the file under another file name, all the reported data gets wiped-out. When I have created ...
stackexchange/codereview
I had data in XML that had line feeds, spaces, and tabs that I wanted to preserve in the output HTML (so I couldn't use <p>) but I also wanted the lines to wrap when the side of the screen was reached (so I couldn't use <pre>).
stackexchange/codereview
I've been developing modules for DNN since version 2 and back then I was able to easily able to run my module as I developed it on my environment and still easily deploy my module as a DLL. When version 4 came out and used the web site solution (rather than the Web Application solution). It seems like there was someth...
stackexchange/codereview
I want to highlight C/C++/Java/C# etc source codes in my website. How can I do this? Is it a CPU intensive job to highlight the source code?
stackexchange/codereview
I have an Java desktop application which connects directly with the DB (an Oracle). The application has multiple user accounts. What is the correct method to send the user's password (not DB password) over the network? I don't want to send it in plain text.
stackexchange/codereview
We have a rather simple site (minimal JS) with plain html and CSS. It is a simple mobile interface for our main application. We are running into trouble because we have more than one column and several browsers seem to force single columns. Through some searching I ran into 2 meta tags. <meta name="MobileOptimized" co...
stackexchange/codereview
I am writing picture editing windows forms application using vb.net/c#. i have a client requirement to capture the photo from digital still camera attached to computer. how can i capture a photo from USB connected digital still camera device in my windows application ?
stackexchange/codereview
When i try to offline a disk in a zfs raidz pool (the raidz pool is not mirrored), zfs says that the disk cannot be taken offline because it has no valid mirror. Isn't one of the properties of raidz that it has a redundant disk (or even 2 disks in raidz2)...?
stackexchange/codereview
I'm having trouble granting privileges to another user in PostgreSQL 8.3. While the GRANT command gives me no error, the privileges do not show up. Do I need to "flush" them? sirprize=# CREATE DATABASE testdb; CREATE DATABASE sirprize=# GRANT ALL PRIVILEGES ON DATABASE testdb TO testuser; GRANT sirprize=# \c testdb You...
stackexchange/codereview
I'm working on a setup which wants to include the Microsoft.Web.Services3 (WSE 3.0) DLL. However, I typically do not like including Microsoft DLL's in our installs except by way of Microsoft's redistributables. There is both a developer and a redist install package available from Microsoft. So, as a best practice, shou...
stackexchange/codereview
Let me start by saying that I do not advocate this approach, but I saw it recently and I was wondering if there was a name for it I could use to point the guilty party to. So here goes. Now you have a method, and you want to return a value. You also want to return an error code. Of course, exceptions are a much bett...
stackexchange/codereview
I have some code like this: If key.Equals("search", StringComparison.OrdinalIgnoreCase) Then DoSomething() End If I don't care about the case. Should I use OrdinalIgnoreCase, InvariantCultureIgnoreCase, or CurrentCultureIgnoreCase?
stackexchange/codereview
We had a need for a document management solution and were hoping SharePoint 2007 would satisfy our needs. We felt our needs were relatively simple. We needed to manage versioning, have searching capabilities, and having an approval workflow. SharePoint handled these three aspects great out of the box. However, we also ...
stackexchange/codereview
The current system that I am working on makes use of Castle Activerecord to provide ORM (Object Relational Mapping) between the Domain objects and the database. This is all well and good and at most times actually works well! The problem comes about with Castle Activerecords support for asynchronous execution, well, mo...
stackexchange/codereview
I have one applicationContext.xml file, and it has two org.springframework.orm.jpa.JpaTransactionManager (each with its own persistence unit, different databases) configured in a Spring middleware custom application. I want to use annotation based transactions (@Transactional), to not mess around with TransactionStatus...
stackexchange/codereview
Let's say I write a DLL in C++, and declare a global object of a class with a non-trivial destructor. Will the destructor be called when the DLL is unloaded?
stackexchange/codereview
I see that within MySQL there are Cast() and Convert() functions to create integers from values, but is there any way to check to see if a value is an integer? Something like is_int() in PHP is what I am looking for.
stackexchange/codereview
I have searched for various techniques on how to read/write dBase III (dbf) files using OLEDB or ODBC with C#/.NET. I have tried almost all of the tecniques posted, but without success. Can someone point me in the right direction? Thanks for your time.
stackexchange/codereview
I'm using membership and roles for authentication in my vb .net application. We have about 5 roles in the application with certain roles filling out a specific profile value. Example is the role is store and the profile value is store number. Obviously if you work for headquarters you don't have a store number so I don...
stackexchange/codereview
I'm trying to implement an outdent of the first letter of the first paragraph of the body text. Where I'm stuck is in getting consistent spacing between the first letter and the rest of the paragraph. For example, there is a huge difference in spacing between a "W" and an "I" Anyone have any ideas about how to mitig...
stackexchange/codereview
I keep hearing from associates about grid computing which, from what I can gather, is highly distributed stuff along the lines of SETI@Home. Is anyone working on these sort of systems for business use? My interest is in figuring out if there's a commercial reason for starting software development in this field.
stackexchange/codereview
I am designing a game to be played in the browser. Game is a space theme and I need to generate a map of the "Galaxy". The basic idea of the map is here: game map http://www.oglehq.com/map.png The map is a grid, with each grid sector can contain a planet/system and each of these has links to a number of adjacent grids....
stackexchange/codereview
I'm trying to bind controls in a WPF form to an interface and I get a runtime error that it can't find the interface's properties. Here's the class I'm using as a datasource: public interface IPerson { string UserId { get; set; } string UserName { get; set; } string Email { get; set; } } public class Perso...
stackexchange/codereview
Note: I am using .Net 1.1, although I am not completely against answer that use higher versions. I am displaying some dynamically generated objects in a PropertyGrid. These objects have numeric, text, and enumeration properties. Currently I am having issues setting the default value for the enumerations so that they do...
stackexchange/codereview
In C#, if I want to deterministically clean up non-managed resources, I can use the "using" keyword. But for multiple dependent objects, this ends up nesting further and further: using (FileStream fs = new FileStream("c:\file.txt", FileMode.Open)) { using (BufferedStream bs = new BufferedStream(fs)) { ...
stackexchange/codereview
Here is a quick test program: public static void main( String[] args ) { Date date = Calendar.getInstance().getTime(); System.out.println("Months:"); printDate( "MMMM", "en", date ); printDate( "MMMM", "es", date ); printDate( "MMMM", "fr", date ); printDate( "MMMM", "de", date ); Syst...
stackexchange/codereview
I want to point a file dialog at a particular folder in the current user's Local Settings folder on Windows. What is the shortcut to get this path?
stackexchange/codereview
I'm having a little trouble figuring out exactly how const applies in a specific case. Here's the code I have: struct Widget { Widget():x(0), y(0), z(0){} int x, y, z; }; struct WidgetHolder //Just a simple struct to hold four Widgets. { WidgetHolder(Widget a, Widget b, Widget c, Widget d): A(a), B(b), C(...
stackexchange/codereview
Let's say that on the C++ side my function takes a variable of type jstring named myString. I can convert it to an ANSI string as follows: const char* ansiString = env->GetStringUTFChars(myString, 0); is there a way of getting const wchar_t* unicodeString = ...
stackexchange/codereview
I want: all links which not contained filename (not .html, .jpg, .png, .css) redirect with state 301 to directory, for example: http://mysite.com/article -> http://mysite.com/article/ But http://mysite.com/article/article-15.html not redirects. What regulat expression I must write to .htaccess for adding slash to virtu...
stackexchange/codereview
I get an XML file From a web service. Now I want to get one of those elements out of the file. I think I should go use XPath - any good starter reference?
stackexchange/codereview
I am using mysql++ in order to connect to a MySQL database to perform a bunch of data queries. Due to the fact that the tables I am reading from are constantly being written to, and that I need a consistent view of the data, I lock the tables first. However, MySQL has no concept of 'NOWAIT' in its lock query, thus if t...
stackexchange/codereview
I am in need of a way to mute a specific application in Vista. Example: Mute just Firefox, but not all of the other application. Much similar to muting a specific program from within the volume mixer in vista. If there is a program that will do this, i would appreciate that. Otherwise if there is a way to do this, I...
stackexchange/codereview
At work we have an application to play 2K (2048*1556px) OpenEXR film sequences. It works well.. apart from when sequences that are over 3GB (quite common), then it has to unload old frames from memory, despite the fact all machines have 8-16GB of memory (which is addressable via the linux BIGMEM stuff). The frames have...
stackexchange/codereview
When using the php include function the include is succesfully executed, but it is also outputting a char before the output of the include is outputted, the char is of hex value 3F and I have no idea where it is coming from, although it seems to happen with every include. At first I thbought it was file encoding, but ...
stackexchange/codereview
We have got a custom MembershipProvider in ASP.NET. Now there are 2 possible scenario the user can be validated: User login via login.aspx page by entering his username/password. I have used Login control and linked it with the MyMembershipProvider. This is working perfectly fine. An authentication token is passed via...
stackexchange/codereview
Are there any advantages compiling for .NET Framework 3.5 instead of 2.0? For example less memory consumption, faster startup, better performance... Personally I don't think so however, I may have missed something. Edits Of course there are more features in the 3.5 framework, but these are not the focus of this questi...
stackexchange/codereview
I have a members table in MySQL CREATE TABLE `members` ( `id` int(10) unsigned NOT NULL auto_increment, `name` varchar(65) collate utf8_unicode_ci NOT NULL, `order` tinyint(3) unsigned NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB; And I would like to let users order the members how they like. I'm...
stackexchange/codereview
I'm using a deploy project to deploy my ASP.net web application. When I build the deploy project, all the .compiled files are re-created. Do I need to FTP them to the production web server? If I do a small change do I need to copy all the web site again?
stackexchange/codereview
How does the open-source/free software community develop drivers for products that offer no documentation?
stackexchange/codereview
When I originally was introduced to Mocks I felt the primary purpose was to mock up objects that come from external sources of data. This way I did not have to maintain an automated unit testing test database, I could just fake it. But now I am starting to think of it differently. I am wondering if Mocks are more eff...
stackexchange/codereview
What culprits are the most likely to cause a 404 resource not found error when a page in a given .WAR, autocreated by Sun's J2EE deploytool, is trying to load a Servlet in the same .WAR file? Eg: HTTP Status 404 - /MyServlet/MyServlettype Status reportmessage /MyServlet/MyServletdescription The requested resource (/...
stackexchange/codereview
Whenever I run rspec tests for my Rails application it takes forever and a day of overhead before it actually starts running tests. Why is rspec so slow? Is there a way to speed up Rails' initial load or single out the part of my Rails app I need (e.g. ActiveRecord stuff only) so it doesn't load absolutely everything...
stackexchange/codereview
Which of the WCF Service Protocols work well with Java? Do the TCP Service Bindings work with java remoting (either Corba, EJB, JMS, etc.)? What about the WebServices exposed as Service EndPoints. Have these been tested against the common Java WebServices stack for interoperability?
stackexchange/codereview
I know WCF supports many WS-* protocols but WS-Eventing does seem to be listed. I do know that WCF has a pub/sub model, but is it WS-Eventing compliant?
stackexchange/codereview
I am forced to use VSS at work, but use SVN for a personal repository. What is the best way to sync between VSS and sync?
stackexchange/codereview
Will the code below work if the clock on the server is ahead of the clock on the client? Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1)) EDIT: the reason I ask is on one of our web apps some users are claiming they are seeing the pages ( account numbers, etc ) from a user that previously used that machine. Yet...
stackexchange/codereview
How can i add a line break to the text area in a html page? i use VB.net for server side coding.
stackexchange/codereview
Where is a good place to start with making an application in .NET that communicates through OPC?
stackexchange/codereview
I bought an ASP.NET script about a year ago to retrieve FedEx shipping values. It builds an XML string that passes to the FedEx server using an HttpWebRequest, then parses the raw XML. The average response time for the script is about 900 milliseconds. So the other day I was poking around in the FedEx developer c...
stackexchange/codereview
For example which is better: select * from t1, t2 where t1.country='US' and t2.country=t1.country and t1.id=t2.id or select * from t1, t2 where t1.country'US' and t2.country='US' and t1.id=t2.id better as in less work for the database, faster results. Note: Sybase, and there's an index on both tables of country+id.
stackexchange/codereview