instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I have a side project I do = in Java. It's a pretty straight-forward webapp. It runs in Tomcat on a Linux Server and uses a MySQL database. The majority of the code was written with the Spring Framework. It has a lot of Unit Tests in place. When I'm coding it's in Eclipse. When I deploy the application I run a few sh...
stackexchange/codereview
I am looking for a library that will allow me to look up the status of a windows service to verify that the service is started and running. I looked into the Sigar library, but it is GPL and therefor I cannot use it. A Commercial or BSD(ish) license is required as this will be bundled into commercial software.
stackexchange/codereview
In Java, web apps are bundled in to WARs. By default, many servlet containers will use the WAR name as the context name for the application. Thus myapp.war gets deployed to http://example.com/myapp. The problem is that the webapp considers its "root" to be, well, "root", or simply "/", whereas HTML would consider the r...
stackexchange/codereview
PHP, as we all know is very loosely typed. The language does not require you to specify any kind of type for function parameters or class variables. This can be a powerful feature. Sometimes though, it can make debugging your script a painful experience. For example, passing one kind of object into a method that expect...
stackexchange/codereview
I need to install amp on a windows2003 production server. I'd like, if possible, an integrated install/management tool so I don't have to install/integrate the components of amp separately. Those that I've found are 'development' servers. Are there any packages out there that install amp in a production ready (locked d...
stackexchange/codereview
What are the advantages and limitations of dynamic type languages compared to static type languages? See also: whats with the love of dynamic languages (a far more argumentative thread...)
stackexchange/codereview
I come across this problem when i am writing an event handler in SharePoint. My event handler has a web reference. When i create this web reference, the URL of the web service will be added in the .config file of the assembly. If i have to change the web reference URL i just have to change the link in the config file. ...
stackexchange/codereview
I am using C# to process a message in my Outlook inbox that contains attachments. One of the attachments is of type olEmbeddeditem. I need to be able to process the contents of that attachment. From what I can tell I need to save the attachment to disk and use CreateItemFromTemplate which would return an object. T...
stackexchange/codereview
I've tried this, but get a ClassNotFoundException when calling: Class.forName("com.AClass", false, mySpecialLoader)
stackexchange/codereview
EDIT TO IMPROVE CLARITY Scrum suggests that you split your development into a number of sprints. Each sprint being a fixed duration. At the end of each sprint you ask the client if you should release the software. If they say yes, you perform a Release Sprint, during which you do all the tasks that you woud like to do ...
stackexchange/codereview
I first got an error usign the code below, explaining that "DataGridLinkButton' must be placed inside a form tag with runat=server." Now I've tried setting AllowSorting to false, as well as removing the sort expression from each column, with the same error. Then I tried creating a new, plain, DataGrid, with the same d...
stackexchange/codereview
I want to programmatically edit file content using windows command line (cmd.exe). In *nix there is sed for this tasks. Are there any useful native equivalents (cmd or ps) in windows?
stackexchange/codereview
I have been trying to follow the guidelines in this Microsoft article to authenticate against Apache with Kerberos and AD. I have successfully tested the communication between the apache server and the AD server with kinit. However when I attempt to access a restricted page on the server with IE I get an Internal serv...
stackexchange/codereview
I'm failing at finding the commands I need to send to authenticate to a SMTP server using NTLM. I think it goes something like: AUTH NTLM <bae64encode something> 334 <bae64encode something> 235
stackexchange/codereview
Does anyone have any experience with any COTS systems for managing workshops and the associated registrations, courses, communications, etc.? We have a home-built Perl system that is about 8 years old and is currently embedded as an iframe in a SharePoint portal site (externally facing). Needless to say, it isn't integ...
stackexchange/codereview
I am writing a custom maven2 MOJO. I need to access the runtime configuration of another plugin, from this MOJO. What is the best way to do this?
stackexchange/codereview
I've seen several question on here about exceptions, and some of them hint at interrupts as exceptions, but none make the connection clear. What is an interrupt? What is an exception? (please explain what exceptions are for each language you know, as there are some differences) When is an exception an interrupt and vi...
stackexchange/codereview
The question posed came about during a 2nd Year Comp Science lecture while discussing the impossibility of generating numbers in a deterministic computational device. This was the only suggestion which didn't depend on non-commodity-class hardware. Subsequently nobody would put their reputation on the line to argue def...
stackexchange/codereview
I have a class that defines the names of various constants, e.g. class Constants { public static final String ATTR_CURRENT_USER = "current.user"; } I would like to use these constants within a JSP without using Scriptlet code such as: <%@ page import="com.example.Constants" %> <%= Constants.ATTR_CURRENT_USER %> T...
stackexchange/codereview
Outlook saves its client-side rule definitions in a binary blob in a hidden message in the Inbox folder of the default store for a profile. The hidden message is named "Outlook Rules Organizer" with a message class IPM.RuleOrganizer. The binary blob is saved in property 0x6802. The same binary blob is written to the ex...
stackexchange/codereview
How do I exit a script early, like the die() command in PHP?
stackexchange/codereview
I'm looking for an answer in MS VC++. When debugging a large C++ application, which unfortunately has a very extensive usage of C++ exceptions. Sometimes I catch an exception a little later than I actually want. Example in pseudo code: FunctionB() { ... throw e; ... } FunctionA() { ... FunctionB() ...
stackexchange/codereview
I have code that references a web service, and I'd like the address of that web service to be dynamic (read from a database, config file, etc.) so that it is easily changed. One major use of this will be to deploy to multiple environments where machine names and IP addresses are different. The web service signature w...
stackexchange/codereview
Not sure if this is possible or if I'm expressing correctly what I'm looking for, but I have the following piece of code in my library repeatedly and would like to practice some DRY. I have set of SQL Server tables that I'm querying based on a simple user-supplied search field ala Google. I'm using LINQ to compose the...
stackexchange/codereview
I produce a report as an CSV file. When I try to open the file in Excel, it makes an assumption about the data type based on the contents of the cell, and reformats it accordingly. For example, if the CSV file contains ...,005,... Then Excel shows it as 5. Is there a way to override this and display 005? I would prefe...
stackexchange/codereview
I'm using browser automation for testing web sites but I need to verify HTTP requests from the browser (i.e., images, external scripts, XmlHttpRequest objects). Is there a way to programmatically instantiate a proxy for the browser to use in order to see what its sending? I'm already using Fiddler to watch the traffic ...
stackexchange/codereview
A couple of months ago I've coded a tiny tool that we needed at work for a specific task, and I've decided to share it on CodePlex. It's written in C# and honestly it's not big deal but since it's the first project I've ever built from scratch in that language and with the goal of opening it from the very beginning, on...
stackexchange/codereview
Is there a way to use MS WF interactively in ASPNET MVC?
stackexchange/codereview
I got pretty big webflow definition, which I do not want to copy/paste for reusing. There are references to action bean in XML, which is kind natural. I want to use same flow definiton twice: second time with actions configured differently (inject different implementation of service to it). Is there easy way to do thi...
stackexchange/codereview
I'm running the java cocoon 2 and castor oql. I'm trying to filter my oql query by today's date, but I can't seem to figure out (or find in google) the syntax of the date. The database is mySql, but the oql is mapped by the java classes... so doing a search on field_date >= Now() doesn't work. Any ideas? I really ca...
stackexchange/codereview
What are some good tools and techniques for making in game UI? I'm looking for things that help artists-types create and animate game HUD (heads up display) UI and can be added to the game engine for real time playback.
stackexchange/codereview
Here is a snippet of CSS that I need explained: #section { width: 860px; background: url(/blah.png); position: absolute; top: 0; left: 50%; margin-left: -445px; } Ok so it's absolute positioning of an image, obviously. top is like padding from the top, right? what does left 50% do? why is the ...
stackexchange/codereview
I'm teaching/helping a student to program. I remember the following process always helped me when I started; It looks pretty intuitive and I wonder if someone else have had a similar approach. Read the problem and understand it ( of course ) . Identify possible "functions" and variables. Write how would I do it step b...
stackexchange/codereview
I want to take the url: http://www.mydomain.com/signup-12345 And actually give them: http://www.mydomain.com/signup/?aff=12345 I have NO history with mod_rewrite, HELP!
stackexchange/codereview
Moved from preview 2 to preview 5 and now my Html.ActionLink calls are all failing. It appears that the generic version has been replaced with a non-type safe version. // used to work <li> <%= Html.ActionLink<HomeController>(c => c.Index(), "Home")%> </li> // what appears I can only do now <li> <%= Html.ActionLink...
stackexchange/codereview
What is a "table-driven method"? As mentioned by Bill Gates in the second Windows Vista commercial at 1:05.
stackexchange/codereview
We've got a Java server application that runs on a number of computers, all connected to the Internet, some behind firewalls. We need to remotely update the JAR files and startup scripts from a central site, with no noticeable interruption to the app itself. The process has to be unattended and foolproof (i.e. we can't...
stackexchange/codereview
I'm porting a C++ 32 bit application to 64 bit on windows. The application is a client of IBM WebSphere MQ. It uses the MQ client API. Now, as the port progresses, I'm trying to find a 64 bit client. So far, no luck. Does anyone here happen to know if where I can find one or confirm that there isn't one?
stackexchange/codereview
Objective: use the standard Win32 MonthCal control, and paint days such as holidays in RED. It seems like the Win32's native approach would be use the MCN_GETDAYSTATE notification, which seems to allow only painting specific days in Bold. Possible (but declined) solution would be to write my own painted-at-will MonthCa...
stackexchange/codereview
How could I get the Fault Detail sent by a SoapFaultClientException ? I use a WebServiceTemplate as shown below : WebServiceTemplate ws = new WebServiceTemplate(); ws.setMarshaller(client.getMarshaller()); ws.setUnmarshaller(client.getUnMarshaller()); try { MyResponse resp = (MyResponse) = ws.marshalSendAndReceive(...
stackexchange/codereview
I am using gsoap to create a soap server in C++. Messages are routed through a bus written in Java. Both the server and the bus are multithreaded. Everything works well sending one message at a time through the system. If I start 3 clients each sending messages as fast as possible everything is fine for about 3500 mess...
stackexchange/codereview
Are there any resources which show how to create custom GnuCash reports? I don't know the intricacies of Scheme but I do know the basics of Lisp, based on tinkering with Emacs. Is there a site which lays out the API for GnuCash reports, ideally with a little explanation of Scheme as well?
stackexchange/codereview
I am currently building an internal web application used in a factory/warehouse type location. The users will be sharing a single PC between several people, so we need to have a fairly short session timeout to stop people wandering off and leaving the application logged in where someone else can come to the PC and do s...
stackexchange/codereview
Tomcat (version 5 here) stores session information in memory. When clustering this information is periodically broadcast to other servers in the cluster to keep things in sync. You can use a database store to make sessions persistant but this information is only written periodically as well and is only really used for ...
stackexchange/codereview
What are the various charting tools that are available for displaying charts on a web page using ASP.NET? I know about commercial tools such as Dundas and Infragistics. I could have "googled" this but I want to know the various tools that SO participants have used? Any free charting tools that are available are also we...
stackexchange/codereview
It seems like the methods of Ruby's Net::HTTP are all or nothing when it comes to reading the body of a web page. How can I read, say, the just the first 100 bytes of the body? I am trying to read from a content server that returns a short error message in the body of the response if the file requested isn't available...
stackexchange/codereview
I'm new to both Web Services and RMI and I wonder which is the better way to do remoting between different web applications, when these applications are all written in Java, that is when different programming languages don't matter (which would be the advantage of WS). While on the one hand I would guess that there's a...
stackexchange/codereview
So I got this question from one of the developers in my team: What is domain driven design? I could of course point to the book from Evans but is that actually an answer? How would you explain DDD in a few sentences to junior software engineers in your team?
stackexchange/codereview
I have a simple software that is made in Delphi 7, and it crashes on Vista after a while. These are totally random crashes, nothing is written in any crash log, just stops working and then Vista tries to find a solution. Does anyone have any ideas ?
stackexchange/codereview
How would a go about making a program where the user enters a string, and the program generates a list of words beginning with that string? Ex: User: "abd" Program:abdicate, abdomen, abduct... Thanks! Edit: I'm using python, but I assume that this is a fairly language-independent problem.
stackexchange/codereview
How can I start an interactive console for Perl, similar to the irb command for Ruby or python for Python?
stackexchange/codereview
Coming from J2ME programming are there any similarities that would make it easy to adapt to Android API. Or is Android API completely different from the J2ME way of programming mobile apps.
stackexchange/codereview
How can I poll disk activity in Applescript? Check to see if disk X is being read, written, or idle every N seconds and do something.
stackexchange/codereview
When I run a particular SQL script in Unix environments, I see a '^M' character at the end of each line of the SQL script as it is echoed to the command line. I don't know on which OS the SQL script was initially created. What is causing this and how do I fix it?
stackexchange/codereview
I like to use Emacs' shell mode, but it has a few deficiencies. One of those is that it's not smart enough to open a new buffer when a shell command tries to invoke an editor. For example with the environment variable VISUAL set to vim I get the following from svn propedit: $ svn propedit svn:externals . "svn-prop.tm...
stackexchange/codereview
The cascading dropdown control works great except that I am unable to figure out a way to reset the dropdown client-side (in Javascript) My set up is something like this DD1 DD2 DD3 DD4 each DD is dependent on the previous DD and uses webservice to load them. On change of DD3 I need to reset DD4 but the previous sele...
stackexchange/codereview
If you were writing a new application from scratch today, and wanted it to scale to all the cores you could throw at it tomorrow, what parallel programming model/system/language/library would you choose? Why? I am particularly interested in answers along these axes: Programmer productivity / ease of use (can mortals ...
stackexchange/codereview
This is an issue I've run into with a website I'm designing. I'm using a template based design for the site, so the information on the page is thrown inside the template when the page is accessed. The information shown changes based on the page attribute passed in as a GET request. So, to actually load the information ...
stackexchange/codereview
I'm setting up a server which is on a network behind a firewall and I want programs on this computer to be able to use sendmail to send emails to any email address. We have an SMTP server running on this network (let's call it mailrelay.example.com) which is how we're supposed to get outgoing emails through the firewa...
stackexchange/codereview
Let's say I have a web site for hosting community generated content that targets a very specific set of users. Now, let's say in the interest of fostering a better community I have an off-topic area where community members can post or talk about anything they want, regardless of the site's main theme. Now, I want most...
stackexchange/codereview
Background: We have an old (but business-critical) SQL Server database with an MS Access ADP front-end; this was originally upsized to SQL Server from a series of Access databases. This database tracks hazardous materials for our customers, and stores a large number of images. These images are inserted from MS Access, ...
stackexchange/codereview
I need to parse a xml file which is practically an image of a really big tree structure, so I'm using the XmlReader class to populate the tree 'on the fly'. Each node is passed just the xml chunk it expects from its parent via the ReadSubtree() function. This has the advantage of not having to worry about when a node h...
stackexchange/codereview
I'm trying to set the number format of a cell but the call to xlcFormatNumber fails leaving the cell number format as "General". I can successfully set the value of the cell using xlSet. XLOPER xRet; XLOPER xRef; //try to set the format of cell A1 xRef.xltype = xltypeSRef; xRef.val.sref.count = 1; xRef.val.sref.ref.r...
stackexchange/codereview
I need to join two binary files with a *.bat script on Windows. How can I achieve that?
stackexchange/codereview
I have a dev, that will get around our code coverage by writing tests that never fail. The code is just atrocious, but the tests never catch it because they assert(true). I code review, but I can't do everyones work for them, all the time. How do you get people like this motivated to make good software? Is there a buil...
stackexchange/codereview
I am using Excel where certain fields are allowed for user input and other cells are to be protected. I have used Tools Protect sheet, however after doing this I am not able to change the values in the VBA script. I need to restrict the sheet to stop user input, at the same time allow the VBA code to change the cell va...
stackexchange/codereview
I am looking for a Repository pattern implementation example/resource that follows domain driven design principles for my ASP.net MVC application. Does anyone have a good example or learning resource that can be shared?
stackexchange/codereview
Given an existing valid SVG document, what's the best way to create "informational popups", so that when you hover or click on certain elements (let's say ) you popup a box with an arbitrary amount (i.e. not just a single line tooltip) of extra information? This should display correctly at least in Firefox and be invis...
stackexchange/codereview
Since the only operations required for a container to be used in a stack are: back() push_back() pop_back() Why is the default container for it a deque instead of a vector? Don't deque reallocations give a buffer of elements before front() so that push_front() is an efficient operation? Aren't these elements wasted s...
stackexchange/codereview
Is their a way to access a web server such as windows server 2003 installed on a virtual box such as vmware from the host machine?
stackexchange/codereview
We create thumb images on our server and I'm looking for a way to save metadata (text) in that image. Is that possible? At this moment we use PHP and we create JPG images.
stackexchange/codereview
I'm trying to write a piece of code that will do the following: Take the numbers 0 to 9 and assign one or more letters to this number. For example: 0 = N, 1 = L, 2 = T, 3 = D, 4 = R, 5 = V or F, 6 = B or P, 7 = Z, 8 = H or CH or J, 9 = G When I have a code like 0123, it's an easy job to encode it. It will obviously ma...
stackexchange/codereview
I am using VirtualPc 2007 more and more, the one annoyance is "Alt-Tab". What I want is to be able to use alt-tab to iterate through all of the applications in the host pc and virtual(s) as if they were one long list. Is there a setting or program to do this?
stackexchange/codereview
I've just inherited some old Struts code. If Struts (1.3) follows the MVC pattern, how do the Action classes fill the View with variables to render in HTML ? So far, I've seen the Action classes push variables in (1) the HTTP request with request.setAttribute("name", user.getName()) (2) in ActionForm classes, using me...
stackexchange/codereview
Which Visual Studio template should be used for a ASP.NET web site, the Web Site template or the Project | Web Application template?
stackexchange/codereview
How to match a single quote in sed if the expression is enclosed in single quotes: sed -e '...' For example need to match this text: 'foo'
stackexchange/codereview
I'm using this formula to calculate the distance between entries in my (My)SQL database which have latitude and longitude fields in decimal format: 6371 * ACOS(SIN(RADIANS( %lat1% )) * SIN(RADIANS( %lat2% )) + COS(RADIANS( %lat1% )) * COS(RADIANS( %lat2% )) * COS(RADIANS( %lon2% ) - RADIANS( %lon1% ))) Substituting ...
stackexchange/codereview
I'd be leading a new project soon. And I've been pondering over what are the basic infrastructure for a software project. These are the stuff that I think every project should have: -Coding style conventions -Naming conventions -Standard project directory structure(eg maven standard dir layout, etc) -Project management...
stackexchange/codereview
Suppose I have a string 'nvarchar(50)', which is for example the T-SQL string segment used in creating a table of that type. How do I best convert that to an enum representation of System.Data.DbType? Could it handle the many different possible ways of writing the type in T-SQL, such as: [nvarchar](50) nvarchar 50 @J...
stackexchange/codereview
I am working on a WinForms application programmed in C# .NET 2.0 and VS2008. I am just about to start translating the app into several languages. Before I start, is it a good idea to use the VS2008 itself for all the localization? Or is it better to use some external tool right away? This is my first .NET app, so I rat...
stackexchange/codereview
Is there a way to comment out markup in an .ASPX page so that it isn't delivered to the client? I have tried the standard comments <!-- --> but this just gets delivered as a comment and doesn't prevent the control from rendering.
stackexchange/codereview
What makes a language strongly typed? I'm looking for the most important aspects of a strongly typed language. Yesterday I asked if PowerShell was strongly typed, but no one could agree on the definition of "strongly-typed", so I'm looking to clarify the definition. Feel free to link to wikipedia or other sources, but ...
stackexchange/codereview
Table: UserId, Value, Date. I want to get the UserId, Value for the max(Date) for each UserId. That is, the Value for each UserId that has the latest date. How do I do this in SQL? (Preferably Oracle.) I need to get ALL the UserIds. But for each UserId, only that row where that user has the latest date.
stackexchange/codereview
If I need to copy a stored procedure (SP) from one SQL Server to another I right click on the SP in SSMS and select Script Stored Procedure as > CREATE to > New Query Editor Window. I then change the connection by right clicking on that window and selecting Connection > Change Connection... and then selecting the new s...
stackexchange/codereview
I'm looking for some insight into XNA on Xbox 360, mainly if its possible to run vector-based float mathematics on its GPU? If there's a way, can you point me into the right direction?
stackexchange/codereview
I'm developping a small UML Class editor in Java, mainly a personal project, it might end up on SourceForge if I find the time to create a project on it. The project is quite advanced : I can create classes, move them around, create interfaces, create links, etc. What I'm working on is the dialog box for setting class/...
stackexchange/codereview
i have a page for a small mobile site that has an image that has its src value set via a getImage.aspx method, wherein an image is dynamically built and returned to the image tag. Most of the time it works great. However, there are moments where the image just doesnt load on the first shot. Hitting refresh helps most o...
stackexchange/codereview
If our server (running on a device) starts before a DHCP lease had been acquired then it can never connect using a hostname. If that happens it can find hosts by IP address but not by DNS. I initially thought that the Curl DNS cache was at fault as the curl connections failed. But I used CURLOPT_DNS_CACHE_TIMEOUT to pr...
stackexchange/codereview
Using Rails v2.1, lets say you have an action for a controller that is accessible from more than one location. For example, within the Rails app, you have a link to edit a user from two different views, one on the users index view, and another from another view (lets say from the nav bar on every page). I'm wondering ...
stackexchange/codereview
I have a repository of files which are unrelated to each other but are common to multiple projects. Each project might only need a subset of these files. For example: /myRepo: /jquery.js /jquery.form.js /jquery.ui.js Project A requires jquery.js and jquery.form.js, whereas Project B requires jquery.js and ...
stackexchange/codereview
Working on a project that parses a log of events, and then updates a model based on properties of those events. I've been pretty lazy about "getting it done" and more concerned about upfront optimization, lean code, and proper design patterns. Mostly a self-teaching experiment. I am interested in what patterns more exp...
stackexchange/codereview
I need to create a configuration section, that is able to store key-value pairs in an app.config file and the key-value pairs can be added runtime regardless of their type. It is also important that the value keeps its original type. I need to extend the following interface public interface IPreferencesBackend { b...
stackexchange/codereview
When userA uploads a file, his files will be uploaded to folderA, when userB, to folderB, and so on. Roles/Profiles in ASP.NET. Folders will be pre-existing. Anyone?
stackexchange/codereview
I've had a serious issue with my Visual Studio 2008 setup. I receive the ever-so-useful error 'A problem has been encountered while loading the setup components. Canceling setup.' whenever I try to uninstall, reinstall or repair Visual Studio 2008 (team system version). If I can't resolve this issue I have no choice bu...
stackexchange/codereview
As I develop more with vim, I find myself wanting to copy in blocks of useful code, similar to "templates" in Eclipse. I was thinking of making a separate file for each code chunk and just reading them in with :r code-fornext but that just seems kind of primitive. Googling around I find vim macros mentioned and somet...
stackexchange/codereview
I need to take any given valid XML schema (XSD) and denormalize it to a simple form containing no refs, no includes, etc. All simple type definitions should be inline, such that when looking at any given element, all declarations are visible without performing another lookup. I've found some tools that have this built...
stackexchange/codereview
While googling, I see that using java.io.File#length() can be slow. FileChannel has a size() method that is available as well. Is there an efficient way in java to get the file size?
stackexchange/codereview
I have a pdf file of a logo, about 1"x2" in dimension. Can anybody provide the code snippet to import that PDF logo into another PDF file using the Zend_PDF API's? Ideally, I'd like to be able to place it like the PNG, TIFF or JPG objects with the Zend_Pdf_Image object. In other words, I want to be able to place th...
stackexchange/codereview
In a web application, is it acceptable to use HTML in your code (non-scripted languages, Java, .NET)? There are two major sub questions: Should you use code to print HTML, or otherwise directly create HTML that is displayed? Should you mix code within your HTML pages?
stackexchange/codereview
I'm using the ProgressBar control in a WPF application and I'm getting this old, Windows 3.1 ProgressBlocks thing. In VB6, there was a property to show a smooth ProgressBar. Is there such a thing for WPF?
stackexchange/codereview