instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
One of my goals over the next few months is to get familiar with NHibernate and am curious if anyone out there has any suggestions of where to begin. Preferably, I'd like to find a example project that demonstrates what you would see in an in-the-field application.
stackexchange/codereview
I am working on a ASP.net application written in C# with Sql Server 2000 database. We have several PDF reports which clients use for their business needs. The problem is these reports take a while to generate (> 3 minutes). What usually ends up happening is when the user requests the report the request timeout kills th...
stackexchange/codereview
How do you calculate the least common multiple of multiple numbers? So far I've only been able to calculate it between two numbers. But have no idea how to expand it to calculate 3 or more numbers. So far this is how I did it LCM = num1 * num2 / gcd ( num1 , num2 ) With gcd is the function to calculate the greatest...
stackexchange/codereview
Is it possible to model relationships between entities that are defined in separate NSManagedObjectModels if the entities are always used within an NSManagedObjectModel that is created by merging the relevant models? For example, say model 1 defines an entity Foo with relationship (one-to-one) toBar and that model 2 de...
stackexchange/codereview
I am working on converting a CVS repository that has the following symbols (among others): tcm-6.1.0-branch -- a branch tcm-6.1.0 -- a tag Using the standard transformations cvs2svn identifies them properly. However, I'd like to do some clean up during the conversion. Specifically I'd like to drop the redundant '-b...
stackexchange/codereview
I would like to receive suggestions on the data generators that are available, for SQL server. If posting a response, please provide any features that you think are important. I have never used a application like this, so I am looking to be educated on the topic. Thank you. (My goal is to fill a database with 10,000+ ...
stackexchange/codereview
I'm using VisualSVN Server to host an SVN repo, and for some automation work, I'd like to be able to get specific versions via the http[s] layer. I can get the HEAD version simply via an http[s] request to the server (httpd?) - but is there any ability to specify the revision, perhaps as a query-string? I can't seem to...
stackexchange/codereview
Tackling a strange scenario here. We use a proprietary workstation management application which uses mySQL to store its data. Within the application they provide number of reports, such as which user logged into which machine at what time, all the software products installed on the monitored machines, so on and so for...
stackexchange/codereview
How can I have a relative path in the web.config file. This value is not in the connection string so I cannot use |DataDirectory| (I think), so what can I do?
stackexchange/codereview
I want to copy a DLL file from PC to vs.net`s pocket pc 2003 simulator, so i use the shared folder of the simulator, but i can not see the dll file in file list of simulator. How to do it, please ?
stackexchange/codereview
I want to implement Generics in my Page Class like : Public Class MyClass(Of TheClass) Inherits System.Web.UI.Page But for this to work, I need to be able to instantiate the Class (with the correct Generic Class Type) and load the page, instead of a regular Response.Redirect. Is there a way to do this ?
stackexchange/codereview
I want to display data like the following: Title Subject Summary Date So my HTML looks like: <div class="title"></div> <div class="subject"></div> <div class="summary"></div> <div class="date"></div> The problem is, all the text doesn't appear on a single line. I tried adding display="block" but that doesn...
stackexchange/codereview
On a JSTL/JSP page, I have a java.util.Date object from my application. I need to find the day after the day specified by that object. I can use <jsp:scriptlet> to drop into Java and use java.util.Calendar to do the necessary calculations, but this feels clumsy and inelegant to me. Is there some way to use JSP or JSTL ...
stackexchange/codereview
The system I'm currently working on consists of a controller PC running XP with .Net 2 connected to a set of embedded systems. All these components communicate with each other over an ethernet network. I'm currently using TcpClient.Connect on the XP computer to open a connection to the embedded systems to send TCP/IP m...
stackexchange/codereview
How do you set your Cocoa application as the default web browser? I want to create an application that is launched by default when the user clicks on an HTTP or HTTPS link in other applications (Mail, iChat etc.).
stackexchange/codereview
I have played with the idea of using a wiki (MediaWiki) to centralize all project information for a development project. This was done using extensions that pull information from SVN (using SVNKit) and by linking to Bugzilla to extract work assigned to a developer or work remaining for a release. Examples: <bugzilla t...
stackexchange/codereview
Is there an NSIS var to get the path of the currently running installer?
stackexchange/codereview
When I try to execute a view that includes tables from different schemas an ORA-001031 Insufficient privileges is thrown. These tables have execute permission for the schema where the view was created. If I execute the view's SQL Statement it works. What am I missing?
stackexchange/codereview
I am programmatically creating PDFs, and a recent change to my generator is creating documents that crash both Mac Preview and Adobe Reader on my Mac. Before Adobe Reader crashes, it reports: There was an error processing a page. There was a problem reading this document (18). I suspect that that "18" might give m...
stackexchange/codereview
The source database is quite large. The target database doesn't grow automatically. They are on different machines. I'm coming from a MS SQL Server, MySQL background and IDS11 seems overly complex (I am sure, with good reason).
stackexchange/codereview
Is this valid SOAP / XML? <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <CreateRoute xmlns="urn:Routs"> <aRoute>...
stackexchange/codereview
We are using JBoss Rules (a.k.a. Drools) and have several .drl files that each contain several rules. Is there a way to avoid duplication between files, so that we can define common rules that are available to more than one .drl file? Unfortunately, there does not seem to be any kind of include or module facility.
stackexchange/codereview
How does it work, what is it used for and when should one use it?
stackexchange/codereview
Do you know any libraries similar to java.util.Properties that support more advanced features like grouping properties, storing arrays, etc? I am not looking for some heavy super-advanced solution, just something light and useful for any project. Thanks.
stackexchange/codereview
I'm working on a casual game on XNA with the intention of deploying to the Xbox 360. I'm not going to have access to hardware for a few weeks and I'm on a tight deadline, so I'd like to test that a few things -- Boo and a few custom libraries -- will work properly on the 360. If they don't, I need to work around them...
stackexchange/codereview
I have a helper method has been created which allows a MovieClip-based class in code and have the constructor called. Unfortunately the solution is not complete because the MovieClip callback onLoad() is never called. (Link to the Flashdevelop thread which created the method .) How can the following function be modif...
stackexchange/codereview
Hi im new to MVC and I've fished around with no luck on how to build MVC User Controls that have ViewData returned to them. I was hoping someone would post a step by step solution on how to approach this problem. If you could make your solution very detailed that would help out greatly. Sorry for being so discrete with...
stackexchange/codereview
This is what I have so far: myArray.map!{ rand(max) } Obviously, however, sometimes the numbers in the list are not unique. How can I make sure my list only contains unique numbers without having to create a bigger list from which I then just pick the n unique numbers? Edit: I'd really like to see this done w/o loop...
stackexchange/codereview
In the markup shown below, I'm trying to get the content div to stretch all the way to the bottom of the page but it's only stretching if there's content to display. The reason I want to do this is so the vertical border still appears down the page even if there isn't any content to display. Here is my DEMO: body { ...
stackexchange/codereview
I was looking for a generic method in .Net to encode a string for use in an Xml element or attribute, and was surprised when I didn't immediately find one. So, before I go too much further, could I just be missing the built-in function? Assuming for a moment that it really doesn't exist, I'm putting together my own ...
stackexchange/codereview
Are there any IDE's for developing HLSL code? The three key features I want are: 1) syntax highlighting 2) auto-complete 3) interaction debugging Visual Studio doesn't do any of these things, and it doesn't seem that RenderMonkey or FX Composer do either. Is there some IDE that I'm not aware of, or does one of these t...
stackexchange/codereview
I need to save a user's login information in encrypted form for this application I'm building, but I'm not sure of the best place to save the file. I don't want to save it into the program application folder as I want it per user. So what is the best folder (or way) to save it into? Edit: Using C++.
stackexchange/codereview
I am working on an ASP.NET application. I need to use some third party component (do not have the source code) that is unverifiable (I think it is written in managed c++). I am wondering if this can cause problems for the customers. The ASP.NET application can be installed on the customers servers or potentially on som...
stackexchange/codereview
I am using Enterprise Library 4.0 and I can't find any documentation on creating a custom logging filter. Has anyone done this or seen any good online documentation on this?
stackexchange/codereview
Do you use any of these technologies? Which ones are current and hence sensible to include in a site? Documentation on any seems to be relatively sparse, and usage of any of them limited, as search engines get better, are they even relevant any more?
stackexchange/codereview
Could Silverlight be used for the same things as jQuery, or are they intended for different things? For example, vb.net could be used for the same stuff as C# while C# is intended for different things than what JavaScript is. Is Silverlight and jQuery like vb.net and C#, or more like C# and JavaScript?
stackexchange/codereview
I'm writing a web app that will be distributed and I want to allow the installer to choose between using Integrated Authentication, or FBA. Switching between those with web.config is obviously very easy. I'm trying to decide how best to architect the database and code to accept either a windows-sid or a UserID from t...
stackexchange/codereview
Is there a general rule of thumb to follow when storing web application data to know what database backend should be used? Is the number of hits per day, number of rows of data, or other metrics that I should consider when choosing? My initial idea is that the order for this would look something like the following (bu...
stackexchange/codereview
I made a class from Linq to SQL Clasees with VS 2008 SP1 Framework 3.5 SP1, in this case I extended the partial partial void UpdateMyTable(MyTable instance){ // Business logic // Validation rules, etc. } My problem is when I execute db.SubmitChanges(), it executes UpdateMyTable and makes the validations but it d...
stackexchange/codereview
Here on Stack Overflow, you're a "user." On 43things.com you're a "person." On other sites, you're an "account." And then some web apps skip the usage of this kind of signifier, and it's just http://webapp.com/yourusername Do you think that these signifiers imply anything at all? Do you prefer one over the other? In b...
stackexchange/codereview
I have an Xtext/Xpand (oAW 4.3, Eclipse 3.4) generator plug-in, which I run together with the editor plug-in in a second workbench. There, I'd like to run Xpand workflows programmatically on the model file I create. If I set the model file using the absolute path of the IFile I have, e.g. with: String dslFile = file.ge...
stackexchange/codereview
MSDN displays the following for CreatePatternBrush: You can delete a pattern brush without affecting the associated bitmap by using the DeleteObject function. Therefore, you can then use this bitmap to create any number of pattern brushes. My question is the opposite. If the HBRUSH is long lived, can I dele...
stackexchange/codereview
Is their any profilers that support Silverlight? I have tried ANTS (Version 3.1) without any success? Does version 4 support it? Any other products I can try? Updated since the release of Silverlight 4, it is now possible to do full profiling on SL applications... check out this article on the topic At PDC, I announce...
stackexchange/codereview
Say you have several webparts, one as a controller and several which take information from the controller and act on it. This is fairly easy to model using the Consumer/Producer interface introduced in ASP 2.0. How would you be able to add interactions the other way around whilst still maintaining the above? A simple...
stackexchange/codereview
Sampling with Activity Monitor/Instruments/Shark will show stack traces full of C functions for the Python interpreter. I would be helpful to see the corresponding Python symbol names. Is there some DTrace magic that can do that? Python's cProfile module can be useful for profiling individual subtrees of Python calls, ...
stackexchange/codereview
The Erlang documentation contains the documentation of modules. Where can I find the documentation of the Erlang shell? (Which is not a module, I suppose.)
stackexchange/codereview
Getting sporadic errors from users of a CMS; Ajax requests sometimes result in a "501 Method not implemented" response from the server. Not all the time; usually works. Application has been stable for months. Users seem to be getting it with Firefox 3. I've seen a couple references via Google to such problems being re...
stackexchange/codereview
Has anybody attempted to pass a VBA (or VB6) function (via AddressOf ?) to the SQLite create a UDF function (http://www.sqlite.org/c3ref/create_function.html). How would the resulting callback arguments be handled by VBA? The function to be called would have the following signature... void (xFunc)(sqlite3_context,int...
stackexchange/codereview
I'm new to CodeIgniter, and I need some help. I'd like to implement the following: View a user's profile via: http://localhost/profile/johndoe Administrate a user's profile via: http://localhost/admin/profile/johndoe Be able to accomplish even further processing via: http://localhost/admin/profile/create ...and... h...
stackexchange/codereview
I have a JavaScript widget which provides standard extension points. One of them is the beforecreate function. It should return false to prevent an item from being created. I've added an Ajax call into this function using jQuery: beforecreate: function (node, targetNode, type, to) { jQuery.get('http://example.com/ca...
stackexchange/codereview
I'm trying to design some tables to store some data, which has to be converted to different languages later. Can anybody provide some "best practices" or guidelines for this? Thanks
stackexchange/codereview
I've just solved another *I-though-I-was-using-this-version-of-a-library-but-apparently-my-app-server-has-already-loaded-an-older-version-of-this-library-*issue (sigh). Does anybody know a good way to verify (or monitor) whether your application has access to all the appropriate jar-files, or loaded class-versions? Tha...
stackexchange/codereview
I cant seem to find much info on haskells layout features, as I understand it is something like pythons formatting requirements except that is optional. How can I choose not to use this option correctly? Would it be a good idea to start without it so that I get a solid feel for the language itself?
stackexchange/codereview
I am working with a Visual Studio 2005 C++ solution that includes multiple projects (about 30). Based upon my experience, it often becomes annoying to maintain all the properties of the projects (i.e include path, lib path, linked libs, code generation options, ...), as you often have to click each and every project ...
stackexchange/codereview
If I am iterating over each file using : @echo off FOR %%f IN (*\*.\**) DO ( echo %%f ) how could I print the extension of each file? I tried assigning %%f to a temporary variable, and then using the code : echo "%t:~-3%" to print but with no success.
stackexchange/codereview
Greetings, I want to write a small cross-platform utility program with GUI in it. What language/GUI-library should I stick to? Is it possible whatsoever? This is gonna be a small program, so I don't want to make people download JVM or .NET Framework. Is it possible to develop it natively? Update 1. By "natively" I mean...
stackexchange/codereview
I'm trying to change the background color of a single subplot in a MATLAB figure. It's clearly feasible since the UI allows it, but I cannot find the function to automate it. I've looked into whitebg, but it changes the color scheme of the whole figure, not just the current subplot. (I'm using MATLAB Version 6.1 by th...
stackexchange/codereview
How do I use the ofstream to write text to the end of a file without erasing its content inside?
stackexchange/codereview
I need to find a way to get at the request/response streams inside of the webbrowser winforms control and see that it's not real intuitive. For example, I need to be able to modify post data when a user clicks a submit button. It looks like you have to register for some MSHTML COM events to do so, but am unsure which I...
stackexchange/codereview
Is there a window manager for Visual Studio 2008 like this one. I really liked it, and that's all I used in Visual Studio 2005 and saw somewhere it is supposed to work in Visual Studio 2008, but it doesn't. I have tried it on many installations of Visual Studio 2008, and it doesn't remember any settings. I really liked...
stackexchange/codereview
I've got some XML, for example purposes it looks like this: <root> <field1>test</field1> <f2>t2</f2> <f2>t3</f2> </root> I want to transform it with XSLT, but I want to suppress the second f2 element in the output - how do I check inside my template to see if the f2 element already exists in the output whe...
stackexchange/codereview
I'm a contract programmer with lots of experience. I'm used to being hired by a client to go in and do a software project of one form or another on my own, usually from nothing. That means a clean slate, almost every time. I can bring in libraries I've developed to get a quick start, but they're always optional. (an...
stackexchange/codereview
Starting with the error: Error 81 The OutputPath property is not set for this project. Please check to make sure that you have specified a valid Configuration/Platform combination. Configuration='Staging' Platform='AnyCPU' C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets 490 9 ...
stackexchange/codereview
I'm running Drupal 5 on my website and want to upgrade to V6. I've not got any obscure or unsupported modules running. What do I do though? I can't seem to find any step-by-step upgrade methods. Do I just have to overwrite all the files and then re-run the installer again?
stackexchange/codereview
Which Ajax framework/toolkit can you recommend for building the GUI of web applications that are using struts?
stackexchange/codereview
I want to use VBScript to catch errors and log them (ie on error "log something") then resume the next line of the script. For example, On Error Resume Next 'Do Step 1 'Do Step 2 'Do Step 3 When an error occurs on step 1, I want it to log that error (or perform other custom functions with it) then resume at step 2. I...
stackexchange/codereview
For a university project I programmed a Internet Explorer Browser Helper Object to process web document information while browsing. It were running successful on Windows XP with IE6 and IE7. Now I have the issue that under Windows Vista the same BHO needs administrator rights to run. Browser and BHO running if you sta...
stackexchange/codereview
I have a program which needs to behave slightly differently on Tiger than on Leopard. Does anybody know of a system call which will allow me to accurately determine which version of Mac OS X I am running. I have found a number of macro definitions to determine the OS of the build machine, but nothing really good to det...
stackexchange/codereview
I'm using a device that's got GPRS media to connect to a PC running stunnel. On TCPIP connections, the number of sessions is limitless. However, when it comes to SSL connections, it could only go as far as 1062 successful sessions. I've tried it like 3 times but makes no difference. I've checked the OpenSSL codes and...
stackexchange/codereview
On a PHP-based web site, I want to send users a download package after they have filled out a short form. The site-initiated download should be similar to sites like download.com, which say "your download will begin in a moment." A couple of possible approaches I know about, and browser compatibility (based on a quick ...
stackexchange/codereview
I would like to have information about the icons which are displayed alongside the site URLs on a web browser. Is this some browser specific feature? Where do we specify the icon source, ie, is it in some tag on the web page itself ?
stackexchange/codereview
How do I iterate over a set of records in RPG(LE) with embedded SQL?
stackexchange/codereview
Is there any source on the web where I could find date and time formats used in individual countries in the World? I was checking languages listed in Control panel in Windows, but there are some countries missing (for example countries in Africa etc.). I found some locale tables on the web, but these usualy differ from...
stackexchange/codereview
I'm trying to format a column in a <table/> using a <col/> element. I can set background-color, width, etc., but can't set the font-weight. Why doesn't it work? <table> <col style="font-weight:bold; background-color:#CCC;"> <col> <tr> <td>1</td> <td>2</td> </tr> <tr> <td>3</t...
stackexchange/codereview
I am making my switch from coding in C++ to C#. I need to replace my C++ error logging/reporting macro system with something similar in C#. In my C++ source I can write LOGERR("Some error"); or LOGERR("Error with inputs %s and %d", stringvar, intvar); The macro & supporting library code then passes the (possibly varar...
stackexchange/codereview
How do I get command line utilities like ping to use the default proxy in Windows XP. proxycfg -u sets the proxy to the default (IE) proxy alright, but it doesn't seem to be working. Update: I am behind a proxy and would like a way to check if a site is up or not hence trying to use ping! Also would like a way to telne...
stackexchange/codereview
I have a pretty basic windows form app in .Net. All the code is C#. I'd like to turn it into an Asp.net web app. How can I easily do this? I think there's an easy way since the controls I drag/drop onto the windows form designer are pretty much the same that I drag/drop onto the aspx design page. Note: the windows ...
stackexchange/codereview
I am trying to pass a member function within a class to a function that takes a member function class pointer. The problem I am having is that I am not sure how to properly do this within the class using the this pointer. Does anyone have suggestions? Here is a copy of the class that is passing the member function: c...
stackexchange/codereview
Convert a .doc or .pdf to an image and display a thumbnail in Ruby? Does anyone know how to generate document thumbnails in Ruby (or C, python...)
stackexchange/codereview
I am currently suffering a brain fart. I've done this before but I can't remember the exact syntax and I can't look at the code I wrote because I was working at another company at the time. I have this arrangement: class P { // stuff }; class PW : public P { // more stuff }; class PR : public P { // more stuff }; cl...
stackexchange/codereview
I have an ext combobox which uses a store to suggest values to a user as they type. An example of which can be found here: combobox example Is there a way of making it so the suggested text list is rendered to an element in the DOM. Please note I do not mean the "applyTo" config option, as this would render the whole ...
stackexchange/codereview
I'm trying to script the shutdown of my VM Servers in a .bat. if one of the vmware-cmd commands fails (as the machine is already shutdown say), I'd like it to continue instead of bombing out. c: cd "c:\Program Files\VMWare\VmWare Server" vmware-cmd C:\VMImages\TCVMDEVSQL01\TCVMDEVSQL01.vmx suspend soft -q vmware-cmd C...
stackexchange/codereview
I have a DataGrid, populated with objects in an ArrayCollection. After updating one of the objects' fields, I want the screen to update. The data source is not bindable, because I'm constructing it at runtime (and I don't understand how to make it bindable on the fly yet -- that's another question). In this situation...
stackexchange/codereview
Can anyone tell how Adobe Acrobat 9 was made? I like the look and feel of the GUI and I'm curious how it was made. Specifically, what programming language was used to make it?
stackexchange/codereview
I'm creating an XML Document in JavaScript on the client side, and then transforming it back to a string to send to the server. Mozilla has a handy method to accomplish this: XMLSerializer().serializeToString(), which I'm using. However, there seems to be a bug in this method: it returns all node names in uppercase and...
stackexchange/codereview
Can I rename a folder in Perforce from //depot/FooBar/ to //depot/Foobar/? I've tried this by renaming from //depot/FooBar/ to //depot/Temp/ to //Depot/Foobar/ but the end result ends up the same as //depot/FooBar/.
stackexchange/codereview
I code C++ using MS Dev Studio and I work from home two days per week. I use CVS to keep my sources synchronized between the two computers but there are difference between the environments the machines are in. Can anyone suggest a way I can conditionally modify constants in my code depending on whether I am compiling o...
stackexchange/codereview
One problem I've been toying with off and on is a service that requires my server to produce a screenshot of a webpage at a given url. The problem is that I don't have any idea how I would accomplish this. I mostly use a LAMP software stack, so answers that were given with that in mind would be the most helpful. Again ...
stackexchange/codereview
How do you extract an RT_RCDATA section from a Win32 executable (preferably in C#)? The only way I know how to do this currently is opening up the EXE in Visual Studio. I'd love to be able to do this entirely in C# if possible. Thanks!
stackexchange/codereview
class someclass {}; class base { int a; int *pint; someclass objsomeclass; someclass* psomeclass; public: base() { objsomeclass = someclass(); psomeclass = new someclass(); pint = new int(); throw "constructor failed"; a = 43; } } int main() { b...
stackexchange/codereview
is there an alternative for mysql_insert_id() php function for PostgreSQL? Most of the frameworks are solving the problem partially by finding the current value of the sequence used in the ID. However, there are times that the primary key is not a serial column....
stackexchange/codereview
I admit it: I don't bother with too much exception handling. I know I should do more but I can never wrap my head around where to start and where to stop. I'm not being lazy. Far from it. It's that I'm overwrought with exception handling ambivalence. It just seems that there is a seemingly infinite number of places...
stackexchange/codereview
I am writing a C# control that wraps DirectX 9 and provides a simplified interface to perform 2D pixel level drawing. .NET requires that I wrap this code in an unsafe code block and compile with the allow unsafe code option. I'm locking the entire surface which then returns a pointer to the locked area of memory. I can...
stackexchange/codereview
How can I make a major upgrade to an installation set (MSI) built with WiX install into the same folder as the original installation? The installation is correctly detected as an upgrade, but the directory selection screen is still shown and with the default value (not necessarily the current installation folder). Do I...
stackexchange/codereview
Why does the sizeof operator return a size larger for a structure than the total sizes of the structure's members?
stackexchange/codereview
nHibernate is not able to retrieve manually changed data from repository table? I have disabled second level cache also but looks like it(nhibernate) is retrieving sometimes from cache and sometimes from repository table.
stackexchange/codereview
Using any member of the Windows Server family, I can set up an active directory, and have a single pool of users for a large scale of computers; access can be given / removed for any shared resources in the given domain (including access to client computers, etc). What similar (and widespread) solutions exist for manag...
stackexchange/codereview
How do I get the caller's IP address in a WebMethod? [WebMethod] public void Foo() { // HttpRequest... ? - Not giving me any options through intellisense... } using C# and ASP.NET
stackexchange/codereview
I am working on a web application (J2EE) and I would like to know the options that are available for handling a double post from the browser. The solutions that I have seen and used in the past are all client-side: Disable the submit button as soon as the user clicks it. Follow a POST-Redirect-GET pattern to prevent P...
stackexchange/codereview
Developing a .NET WinForms application: how can I check if the window is in Help mode (i.e. after clicking the "?" button in the title bar)? The problem I have is that my System.Windows.Forms.ToolStripItem objects do not have a HelpRequested event (because they do not inherit from Control) so in the Click event handler...
stackexchange/codereview