instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I am looking for an open source project that uses EJB3 as backend and JSF as frontend. It should not be a tutorial but a real application that real people are using. The application should be data-driven, i.e. the following aspects are fundamental and make 80% or more of the application. form-based (many input forms) ...
stackexchange/codereview
I'm trying to use “rusage” statistics in my program to get data similar to that of the time tool. However, I'm pretty sure that I'm doing something wrong. The values seem about right but can be a bit weird at times. I didn't find good resources online. Does somebody know how to do it better? Sorry for the long code. cl...
stackexchange/codereview
I'm using an older version of ASP.NET AJAX due to runtime limitations, Placing a ASP.NET Validator inside of an update panel does not work. Is there a trick to make these work, or do I need to use the ValidatorCallOut control that comes with the AJAX toolkit?
stackexchange/codereview
Is there any way to tinker with the iPhone SDK on a Windows machine? Are there plans for an iPhone SDK version for Windows? The only other way I can think of doing this is to run a Mac VM image on a VMWare server running on Windows, although I'm not too sure how legal this is.
stackexchange/codereview
I'm wondering how you can implement a program similar to tail -f in C/C++, a program that watches for and processes new lines added to a log file?
stackexchange/codereview
Grails makes it very easy to configure datasources for different environments (development, test, production) in its DataSources.groovy file, but there seems to be no facility for configuring multiple datasources in one environment. What to I do if I need to access several databases from the same Grails application?
stackexchange/codereview
I have heard that Microsoft SharePoint was used by many companies. Could someone tell me briefly what is SharePoint and why is it popular?
stackexchange/codereview
What's the best way to use QT4's QItemDelegate to show thumbnails for images in a view? Specifically, how do you stop the item delegate from blocking when generating pixmaps from very large image files (> 500MB)? Can anyone link to some example code that achieves this? Then again, perhaps this isn't the place to look ...
stackexchange/codereview
What is the purpose of annotations in Java? I have this fuzzy idea of them as somewhere in between a comment and actual code. Do they affect the program at run time? What are their typical usages? Are they unique to Java? Is there a C++ equivalent?
stackexchange/codereview
Is it possible to read a disk directly with .NET? By directly, I mean via the device bypassing the file system. I think I would go about this by opening the device some way "\Device\Ide\IdeDeviceP2T0L0-1" for example. If I can't open the device with a .NET API, knowing which Win32 API to use would be helpful.
stackexchange/codereview
Is there an easy way to tell if a ruby script is already running and then handle it appropriately? For example: I have a script called really_long_script.rb. I have it cronned to run every 5 minutes. When it runs, I want to see if the previous run is still running and then stop the execution of the second script. ...
stackexchange/codereview
What's the DOS FINDSTR equivalent for PowerShell? I need to search a bunch of log files for "ERROR".
stackexchange/codereview
does anyone have a clue why the TortoiseSVN windows client (in Win32 XP and Vista) is so incredible slow when used with Putty and PAM? It seems it connects for each request since datatransfers (checkout) are not slow at all? Any ideas how to change it? Update: I had no problems with SSH before. But I have to use key ba...
stackexchange/codereview
We're having sporadic, random query timeouts on our SQL Server 2005 cluster. I own a few apps that use it, so I'm helping out in the investigation. When watching the % CPU time in regular ol' Perfmon, you can certainly see it pegging out. However, SQL activity monitor only gives cumulative CPU and IO time used by a pro...
stackexchange/codereview
I want to catch all unhandled exceptions thrown in a remote object on the server and log them there before I translate them into some custom exception so that specific exceptions do not cross the client/server boundary. I think I have to use a custom channel sync, but can anyone confirm this and/or have any other advic...
stackexchange/codereview
How many possible combinations of the variables a,b,c,d,e are possible if I know that: a+b+c+d+e = 500 and that they are all integers and >= 0, so I know they are finite.
stackexchange/codereview
I'm looking at the PHP Manual, and I'm not seeing a section on data structures that most languages have, such as lists and sets. Am I just blind or does PHP not have anything like this built in?
stackexchange/codereview
What are the steps and techniques to debug an apparent hang due to a deadlock in a Win32 production process. I heard that WinDbg can be used for this purpose but could you please provide clear hints on how this can be accomplished?
stackexchange/codereview
I am getting an 403 access forbidden when attempting to open a page under a vhost where the document root is sitting on a different drive than where apache is sitting. I installed using the apachefriends release. This is my httpd-vhosts.conf file: NameVirtualHost 127.0.0.1 <VirtualHost 127.0.0.1> ServerName foo.loc...
stackexchange/codereview
I have a need to convert images from CMYK to RGB - not necessarily back again, but hey, if it can be done... With the release of ColdFusion 8, we got the CFImage tag, but it doesn't support this conversion; and nor does Image.cfc, or Alagad's Image Component. However, it should be possible in Java; which we can leverag...
stackexchange/codereview
The primary class in the subprocess module is name Popen, and represents a subprocess. Popen sounds like someone was trying to force the name to follow some function naming format, rather than chosing a name that actually represents what the object is. Does anyone know why it was chosen over something simple like, say...
stackexchange/codereview
celsius = (5.0/9.0) * (fahr-32.0); Is it just a development choice that the C developers decided upon or is there a reason to this? I believe a float is smaller than a double, so it might be to prevent overflows caused by not knowing what decimal format to use. Is that the reason, or am I overlooking something?
stackexchange/codereview
I've seen lots of examples of making an entire regular expression case-insensitive. What I'm wondering about is having just part of the expression be case-insensitive. For example, let's say I have a string like this: fooFOOfOoFoOBARBARbarbarbAr What if I want to match all occurrences of "foo" regardless of case but ...
stackexchange/codereview
Say I have a Student table, it's got an int ID. I have a fixed set of 10 multiple choice questions with 5 possible answers. I have a normalized answer table that has the question id, the Student.answer (1-5) and the Student.ID I'm trying to write a single query that will return all scores over a certain pecentage. T...
stackexchange/codereview
Anyone know uf there's a dll/runner anywhere that returns TAP output from an NUnit test suite?
stackexchange/codereview
I'm using an Xml field in my Sql Server database table. I'm trying to search a word using the XQuery contains method but it seems to search only in case sensitive mode. The lower method isn't implemented on Sql Server XQuery implementation also. ¿Is there a simple solution to this problem?
stackexchange/codereview
I have a web system which has a classical parent-children menu saved in a database, with fields id as the PK, and parent_id to pointing to the owning menu. (Yes, I know this doesn't scale very well, but that's another topic). So for these records (id-parent_id pairs): 0-7 0-4 4-9 4-14 4-16 9-6 I have this tree: 0 ├ 7...
stackexchange/codereview
Why does Leopard mangle some symbols with $non_lazy_ptr? More importantly what is the best method to fix undefined symbol errors because a symbol has been mangled with $non_lazy_ptr?
stackexchange/codereview
While writing a custom IHttpHandler I came across a behavior that I didn't expect concerning the HttpCachePolicy object. My handler calculates and sets an entity-tag (using the SetETag method on the HttpCachePolicy associated with the current response object). If I set the cache-control to public using the SetCacheabil...
stackexchange/codereview
Is it possible to embed an inline search box into a web page which provides similar functionality to the IE7Pro Inline Search or similar plugins for Firefox/Safari?
stackexchange/codereview
I am looking for information on handling search in different ORMs. Currently I am redeveloping some old application in PHP and one of requirements is: make everything or almost everything searchable, so user just types "punkrock live" and the app finds videos clips, music tracks, reviews, upcoming events or even user c...
stackexchange/codereview
Why wouldn't I choose abstract? What are the limitations to declaring a class member virtual? Can only methods be declared virtual?
stackexchange/codereview
Assuming there are 5 items in the settings file (MySetting1 to MySetting5), why does PropertyValues have 0 items while Properties has the correct number? Console.WriteLine( Properties.Settings.Default.PropertyValues.Count); // Displays 0 Console.WriteLine( Properties.Settings.Default.Properties.Count); // Displays...
stackexchange/codereview
I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000020: Document 1 - Completed successfully I'm trying to extract pieces from it using regex. In this case, I want to grab everything after Pro...
stackexchange/codereview
In FXRuby; how do I set the FXFileDialog to be at the home directory when it opens?
stackexchange/codereview
I am looking for a little bit of JQuery or JS that allows me to produce a horizontally scrolling "news ticker" list. The produced HTML needs to be standards compliant as well. I have tried liScroll but this has a habit of breaking (some content ends up on a second line at the start of the scroll), especially with longe...
stackexchange/codereview
I'm getting some strange, intermittent, data aborts (< 5% of the time) in some of my code, when calling memset(). The problem is that is usually doesn't happen unless the code is running for a couple days, so it's hard to catch it in the act. I'm using the following code: char *msg = (char*)malloc(sizeof(char)*2048); ...
stackexchange/codereview
I've come to love Amazon's EC2 service and I'm looking for something similar that supports the ability to save a running Windows server image and start new instances from it. I contacted GoGrid (the feature is planned in future) and Mosso (no joy) Anyone know of any hosting/cloud providers that can dothis?
stackexchange/codereview
What libraries/methods do you know of that can do some basic HTML representation in Swing? Can you comment on your experience?
stackexchange/codereview
Is there any difference between: if foo is None: pass and if foo == None: pass The convention that I've seen in most Python code (and the code I myself write) is the former, but I recently came across code which uses the latter. None is an instance (and the only instance, IIRC) of NoneType, so it shouldn't matter, r...
stackexchange/codereview
We've got a page with a ton of jQuery (approximately 2000 lines) that we want to trim down b/c it is a maintenance nightmare, and it might be easier to maintain on the server. We've thought about using UpdatePanel for this. However, we don't like the fact that the UpdatePanel is sending the whole page back to the ser...
stackexchange/codereview
I'm going to be working on some iPhone apps so I've been given a golden ticket to buy a Mac. However the golden ticket isn't worth that much, and I'm thinking iMac. Now, Macs are great, I love 'em and use 'em at home, but I know that the iMac is geared more towards the average consumer than the professional. Is an iMac...
stackexchange/codereview
How do I select all records that contain "LCS" within the title column in sql.
stackexchange/codereview
Frameworks simplify coding at the cost of speed and obfuscation of the OS. With the passing of Moore's law do you thing that there might be a shift away from Frameworks? I suspect that one of the reasons for Vista not being an outstanding success was that it ran much slower than XP, and, because computers had not imp...
stackexchange/codereview
Ever since moving to Vista some time ago on my development machine, connecting to SQL Servers in our DMZ active directory domain from client tools like SSMS has not worked like it used to. In XP, as long as I had authenticated in some way on the server (for example directing Explorer to \server.dmzdomain\c$ and enteri...
stackexchange/codereview
The Wikipedia article on ANSI C says: One of the aims of the ANSI C standardization process was to produce a superset of K&R C (the first published standard), incorporating many of the unofficial features subsequently introduced. However, the standards committee also included several new features, such as function pro...
stackexchange/codereview
I have a form view, in the edit template I have two drop downs. Drop down 1 is explicitly set with a list of allowed values. It is also set to autopostback. Drop down 2 is databound to an objectdatasource, this objectdatasource uses the first dropdown as one of it's parameters. (The idea is that drop down 1 limits wha...
stackexchange/codereview
boolean a = false, b = true; if ( a && b ) { ... }; In most languages, b will not get evaluated because a is false so a && b cannot be true. My question is, wouldn't short circuiting be slower in terms of architecture? In a pipeline, do you just stall while waiting to get the result of a to determine if b should be ev...
stackexchange/codereview
How do you implement autocomplete on ASP.Net Gridview? Can anyone point me where to go to achieve this? I'm willing to use non-.Net ajax controls if that what it takes.
stackexchange/codereview
I have an ASP.NET webforms application (3.5 SP1) that I'm working on, and attempting to enable gzip fpr HTML and CSS that comes down the pipe. I'm using this implementation (and tried a few others that hook into Application_BeginRequest), and it seems to be corrupting the external CSS file that the pages use, but inter...
stackexchange/codereview
I have a folder in my web server used for the users to upload photos using an ASP page. Is it safe enough to give IUSR write permissions to the folder? Must I secure something else? I am afraid of hackers bypassing the ASP page and uploading content directly to the folder. I'm using ASP classic and IIS6 on Windows 2003...
stackexchange/codereview
For example: >>> x = [1, 1, 2, 'a', 'a', 3] >>> unique(x) [1, 2, 'a', 3] Assume list elements are hashable. Clarification: The result should keep the first duplicate in the list. For example, [1, 2, 3, 2, 3, 1] becomes [1, 2, 3].
stackexchange/codereview
In my web app, I submit some form fields with jQuery's $.getJSON() method. I am having some problems with the encoding. The character-set of my app is charset=ISO-8859-1, but I think these fields are submitted with UTF-8. How I can set encoding used in $.getJSON calls?
stackexchange/codereview
OK, so we all know the daily build is the heart beat of a project, but whats the single best way of automating it? We have perl scripts wrapping our pipeline which includes ClearCase, VS2005 (C++), Intel FORTRAN, Inno setup. We use cron jobs on UNIX to schedule the build, and host a simple Apache web server to view an...
stackexchange/codereview
I'm trying to test the DB2 adapter for BizTalk 2006 (not R2). While trying to configure an instance in an application, I get an error stating: DB2 Transport Component is not registered correctly The enivronment is 2 BizTalk servers sharing a messagebox. The DB2 adapter works fine on the first server. It is the second...
stackexchange/codereview
The following bit of code catches the EOS Exception using (var reader = new BinaryReader(httpRequestBodyStream)) { try { while (true) { bodyByteList.Add(reader.ReadByte()); } } catch (EndOfStreamException) { } } So why do I still receive first-chance exceptions in my console? A f...
stackexchange/codereview
I am facing a problem with .NET generics. The thing I want to do is saving an array of generics types (GraphicsItem): public class GraphicsItem<T> { private T _item; public void Load(T item) { _item = item; } } How can I save such open generic type in an array?
stackexchange/codereview
What is WCF in simple terms? It's hard to distill the meaning from the Wikipedia page.
stackexchange/codereview
How do i check out a specific directory from CVS and omit the tree leading up to that directory? EX. Id like to checkout to this directory C:/WebHost/MyWebApp/www My CVS Project directory structure is MyWebApp/Trunk/www How do i omit the Trunk and MyWebApp directories?
stackexchange/codereview
I am trying to automate functional testing of a server using a realistic frequency distribution of requests. (sort of load testing, sort of simulation) I've chosen the Weibull distribution as it "sort of" matches the distribution I've observed (ramps up quickly, drops off quickly but not instantly) I use this distribut...
stackexchange/codereview
I am having problem that even though I specify the level to ERROR in the root tag, the specified appender logs all levels (debug, info, warn) to the file regardless the settings. I am not a Log4j expert so any help is appreciated. I have checked the classpath for log4j.properties (there is none) except the log4j.xml. H...
stackexchange/codereview
What is the normal way people writing network code in Delphi use Windows-style overlapped asynchronous socket I/O? Here's my prior research into this question: The Indy components seem entirely synchronous. On the other hand, while ScktComp unit does use WSAAsyncSelect, it basically only asynchronizes a BSD-style multi...
stackexchange/codereview
Right now my ant task looks like. <javadoc sourcepath="${source}" destdir="${doc}"> <link href="http://java.sun.com/j2se/1.5.0/docs/api/" /> </javadoc> And I'm getting this warning: javadoc: warning - Error fetching URL: http://java.sun.com/j2se/1.5.0/docs/api/package-list How do I get the javadoc to properly lin...
stackexchange/codereview
What is the best way to sort the results of a sql query into a random order within a stored procedure?
stackexchange/codereview
I have a team lead who seems to think that business logic is very subjective, to the point that if my stored procedure has a WHERE ID = @ID — he would call this “business logic” What approach should I take to define “business logic” in a very objective way without offending my team lead?
stackexchange/codereview
So I'm interested in hearing different thoughts about what is the best way to go about unit testing XNA Game/Applications. Astute googlers can probably figure out why I'm asking, but I didn't want to bias the topic :-)
stackexchange/codereview
Is it "taboo" to programatically create system restore points? I would be doing this before I perform a software update. If there is a better method to create a restore point with just my software's files and data, please let me know. I would like a means by which I can get the user back to a known working state if e...
stackexchange/codereview
Is it possible to get the x,y coordinates of a Flex app within an HTML page? I know you can use ExternalInterface.ObjecID to get the "id attribute of the object tag in Internet Explorer, or the name attribute of the embed tag in Netscape" but I can't seem to get past that step. It seems like it should be possible to ...
stackexchange/codereview
Speaking as a non-C# savvy programmer, I'm curious as to the evaluation semantics of LINQ queries like the following: var people = from p in Person where p.age < 18 select p var otherPeople = from p in people where p.firstName equals "Daniel" select p Assu...
stackexchange/codereview
I love the way Mac OS beautifully renders fonts (not just browsers). I was wondering if we could somehow get the same rendering in browsers running on Windows? Someone recommended sIFR but I guess that's useful when I need to use non-standard fonts?
stackexchange/codereview
A GUI driven application needs to host some prebuilt WinForms based components. These components provide high performance interactive views using a mixture of GDI+ and DirectX. The views handle control input and display custom graphical renderings. The components are tested in a WinForms harness by the supplier. Can a ...
stackexchange/codereview
Can you use windows hooks or other methods to do code injection with c#? I've seen lots of things about code injection but all of them are done in C/C++. I don't know either of those languages and have a really hard time translating. Does anyone have any ideas on how to do this?
stackexchange/codereview
From time to time am I working in a completely disconnected environment with a Macbook Pro. For testing purposes I need to run a local DNS server in a VMWare session. I've configured the lookup system to use the DNS server (/etc/resolve.conf and through the network configuration panel, which is using configd underneath...
stackexchange/codereview
When using a browser to transform XML (Google Chrome or IE7) is it possible to pass a parameter to the XSLT stylesheet through the URL? example: data.xml <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="sample.xsl"?> <root> <document type="resume"> <author>John Doe</author> ...
stackexchange/codereview
I need to disable specific keys (Ctrl and Backspace) in Internet Explorer 6. Is there a registry hack to do this. It has to be IE6. Thanks. Long Edit: @apandit: Whoops. I need to more specific about the backspace thing. When I say disable backspace, I mean disable the ability for Backspace to mimic the Back brows...
stackexchange/codereview
I would like a panel in GWT to fill the page without actually having to set the size. Is there a way to do this? Currently I have the following: public class Main implements EntryPoint { public void onModuleLoad() { HorizontalSplitPanel split = new HorizontalSplitPanel(); //split.setSize("250...
stackexchange/codereview
What is the difference in C# between Convert.ToDecimal(string) and Decimal.Parse(string)? In what scenarios would you use one over the other? What impact does it have on performance? What other factors should I be taking into consideration when choosing between the two?
stackexchange/codereview
I have a console program written in C# that I am using to send faxes. When I step through the program in Visual Studio it works fine. When I double click on the program in Windows Explorer it works fine. When I setup a Windows scheduled task to run the program it fails with this in the event log. EventType clr20r3, ...
stackexchange/codereview
I'm working on a messaging/notification system for our products. Basic requirements are: Fire and forget Persistent set of messages, possibly updating, to stay there until the sender says to remove them The libraries will be written in C#. Spring.NET just released a milestone build with lots of nice messaging abstr...
stackexchange/codereview
I would like to read the text and binary attachments in a saved Outlook message (.msg file) from a Java application, without resorting to native code (JNI, Java Native Interface). Apache POI-HSMF seems to be in the right direction, but it's in very early stages of development...
stackexchange/codereview
I own an image hosting site and would like to generate one popup per visitor per day. The easiest way for me to do this was to write a php script that called subdomains, like ads1.sitename.com ads2.sitename.com unfortunatly most of my advertisers want to give me a block of javascript code to use rather than a direct l...
stackexchange/codereview
In this post I asked if there were any tools that compare the structure (not actual content) of 2 HTML pages. I ask because I receive HTML templates from our designers, and frequently miss minor formatting changes in my implementation. I then waste a few hours of designer time sifting through my pages to find my mistak...
stackexchange/codereview
I'm using exim on both the sending and relay hosts, the sending host seems to offer: HELO foo_bar.example.com Response: 501 Syntactically invalid HELO argument(s)
stackexchange/codereview
Specifically getting on Windows the "..\Documents & Settings\All Users, basicaly any path that needs the front end to be dynamically derived based on the OS your software is running on. (Now I need the answer to this) the current users My Documents dirctory (okay this has been answered) and basicaly any path that ne...
stackexchange/codereview
I'm currently working on a JavaScript tool that, during the course of its execution, will ultimately traverse each node in the DOM. Because this has potential to be a very expensive task, I'd like to benchmark the performance of this script. What's the best, free tool for benchmarking a script such as this across the m...
stackexchange/codereview
We're looking at moving from a check-out/edit/check-in style of version control system to Subversion, and during the evaluation we discovered that when you perform an Update action in TortoiseSVN (and presumably in any Subversion client?), if changes in the repository that need to be applied to files that you've been e...
stackexchange/codereview
What was the motivation for having the reintroduce keyword in the Delphi Programming Language? If you have a child class that contains a function with the same name as a virtual function in the parent class and it is not declared with the override modifier then it is a compile error. Adding the reintroduce modifier in ...
stackexchange/codereview
I have ms sql databases that grow very large. Upon examination I find that there is a bunch of unused space in certain tables. I don't do many physical deletes, so I don't think that its just deleted records. DBCC SHRINK doesn't make the file smaller. But, if I dump the table to a new, empty database, the size goes dow...
stackexchange/codereview
I'm familiar with object-oriented architecture, including use of design patterns and class diagrams for visualization, and I know of service-oriented architecture with its contracts and protocol bindings, but is there anything characteristic about a software architecture for a system written in a functional programming...
stackexchange/codereview
I have a SqlServer database that I've manually filled with some test data. Now I'd like to extract this test data as insert statements and check it in to source control. The idea is that other team members should be able to create the same database, run the created insert scripts and have the same data to test and deve...
stackexchange/codereview
We use an ERP that has a bunch of reports in QuickReport format (.qr2). From what I could search, Quickreports has an interface for Delphi but not for .NET. Anyone know if there's a (preferably free/OSS) solution for converting .qr2 reports to something I could work with in C#? Or a component for reading these reports ...
stackexchange/codereview
If you go to a site such as: http://www.cs.cmu.edu/~maverick/VimColorSchemeTest/index-c.html It has a bunch of example colour themes for VI. Does anyone know of a tool that would take those files and convert them into .vssettings files to use in Visual Studio? If not, how about some good docs on ether of the formats.
stackexchange/codereview
How do I call an external command within Python as if I had typed it in a shell or command prompt?
stackexchange/codereview
Using Windows Server 2003 in a multi-user environment (via Remote Desktop, using it as an application server), how to mount a (preferably encrypted) volume in a way, that won't show up on any other user's desktop? Tried, and failed approaches: tweaking user rights -display of mounted volume can not be changed. Bestcry...
stackexchange/codereview
How can you make the display frames per second be independent from the game logic? That is so the game logic runs the same speed no matter how fast the video card can render.
stackexchange/codereview
Suppose a large composite application built on several foundation components packaged in their own assemblies: (database reading, protocol handlers, etc.). For some deployments, this can include over 20 assemblies. Each of these assemblies has settings or configuration information. Our team tends to like the VS set...
stackexchange/codereview
Is there a way to search the latest version of every file in TFS for a specific string or regex? This is probably the only thing I miss from Visual Source Safe... Currently I perform a Get Latest on the entire codebase and use Windows Search, but this gets quite painful with over 1GB of code in 75,000 files. EDIT: ...
stackexchange/codereview
I am trying to print a report from within an InfoPath template. So my dataset is an XML DOM that I will load into the Crystal Report at runtime. But how do I define the dataset off which the Crystal Report is developed? Crystal Reports has a great tool to build a dataset from an SQL database. Is there something simil...
stackexchange/codereview
While creating a file synchronization program in C# I tried to make a method copy in LocalFileItem class that uses System.IO.File.Copy(destination.Path, Path, true) method where Path is a string. After executing this code with destination. Path = "C:\\Test2" and this.Path = "C:\\Test\\F1.txt" I get an exception saying ...
stackexchange/codereview
As far as I can tell, in spite of the countless millions or billions spent on OOP education, languages, and tools, OOP has not improved developer productivity or software reliability, nor has it reduced development costs. Few people use OOP in any rigorous sense (few people adhere to or understand principles such as LS...
stackexchange/codereview