instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I have an existing Java project in Netbeans (a JSF web application). I'd like to experiment with GWT in a separate project - put pull in source from the original project. Is there any way to share source between two Netbeans projects. When I attempt to add the source directory from the original project into the new th...
stackexchange/codereview
Imagine I have a chunk of initialisation code at the top of a stored procedure with a number of variable assignments: SET @proc = 'sp_madeupname' SET @magic_number = 42 SET @tomorrows_date = DATEADD(dd, 1, GETDATE()) ... Clearly doing all of the above as one SELECT would be faster: SELECT @proc = 'sp_madeupname' ...
stackexchange/codereview
I'd like to re-brand (and send error emails) for all of the SSRS default error pages (picture below) when you access reports via /ReportServer/. I'm already handling the ASP OnError event and some of the default SSRS errors appear to catch their own exceptions and then render this page cancel the response all before t...
stackexchange/codereview
I have a C# interface with certain method parameters declared as object types. However, the actual type passed around can differ depending on the class implementing the interface: public interface IMyInterface { void MyMethod(object arg); } public class MyClass1 : IMyInterface { public void MyMethod(object arg...
stackexchange/codereview
Is there any way (in Java Servlet) to determine whether a HTTP POST or GET request is a result from a submission from a HTML form or otherwise?
stackexchange/codereview
What is the right place to store program data files which are the same for every user but have to be writeable for the program? What would be the equivalent location on MS Windows XP? I have read that C:\ProgramData is not writeable after installation by normal users. Is that true? How can I retrieve that directory pro...
stackexchange/codereview
I would like to have both Eclipse and Netbeans (with JUnit) installed on one system, so I can be somewhat familiar with both. Besides GUI development (see "Using both Eclipse and Netbeans"), are there any other issues with using both IDEs on the same system, or even the same project?
stackexchange/codereview
I try to define a schema for XML documents I receive. The documents look like: <root> <items> <group name="G-1"> <item name="I-1"/> <item name="I-2"/> <item name="I-3"/> <item name="I-4"/> </group> </items> <data> <group name="G-1" plac...
stackexchange/codereview
I'd like to call methods of my DAOs by AJAX. I'm quite new in that so I would like to ask what is the best way to do that. Is it possible to publish my beans as web services and call them with e.g. jQuery? I think it is not possible :) I've also read about Direct Web Remoting but I don't know which way to go... As I s...
stackexchange/codereview
I'm using Eclipse's AntRunner to build a set of plugins, but I'm having trouble in configuring the logging behavior. Specifically, I'd like AntRunner not to display empty tasks. Anybody knows how to do this?
stackexchange/codereview
I would like to know how to filter files in a open file dialog (in winforms) based on a regular expression. Files have all same extensions (.xml). Big files are split up into several files with the same name only to be separated with _1 ... We only want to show the files without _1 (first data file) the open file dial...
stackexchange/codereview
i work with sql server, but i must migrate to an application with Oracle DB. for trace my application queries, in Sql Server i use wonderful Profiler tool. is there something of equivalent for Oracle?
stackexchange/codereview
I have the following C# singleton pattern, is there any way of improving it? public class Singleton<T> where T : class, new() { private static object _syncobj = new object(); private static volatile T _instance = null; public static T Instance { get { ...
stackexchange/codereview
Which CMS are you using in Java and what is your experience with it (in terms of extensibility, usage comfort, framework API, memory usage, performance etc.). I am looking for suggestions. Specifically any one that supports a search engine(probably lucene or similar).
stackexchange/codereview
As a developer I often release different versions of applications that I want tested by users to identify bugs and to confirm requirements are being met. I give the users a rough idea of what I have changed or new features that need testing, but this seems a bit slap-dash and not very well strucutured. I'd like to know...
stackexchange/codereview
I have an MFC sdi app that uses a splitter window to contain a tree control alongside the main view showing the data. When the user selects something in the tree, that view keeps focus until the user deliberately clicks in the main data window. This means that any toolbar buttons associated with the main view are dis...
stackexchange/codereview
I'm using the build-helper-maven-plugin to add it to my build, but I'd like to see the XREF source for this extra source directory as well. FYI: maven-jxr-plugin - The JXR plugin produces a cross-reference of the project's sources. The generated reports make it easier for the user to reference or find specific lines of...
stackexchange/codereview
I'm using a COM Wrapper to interact with Windows Media Player. The it is using an AxHost to somehow wrap the player, for me it's all just magic under the hood^^ The AxHost.AttachInterfaces looks like this protected override void AttachInterfaces() { try { //Get the IOleObject fo...
stackexchange/codereview
In MATLAB 2008a, is there a way to allow a class method to act as a uicontrol callback function without having to make the method public? Conceptually, the method should not be public because it should never be called by a user of the class. It should only be called as a result of a UI event triggering a callback. H...
stackexchange/codereview
I'm writing a website that will sell items from one of my classes. It will be linked to a SQL Server db where I will pull pricing, item name, quantity and description. If I wanted to display the items from the database in a thinkgeek fashion, what would be the best control to use so I can custimize the display to actua...
stackexchange/codereview
I have used the XML Parser before, and even though it worked OK, I wasn't happy with it in general, it felt like I was using workarounds for things that should be basic functionality. I recently saw SimpleXML but I haven't tried it yet. Is it any simpler? What advantages and disadvantages do both have? Any other parser...
stackexchange/codereview
I am wondering if someone can put a bit of an authoritative reference summary of when the !important declaration in CSS does not work to override inline styles.
stackexchange/codereview
I frequently encounter some definitions for Win32API structures (but not limited to it) that have a cbSize member as in the following example. typedef struct _TEST { int cbSize; // other members follow } TEST, *PTEST; And then we use it like this: TEST t = { sizeof(TEST) }; ... or TEST t; t.cbSize = sizeof(TE...
stackexchange/codereview
Is it possible to have transport security without authentication? I'm well aware of it's flaws but atm I can't install a certificate a the client side. It seems I can set WSHttpBinding.SecurityMode to Transport and the ClientCredentialType to HttpClientCredentialType.None, but when I try to call the service I get this ...
stackexchange/codereview
Coming from a background, I'm familiar with GUI editors that do a poor job of producing code. However, I've never written a GUI using .NET. Does the GUI editor in Visual Studio have the same problem(s)? Are both the source files and output GUI good?
stackexchange/codereview
I'm familiar with some of the basics, but what I would like to know more about is when and why error handling (including throwing exceptions) should be used in PHP, especially on a live site or web app. Is it something that can be overused and if so, what does overuse look like? Are there cases where it shouldn't be us...
stackexchange/codereview
In Java projects in Eclipse version 3.4.1 sometimes the folder "Referenced Libraries" disappears from the "Project Explorer" view. All third party jars are shown directly in the root of the project folder. The project compiles and runs fine. It seems to be a GUI problem. How can I get this folder back?
stackexchange/codereview
Is there a way to retrieve the time zone choices in Windows Mobile in order to display them in a GUI? It would be much better not to have to show every 15 minutes just to be able to display GMT+5:45 for Kathmandu.
stackexchange/codereview
When you paste the following URL into IE: http://technet.microsoft.com/en-us/sysinternals/bb897434.aspx, the link on the right of the page cleanly says "Download Zoomit (77 KB)". If you paste the link into an Office document (Word, Excel, PowerPoint -- tested using Office 2003), and activate the link from the document...
stackexchange/codereview
I've written a small hello world test app in Silverlight which i want to host on a Linux/Apache2 server. I want the data to come from MySQL (or some other linux compatible db) so that I can databind to things in the db. I've managed to get it working by using the MySQL Connector/.NET: MySqlConnection conn = new MySqlCo...
stackexchange/codereview
sub foo {[$#{$_[!$||$|]}*@{$_[!!$_^!$_]}?@{$_[!$..!!$.]}[$_[@--@+]% @{$_[$==~/(?=)//!$`]}..$#{$_[$??!!$?:!$?]},($)?!$):!!$))..$_[$--$-]%@{ $_[$]/$]]}-(!!$++!$+)]:@{$_[!!$^^^!$^^]}]} update: I thought the word "puzzle" would imply this, but: I know what it does - I wrote it. If the puzzle doesn't interest you, please ...
stackexchange/codereview
I'm investigating the following java.lang.VerifyError: java.lang.VerifyError: (class: be/post/ehr/wfm/application/serviceorganization/report/DisplayReportServlet, method: getMonthData signature: (IILjava/util/Collection;Ljava/util/Collection;Ljava/util/HashMap;Ljava/util/Collection;Ljava/util/Locale;Lorg/apache/struts/...
stackexchange/codereview
I need to set up an instance of SQL Server 2005 with SQL_Latin1_General_CP850_Bin as the server collation (the vendor did not take into accounting looking at DB collation for a bunch of things so stored procedures and temp tables default to the server level and the default collation will not work). During the install f...
stackexchange/codereview
In a related question I asked about creating a generic container. Using polymorphic templates seems like the right way to go. However, I can't for the life of me figure out how a destructor should be written. I want the owner of the memory allocated to be the containers even if the example constructor takes in an array...
stackexchange/codereview
I'm developing an application for an internal customer. One of the requirements is that it be developed in such a way that it could potentially be sold to other organizations. The application is a tracking application for a fund-raising organization that will manage their donations, donors, participants, and events. ...
stackexchange/codereview
Given the following code (that doesn't work): while True: # Snip: print out current state while True: ok = get_input("Is this ok? (y/n)") if ok.lower() == "y": break 2 # This doesn't work :( if ok.lower() == "n": break # Do more processing with menus and stuff Is there a way to mak...
stackexchange/codereview
My ASP.NET web app needs to support the ability for users to create their own forms, complete with textboxes, dropdowns, radio buttons with some logic (required field, etc.). Is there some third party tool that's already geared towards this?
stackexchange/codereview
During an ASP.NET page load I'm opening and closing multiple System.Data.SqlClient.SqlConnections inside multiple controls contained in the page. I thought it would be a good idea instead to create a "pool" of connections and when opening a connection check to see if the connection string matches that of an open connec...
stackexchange/codereview
I am changing a GET to a POST. Currently I have .jsp?id=a,b,c,d. When changing this to a post I am still sitting the id parameter a,b,c,d . This is not working for me. Can I submit a comma separated list to a post parameter?
stackexchange/codereview
Usually I'm fortunate enough to work with really good designers. They take care of the look and feel for all of the web applications / sites I build. In the past when I've done cheap or free work for people for projects I'm interested in, I've used a template from templatemonster or similar. I want to get involved wit...
stackexchange/codereview
I have a lot of classes in the App_Code directory could this be a problem? Would it build faster if it was in a separate library? Any other tips?
stackexchange/codereview
One of the vagaries of my development system (Codegear C++Builder) is that some of the auto-generated headers insist on having... using namespace xyzzy ...statements in them, which impact on my code when I least want or expect it. Is there a way I can somehow cancel/override a previous "using" statement to avoid this...
stackexchange/codereview
I have a internal website that users log into. This data is saved as a cookie. From there the users go on their merry way. Every so often the application(s) will query the authentication record to determine what permissions the user has. My question is this: Is it more efficent to just query the cookie for the user...
stackexchange/codereview
I have an game application I have written for Windows Mobile and I want to have a timer associated with the puzzle. If the program loses focus for any reason (call comes in, user switches programs, user hits the Windows button) then I want a pop up dialog box to cover the puzzle and the timer to stop. When the user clo...
stackexchange/codereview
Is there any difference between having 4 .5GB memcache servers running or one 2GB instance? Does running multiple instances offer any benifits?
stackexchange/codereview
I'm looking for a way to limit the maximum number of running processes in Windows Server 2003. Is there a registry key somewhere that controls it? If so, which one is it?
stackexchange/codereview
Is it possible to call into COM objects via x86 assembly language? If so, how? Why would I want to do this? Let's say I've got two programs that I don't have source for - all I've got are the binaries. One of them implements a COM interface, the other doesn't. I want to inject code into the first program to call into t...
stackexchange/codereview
As far as I understand, CouchDB indexes are updated when a view is queried. Assuming there are more reads than writes, isn't this bad for scaling? How would I configure CouchDB to update indexes on writes, or better yet, on a schedule?
stackexchange/codereview
i am looking for opinions if the following problem maybe has a better/different/common solution: I have a database for products which contains the names of the products in english (the default language of this application) and i need translations of the names if available. Currently i have this setup: A product table ...
stackexchange/codereview
If I want to compile my .NET applications for a 64 bit environment. Do I need 64 bit OS version or 64 bit Visual Studio version Or both?
stackexchange/codereview
I'm using Windows Installer 4.5 new features and WiX to generate MSI packages. I have created an MSI chain installation in order to install a collection of other MSI packages as a transaction. Each package is using the new Embedded UI option so the UI can be WPF. Everything works OK this far. Except one of the goals wo...
stackexchange/codereview
I'm exporting data programatically from Excel to SQL Server 2005 using SqlBulkCopy. It works great, the only problem I have is that it doesn't preserve the row sequence i have in Excel file. I don't have a column to order by, I just want the records to be inserted in the same order they appear in the Excel Spreadsheet....
stackexchange/codereview
One of our unit tests is to populate properties within our business objects with random data. These properties are of different intrinsic types and therefore we would like to use the power of generics to return data of the type you pass in. Something along the lines of: public static T GetData<T>() How would you go ab...
stackexchange/codereview
In the 'DBUtility' project of Petshop 4.0,the abstract class SqlHelper has a method 'GetCachedParameters': public static SqlParameter[] GetCachedParameters(string cacheKey) { SqlParameter[] cachedParms = (SqlParameter[])parmCache[cacheKey]; if (cachedParms == null) return null; ...
stackexchange/codereview
How to tag images in the image itself in a web page? I know Taggify, but... is there other options? Orkut also does it to tag people faces... How is it done? Anyone knows any public framework that is able to do it? See a sample bellow from Taggify:
stackexchange/codereview
I have installed pylons based application from egg, so it sits somewhere under /usr/lib/python2.5/site-packages. I see that the tests are packaged too and I would like to run them (to catch a problem that shows up on deployed application but not on development version). So how do I run them? Doing "nosetests" from dir...
stackexchange/codereview
How can I transform a website to be able to handle multi language (example : english, french, spanish)? I do not like the resource file because I feel limited and it's pretty long to build the list. Do you have any suggestion? Update For the moment the best way we found is to use an XML file and with some Xpath et get ...
stackexchange/codereview
I have been trying to work my way through Project Euler, and have noticed a handful of problems ask for you to determine a prime number as part of it. I know I can just divide x by 2, 3, 4, 5, ..., square root of X and if I get to the square root, I can (safely) assume that the number is prime. Unfortunately this solu...
stackexchange/codereview
Is there any way of determining whether or not a specific temp table has been created in a session without referencing the tempdb database that it was created on? Users are allocated to a specific tempdb when they log in, so I don't know which tempdb they'll be using. I don't need to specify a tempdb to select data out...
stackexchange/codereview
During recent discussions at work, someone referred to a trampoline function. I have read the description at Wikipedia. It is enough to give a general idea of the functionality, but I would like something a bit more concrete. Do you have a simple snippet of code that would illustrate a trampoline?
stackexchange/codereview
Have had to write my first "proper" multithreaded coded recently, and realised just how little I knew about how "imperative-style" (ie, concurrency models used by C++/C#/Java, and the like) concurrent programming techniques. What resources are there (both books and online tutorials, etc) in order to learn more about th...
stackexchange/codereview
I have a VB6 COM component which I need to call from my .Net method. I use reflection to create an instance of the COM object and activate it in the following manner: f_oType = Type.GetTypeFromProgID(MyProgId); f_oInstance = Activator.CreateInstance(f_oType); I need to use GetTypeFromProgID rather than using tlbimp to...
stackexchange/codereview
I need to see if a given process id is running, and it must work in either Java or JRuby (preferably a Ruby solution). It can be system dependent for Linux (specifically Debian and/or Ubuntu). I already have the PID I am looking for, just need to see if it is currently running. UPDATE: Thanks for all the responses ev...
stackexchange/codereview
We have a set of applications that were developed for the ASCII character set. Now, we're trying to install it in Iceland, and are running into problems where the Icelandic characters are getting screwed up. We are working through our issues, but I was wondering: Is there a good "guide" out there for writing C++ code...
stackexchange/codereview
I would like to listen to method calls. For example, when an element is appended by anything to the document, I would like to be passed that element to act on it, like: //somewhere aParent.appendChild(aChild); //when the former, a function I defined as listener is called with the aChild as argument Does anybody know h...
stackexchange/codereview
Is it possible to read and write Word (2003 and 2007) files in Python without using a COM object? I know that I can: f = open('c:\file.doc', "w") f.write(text) f.close() but Word will read it as an HTML file not a native .doc file.
stackexchange/codereview
In a C++ project, compilation dependencies can make a software project difficult to maintain. What are some of the best practices for limiting dependencies, both within a module and across modules?
stackexchange/codereview
I want to be able to place an inline inbetween two different fields in a fieldset. You can already do this with foreignkeys, I figured that inlining the class I wanted and defining it to get extra forms would do the trick, but apparently I get a: "class x" has no ForeignKey to "class y" error. Is this not something...
stackexchange/codereview
I'm trying to place 4 of my image containers into a new pane, having a total of 16 images. The jQuery below is what I came up with to do it. The first pane comes out correctly with 4 images in it. But the second has 4 images, plus the 3rd pane. And the 3rd pane has 4 images plus the 4th pane. I don't know exactly ...
stackexchange/codereview
Introduction In my current organisation, we have many desktop and web applications all feeding into each other at some point. When looking after older applications or creating new applications, it's proving very difficult to try and remember which system rely on other systems in order to work. I'm not talking about sof...
stackexchange/codereview
I am looking for a Regular expression to match only if a date is in the first 28 days of the month. This is for my validator control in ASP.NET
stackexchange/codereview
What is the difference between UNION and UNION ALL?
stackexchange/codereview
Is there an open-source alternative to MATLAB's fmincon function for constrained linear optimization? I'm rewriting a MATLAB program to use Python / NumPy / SciPy and this is the only function I haven't found an equivalent to. A NumPy-based solution would be ideal, but any language will do.
stackexchange/codereview
What advice would you have for someone who wants to start in the BI (Business Intelligence) domain? I where and what I should start with: Books, Blogs, WebCasts... What I should pay attention to and what I should stay away from. Are the Microsoft technologies worth while ?
stackexchange/codereview
Many of my colleagues use SVN in groups of 1-5 people partly working on the specific project. Half of them are inexperienced students. In fact non of us are real software developers with year-long experience. Most of them use Eclipse and subclipse to read and write their contributions to the SVN repositories. Some of t...
stackexchange/codereview
I have two functions, f and g, which call each other recursively. Unfortunately, when f calls g, it has not yet been declared, so I get an "unbound variable" error. How can I prototype (or whatever the equivalent vocabulary is) this function in SML/NJ?
stackexchange/codereview
I can add custom version strings to a C++ DLL in Visual Studio by editing the .rc file by hand. For example, if I add to the VersionInfo section of the .rc file VALUE "BuildDate", "2008/09/19 15:42:52" Then that date is visible in the file explorer, in the DLL's properties, under the Version tab. Can I do the same fo...
stackexchange/codereview
After reading the Test-and-Set Wikipedia entry, I am still left with the question "What would a Test-and-Set be used for?" I realize that you can use it to implement Mutex (as described in wikipedia), but what other uses does it have?
stackexchange/codereview
I am using Infopath forms to collect information to trigger my Windows Workflow sitting on Sharepoint 2007. The Infopath forms have logo's and branding which only show up on the Sharepoint portal but the infopath forms which are emailed when tasks are created during the workflow look different as in the background colo...
stackexchange/codereview
Is it possible to do a SELECT statement with a predetermined order, ie. selecting IDs 7,2,5,9 and 8 and returning them in that order, based on nothing more than the ID field? Both these statements return them in the same order: SELECT id FROM table WHERE id in (7,2,5,9,8) SELECT id FROM table WHERE id in (8,2,5,9,7)...
stackexchange/codereview
I'm looking at introducing multi-lingual support to a mature CGI application written in Perl. I had originally considered rolling my own solution using a Perl hash (stored on disk) for translation files but then I came across a CPAN module which appears to do just what I want (i18n). Does anyone have any experience ...
stackexchange/codereview
I'm trying: import commands print commands.getoutput("ps -u 0") But it doesn't work on os x. os instead of commands gives the same output: USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND nothing more
stackexchange/codereview
Just that, if you embed an icon: [Embed(source='icons/checkmark.png')] private static var CheckMark:Class; You end up with a dynamic class. You can pretty easily assign the icon to a button at runtime by calling the setStyle method: var btn:Button = new Button(); btn.setStyle("icon", CheckMark); But what if you wante...
stackexchange/codereview
Is it possible to read and write Word (2003 and 2007) files in PHP without using a COM object? I know that I can: $file = fopen('c:\file.doc', 'w+'); fwrite($file, $text); fclose(); but Word will read it as an HTML file not a native .doc file.
stackexchange/codereview
For as long as I can remember I have avoided using switch statement fall-through. Actually, I can't remember it ever entering my consciousness as a possible way to do things as it was drilled into my head early on that it was nothing more than a bug in the switch statement. However, today I ran across some code that us...
stackexchange/codereview
What are the maximum allowed number of columns in a query in access 2003?
stackexchange/codereview
We have a RedHat box with Apache2, PHP5 and MySQL 5 for much of our development. Now, we have a Rails client, and we need to set up a Rails app on the same server. Can we install Ruby and the Rails framework with the same Apache, or should we avoid this? Why or Why not? Is it possible to direct subdomains to either PHP...
stackexchange/codereview
Suppose I have one list: IList<int> originalList = new List<int>(); originalList.add(1); originalList.add(5); originalList.add(10); And another list... IList<int> newList = new List<int>(); newList.add(1); newList.add(5); newList.add(7); newList.add(11); How can I update originalList so that: If the int appears ...
stackexchange/codereview
Using ASP.NET 2.0, I have a web app where I am trying to use JavaScript to make one tab in a tab-container the active tab. The recommendations have been based on: var mX=document.getElementById('<%= tc1.ClientID%>') $find('<%= tc1.ClientID%>').set_activeTabIndex(1); Which both produce the error: The Controls collect...
stackexchange/codereview
I am building a small website for fun/learning using a fairly standard Web/Service/Data Access layered design. For the Data Access Layer, what is the best way to handle creating Connection objects to call my SQL stored procedures and why? Bearing in mind I am writing a lot of the code by hand (I know I could be using H...
stackexchange/codereview
I like having my warning level set at W4 but all new projects start at W3. Is there some way to change the default value for warning levels for new projects?
stackexchange/codereview
I need to be able to GZip compress a file in an Excel VBA function. Specifically I need to be able to use the 'deflate' algorithm. Is there a way to do this without having to exec a command line application? With no dependency on external tools the code will be more robust. Ideally the code would make use of pre-instal...
stackexchange/codereview
So I have a weird situation here... I have an System.Web.UI.WebControls.WebParts.EditorPart class. It renders a "Search" button, when you click this button, it's clickHandler method does a DB search, and dynamically creates a LinkButton for each row it returns, sets the CommandName and CommandArgument properties and ad...
stackexchange/codereview
I am trying to use WebClient to download a file from web using a WinForms application. However, I really only want to download HTML file. Any other type I will want to ignore. I checked the WebResponse.ContentType, but its value is always null. Anyone have any idea what could be the cause?
stackexchange/codereview
im creating a Factory class that will contruct and return an object. I normally would do all of the data stuff at the Data Access Layer, but i dont think i could reach my objective and still do so. What i want to do is use a SQLDataReader to quickly read the data information and populate the object to be returned fro...
stackexchange/codereview
I have a C# object with a critical resource that needs to be flushed very specific points in time making it a bad candidate to leave around for the garbage collector to take care of whenever it gets around to it, how should I handle this? Is there something like C++'s delete operator that will let me manually kill th...
stackexchange/codereview
I would like to be able to trap Ctrl+C in a C# console application so that I can carry out some cleanups before exiting. What is the best way of doing this?
stackexchange/codereview
What's the best delimiter to use when exporting data? What's the best way to work with NULL data if you have an INT field in the table?
stackexchange/codereview
I am using the next class (simplified for the sake of understandability) to download images in a struts web application. It is working fine in every browser but firefox, which cuts names containing spaces. That it is to say: file with spaces.pdf gets downloaded in firefox as: file while in chrome, IE7 IE6 is downloade...
stackexchange/codereview
Several times now I've had Eclipse delete files for me seemingly randomly - then they appear under the 'Local History' option. What is going on! I'm definitely not just deleting things by mistake. Most recently it deleted my template files under html-template which are quite important! I have an AIR project and a web ...
stackexchange/codereview