instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I'm trying to add an SVN repository to Eclipse. I've installed Subclipse, and it seems to be working fine. But, when I try to "add a new SVN repository", I input this, for example: http://svn.python.org/projects/peps/trunk I get this: Error validating location: "org.tigris.subversion.javahl.ClientException: RA layer ...
stackexchange/codereview
In Delphi, I want to be able to create an private object that's associated with a class, and access it from all instances of that class. In Java, I'd use: public class MyObject { private static final MySharedObject mySharedObjectInstance = new MySharedObject(); } Or, if MySharedObject needed more complicated init...
stackexchange/codereview
How do I perform a reverse DNS lookup, that is how do I resolve an IP address to its DNS hostname in Perl?
stackexchange/codereview
Suppose I have: Toby Tiny Tory Tily Is there an algorithm that can easily create a list of common characters in the same positions in all these strings? (in this case the common characters are 'T' at position 0 and 'y' at position 3) I tried looking at some of the algorithms used for DNA sequence matching but it see...
stackexchange/codereview
Is there a way to get the tests inside of a TestCase to run in a certain order? For example, I want to separate the life cycle of an object from creation to use to destruction but I need to make sure that the object is set up first before I run the other tests.
stackexchange/codereview
Consider this problem: I have a program which should fetch (let's say) 100 records from a database, and then for each one it should get updated information from a web service. There are two ways to introduce parallelism in this scenario: I start each request to the web service on a new Thread. The number of simultaneo...
stackexchange/codereview
Which is more efficient for the compiler and the best practice for checking whether a string is blank? Checking whether the length of the string == 0 Checking whether the string is empty (strVar == "") Also, does the answer depend on language?
stackexchange/codereview
First time working with UpdatePanels in .NET. I have an updatepanel with a trigger pointed to an event on a FormView control. The UpdatePanel holds a ListView with related data from a separate database. When the UpdatePanel refreshes, it needs values from the FormView control so that on the server it can use them to q...
stackexchange/codereview
Is there an effective tool to convert C# code to Java code?
stackexchange/codereview
I have recently written an application(vb.net) that stores and allows searching for old council plans. Now while the application works well, the other day I was having a look at the routine that I use to generate the SQL string to pass the database and frankly, it was bad. I was just posting a question here to see if ...
stackexchange/codereview
Why does the following code sometimes causes an Exception with the contents "CLIPBRD_E_CANT_OPEN": Clipboard.SetText(str); This usually occurs the first time the Clipboard is used in the application and not after that.
stackexchange/codereview
I have to read data from some files and insert the data into different tables in a database. Is Unix shell script powerful enough to do the job? Is it easy to do the job in shell script or should I go about doing this in Java?
stackexchange/codereview
I have 16,000 jpg's from a webcan screeb grabber that I let run for a year pointing into the back year. I want to find a way to grab every 4th image so that I can then put them into another directory so I can later turn them into a movie. Is there a simple bash script or other way under linux that I can do this. They a...
stackexchange/codereview
How do I find out which process is listening on a TCP or UDP port on Windows?
stackexchange/codereview
Simply, are there any Java Developer specific Linux distros?
stackexchange/codereview
What does the option “convert to web application” do if I select it in visual studio? If I do convert my site to a web application what are the advantages? Can I go back?
stackexchange/codereview
As you may know, Silverlight does not have the TileBrush found in WPF. Is there a workaround to do tiling?
stackexchange/codereview
I'm working on a small templating engine, and I'm using DOMDocument to parse the pages. My test page so far looks like this: <block name="content"> <?php echo 'this is some rendered PHP! <br />' ?> <p>Main column of <span>content</span></p> </block> And part of my class looks like this: private function parse...
stackexchange/codereview
Is there an incantation of mysqldump or a similar tool that will produce a piece of SQL2003 code to create and fill the same databases in an arbitrary SQL2003 compliant RDBMS? (The one I'm trying right now is MonetDB)
stackexchange/codereview
I have a rather large file (150 million lines of 10 chars). I need to split it in 150 files of 2 million lines, with each output line being alternatively the first 5 characters or the last 5 characters of the source line. I could do this in Perl rather quickly, but I was wondering if there was an easy solution using ba...
stackexchange/codereview
Problem My current project requires me to do different things based on different HTTP request headers for nearly every action. Currently, I have one massive Controller (all for the same resource type), and every action method has an ActionName attribute (so that I can have multiple versions of the same action that take...
stackexchange/codereview
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) Hello I a...
stackexchange/codereview
As a programmer I have no idea how one would go about programming menus for a DVD, I have heard that this is possible, and even seen basic games using DVD menus - although it may very well be a closed-system. Is it even possible and if so, what language, compilers etc exist for this?
stackexchange/codereview
Do you know where I could find some useful third party (free) code snippets for VS 2008?
stackexchange/codereview
I was given a C++ project that was compiled using MS Visual Studio .net 2003 C++ compiler, and a .mak file that was used to compile it. I am able to build it from the command line using nmake project.mak, but the compiler complains that afxres.h was not found. I did a little searching around and the afxres.h is in th...
stackexchange/codereview
I didn't see the option to point the workspace (or it's VS equivalent, I'm still learning the terminology for Visual Studio, but it is called a workspace in Eclipse) to My Documents/Programming instead of -- well -- wherever it is now.
stackexchange/codereview
How do you use gen_udp in Erlang to do multicasting? I know its in the code, there is just no documentation behind it. Sending out data is obvious and simple. I was wondering on how to add memberships. Not only adding memberships at start-up, but adding memberships while running would be useful too.
stackexchange/codereview
In SQL Server 2005, a snapshot of a database can be created that allows read-only access to a database, even when the database is in "recovery pending" mode. One use case for this capability is in creating a reporting database that references a copy of a production database, which is kept current through log-shipping...
stackexchange/codereview
What would be the best way to do an scp or sftp copy in a Unix environment using C? I'm interested in knowing the best library to use and an example if at all possible. I'm working on a Solaris server with the Sun tools installed.
stackexchange/codereview
I have a report in Reporting services, and when I preview it, the headers for a table wrap, but when I export it to Excel, the don't. They just get cut off. Any ideas on how to force it to wrap when I export to Excel?
stackexchange/codereview
I have a strange problem with my cake (cake_1.2.0.7296-rc2). My start()-action runs twice, under certain circumstances, even though only one request is made. The triggers seem to be : - loading an object like: $this->Questionnaire->read(null, $questionnaire_id); - accessing $this-data If I disable the call to loadAver...
stackexchange/codereview
I want to be able to view a SQL Server 2005 Reporting Services report from an ASP.NET application in a DMZ through a ReportViewer control. The SQLand SSRS server are behind the firewall.
stackexchange/codereview
I need to execute a directory copy upon a user action, but the directories are quite large, so I would like to be able to perform such an action without the user being aware of the time it takes for the copy to complete. Any suggestions would be much appreciated.
stackexchange/codereview
I'm working on a utility which needs to resolve hex addresses to a symbolic function name and source code line number within a binary. The utility will run on Linux on x86, though the binaries it analyzes will be for a MIPS-based embedded system. The MIPS binaries are in ELF format, using DWARF for the symbolic debuggi...
stackexchange/codereview
I run an ASP.NET website solution with a few other projects in it. I've known that MSBuild projects are capable of this, but is it the best way? Are they easy to create? Is nAnt, CruiseControl.NET or any other solution better? When I build the site (using Web Deployment Projects), can I automate part of the build so th...
stackexchange/codereview
I'm looking for secure ways to pass data between a client running Flash and a server. The data in question will be generated BY the Flash app, which in this case is your score after finishing a game. I want to verify the data is untampered on the server. What are some good methods of getting this done? One simple wa...
stackexchange/codereview
Our (beloved) designer keeps creating PNG files with transparent backgrounds for use in our applications. I'd like to make sure that this feature of the PNG works in "older" browsers as well. What's the best solution? edits below @mabwi & @syd - Whether or not I agree about the use of a PNG is not the point. This is a ...
stackexchange/codereview
I've kept up to date with new features in the C# language as it's moved from version 1 through version 3. I haven't done such a good job keeping up to date with ASP.NET. I feel like some of the post version 1 features are not so good (e.g. the AJAX framework) or are just not that useful to me (e.g. the membership fra...
stackexchange/codereview
I am trying to create a rather simple effect on a set of images. When an image doesn't have the mouse over it, I'd like it to have a simple, gray border. When it does have an image over it, I'd like it to have a different, "selected", border. The following CSS works great in Firefox: .myImage a img { border: 1px ...
stackexchange/codereview
I am calling a vendor's Java API, and on some servers it appears that the JVM goes into a low priority polling loop after logging into the API (CPU at 100% usage). The same app on other servers does not exhibit this behavior. This happens on WebSphere and Tomcat. The environment is tricky to set up so it is difficult...
stackexchange/codereview
Is it in best interests of the software development industry for one framework, browser or language to win the war and become the de facto standard? On one side it takes away the challenges of cross platform, but it opens it up for a single point of failure. Would it also result in a stagnation of innovation, or woul...
stackexchange/codereview
I'm using SQL Server 2000 to print out some values from a table using PRINT. With most non-string data, I can cast to nvarchar to be able to print it, but binary values attempt to convert using the bit representation of characters. For example: DECLARE @binvalue binary(4) SET @binvalue = 0x12345678 PRINT CAST(@binval...
stackexchange/codereview
ASP.NET 1.1 - I have a DataGrid on an ASPX page that is databound and displays a value within a textbox. The user is able to change this value, then click on a button where the code behind basically iterates through each DataGridItem in the grid, does a FindControl for the ID of the textbox then assigns the .Text value...
stackexchange/codereview
How do I multiply 10 to an Integer object and get back the Integer object? I am looking for the neatest way of doing this. I would probably do it this way: Get int from Integer object, multiply it with the other int and create another Integer object with this int value. Code will be something like ... integerObj = new...
stackexchange/codereview
Can a (||any) proxy server cache content that is requested by a client over https? As the proxy server can't see the querystring, or the http headers, I reckon they can't. I'm considering a desktop application, run by a number of people behind their companies proxy. This application may access services across the inter...
stackexchange/codereview
Haven't fired up reflector to look at the difference but would one expect to see the exact same compiled code when comparing Func<T, bool> vs. Predicate<T> I would imagine there is no difference as both take a generic parameter and return bool?
stackexchange/codereview
When using the app_offline.htm feature of ASP.NET, it only allows html, but no images. Is there a way to get images to display without having to point them to a different url on another site?
stackexchange/codereview
I just finished setting up an out-of-place build system for our existing C++ code using inherited property sheets, a feature that seems to be specific to the Visual C++ product. Building out-of-place requires that many of the project settings be changed, and the inherited property sheets allowed me to change all the ne...
stackexchange/codereview
How do you set the Windows time zone on the local machine programmatically in C#? Using an interactive tool is not an option because the remote units have no user interface or users. The remote machine is running .NET 2.0 and Windows XP Embedded and a local app that communicates with a central server (via web service...
stackexchange/codereview
Does anybody have experience working with PHP accelerators such as MMCache or Zend Accelerator? I'd like to know if using either of these makes PHP comparable to faster web-technologies. Also, are there trade offs for using these?
stackexchange/codereview
Lucene has quite poor support for Russian language. RussianAnalyzer (part of lucene-contrib) is of very low quality. RussianStemmer module for Snowball is even worse. It does not recognize Russian text in Unicode strings, apparently assuming that some bizarre mix of Unicode and KOI8-R must be used instead. Do you know ...
stackexchange/codereview
I'm working on a program that will be processing files that could potentially be 100GB or more in size. The files contain sets of variable length records. I've got a first implementation up and running and am now looking towards improving performance, particularly at doing I/O more efficiently since the input file gets...
stackexchange/codereview
We have a fairly standard client/server application built using MS RPC. Both client and server are implemented in C++. The client establishes a session to the server, then makes repeated calls to it over a period of time before finally closing the session. Periodically, however, especially under heavy load conditions, ...
stackexchange/codereview
I'm using markdown to edit this question right now. In some wikis I used wiki markup. Are they the same thing? Are they related? Please explain. If I want to implement one or the other in a web project (like stackoverflow) what do I need to use?
stackexchange/codereview
I currently use AnkhSVN to integrate subversion into Visual Studio. Is there any reason I should switch to VisualSVN? AnkhSVN is free (in more than one sense of the word) while VisualSVN costs $50. So right there unless I'm missing some great feature of VisualSVN I don't see any reason to switch.
stackexchange/codereview
I do some minor programming and web work for a local community college. Work that includes maintaining a very large and soul destroying website that consists of a hodge podge of VBScript, javascript, Dreamweaver generated cruft and a collection of add-ons that various conmen have convinced them to buy over the years. ...
stackexchange/codereview
What is the best solution of defaultButton and "Enter key pressed" for ASP.NET 2.0-3.5 forms?
stackexchange/codereview
After cleaning a folder full of HTML files with TIDY, how can the tables content be extracted for further processing?
stackexchange/codereview
I have an image (mx) and i want to get the uint of the pixel that was clicked. Any ideas?
stackexchange/codereview
What is the difference between publishing a website with visual studio and just copying the files over to the server? Is the only difference that the publish files are pre-compiled?
stackexchange/codereview
Mapping a collection of enums with NHibernate Specifically, using Attributes for the mappings. Currently I have this working mapping the collection as type Int32 and NH seems to take care of it, but it's not exactly ideal. The error I receive is "Unable to determine type" when trying to map the collection as of the typ...
stackexchange/codereview
When should I not use the ThreadPool in .Net? It looks like the best option is to use a ThreadPool, in which case, why is it not the only option? What are your experiences around this?
stackexchange/codereview
Say you have 2 database servers, one database is the 'master' database where all write operations are performed, it is treated as the 'real/original' database. The other server's database is to be a mirror copy of the master database (slave?), which will be used for read only operations for a certain part of the appli...
stackexchange/codereview
Is there a Windows equivalent of the Unix command, nice? I'm specifically looking for something I can use at the command line, and not the "Set Priority" menu from the task manager. My attempts at finding this on Google have been thwarted by those who can't come up with better adjectives.
stackexchange/codereview
A few months back my team switched our source control over to Apache Subversion from Visual SourceSafe, and we haven't been happier. Recently I've been looking at Team Foundation Server, and at least on the surface, it seems very impressive. There is some great integration with Visual Studio, and lots of great tools...
stackexchange/codereview
Is there a preferred way to handle animation when using Flex -- For instance, if I want to render a ball and bounce it around the screen?
stackexchange/codereview
I'm looking for a wordpress-like blog interface to put inside a Joomla hosted site. The admin interface of Joomla is quirky enough and hard enough to use that daily updates are infeasible. What I am looking for is an easy-to-use posting interface that supports multiple users with different accounts/names, a tagging ...
stackexchange/codereview
In a C# .NET 3.5 app (a mix of WinForms and WPF) I want to let the user select a folder to import a load of data from. At the moment, it's using System.Windows.Forms.FolderBrowserDialog but that's a bit lame. Mainly because you can't type the path into it (so you need to map a network drive, instead of typing a UNC pat...
stackexchange/codereview
I'm building a website that requires very basic markup capabilities. I can't use any 3rd party plugins, so I just need a simple way to convert markup to HTML. I might have a total of 3 tags that I'll allow. What is the best way to convert ==Heading== to <h2>Heading</h2>, or --bold-- to <b>bold</b>? Can this be done sim...
stackexchange/codereview
I love the ease that the ASP.NET Ajax control Toolkit provides to ASP.NET developers. However, I've not found it to be a scalable solution at all. I have a page with 2 date input fields. By putting a TextBox and an CalendarExtendar control attached to it for each date field, I get several (11, in fact) external Javascr...
stackexchange/codereview
I am new to developing for Office Forms Server / MOSS 2007. I have to choose between designing my web-based forms and writing code for them in Visual Studio Tools for Applications (aka VSTA) or Visual Studio Tools for Office (aka VSTO). VSTA is included free as part of the license for InfoPath 2007; VSTO, also free, ...
stackexchange/codereview
I have table inside a div tab. The table has 40 rows in it and the div's height is set to show 10 rows of that table. CSS's overflow:auto lets me scroll through the 40 rows. All is well there. How can I, with JavaScript cause the table to programatically position to a given row (i.e., programmatically scroll the table...
stackexchange/codereview
I have a piece of server-ish software written in Java to run on Windows and OS X. (It is not running on a server, but just a normal user's PC - something like a torrent client.) I would like the software to signal to the OS to keep the machine awake (prevent it from going into sleep mode) while it is active. Of course ...
stackexchange/codereview
I'd like to use a LinqDataSource control on a page and limit the amount of records returned. I know if I use code behind I could do something like this: IEnumerable<int> values = Enumerable.Range(0, 10); IEnumerable<int> take3 = values.Take(3); Does anyone know if something like this is possible with a LinqDataSource...
stackexchange/codereview
Is there a trivial, or at least moderately straight-forward way to generate territory maps (e.g. Risk)? I have looked in the past and the best I could find were vague references to Voronoi diagrams. An example of a Voronoi diagram is this: . These hold promise, but I guess i haven't seen any straight-forward ways of r...
stackexchange/codereview
I'm looking around for a Java code signing certificate so my Java applets don't throw up such scary security warnings. However, all the places I've found offering them charge (in my opinion) way too much, like over USD200 per year. While doing research, a code signing certificate seems almost exactly the same as an SSL...
stackexchange/codereview
I have a cross platform app and for my Linux and Mac versions it generates a postscript file for printing reports and then prints them with CUPS. It works for simple characters and images but I would like to have the ability to embed a true type font directly into the postscript file. Does anyone know how to do this?? ...
stackexchange/codereview
I have an xslt sheet with some text similar to below: <xsl:text>I am some text, and I want to be bold</xsl:text> I would like some text to be bold, but this doesn't work. <xsl:text>I am some text, and I want to be <strong>bold<strong></xsl:text> The deprecated b tag doesn't work either. How do I format text within an...
stackexchange/codereview
any idea how if the following is possible in PHP as a single line ?: <?php $firstElement = functionThatReturnsAnArray()[0]; ... It doesn't seem to 'take'. I need to do this as a 2-stepper: <?php $allElements = functionThatReturnsAnArray(); $firstElement = $allElements[0]; ... just curious - other languages I play wit...
stackexchange/codereview
I need to validate an XML string (and not a file) against a DTD description file. How can that be done in python?
stackexchange/codereview
The product we are working on allows the user to easily set it up to run automatically whenever the computer is started. This is helpful because the product is part of the basic work environment of most of our users. This feature was implemented not so long ago and for a while all was well, but when we started testing ...
stackexchange/codereview
Ok, I've run across my first StackOverflowError since joining this site, I figured this is a must post :-). My environment is Seam 2.0.1.GA, JBoss 4.2.2.GA and I'm using JSF. I am in the process of converting from a facelets view to JSP to take advantage of some existing JSP tags used on our existing site. I chang...
stackexchange/codereview
By default IntelliJ IDEA 7.0.4 seems to use 4 spaces for indentation in XML files. The project I'm working on uses 2 spaces as indentation in all it's XML. Is there a way to configure the indentation in IntelliJ's editor?
stackexchange/codereview
I develop an extension module for Guile, written in C. This extension module embeds a Python interpreter. Since this extension module invokes the Python interpreter, I need to verify that it properly manages the memory occupied by Python objects. I found that the Python interpreter is well-behaved in its own memory ...
stackexchange/codereview
More specifically I am trying to make the mailto component show within my template; the same way as an article does. By default the mailto component opens in a new window. So far I changed the code so it opens on the same window, but that way the whole template is gone. Any suggestions?
stackexchange/codereview
I'm a front-end developer and I was looking for opinions about the best all-round online documentation for javascript/css/html/xhtml/dom/browser quirks and support. I've tried Sitepoint, Quirksmode, W3Schools but all of these seem to be lacking in certain aspects and have been using them in combination.
stackexchange/codereview
Struts 1.3 application. Main website is NOT served by struts/Java. I need to forward the result of a struts action to a page in the website, that is outside of the struts context. Currently, I forward to a JSP in context and use a meta-refresh to forward to the real location. That seems kinda sucky. Is there a bet...
stackexchange/codereview
I have a few scripts on a site I recently started maintaining. I get those Object Not Found errors in IE6 (which Firefox fails to report in its Error Console?). What's the best way to debug these- any good cross-browser-compatible IDEs, or javascript debugging libraries of some sort?
stackexchange/codereview
What is the single most effective practice to prevent arithmetic overflow and underflow? Some examples that come to mind are: testing based on valid input ranges validation using formal methods use of invariants detection at runtime using language features or libraries (this does not prevent it)
stackexchange/codereview
Current code opens up an Outlook Calendar database as follow: my $outlook = Win32::OLE->GetActiveObject('Outlook.Application') || Win32::OLE->new('Outlook.Application', 'Quit'); my $namespace = $outlook->GetNamespace("MAPI"); ## only fetch entries from Jan 1, 2007 onwards my $restrictDates = "[Start] >= '01/01/2007'"...
stackexchange/codereview
Trying to make a make generic select "control" that I can dynamically add elements to, but I am having trouble getting functions to work right. This is what I started with. $select = $("<select></select>"); $select.addOption = function(value,text){ $(this).append($("<option></option>").val(value).text(text)); }; Thi...
stackexchange/codereview
Does anyone know of a web based IDE (Like VS, Eclipse, IDEA)? Besides ECCO?
stackexchange/codereview
I'm looking for a way to check within pageLoad() if this method is raised during load event because of a postback/async postback or because of being loaded and access the first time. This is similar to Page.IsPostback property within code behind page. TIA, Ricky
stackexchange/codereview
I am having problems manually looping through xml data that is received via an HTTPService call, the xml looks something like this: <DataTable> <Row> <text>foo</text> </Row> <Row> <text>bar</text> </Row> </DataTable> When the webservice result event is fired I do something like this: f...
stackexchange/codereview
When I run this code the selected item is not visible. I've already tried to run it in a separate thread with no luck. import javax.swing.JFrame; import java.awt.Container; import javax.swing.JList; import javax.swing.ListSelectionModel; import javax.swing.JScrollPane; import java.awt.Dimension; public class ScrollLi...
stackexchange/codereview
MSDN says that you should use structs when you need lightweight objects. Are there any other scenarios when a struct is preferable over a class? Some people might have forgotten that: structs can have methods. structs cannot be inherited. I understand the technical differences between structs and classes, I just don'...
stackexchange/codereview
I'd like to take some time to learn more about dynamic languages built on top of the DLR and I'm not sure which language would be better to learn. Having limited time, I really only have time to look learn one of them. Any opinions on which of the two (Iron Ruby or Iron Python) would be more useful in the long run?
stackexchange/codereview
What's the best way to get user input in a C program where the choices are of a limited number? Say for example the choices are: A) Print the list. B) Add 99 to the end of the list. C) Delete all duplicates. 5) Reset 5 times. Entering "A" and then Enter is OK. Or, just a single keystroke would work as well.
stackexchange/codereview
I am using sp_send_dbmail in SQL2005 to send an email with the results in an attachment. When the attachment is sent it is UCS-2 Encoded, I want it to be ANSI or UTF-8. Here is the SQL EXEC msdb.dbo.sp_send_dbmail @recipients = 'temp@example.com' , @query = 'DECLARE @string_to_trim varchar(60);SET @string_to_tr...
stackexchange/codereview
When opening Adobe Acrobat Pro, whether it be through Applescript or finder, the introductory dialog is shown. Is there a way to not show this dialog without already having checked the "Don't Show Again" option when opening a document using Applescript? Photoshop and Illustrator Applescript libraries have ways of se...
stackexchange/codereview