instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I've been looking at profiles in maven for selecting different sets of dependencies. This is fine when you want to build say a debug build differently from a release build. My problem is that I want to do a fair bit more than this. For my application (Mobile Java app where J2ME is just one target among many) there may ...
stackexchange/codereview
I am trying to leverage ORM given the following requirements: 1) Using .NET Framework (latest Framework is okay) 2) Must be able to use Sybase, Oracle, MSSQL interchangeably 3) The schema is mostly static, BUT there are dynamic parts. I am somewhat familiar with SubSonic and NHibernate, but not deeply. I get the naggin...
stackexchange/codereview
Even though Silverlight2 is still in it's infancy, can anyone recommend a book to get started with? One that has more of a developer focus than a designer one?
stackexchange/codereview
HyperTerminal is a program that you can use to connect to other computers, Telnet sites, bulletin board systems (BBSs), online services, and host computers, using either your modem, a null modem cable or Ethernet connection. But My main usage of Hyperterminal is to communicate with hardware through local (v...
stackexchange/codereview
I am working on a web application, where I transfer data from the server to the browser in XML. Since I'm danish, I quickly run into problems with the characters æøå. I know that in html, I use the "æøå" for æøå. however, as soon as the chars pass through JavaScript, I get black boxes wit...
stackexchange/codereview
Is it a good idea to use while loop instead of a cursor? What are the advantages/disadvantages of cursors?
stackexchange/codereview
Is there any conflict?
stackexchange/codereview
We need to build an administration portal website to support our client/server application. Since we're a .Net shop the obvious traditional way would be to do that in ASP.Net. But Silverlight 2 will be coming out of beta a good while before our release date. Should we consider building the whole website in silverlight ...
stackexchange/codereview
If I want to inject a globally scoped array variable into a page's client-side javascript during a full page postback, I can use: this.Page.ClientScript.RegisterArrayDeclaration("WorkCalendar", "\"" + date.ToShortDateString() + "\""); to declare and populate a client-side javascript array on the page. Nice and simple....
stackexchange/codereview
I've been mystified by the R quantile function all day. I have an intuitive notion of how quantiles work, and an M.S. in stats, but boy oh boy, the documentation for it is confusing to me. From the docs: Q[i](p) = (1 - gamma) x[j] + gamma x[j+1], I'm with it so far. For a type i quantile, it's an interpolation...
stackexchange/codereview
GDB has severe issues when debugging with multiple threads (pthreads). Are there any other good multi-threaded debuggers for C/C++ on *nix?
stackexchange/codereview
I'm currently running Vista and I would like to manually complete the same operations as my Windows Service. Since the Windows Service is running under the Local System Account, I would like to emulate this same behavior. Basically, I would like to run CMD.EXE under the Local System Account. I found information online ...
stackexchange/codereview
Every time I call this method my NSMutableData is leaking and I cannot figure out how to plug it. theData's retain count is upped by one after the decoder is allocated and initialized and I have no idea why. I am stuck with a retain count of 2 at the end of the method and attempting to release it causes an app crash. -...
stackexchange/codereview
Unfortunately, there seems to be no string.Split(string separator), only string.Split(char speparator). I want to break up my string based on a multi-character separator, a la VB6. Is there an easy (that is, not by referencing Microsoft.VisualBasic or having to learn RegExes) way to do this in c#? EDIT: Using .NET Fra...
stackexchange/codereview
I want to store a large number of sound files in a database, but I don't know if it is a good practice. I would like to know the pros and cons of doing it in this way. I also thought on the possibility to have "links" to those files, but maybe this will carry more problems than solutions. Any experience in this directi...
stackexchange/codereview
Ok, Regex wizards. I want to be able to search through my logfile and find any sessions with the word 'error' in it and then return the entire session log entry. I know I can do this with a string/array but I'd like to learn how to do it with Regex but here's the question. If I decide to do this with Regex do I have o...
stackexchange/codereview
I've heard that SELECT * is generally bad practice to use when writing SQL commands because it is more efficient to SELECT columns you specifically need. If I need to SELECT every column in a table, should I use SELECT * FROM TABLE or SELECT column1, colum2, column3, etc. FROM TABLE Does the efficiency really matter ...
stackexchange/codereview
What techniques or tools are recommended for finding broken links on a website? I have access to the logfiles, so could conceivably parse these looking for 404 errors, but would like something automated which will follow (or attempt to follow) all links on a site.
stackexchange/codereview
I've recently started playing with Mono (1.9.1) on Ubuntu 8.04 with the Mono-Develop IDE (v1). I am attempting to use GTK-Sharp 2 to run the GUI for the play apps. For some reason when I try to create gtk dialogs (ColorSelectionDialog or MessageDialog) the compiler throws the error "'Gtk.ColorSelectionDialog.ColorSele...
stackexchange/codereview
I need an easy way to take a tar file and convert it into a string (and vice versa). Is there a way to do this in Ruby? My best attempt was this: file = File.open("path-to-file.tar.gz") contents = "" file.each {|line| contents << line } I thought that would be enough to convert it to a string, but then when I try to...
stackexchange/codereview
I want to provide my own message from the validation done in DocumentBuilder, rather than the one from XMLMessages.properties. Now I see that a property error-reporter needs to be set to a class which extends XMLErrorReporter. However, I've not been able to get ComponentManager from Document/Builder/Factory. Doing pars...
stackexchange/codereview
If you want to develop against WordPress (i.e., have a local instance running on your machine so you can develop themes, get blogs and sites laid out, etc.) and you're running Windows on your development machine with IIS and SQL Server already installed, what's the best way to do it? I found a method online which sets ...
stackexchange/codereview
There are several different methods for converting floating point numbers to Integers in JavaScript. My question is what method gives the best performance, is most compatible, or is considered the best practice? Here are a few methods that I know of: var a = 2.5; window.parseInt(a); // 2 Math.floor(a); // 2 a | 0;...
stackexchange/codereview
To deploy a new version of our website we do the following: Zip up the new code, and upload it to the server. On the live server, delete all the live code from the IIS website directory. Extract the new code zipfile into the now empty IIS directory This process is all scripted, and happens quite quickly, but there ca...
stackexchange/codereview
Is there any simple way to programatically colorize images in .NET? Basically we have a black and white image and need to put a layer of say pink above it and reduce the opacity of that layer to make the picture colorized in pink.
stackexchange/codereview
What is the best way to generate a Unique ID from two (or more) short ints in C++? I am trying to uniquely identify vertices in a graph. The vertices contain two to four short ints as data, and ideally the ID would be some kind of a hash of them. Prefer portability and uniqueness over speed or ease. There are a lo...
stackexchange/codereview
I'm currently planning the infrastructure for my future web project. I want to go the way Joel went with having one DB per client and now thinking which DB engine will be good for me. The best would be of course SQL Server, but I can't afford a full-blown version at this moment and I don't think SQL Server Express will...
stackexchange/codereview
I have a method that periodically (e.g. once in every 10 secs) try to connect to a server and read some data from it. The server might not be available all the time. If the server is not available the method throws an exception. What would be the best way to implement a wrapper method that doesn't throw an exception ex...
stackexchange/codereview
I'm using spring 2.5, and am using annotations to configure my controllers. My controller works fine if I do not implement any additional interfaces, but the spring container doesn't recognize the controller/request mapping when I add interface implementations. I can't figure out why adding an interface implementation...
stackexchange/codereview
I am sure a responsive UI is something that everyone strives for and the reccomended way to do stuff is to use the BackgroundWorker for this. Do you find it easy to work with ? Do you use it often ? Or do you have your own frameworks for lengthy tasks and reporting process. I have found that I am using it quite a lot ...
stackexchange/codereview
In a Linux embedded application I'm developing, there is the need to record some events that happen from time to time. These records are saved on a MTD flash device and once written there is no need to change them or do efficient searches, but read access is required to show the data back to the user. A big problem is ...
stackexchange/codereview
I'm currently writing a TYPO3 extension which is configured with a list of tt_content UID's. These point to content elements of type "text" and i want to render them by my extension. Because of TYPO3s special way of transforming the text you enter in the rich text editing when it enters the database, and again transfor...
stackexchange/codereview
I am using a .NET Windows Forms DataGridView and I need to edit a DataBound column (that binds on a boolean DataTable column). For this I specify the cell template like this: DataGridViewColumn column = new DataGridViewColumn(new DataGridViewCheckBoxCell()); You see that I need a CheckBox cell template. The problem I f...
stackexchange/codereview
In IIS 6, I can use the Web Service Extensions folder in Inetmgr to allow/prohibit isapi filters, such as ASP.net. I want to be able to do this programmatically (in particular, from an installer script/exe). Any ideas?
stackexchange/codereview
Could you guys recommend some affordable SQL modeling tool which supports SQL Server, PostgreSQL and MySQL? I'm looking into up to $300 per license range. One tool per answer, please! Thanks!
stackexchange/codereview
My development environment is running in JDK1.6, and I need to compile some classes so they are compatible with a client running JDK1.5. How would I do this with the 'javac' ant target?
stackexchange/codereview
I am writing a C# program which captures signals from a external device, and sends keystrokes to another application. I am using SendKeys and it works fine. SendKeys does "press" a key by holding and releasing it immediately. I would like to make it push key and release it at will. My question is : "is there a way to s...
stackexchange/codereview
So, In a Flex app I add a new GUI component by creating it and calling parent.addChild(). However in some cases, this causes an error in the bowels of Flex. Turns out, addChild actually does: return addChildAt(child, numChildren); In the cases where it breaks, somehow the numChildren is off by one. Leading to this err...
stackexchange/codereview
I've created a web page that lets you input some information and then draws an image in a canvas element based on that info. I have it pretty much working the way I want except for the printing. Is there a way to print out the canvas element or is creating a new window to draw in, the only way to do it? Update: The an...
stackexchange/codereview
I am using Forms authentication in my asp.net (3.5) application. I am also using roles to define what user can access which subdirectories of the app. Thus, the pertinent sections of my web.config file look like this: <system.web> <authentication mode="Forms"> <forms loginUrl="Default.aspx" path="/" protection="A...
stackexchange/codereview
I am wondering about what the difference between logging and tracing is. Is the difference basically that tracing is more detailed log giving developers a tool to debug applications at runtime? I have been experimenting with log4net and doing logging. Now I am wondering if I should be doing tracing as well and if I cou...
stackexchange/codereview
I have about 200 Excel files that are in standard Excel 2003 format. I need them all to be saved as Excel xml - basically the same as opening each file and choosing Save As... and then choosing Save as type: XML Spreadsheet Would you know any simple way of automating that task?
stackexchange/codereview
Unquestionably, I would choose to use the STL for most C++ programming projects. The question was presented to me recently however, "Are there any cases where you wouldn't use the STL?"... The more I thought about it, the more I realized that perhaps there SHOULD be cases where I choose not to use the STL... For exampl...
stackexchange/codereview
Basically I want to know how to set center alignment for a cell using VBScript... I've been googling it and can't seem to find anything that helps.
stackexchange/codereview
I have an idea for how to solve this problem, but I wanted to know if there's something easier and more extensible to my problem. The program I'm working on has two basic forms of data: images, and the information associated with those images. The information associated with the images has been previously stored in a ...
stackexchange/codereview
By default the MVC Preview 5 web project comes with a HomeController.vb class. This sets the web URL to http://www.mywebsite.com/home/ by default. If I just wanted this to be http://www.mywebsite.com/ by default, how would I accomplish that?
stackexchange/codereview
I understand that they are both supposed to be small, but what are the key differences between the two?
stackexchange/codereview
I haven't a clue about encryption at all. But I need it. How? Say you have a system of nodes communicating with each other on a network via asynchronous messages. The nodes do not maintain session information about other nodes (this is a design restriction). Say you want to make sure only your nodes can read the messag...
stackexchange/codereview
I have a table that has redundant data and I'm trying to identify all rows that have duplicate sub-rows (for lack of a better word). By sub-rows I mean considering COL1 and COL2 only. So let's say I have something like this: COL1 COL2 COL3 --------------------- aa 111 blah_x aa 111 blah_j aa ...
stackexchange/codereview
I have a method that takes an IQueryable. Is there a LINQ query that will give me back the size of each column in the IQueryable? To be more clear: this is Linq-to-objects. I want to get the length of the ToString() of each "column".
stackexchange/codereview
There are a lot of different systems for balancing load and achieving redundancy in production servers (Not just web servers) Round-robin DNS Linux Virtual Server Cisco Local Director F5 BigIP Windows NLB etc? If you use one of these (or another) in production, which one? How well does it work for you? Have you evalu...
stackexchange/codereview
I am trying to use the BGGA closures prototype with an existing JDK 6 (standard on Mac OS X Leopard). The sample code I'm compiling is from a BGGA tutorial: public static void main(String[] args) { // function with no arguments; return value is always 42 int answer = { => 42 }.invoke(); System.out.println(answer...
stackexchange/codereview
My web application sends email fairly often, and it sends 3 kinds of emails: initiated by user, in response to an event in the system, and in automatic response to an email received by the application. I would like to make sure that the third type of email does not get stuck in an endless loop of auto-responders talkin...
stackexchange/codereview
I wrote a PHP web-application using SQLite and sessions stored on filesystem. This is functionally fine and attractively low maintenance. But, now it needs to run on a shared host. All web-applications on the shared host run as the same user, so my users' session data is vulnerable, as is the database, code, etc. Many...
stackexchange/codereview
I use both ruby on rails and Java. I really enjoy using migrations when I am working on a rails project. so I am wondering is there a migrations like tool for Java? If there is no such tool is it a good idea to use migrations as a tool to control a database used by a Java project?
stackexchange/codereview
I have a backroundrb scheduled task that takes quite a long time to run. However it seems that the process is ending after only 2.5 minutes. My background.yml file: :schedules: :named_worker: :task_name: :trigger_args: 0 0 12 * * * * :data: input_data I have zero activity on the server when the proce...
stackexchange/codereview
I know there is a list-comprehension library for common lisp (incf-cl), I know they're supported natively in various other functional (and some non-functional) languages (F#, Erlang, Haskell and C#) - is there a list comprehension library for Scheme? incf-cl is implemented in CL as a library using macros - shouldn't it...
stackexchange/codereview
I'm working on an application for a charitable student organization. The application will track participation and fund-raising for (primarily) student participants in an event. One of the things we'd like to do is collect some demographic information about students who register for the event from our enterprise direc...
stackexchange/codereview
I have a script that successfully encrypts a credit card. I need it to work as a trigger, so that any insert done to the creditcard column automatically encrypts it. Right now, my trigger works BUT the creditcard column is a varchar. When an app tries to insert, I do this: DECLARE @encryptedCreditCardNumber varbinary(...
stackexchange/codereview
I have an HTTP server that returns large bodies in response to POST requests (it is a SOAP server). These bodies are "streamed" via chunking. If I encounter an error midway through streaming the response how can I report that error to the client and still keep the connection open? The implementation uses a proprietary ...
stackexchange/codereview
I have a number of stored procs which I would like to all run simultaneously on the server. Ideally all on the server without reliance on connections to an external client. What options are there to launch all these and have them run simultaneously (I don't even need to wait until all the processes are done to do addi...
stackexchange/codereview
Is it possible to do at least one of the following: 1) Detect a setting of a Local Security Policy (Accounts: Limit local account use of blank passwords to console logon only) 2) Modify that setting Using Win32/MFC?
stackexchange/codereview
We are using TFS 2008 for project managmeent and I am looking for a method to roll up smaller tasks into larger tasks within tfs. Our work flow works like this: I create a new large work item, say 'Implement web page X' and assign it to my developer (lets call him Brad) Brad receives the task. Now he has never desig...
stackexchange/codereview
While it would be very convenient to use inline functions at some situations, Are there any drawbacks with inline functions? Conclusion: Apparently, There is nothing wrong with using inline functions. But it is worth noting the following points! Overuse of inlining can actually make programs slower. Depending on a fun...
stackexchange/codereview
This could be weird, Have you ever come across a blog which you wanted to read in the chronological order? And that blog could be old, with several hundred posts. When i add this feed to my feed reader, say googlereader, the latest feed comes on top and as i scroll down further, the older posts appear. This could be fr...
stackexchange/codereview
In Tomcat 5.5 the server.xml can have many connectors, typically port only 8080, but for my application a user might configure their servlet.xml to also have other ports open (say 8081-8088). I would like for my servlet to figure out what socket connections ports will be vaild (During the Servlet.init() tomcat has not...
stackexchange/codereview
I've got a Win32 C++ app with a suite of unit tests. After the unit tests have finished running, I'd like a human-readable report on any unfreed memory to be automatically generated. Ideally, the report will have a stack with files & line number info for each unfreed allocation. It would be nice to have them generat...
stackexchange/codereview
Now I have seen this question in another forum but it didn't had an acceptable answer. Suppose I have two tables, the Groups table and the Elements table. The tables have no defined relationships. The Elements table has an IdGroup field that refers to the IdGroup (PK) field of the Groups table. I use the following quer...
stackexchange/codereview
I am creating a component and want to expose a color property as many flex controls do, lets say I have simple component like this, lets call it foo_label: <mx:Canvas> <mx:Script> [Bindable] public var color:uint; </mx:Script> <mx:Label text="foobar" color="{color}" /> </mx:Canvas> and then add ...
stackexchange/codereview
I always seem to use Get when working with data (strongly typed or otherwise) from the database and I have never really needed to use Fill although I just as easily could use Fill instead of get when pulling out and updating data. Can anyone provide guidance as to the implications and gotchas of each method? In what s...
stackexchange/codereview
I have a multi-line string that I want to do an operation on each line, like so: inputString = """Line 1 Line 2 Line 3""" I want to iterate on each line: for line in inputString: doStuff()
stackexchange/codereview
I'm looking for a getopt library for c#. So far I found a few (phpguru, XGetOptCS, getoptfordotnet) but these look more like unfinished attempts that only support a part of C's getopt. Is there a full getopt c# implementation?
stackexchange/codereview
I have googled around and not seen any info. What format and icon color depths are used for applications?
stackexchange/codereview
I use Codesmith to create our code generation templates and have had success in learning how to use the tool by looking at example templates and the built in documentation. However I was wondering if there are any other resources (books, articles, tutorials, etc.) for getting a better grasp of Codesmith?
stackexchange/codereview
I'm processing some data files that are supposed to be valid UTF-8 but aren't, which causes the parser (not under my control) to fail. I'd like to add a stage of pre-validating the data for UTF-8 well-formedness, but I've not yet found a utility to help do this. There's a web service at W3C which appears to be dead, an...
stackexchange/codereview
I have a Flex application where I'm using a Canvas to contain several other components. On that Canvas there is a Button which is used to invoke a particular flow through the system. Clicking anywhere else on the Canvas should cause cause a details pane to appear showing more information about the record represented ...
stackexchange/codereview
I need to determine the current year in Java as an integer. I could just use java.util.Date(), but it is deprecated.
stackexchange/codereview
I installed mediawiki on my server as my personal knowledge base. Sometimes I copy some stuff from Web and paste to my wiki - such as tips & tricks from somebody's blog. How do I make the copied content appear in a box with border? For example, the box at the end of this blog post looks pretty nice: http://blog.dreamho...
stackexchange/codereview
Since AS3 does not allow private constructors, it seems the only way to construct a singleton and guarantee the constructor isn't explicitly created via "new" is to pass a single parameter and check it. I've heard two recommendations, one is to check the caller and ensure it's the static getInstance(), and the other is...
stackexchange/codereview
I have been getting an error in VB .Net object reference not set to an instance of object. Can you tell me what are the causes of this error ?
stackexchange/codereview
Not sure how to ask a followup on SO, but this is in reference to an earlier question: Fetch one row per account id from list The query I'm working with is: SELECT * FROM scores s1 WHERE accountid NOT IN (SELECT accountid FROM scores s2 WHERE s1.score < s2.score) ORDER BY score DESC This selects the top scores, and li...
stackexchange/codereview
There is an interesting post over here about this, in relation to cross-application flow of control. Well, recently, I've come across an interesting problem. Generating the nth value in a potentially (practically) endless recursive sequence. This particular algorithm WILL be in atleast 10-15 stack references deep at t...
stackexchange/codereview
We're developing a windows mobile 6.1 application and would like to make the user interface look better than the standard battleship grey. Has anyone had any experience with 3rd party controls that can make a windows mobile app look like a WPF/Silverlight/Iphone - like interface?
stackexchange/codereview
I'm trying to create a Crystal Reports formula field (to calculate the percentage change in a price) that will return "N/A" if a particular report field is null, but return a number to two decimal places using accounting format (negative numbers surrounded by parentheses) if it is not. The closest I have been able to m...
stackexchange/codereview
I have a bunch of java files from which I want to remove the javadoc lines with the license [am changing it on my code]. The pattern I am looking for is ^\* \* ProjectName .* USA\.$ but matched across lines Is there a way sed [or a commonly used editor in Windows/Linux] can do a search/replace for a multiline pattern?...
stackexchange/codereview
I'd like to be able to do some drawing to the right of the menu bar, in the nonclient area of a window. Is this possible, using C++ / MFC?
stackexchange/codereview
Obviously the Java API reference, but what else is there that you all use? I've been doing web development my entire career. Lately I've been messing around a lot with Groovy and I've decided to do a small application in Griffon just to experiment more with Groovy and also break some ground in desktop development. ...
stackexchange/codereview
When reading some answers to aquestion on clearing cache for JS files, somebody pointed to this part of the http spec. It basically says that URLS containing a ? should not be pulled from the cache, unless a specific expiry date is given. How do query string absent URLs which are so common with MVC websites (RoR, ASP...
stackexchange/codereview
I've read numerous posts about people having problems with viewWillAppear when you do not create your view hierarchy just right. My problem is I can't figure out what that means. If I create a RootViewController and call addSubView on that controller, I would expect the added view(s) to be wired up for viewWillAppear e...
stackexchange/codereview
I've started figuring out drupal, and so far most of the results are just ugly. May be I need to learn it in something similar to a real-life project. I thought — to reproduce this site's functionality might be a good learning project. But I need help. :) Without assuming this site is based on drupal (it most likely is...
stackexchange/codereview
The Date object in JavaScript performs differently machine to machine and browser to browser in respect to the function's resolution in milliseconds. I've found most machines have a resolution of about 16 ms on IE, where Chrome or Firefox may have a resolution as good as 1ms. Is there another function available to Jav...
stackexchange/codereview
I would like to create a copy of a database with approximately 40 InnoDB tables and around 1.5GB of data with mysqldump and MySQL 5.1. What are the best parameters (ie: --single-transaction) that will result in the quickest dump and load of the data? As well, when loading the data into the second DB, is it quicker to: ...
stackexchange/codereview
Please excuse the vague title. If anyone has a suggestion, please let me know! Also please retag with more appropriate tags! The Problem I want to have an instance of an imported class be able to view things in the scope (globals, locals) of the importer. Since I'm not sure of the exact mechanism at work here, I can...
stackexchange/codereview
I have created an end user model and deployed it. Any report that I create and run gives me an error: Report execution error The report might not be valid or the server could not process the data. Semantic query execution failed. Invalid column name 'rowguid'. Query execution failed for data set 'dataSet'. An error ha...
stackexchange/codereview
I am coming from Java and am currently working on a C# project. What is the recommended way to go about a) unit testing existing C# code and b) accomplishing TDD for C# development? Also is there an equivalent to EMMA / EclEmma (free yet powerful code coverage tool) for Visual Studio and C# code?
stackexchange/codereview
Im calling a locally hosted wcf service from silverlight and I get the exception below. Iv created a clientaccesspolicy.xml, which is situated in the route of my host. <?xml version="1.0" encoding="utf-8"?> <access-policy> <cross-domain-access> <policy> <allow-from http-request-headers="*"> <domain ...
stackexchange/codereview
I'm trying to use a link to open an overlay instead of in a separate popup window. This overlay should consist of a semi-transparent div layer that blocks the whole screen from being clicked on. I also aim to disable scrolling at this point. Not matter where you are on the main page, when the link is clicked, the overl...
stackexchange/codereview
I was curious if anyone had any problems creating unit tests around using the ResourceManager. I am using Visual Studio test edition and it appears that the satellite assemblies don't get loaded during the test. When I try to get a resource for another culture, the test always fails and the resource manager always fa...
stackexchange/codereview
Seeing as Java doesn't have nullable types, nor does it have a TryParse(), how do you handle input validation without throwing an exceptions? The usual way: String userdata = /*value from gui*/ int val; try { val = Integer.parseInt(userdata); } catch (NumberFormatException nfe) { // bad data - set to sentinel ...
stackexchange/codereview
I'm trying to figure out how to decide when to use NSDictionary or NSCoder/NSCoding? It seems that for general property lists and such that NSDictionary is the easy way to go that generates XML files that are easily editable outside of the application. When dealing with custom classes that holds data or possibly other ...
stackexchange/codereview