instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
Suppose I attach an blur function to an HTML input box like this: <input id="myInput" onblur="function() { ... }"></input> Is there a way to get the ID of the element which caused the blur event to fire (the element which was clicked) inside the function? How? For example, suppose I have a span like this: <span id="my...
stackexchange/codereview
I cannot use the Resource File API from within a file system plugin due to a PlatSec issue: *PlatSec* ERROR - Capability check failed - Can't load filesystemplugin.PXT because it links to bafl.dll which has the following capabilities missing: TCB My understanding of the issue is that: File system plugins are dlls whi...
stackexchange/codereview
Is it possible to close an InfoPath form programmatically? I know that it can be configured as a form rule / action but I want to close the form via code.
stackexchange/codereview
I need a function written in Excel VBA that will hash passwords using a standard algorithm such as SHA-1. Something with a simple interface like: Public Function CreateHash(Value As String) As String ... End Function The function needs to work on an XP workstation with Excel 2003 installed, but otherwise must use no ...
stackexchange/codereview
When Joel Spolsky and Jeff Atwood began the disagreement in their podcast over whether programmers should learn C, regardless of their industry and platform of delivery, it sparkled quite an explosive debate within the developer community that probably still rages amongst certain groups today. I have been reading a num...
stackexchange/codereview
In a asp.net web application, I want to write to a file. This function will first get data from the database, and then write out the flat file. What can I do to make sure only 1 write occurs, and once the write occurrs, the other threads that maybe want to write to the file don't since the write took place. I want to ...
stackexchange/codereview
From what I have gleaned from reflector, RunWithElevatedPriveleges simply reverts the current thread identity to the base (non-impersonated) identity. This makes perfect sense in the case of code running inside the WSS application pool, since the base service account is a super-user. Does it have any effect when runn...
stackexchange/codereview
I have inherited a poorly written web application that seems to have errors when it tries to read in an xml document stored in the database that has an "&" in it. For example there will be a tag with the contents: "Prepaid & Charge". Is there some secret simple thing to do to have it not get an error parsing that cha...
stackexchange/codereview
What can be a practical solution to center vertically and horizontally content in HTML that works in Firefox, IE6 and IE7? Some details: I am looking for solution for the entire page. You need to specify only width of the element to be centered. Height of the element is not known in design time. When minimizing window...
stackexchange/codereview
I have just set up cruise control.net on our build server, and I am unable to find a setting to tell it to only build one project at a time. Any ideas?
stackexchange/codereview
We've got an Apache instance deployed through Oracle Application Server. It's currently installed with the default wallet, and, the self-signed certificate. We've got a GEOTRUST certificiate, imported the Trusted Roots and imported the new Cert to the Wallet Manager. We've then updated the SSL properties of the VHOST a...
stackexchange/codereview
We have the standard Subversion trunk/branches/tags layout. We have several branches for medium- and long-term projects, but none so far for a release. This is approaching fast. Should we: Mix release branches and project branches together? Create a releases folder? If so, is there a better name than releases? Create ...
stackexchange/codereview
I have a question about using streams in .NET to load files from disk. I am trying to pinpoint a performance problem and want to be sure it's where I think it is. Dim provider1 As New MD5CryptoServiceProvider Dim stream1 As FileStream stream1 = New FileStream(FileName, FileMode.Open, FileAccess.Read, FileShare.Read) ...
stackexchange/codereview
A feature in Eclipse that I really miss is how you can auto-complete method parameters with currently in-scope variables. This feature will, with a single key combo (ctrl+space) fill in all method parameters. As long as my variables were named similarly to the method parameters, I never had a problem with this auto-c...
stackexchange/codereview
I've used MyGeneration, and I love it for generating code that uses Data Access Applicaiton Blocks from Microsoft for my Data Access Layer, and keeping my database concepts in sync with the domain I am modeling. Although, it took a steeper than expected learning curve one weekend to make it productive. I'm wondering w...
stackexchange/codereview
I have been able to define multiple aspects (one is @Before and another is @Around) using Spring AOP (combined with AspectJ annotations) over a business service class. Currently they are getting called one by one (in sequence). However I would like to know how the priority of calling the aspects can be defined and wher...
stackexchange/codereview
What makes a language a scripting language? I've heard some people say "when it gets interpreted instead of compiled". That would make PHP (for example) a scripting language. Is that the only criterion? Or are there other criteria? See also: What’s the difference between a “script” and an “application”?
stackexchange/codereview
I have a C extension module and it would be nice to distribute built binaries. Setuptools makes it easy to build extensions modules on OS X and GNU/Linux, since those OSs come with GCC, but I don't know how to do it in Windows. Would I need to buy a copy of Visual Studio, or does Visual Studio Express work? Can I just ...
stackexchange/codereview
We are setting up a new SharePoint for which we don't have a valid SSL certificate yet. I would like to call the Lists web service on it to retrieve some meta data about the setup. However, when I try to do this, I get the exception: The underlying connection was closed: Could not establish trust relationship for the ...
stackexchange/codereview
I am told that good developers can spot/utilize the difference between Null and False and 0 and all the other good "nothing" entities. What is the difference, specifically in PHP? Does it have something to do with ===?
stackexchange/codereview
In Oracle, is there an easy way to fully unwrap a view? eg: If I have a view which is made up of selects on more views, is there some way to unwrap it to just select directly on real tables?
stackexchange/codereview
After rebooting the Windows 2003 Server with the IIS I receive the follow error message: Cannot connect to the configuration database in the browser. The error occur on different pages and with different clients. that I think it is a server problem. What can I do to solve this error?
stackexchange/codereview
Is there a cheap way to get the dimensions of an image (jpg, png, ...)? Preferably, I would like to achieve this using only the standard class library (because of hosting restrictions). I know that it should be relatively easy to read the image header and parse it myself, but it seems that something like this should be...
stackexchange/codereview
I'm planning on creating a game that contains a landscape with objects on it. The landscape will be defined using a heightfield, and the objects will move about on top of, and fly over the terrain. If you've ever played the old games Marble Madness and Virus/Zarch, that's the kind of complexity and style I'm trying to ...
stackexchange/codereview
I use the on-demand (hosted) version of FogBugz. I would like to start using Mercurial for source control. I would like to integrate FogBugz and a BitBucket repository. I gave it a bit of a try but things weren't going very well. FogBugz requires that you hook up your Mercurial client to a fogbugz.py python script....
stackexchange/codereview
When building some of my PHP apps, a lot of the functionality could be coded using PEAR/PECL modules, however, the fact that some people using it may not have the access to install things, It poses a puzzler for me. Should I forsake some users to use PEAR/PECL for functionality, where these will allow me to have a syst...
stackexchange/codereview
For example, how do I show or hide the Outlook envelope icon from an Outlook Rule? The envelope icon option is set by going to: Tools -> Options... E-mail Options Advanced E-mail Options Show an envelope icon in the notification area The reason why I say programmatically is because none of the standard Rule actions ...
stackexchange/codereview
My Invoice model has an address_id attribute, and I don't want this address_id to change FOREVER. So I don't want this to happen outside the class: invoice.address_id = 1 invoice.address = some_address Rails automatically adds this address_id attribute to the model from the invoice table, so how can I declare this att...
stackexchange/codereview
I'd like to learn assembler. However, there are very few resources for doing assembler with OS X. Is there anyone out there who has programmed in assembly on a Mac? Where did you learn? And, is there any reason I shouldn't be doing assembly? Do I risk (significantly) crashing my computer irreparably?
stackexchange/codereview
On some systems it is UTF-8, on others latin-1. How do you set this? Is it something in php.ini? (I know you can set the encoding/charset for a given page by setting HTTP headers, but this is not what I am looking for.) Alex
stackexchange/codereview
Does anyone know how I can check to see if a directory is writeable in PHP? The function is_writable doesn't work for folders. Edit: It does work. See the accepted answer.
stackexchange/codereview
I have a VS2008 solution using xml documentation, and we have warnings as errors turned on for release mode (a nice feature IMHO); this results, however, in long lists of 'missing xml comment' errors for such things as every element of a (self describing) enum. Does anyone know of an attribute or similar which switches...
stackexchange/codereview
I am working with a Sharepoint document library and I'm trying to locate the source of the document library page. I'm working on the Sharepoint server. I just can't find it, where should it be stored? Thank you!
stackexchange/codereview
First, yes I know about this question, but I'm looking for a bit more information that that. I have actually, a fairly similar problem, in that I need to be able to capture input for mouse/keyboard/joystick, and I'd also like to avoid SDL if at all possible. I was more or less wondering if anyone knows where I can get ...
stackexchange/codereview
I am investigating the design of a work queue processor where the QueueProcessor retrieves a Command Pattern object from the Queue and executes it in a new thread. I am trying to get my head around a potential Queue lockup scenario where nested Commands may result in a deadlock. E.G. A FooCommand object is placed onto ...
stackexchange/codereview
i wonder if there is a simple solution to change language of a wpf application during runtime. i used locbaml to globalize all the resources. Setting the Current Thread's UICulture in the App-constructor works fine, but when i try to chang it a little bit later, i doesn't reflect the changes anymore. This was actually ...
stackexchange/codereview
How can I tell in JavaScript what path separator is used in the OS where the script is running?
stackexchange/codereview
Is it possible to create Windows CE 5.0 images (ie: nk.bin) from VS2005/VS2008 without using Platform Builder? If so, how? Can a vendor BSP for WinCE 5 be loaded into VS2005/2008? Are there the parts to do this available for download from Microsoft (ie: the SDK), or must you buy the special bits (a la PB) from a "sp...
stackexchange/codereview
I'm trying to use JVLC but I can't seem to get it work. I've downloaded the jar, I installed VLC and passed the -D argument to the JVM telling it where VLC is installed. I also tried: NativeLibrary.addSearchPath("libvlc", "C:\\Program Files\\VideoLAN\\VLC"); with no luck. I always get: Exception in thread "main" ja...
stackexchange/codereview
How do I make Caps Lock work like Esc in Mac OS X?
stackexchange/codereview
E.g. the Soundex algorithm is optimized for English. Is there a more universal algorithm that would apply across large families of languages?
stackexchange/codereview
int i = 4; string text = "Player "; cout << (text + i); I'd like it to print Player 4. The above is obviously wrong but it shows what I'm trying to do here. Is there an easy way to do this or do I have to start adding new includes?
stackexchange/codereview
What is your favorite method to handle errors in Bash? The best example of handling errors I have found on the web was written by William Shotts, Jr at http://www.linuxcommand.org. He suggests using the following function for error handling in Bash: #!/bin/bash # A slicker error handling routine # I put a variable ...
stackexchange/codereview
I have breakpoints set but Xcode appears to ignore them.
stackexchange/codereview
I'm currently using Intelligencia.UrlRewriter does anyone have better suggestions?
stackexchange/codereview
I'm trying to start an external application through system() - for example, system("ls"). I would like to capture its output as it happens so I can send it to another function for further processing. What's the best way to do that in C/C++?
stackexchange/codereview
I'm working on a project using Windows 2008, .NET 3.5 and WCF for some internal services and the question of how to host the services has arisen. Since we're using Windows 2008 I was thinking it'd be good to take advantage of Windows Process Activation Service (WAS) although the feeling on the project seems to be that ...
stackexchange/codereview
How would I drainstop one of the nodes in a MS NLB via command line and then get notified of its completion? If there's no way to callback, is there an easy way to poll?
stackexchange/codereview
In answer to this question Joel Coehoorn said Finally, only after the site's gone through a suitable QA process, the production server is updated from source control, not from within visual studio. Does VSS Explorer have tools for deploying sites (via FTP, I would assume)? I noticed for the first time a Web/Deploy m...
stackexchange/codereview
Normally I use imagecreatefromjpeg() and then getimagesize(), but with Firefox 3 I need to go round this different. So now im using imagecreatefromstring(), but how do I retreive the image dimensions now?
stackexchange/codereview
In a recent project I have nearly completed we used an architecture that as its top layer of interaction from the web/services layers uses XXXManager classes. For example, there is a windows services that runs on a scheduled basis that imports data from several diverse data sources into our system. Within this service...
stackexchange/codereview
Where can I get the 64 bit bootstrapper for SQL Server Express 2005 64 bit. The default bootstrapper is 32 bit only. This will not install on Vista 64 bit.
stackexchange/codereview
There are zillions of Java web application frameworks. 95% were designed before the modern era of AJAX/DHTML-based development, and that means these new methods are grafted on rather than designed in. Has any framework been built from the ground up with e.g. GWT + Extjs in mind? If not, which framework has adapted best...
stackexchange/codereview
So, I have Flex project that loads a Module using the ModuleManager - not the module loader. The problem that I'm having is that to load an external asset (like a video or image) the path to load that asset has to be relative to the Module swf...not relative to the swf that loaded the module. The question is - How can...
stackexchange/codereview
Basically I want to pass a string which contains Spanish text that could be in one of several encodings (Latin-1, CP-1252, or UTF-8 to name a few). Once it gets to the XMLRPC I can detect the encoding, but I won't know it before then. C#, by default seems to be killing any characters outside of ASCII. I've gotten ar...
stackexchange/codereview
I'm a member of ACM, and I have limited access to both Books 24x7 and Safari Books Online, however if I was interested in moving up to a full account for greater access to other books what online book service would you recommend?
stackexchange/codereview
What is the best way (performance wise) to paginate results in SQL Server 2000, 2005, 2008, 2012 if you also want to get the total number of results (before paginating)?
stackexchange/codereview
Why doesn't have the c standard a memswap function, which would probably look like: int memswap(void *ptr1, void *ptr2, size_t nbytes)? I know it'd be easy to write, but i think the libc could do some awesome tricks to speed it up like some implementations do it for memcpy.
stackexchange/codereview
Whats the best way to bind variable column names to a report field in Access when using a crosstab query?
stackexchange/codereview
I've been given the task of laying the groundwork of a SOA for my client. The goal is to open up various processes in an end-client independent way and also to make data available offline e.g. for reps visiting customers. I do have extensive experience with J2EE (Websphere) and web services but I would appreciate advic...
stackexchange/codereview
As part of our product we use 3rd party hardware and drivers. Unfortunately, these drivers aren't signed so up pops the "Found new hardware wizard" when installing or upgrading our product. Our product is web based and allows the users access to everything they need remotely, apart from this one case. Is there a regi...
stackexchange/codereview
I have Java 1.5.0 installed on a Mac OS machine. I have the Java Embedding Plugin 0.9.6.4 installed and java enabled on the preferences panel. When I go to http://java.com/en/download/help/testvm.xml the applet appears blank. Does anyone has an idea of what is happening?
stackexchange/codereview
I'm trying to generate customized xml files from a template xml file in python. Conceptually, I want to read in the template xml, remove some elements, change some text attributes, and write the new xml out to a file. I wanted it to work something like this: conf_base = ConvertXmlToDict('config-template.xml') conf_ba...
stackexchange/codereview
We are running part of our app as a windows service and it needs to b able to access DSNs in order to import through ODBC. However there seem to be a lot of restrictions found through trial and error on what DSNs it can access. For example it seems that it cannot 1. access a system DSN unless the account that is run...
stackexchange/codereview
Does anyone know the keyboard shortcut in Visual Studio to open the context menu? i.e The equivalent of right clicking. Thanks.
stackexchange/codereview
We started some overseas merge replication 1 year ago and everything is going fine till now. My problem is that we have now so much data in our system that any crash on one of the subscriber's servers will be a disaster: reinitialising a subscription the standard way will take days (our connexions are definitely slow, ...
stackexchange/codereview
I have an Access 2003 application that communicates with a Webservice to get articles from a central database. It runs fine in a full Access install but when I make runtime install with Package Wizard included in Access 2003 developer extensions, it fails with the error message "429 cannot create an object in the activ...
stackexchange/codereview
I have an SSIS package, which depending on a boolean variable, should either go to a Script Task or an Email task.(Note: the paths are coming from a Script Task) I recall in the old dts designer there was a way to do this via code. What is the proper way to accomplish this in SSIS?
stackexchange/codereview
Good morning, I am about to start writing an Excel add-in for Excel 2002. The add-in needs to call a form. Obviously, I can write the form within VBA. My question is -- is there an easy/good way of calling a .NET (I am using 3.5) from Excel, and have the form be able to write stuff back to Excel the same way a native...
stackexchange/codereview
I have this RewriteRule that works too well :-) RewriteRule ^([^/]*)/$ /script.html?id=$1 [L] The bad thing about this rule is that it also matches physical directories which I don't want. How can I tell the mod_rewrite to ignore physical directories and apply the above rule only when the directory matched does not ex...
stackexchange/codereview
Having a problem getting a TreeView control to display node images. The code below works sometimes but fails to show any image at other times. private TreeNode AddNodeForCore(TreeNode root, Core c) { string key = GetImageKey(c); TreeNode t = root.Nodes.Add(c.Name, c.Name, key, key); t.Tag = c; return t...
stackexchange/codereview
I'm trying to configure a dedicated server that runs ASP.NET to send mail through the local IIS SMTP server but mail is getting stuck in the Queue folder and doesn't get delivered. I'm using this code in an .aspx page to test: <%@ Page Language="C#" AutoEventWireup="true" %> <% new System.Net.Mail.SmtpClient("localhos...
stackexchange/codereview
For my school work, I do a lot of switching computers (from labs to my laptop to the library). I'd kind of like to put this code under some kind of version control. Of course the problem is that I can't always install additional software on the computers I use. Is there any kind of version control system that I can ...
stackexchange/codereview
I need to change the credentials of an already existing Windows service using C#. I am aware of two different ways of doing this. ChangeServiceConfig, see ChangeServiceConfig on pinvoke.net ManagementObject.InvokeMethod using Change as the method name. Neither seems a very "friendly" way of doing this and I was wonde...
stackexchange/codereview
I'm trying to create the IDL for the IConverterSession interface and I'm confused by the definition of the MIMETOMAPI method. It specifies the LPMESSAGE pmsg parameter as [out] yet the comments state its the pointer to the MAPI message to be loaded. Its unclear to me whether the functions allocates the MAPI message obj...
stackexchange/codereview
I know that Sql Server has some handy built-in quarterly stuff, but what about the .Net native DateTime object? What is the best way to add, subtract, and traverse quarters? Is it a bad thing™ to use the VB-specific DateAdd() function? e.g.: Dim nextQuarter As DateTime = DateAdd(DateInterval.Quarter, 1, DateTime.Now) ...
stackexchange/codereview
I want to add the selected item from the TreeView to the ListBox control using DataBinding (If it can work with DataBinding). <TreeView HorizontalAlignment="Left" Margin="30,32,0,83" Name="treeView1" Width="133" > </TreeView> <ListBox VerticalAlignment="Top" Margin="208,36,9...
stackexchange/codereview
I have a list with two <div>s in every <li> and I want to float them one next to the other and I want the <li> to take the whole availabe space. How do I do it? <html> <head> <title></title> <style type="text/css"> body { } ul { } li { ...
stackexchange/codereview
(I don't want to hear about how crazy I am to want that! :) Focus-follows-mouse is also known as point-to-focus, pointer focus, and (in some implementations) sloppy focus. [Add other terms that will make this more searchable!] X-mouse
stackexchange/codereview
My model layer is being used by a handful of different projects and I'd like to use a single XML Spring Configuration file for the model regardless of which project is using it. My question is: Since not all beans are used in all projects am I wasting resources to any significant amount if there not being instantiated?...
stackexchange/codereview
(Not related to versioning the database schema) Applications that interfaces with databases often have domain objects that are composed with data from many tables. Suppose the application were to support versioning, in the sense of CVS, for these domain objects. For some arbitry domain object, how would you design a da...
stackexchange/codereview
I am new to java so excuse my lame questions:) I am trying to build a web service in Java NetBeans 6.1 , but I have some troubles with configuration parameters ( like .settings in .net). What is the right way to save and access such settings in a java web service. Is there a way to read context parameters from web.xml...
stackexchange/codereview
Maps are great to get things done easily, but they are memory hogs and suffer from caching issues. And when you have a map in a critical loop that can be bad. So I was wondering if anyone can recommend another container that has the same API but uses lets say a vector or hash implementation instead of a tree implementa...
stackexchange/codereview
I'm currently working on a class that calculates the difference between two objects. I'm trying to decide what the best design for this class would be. I see two options: 1) Single-use class instance. Takes the objects to diff in the constructor and calculates the diff for that. public class MyObjDiffer { public M...
stackexchange/codereview
I'm trying to install Maatkit following the maatkit instructions. I can't get past having to install DBD::mysql. "Warning: prerequisite DBD::mysql 1 not found." When I try to install DBD::mysql from cpan, I get very helpful "make had returned bad status, install seems impossible". Perl is "v5.8.8 built for darwin-thre...
stackexchange/codereview
When trying to distribute work that requires a multiple stage processing pipeline what are the communication, synchronization and throughput costs limitations in JMS vs JavaSpaces?
stackexchange/codereview
I'm working on a fairly complex project, a custom encryption routine if you will (just for fun) and I've run into this issue in designing my code layout. I have a number of functions that I want to be able to call by index. Specifically, I need to be able to call one randomly for the encrypt process, but then address t...
stackexchange/codereview
Ok, this is a curly one. I'm working on some Delphi code that I didn't write, and I'm encountering a very strange problem. One of my stored procedures' parameters is coming through as null, even though it's definitely being sent 1. The Delphi code uses a TADOQuery to execute the stored procedure (anonymized): ADOQuery...
stackexchange/codereview
I was reading about output buffering in JavaScript here, and was trying to get my head around the script the author says was the fastest at printing 1 to 1,000,000 to a web page. (Scroll down to the header "The winning one million number script".) After studying it a bit, I have a few questions: What makes this scrip...
stackexchange/codereview
I use MySQL in a fairly complex web site (PHP driven). Ideally, there would be a tool I could use that would help me test the SQL queries I am using and suggest better table indexes that will improve performance and avoid table scans. Failing that, something that will tell me exactly what each query is up to, so I can ...
stackexchange/codereview
Is there a way to prevent someone from faking a mime type on a file upload and then running a php/exe/etc... I have to make the file upload directory writeable and executable so that the files can be stored, but this allows anyone to run a script after. One thing I can do is add random data to the file name so they ca...
stackexchange/codereview
I have a .NET 2.0 Windows Forms application. On this app there is a Form control with a Menu bar and a status bar. Also there's a ListView on this form. If I add a context menu to this form, the context menu will open when the user right clicks any part of the form, including the menu bar and the status bar. How can ...
stackexchange/codereview
When an error occurs in a function, I'd like to know the sequence of events that lead up to it, especially when that function is called from a dozen different places. Is there any way to retrieve the call stack in VB6, or do I have to do it the hard way (e.g., log entries in every function and error handler, etc.)?
stackexchange/codereview
I'm working on an existing report and I would like to test it with the database. The problem is that the catalog set during the initial report creation no longer exists. I just need to change the catalog parameter to a new database. The report is using a stored proc for its data. It looks like if try and remove the...
stackexchange/codereview
I'm trying to implement the WMD editor used on StackOverflow to create some basic Wiki-style functionality. I'm up to the point where it's time to save to the database, but I'm unsure as to what I should be saving. If I save the produced HTML then I can retrieve and display it correctly, but on re-edit I'm faced with ...
stackexchange/codereview
I'm trying to handle Winsock_Connect event (Actually I need it in Excel macro) using the following code: Dim Winsock1 As Winsock 'Object type definition Sub Init() Set Winsock1 = CreateObject("MSWinsock.Winsock") 'Object initialization Winsock1.RemoteHost = "MyHost" Winsock1.RemotePort = "22" Winsock1....
stackexchange/codereview
I'd like to remove all of the black from a picture attached to a sprite so that it becomes transparent.
stackexchange/codereview
I have two custom controls that are analogous to a node and the control that draws links between nodes. I would like to have both controls written as much in xaml as possible. The link stores both nodes as dependency properties, and I use databinding to move the line between the nodes whenever the nodes move. It wou...
stackexchange/codereview
I'm working with DotNetNuke's scheduler to schedule tasks and I'm looking to get the physical file path of a email template that I created. The problem is that HttpContext is NULL because the scheduled task is on a different thread and there is not http request. How would you go about getting the file's physical path?
stackexchange/codereview
I have converted one of my VS2006 projects into VS2008 and when trying to build the project in VS2008 I get the above error. What is .sbr file ? and how can I fix the compile error? Any help is hugely appreciated.
stackexchange/codereview