instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I have a button bar inf flex along with several other input controls, I have set the tabIndex property for each control and all goes well until I tab to the ButtonBar. The ButtonBar has 3 buttons but tabbing to it, only the first button gets focus, tab again and the focus goes back to the top control... How can I make...
stackexchange/codereview
Is anyone using the Obout controls in C# .Net? How would you rate these controls, especially the Grid Control?
stackexchange/codereview
I am calling, through reflection, a method which may cause an exception. How can I pass the exception to my caller without the wrapper reflection puts around it? I am rethrowing the InnerException, but this destroys the stack trace. Example code: public void test1() { // Throw an exception for testing purposes ...
stackexchange/codereview
Are asymmetrical cryptographic keys fundamentally inter-convertible between the major key container formats? For example, can I convert an X.509 key file into a PGP or OpenGPG key file? And--assuming the answer is yes--is it "security neutral" to keep one key pair in whatever format and convert into whichever containe...
stackexchange/codereview
I like the idea of having Interfaces and Implementation separate. But how separate? Are the Interface definitions in a separate .Net assembly? Do you have a single project that defines all Interfaces for a solution? Otherwise are there issues with circular dependencies of Interfaces?
stackexchange/codereview
I have never "hand-coded" object creation code for SQL Server and foreign key decleration is seemingly different between SQL Server and Postgres. Here is my sql so far: drop table exams; drop table question_bank; drop table anwser_bank; create table exams ( exam_id uniqueidentifier primary key, exam_name varch...
stackexchange/codereview
I've created a custom exception for a very specific problem that can go wrong. I receive data from another system, and I raise the exception if it bombs while trying to parse that data. In my custom exception, I added a field called "ResponseData", so I can track exactly what my code couldn't handle. In custom exceptio...
stackexchange/codereview
Are there any prebuilt modules for this? Is there an event thats called everytime a page is loaded? I'm just trying to secure one of my more important admin sections.
stackexchange/codereview
Do you know any open source/free software C++ libraries to manipulate images in these formats: .jpg .gif .png .bmp ? The more formats it supports, the better. I am implementing a free program in C++ which hides a text file into one or more images, using steganography. I am working under Unix.
stackexchange/codereview
Is there any way in the Servlet API to access properties specified in web.xml (such as initialization parameters) from within a Bean or Factory class that is not associated at all with the web container? For example, I'm writing a Factory class, and I'd like to include some logic within the Factory to check a hierarchy...
stackexchange/codereview
I noticed that you can call Queue.Synchronize to get a thread-safe queue object, but the same method isn't available on Queue<T>. Does anyone know why? Seems kind of weird.
stackexchange/codereview
I tried to install Delphi 7 on Vista several times and Vista prevented me from doing so by telling me that there are known problems with this application (Delphi 7). Several other people in my company experienced problems with installing D7 on Vista. This lead to the conclusion that we were at risk with our D7 applicat...
stackexchange/codereview
The collection of fonts available to a web developer is depressingly limited. I remember reading long ago about TrueDoc, as a way of shipping fonts alongside a website - but it seems to have languished. Has anybody used this, or something similar? Is it supported by enough browsers? Am I missing a good solution? Note t...
stackexchange/codereview
Using reflection, I need to investigate a user DLL and create an object of a class in it. What is the simple way of doing it?
stackexchange/codereview
This might be a bit on the silly side of things but I need to send the contents of a DataTable (unknown columns, unknown contents) via a text e-mail. Basic idea is to loop over rows and columns and output all cell contents into a StringBuilder using .ToString(). Formatting is a big issue though. Any tips/ideas on how ...
stackexchange/codereview
I've seen numerous people mentions that you shouldn't use widths and padding or margins on the same element with CSS. Why is that?
stackexchange/codereview
A database that stores a lot of credit card information is an inevitable part of the system we have just completed. What I want though is ultimate security of the card numbers whereby we setup a mechanism to encrypt and decrypt but of ourselves cannot decrypt any given number. What I am after is a way to secure this i...
stackexchange/codereview
I am using ActiveScaffold in a Ruby on Rails app, and have replaced the default "actions" text in the table (ie. "edit", "delete", "show") with icons using CSS. I have also added a couple of custom actions with action_link.add ("move" and "copy"). For clarity, I would like to have the icons displayed in a different ord...
stackexchange/codereview
EmployeeNumber = string.IsNullOrEmpty(employeeNumberTextBox.Text) ? null : Convert.ToInt32(employeeNumberTextBox.Text), I often find myself wanting to do things like this (EmployeeNumber is a Nullable<int> as it's a property on a LINQ-to-SQL dbml object where the column allows NULL values). Unfortunately, the...
stackexchange/codereview
I've built a web part for Sharepoint that retrieves data from an external service. I'd like to display the items in a way that's UI-compatible with Sharepoint (fits in with its surroundings.) I'm aware of the "DataFormWebPart" but was unable to get one working properly. It requires a valid DataSource and I was unable...
stackexchange/codereview
I'm building a quick csv from a mysql table with a query like: select DATE(date),count(date) from table group by DATE(date) order by date asc; and just dumping them to a file in perl over a: while(my($date,$sum) = $sth->fetchrow) { print CSV "$date,$sum\n" } There are date gaps in the data, though: | 2008-08-05 |...
stackexchange/codereview
What's the best way to implement the enum idiom in Ruby? I'm looking for something which I can use (almost) like the Java/C# enums.
stackexchange/codereview
1.exe doesn't give enough time for me to launch the IDE and attach 1.exe to the debugger to break into.
stackexchange/codereview
Is there any way to convert a bmp image to jpg/png without losing the quality in C#? Using Image class we can convert bmp to jpg but the quality of output image is very poor. Can we gain the quality level as good as an image converted to jpg using photoshop with highest quality?
stackexchange/codereview
I have a svn repository, R, that depends on a library, l, in another repository. The goal is that when someone checks out R, they also check out l. We want l to still be in its own repository so that l can be updated without dependence on R. I don't know much about external svn links, but I believe that when depending ...
stackexchange/codereview
In textmate, when there's a current selection, I hit the " key and the selection gets surrounded by quotes. The same thing happens with other balanced characters like (, {, [ and '. Am I missing something obvious in Emacs configuration that would enable similar behaviour when using transient mark mode, or do I need to ...
stackexchange/codereview
For many questions the answer seems to be found in "the standard". However, where do we find that? Preferably online. Googling can sometimes feel futile, again especially for the C standards, since they are drowned in the flood of discussions on programming forums. To get this started, since these are the ones I am sea...
stackexchange/codereview
What is the most efficient, secure way to pipe the contents of a postgresSQL database into a compressed tarfile, then copy to another machine? This would be used for localhosting development, or backing up to a remote server, using *nix based machines at both ends.
stackexchange/codereview
What's the "right" way to do the following as a boolean expression? for i in `ls $1/resources`; do if [ $i != "database.db" ] then if [ $i != "tiles" ] then if [ $i != "map.pdf" ] then if [ $i != "map.png" ] then svn exp...
stackexchange/codereview
I'm trying to get Google AppEngine to work on my Debian box and am getting the following error when I try to access my page: <type 'exceptions.ImportError'>: No module named core.exceptions The same app works fine for me when I run it on my other Ubuntu box, so I know it's not a problem with the app itself. However, ...
stackexchange/codereview
I assumed that the C# margin property had a meaning like in CSS - the spacing around the outside of the control. But Margin values seem to be ignored to matter what values I enter. Then I read on the SDK: Setting the Margin property on a docked control has no effect on the distance of the control from the the e...
stackexchange/codereview
I've been using make and makefiles for many many years, and although the concept is sound, the implementation has something to be desired. Has anyone found any good alternatives to make that don't overcomplicate the problem?
stackexchange/codereview
Has anybody experience in building a custom style in Qt? What I have in my mind is a complete new style that affects all kind of widgets. I have seen some examples in the web for a custom combo box. But I have no idea how much time and code it takes to build a "complete" new custom style ... maybe someone can give me a...
stackexchange/codereview
While searching the interweb for a solution for my VB.net problems I often find helpful articles on a specific topic, but the code is C#. That is no big problem but it cost some time to convert it to VB manually. There are some sites that offer code converters from C# to VB and vice versa, but to fix all the flaws afte...
stackexchange/codereview
I have an Asp.Net repeater, which contains a textbox and a checkbox. I need to add client-side validation that verifies that when the checkbox is checked, the textbox can only accept a value of zero or blank. I would like to use one or more of Asp.Net's validator controls to accomplish this, to provide a consistent di...
stackexchange/codereview
This is an antique problem with VB6 DLL and COM objects but I still face it day to day. What tools or procedures can be used to see which DLL file or version another DLL is referencing? I am referring to compiled DLLs at runtime, not from within VB6 IDE. It's DLL hell.
stackexchange/codereview
I am curious if anyone have used UnderC, Cint, Cling, Ch, or any other C++ interpreter and could share their experience.
stackexchange/codereview
How do you schedule a task in Windows XP to run when you shut down windows. Such that I want to run a simple command line program I wrote in c# everytime I shut down windows. There doesn't seem to be an option in scheduled tasks to perform this task when my computer shuts down.
stackexchange/codereview
I've started using Vim to develop Perl scripts and am starting to find it very powerful. One thing I like is to be able to open multiple files at once with: vi main.pl maintenance.pl and then hop between them with: :n :prev and see which file are open with: :args And to add a file, I can say: :n test.pl which I e...
stackexchange/codereview
Is there any complete guidance on doing AppBar docking (such as locking to the screen edge) in WPF? I understand there are InterOp calls that need to be made, but I'm looking for either a proof of concept based on a simple WPF form, or a componentized version that can be consumed. Related resources: http://www.codepro...
stackexchange/codereview
(Eclipse 3.4, Ganymede) I have an existing Dynamic Web Application project in Eclipse. When I created the project, I specified 'Default configuration for Apache Tomcat v6' under the 'Configuration' drop down. It's a month or 2 down the line, and I would now like to change the configuration to Tomcat 'v5.5'. (This will ...
stackexchange/codereview
In Visual Studio you can create a template XML document from an existing schema. The new XML Schema Explorer in VS2008 SP1 takes this a stage further and can create a sample XML document complete with data. Is there a class library in .NET to do this automatically without having to use Visual Studio? I found the XmlSam...
stackexchange/codereview
Is there a way of getting the process id of my C++ application? I am using the Carbon framework, but not Cocoa…
stackexchange/codereview
I've got some Java code using a servlet and Apache Commons FileUpload to upload a file to a set directory. It's working fine for character data (e.g. text files) but image files are coming out garbled. I can open them but the image doesn't look like it should. Here's my code: Servlet protected void doPost(HttpServlet...
stackexchange/codereview
I'd like to implement a way of recording the version of a project within code, so that it can be used when testing and to help track bugs. It seems the best version number to use would just be the current revision number from Subversion. Is there an easy way to hook this number into a (C++ in my case) header file or s...
stackexchange/codereview
It seems like you could use a mashup of Relector and a Debugger to be able to debug any .NET app WITHOUT having the source code at all. Is this possible? Has anyone seen this before?
stackexchange/codereview
As a follow up to "What are indexes and how can I use them to optimise queries in my database?" where I am attempting to learn about indexes, what columns are good index candidates? Specifically for an MS SQL database? After some googling, everything I have read suggests that columns that are generally increasing and u...
stackexchange/codereview
I'm wondering if there's such a thing as Django-like ease of web app development combined with good deployment, debugging and other tools? Django is a very productive framework for building content-heavy sites; the best I've tried and a breath of fresh air compared to some of the Java monstrosities out there. However ...
stackexchange/codereview
Update: Check out this follow-up question: Gem Update on Windows - is it broken? On Windows, when I do this: gem install sqlite3-ruby I get the following error: Building native extensions. This could take a while... ERROR: Error installing sqlite3-ruby: ERROR: Failed to build gem native extension. c:/ruby/...
stackexchange/codereview
Say I have a linked list of numbers of length N. N is very large and I don’t know in advance the exact value of N. How can I most efficiently write a function that will return k completely random numbers from the list?
stackexchange/codereview
I've found a few resources on the subject, but they all require a deep understanding of SmallTalk or Haskell, neither of which I know.
stackexchange/codereview
Has someone experiment RDF storage solution like Sesame? I'm looking for performance review of this kind of solution compared to the traditional database solution.
stackexchange/codereview
I'm thinking of learning the ASP.NET MVC framework for an upcoming project. Can I use the advanced routing to create long URLs based on the sitemap hierarchy? Example navigation path: Home > Shop > Products > Household > Kitchen > Cookware > Cooksets > Nonstick Typical (I think) MVC URL: http://example.com/products/ca...
stackexchange/codereview
.NET, Java and other high level database API's in various language often provide techniques known as prepared statements and parameter binding as opposed to sending plain text commands to the Database server. What I would like to know is what happens when you execute a statement like this: SqlCommand cmd = new SqlComma...
stackexchange/codereview
How do I capture the event of the clicking the Selected Node of a TreeView? It doesn't fire the SelectedNodeChanged since the selection has obviously not changed but then what event can I catch so I know that the Selected Node was clicked? UPDATE: When I have some time, I'm going to have to dive into the bowels of the ...
stackexchange/codereview
Is there a way to select data where any one of multiple conditions occur on the same field? Example: I would typically write a statement such as: select * from TABLE where field = 1 or field = 2 or field = 3 Is there a way to instead say something like: select * from TABLE where field = 1 || 2 || 3 Any help is apprec...
stackexchange/codereview
Say I have an interface IFoo which I am mocking. There are 3 methods on this interface. I need to test that the system under test calls at least one of the three methods. I don't care how many times, or with what arguments it does call, but the case where it ignores all the methods and does not touch the IFoo mock is t...
stackexchange/codereview
Possible Duplicate: SQL Query to get latest price I have a database containing stock price history. I want to select most recent prices for every stock that is listed. I know PostreSQL has a DISTINCT ON statement that would suit ideally here. Table columns are name, closingPrice and date; name and date together form...
stackexchange/codereview
I've just read up on Thread.IsBackground and if I understand it correctly, when it's set to false the Thread is a foreground thread which means it should stay alive until it has finished working even though the app have been exited out. Now I tested this with a winform app and it works as expected but when used with a ...
stackexchange/codereview
I recently started work on a personal coding project using C++ and KDevelop. Although I started out by just hacking around, I figure it'll be better in the long run if I set up a proper unit test suite before going too much further. I've created a seperate test-runner executable as a sub project, and the tests I've a...
stackexchange/codereview
On my journey into the depths of custom ASP.NET control development I am obviously getting my head around the ASP.NET PostBack model and how it affects control development. I understand that controls have no "lifetime" in ASP.NET, and therefore must be re-initialized on each and every page load. We overcome this by per...
stackexchange/codereview
What's the easiest way to add a header and footer to a .Net PrintDocument object, either pragmatically or at design-time? Specifically I'm trying to print a 3rd party grid control (Infragistics GridEx v4.3), which takes a PrintDocument object and draws itself into it. The resulting page just contains the grid and it's ...
stackexchange/codereview
Is there a built in function in .NET 2.0 that will take two arrays and merge them into one array? The arrays are both of the same type. I'm getting these arrays from a widely used function within my code base and can't modify the function to return the data in a different format. I'm looking to avoid writing my own fun...
stackexchange/codereview
I have to choose an online WYSIWYG editor. I'm pending between TinyMCE and Xinha. My application is developed in Asp.Net 3.5. Could you help me with with some pros and cons?
stackexchange/codereview
I would like to display an RTF document in an SWT (actually Eclipse RCP) application. I know there is a Swing widget for displaying and editing RTF text, but it is Swing and quite alien in look and feel when used in the otherwise platform (not to mention that to the last of my knowledge it did not display images and ha...
stackexchange/codereview
I am looking for an easy way to check if an object in C# is serializable. As we know you make an object serializable by either implementing the ISerializable interface or by placing the [Serializable] at the top of the class. What I am looking for is a quick way to check this without having to reflect the class to get ...
stackexchange/codereview
Given the case I made two independent changes in one file: eg. added a new method and changed another method. I often don't want to commit both changes as one commit, but as two independent commits. On a git repository I would use the Interactive Mode of git-add(1) to split the hunk into smaller ones: git add --patch ...
stackexchange/codereview
Here is a scenario: Let's say I have site with two controllers responsible for displaying different type of content - Pages and Articles. I need to embed Partial View into my masterpage that will list pages and articles filtered with some criteria, and be displayed on each page. I cannot set Model on my masterpage (am ...
stackexchange/codereview
I'm writing a utility for myself, partly as an exercise in learning C# Reflection and partly because I actually want the resulting tool for my own use. What I'm after is basically pointing the application at an assembly and choosing a given class from which to select properties that should be included in an exported HT...
stackexchange/codereview
I am using ActiveScaffold in a Ruby on Rails app, and to save space in the table I have replaced the default "actions" text in the table (ie. "edit", "delete", "show") with icons using CSS. I have also added a couple of custom actions with action_link.add ("move" and "copy"). For clarity, I would like to have a tooltip...
stackexchange/codereview
When trying to connect to an ORACLE user via TOAD (Quest Software) or any other means (Oracle Enterprise Manager) I get this error: ORA-011033: ORACLE initialization or shutdown in progress
stackexchange/codereview
Is there a way to guarantee that a file on Windows (using the NTFS file system) will use contiguous sectors on the hard disk? In other words, the first chunk of the file will be stored in a certain sector, the second chunk of the file will be stored in the next sector, and so on. I should add that I want to be able to ...
stackexchange/codereview
I am using the tablesorter plugin (http://tablesorter.com) and am having a problem with column widths in IE7. It looks fine in Firefox and sometimes in IE7. Here's a screenshot of the problem: IE7 View and here's how it's supposed to look: Firefox view
stackexchange/codereview
We have a NET app that gets installed to the Program Files folder. The app itself writes some files and creates some directories to its app folder. But when a normal windows user tries to use our application it crashes because that user does not have permission to write to app folder. Is there any folder in both WinXP...
stackexchange/codereview
I'm familiar with SQL Server Indexed Views (or Oracle Materialized Views), we use them in our OLAP applications. They have the really cool feature of being able to usurp an execution plan and remap it to the indexed view w/out having to change existing code. IE. Let's say I had a SPROC that was a really expensive join....
stackexchange/codereview
In Eclipse, I have a workspace that contains all of my projects. Each project builds and compiles separately. A project does not interact with another project. How does this relate to Visual Studio and Projects/Solutions there?
stackexchange/codereview
I'm passing raw HTTP requests to an apache server (received by PHP). The request is of type multipart/form-data, i.e. the same MIME type used when submitting HTML forms. However, I'm not sure what HTTP header to use for setting the form field name (I'm just assuming it's a header defining this, don't know what else it...
stackexchange/codereview
Is there a setting in ReSharper 4 (or even Visual Studio itself...) that forces a warning if I forget to wrap code in a using block, or omit the proper Dispose call in a finally block?
stackexchange/codereview
The RefEdit control that comes as part of VBA is a little buggy, but it's good for putting on a form when you want people to specify one or more ranges of cells (i.e. Excel.Range objects). The main problem is that you can only use the RefEdit control on a VBA UserForm (Microsoft states this, and my tests confirm it too...
stackexchange/codereview
Some e-Marketing tools claim to choose which web page to display based on where you were before. That is, if you've been browsing truck sites and then go to Ford.com, your first page would be of the Ford Explorer. I know you can get the immediate preceding page with HTTP_REFERRER, but how do you know where they were 6 ...
stackexchange/codereview
What's the simplest SQL statement that will return the duplicate values for a given column and the count of their occurrences in an Oracle database table? For example: I have a JOBS table with the column JOB_NUMBER. How can I find out if I have any duplicate JOB_NUMBERs, and how many times they're duplicated?
stackexchange/codereview
Has anyone considered using something along the lines of the Amazon SimpleDB data store as their backend database? SQL Server hosting (at least in the UK) is expensive so could something like this along with cloud file storage (S3) be used for building apps that could grow with your application. Great in theory but wou...
stackexchange/codereview
Are there any good solutions to represent a parameterized enum in C# 3.0? I am looking for something like OCaml or Haxe has. I can only think of class hierarchy with a simple enum field for easy switching for now, maybe there are better ideas? See Ocaml example below in one of the replies, a Haxe code follows: enum Tre...
stackexchange/codereview
Are the any task tracking systems with command-line interface? Here is a list of features I'm interested in: Simple task template Something like plain-text file with property:type pairs, for example: description:string some-property:integer required command line interface for example: // Creates task <tas...
stackexchange/codereview
I am trying to join together several audio files into one mp4/m4a file containing chapter metadata. I am currently using QTKit to do this but unfortunately when QTKit exports to m4a format the metadata is all stripped out (this has been confirmed as a bug by Apple) see sample code. I think this rules QTKit out for this...
stackexchange/codereview
I'm asking more about what this means to my code. I understand the concepts mathematically, I just have a hard time wrapping my head around what they mean conceptually. For example, if one were to perform an O(1) operation on a data structure, I understand that the number of operations it has to perform won't grow be...
stackexchange/codereview
I'm having an issue with a query that currently uses LEFT JOIN weblog_data AS pwd ON (pwd.field_id_41 != '' AND pwd.field_id_41 LIKE CONCAT('%', ewd.field_id_32, '%')) However I'm discovering that I need it to only use that if there is no exact match first. What's happening is that the query is double dipping d...
stackexchange/codereview
All the docs for SQLAlchemy give INSERT and UPDATE examples using the local table instance (e.g. tablename.update()... ) Doing this seems difficult with the declarative syntax, I need to reference Base.metadata.tables["tablename"] to get the table reference. Am I supposed to do this another way? Is there a different ...
stackexchange/codereview
Has anyone out there got a good set of instructions for building/compiling Ruby from source of windows XP ?
stackexchange/codereview
I want to debug an application in Visual Studio but I ONLY have the source code for 1 class. I only need to step through a single function in that file, but I don't understand what I need to do it. I think the steps are normally something like this: Open a file in VS Load in the "symbols" (.PDB file) Attach to the r...
stackexchange/codereview
Most of the implementations I find require a hardware instruction to do this. However I strongly doubt this is required (if it is, I can't figure out why...)
stackexchange/codereview
I have a simple type that explicitly implemets an Interface. public interface IMessageHeader { string FromAddress { get; set; } string ToAddress { get; set; } } [Serializable] public class MessageHeader:IMessageHeader { private string from; private string to; [XmlAttribute("From")] string IMessageHe...
stackexchange/codereview
we have several "production environments" (three servers each, with the same version of our system. Each one has a SQL Server Database as production database). In one of this environment the tempdb transaction log starts to grow fast and infinitely, we can´t find why. Same version of SO, SQL Server, application. No ch...
stackexchange/codereview
I have a pretty good knowledge of programming languages like C/C++, Java, Python. But they were all mostly learnt in a college / high school class room setting where the best user interface was a numbered menu. You know, the standard data structures, implementation of various algorithms, file handling and the like. Wh...
stackexchange/codereview
I saw this same question for VIM and it has been something that I myself wanted to know how to do for Emacs. In ReSharper I use CTRL-D for this action. What is the least number of commands to perform this in Emacs?
stackexchange/codereview
I am unable to consume messages sent via ActiveMQ from my Flex client. Sending messages via the Producer seems to work, I can also see that the Flex client is connected and subscribed via the properties on the Consumer object, however the "message" event on the Consumer is never fired so it seems like the messages are ...
stackexchange/codereview
In our application we've run into an error numerous times where we get error CS0433, which complains about a name collison in two separate dlls. This is an ASP.NET app developed in C# using webforms. It always complained about A TimeLog page. Anyone have advice for resolving this error?
stackexchange/codereview
I have a multi-frame layout. One of the frames contains a form, which I am submitting through XMLHttpRequest. Now when I use document.write() to rewrite the frame with the form, and the new page I am adding contains any javascript then the javascript is not exectuted in IE6? For example: document.write("<html><head><sc...
stackexchange/codereview
In file Atomic.aiml, part of the annotated ALICE AIML files, there are a lot of categories like this: <category> <pattern>ANSWER MY QUESTION</pattern> <template> Please try asking <set name="it">your question</set> another way. </template> </category> This code isn't valid acco...
stackexchange/codereview
When I do a clean build my C# project, the produced dll is different then the previously built one (which I saved separately). No code changes were made, just clean and rebuild. Diff shows some bytes in the DLL have changes -- few near the beginning and few near the end, but I can't figure out what these represent. Do...
stackexchange/codereview