instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
From the MSDN article on STAThread: Indicates that the COM threading model for an application is single-threaded apartment (STA). (For reference, that's the entire article.) Single-threaded apartment... OK, that went over my head. Also, I read somewhere that unless your application uses COM interop, this attribute ac...
stackexchange/codereview
What options are there for serialization when returning instances of custom classes from a WebService? We have some classes with a number of child collection class properties as well as other properties that may or may not be set depending on usage. These objects are returned from an ASP.NET .asmx WebService decorated...
stackexchange/codereview
I am checking whether the new name already exists or not. Code 1 if(cmbxExistingGroups.Properties.Items.Cast<string>().ToList().Exists(txt => txt==txtNewGroup.Text.Trim())) { MessageBox.Show("already exists.", "Add new group"); } Otherwise I could have written: Code 2 foreach(var str in cmbxExistingGroup...
stackexchange/codereview
What are some methods of utilising Eclipse for Dependency Management?
stackexchange/codereview
Where I work we have a little bit of a dilemma... I work on a small team developing an application for internal use. We recently just received a new PM to the project. She would like to have access to our database and our sourcecode (stored in svn). Our previous PM did not see a need, nor want, to have access to any...
stackexchange/codereview
I need my code to do different things based on the operating system on which it gets compiled. I'm looking for something like this: #ifdef OSisWindows // do Windows-specific stuff #else // do Unix-specific stuff #endif Is there a way to do this? Is there a better way to do the same thing?
stackexchange/codereview
I am trying to to set up the login control to remember the login credentials of a user who has previously entered their user name and password successfully. I set the remember me property to true, but it doesnt seem to triger any events where I could read the cookie and auto login the user. Is there a straightforward ...
stackexchange/codereview
In Windows, is there an easy way to tell if a folder has a subfile that has changed? I verified, and the last modified date on the folder does not get updated when a subfile changes. Is there a registry entry I can set that will modify this behavior? If it matters, I am using an NTFS volume. I would ultimately like to...
stackexchange/codereview
I want Windows Update to automatically download and install updates on my Vista machine, however I don't want to be bothered by the system tray reboot prompts (which can, at best, only be postponed by 4 hours). I have performed the registry hack described here to prevent Windows forcibly rebooting my machine, which is ...
stackexchange/codereview
In our application, we are using RMI for client-server communication in very different ways: Pushing data from the server to the client to be displayed. Sending control information from the client to the server. Callbacks from those control messages code paths that reach back from the server to the client (sidebar not...
stackexchange/codereview
Can I set timeouts for JSP pages in tomcat either on a per page or server level?
stackexchange/codereview
I mean, is there a coded language with human style coding? For example: Create an object called MyVar and initialize it to 10; Take MyVar and call MyMethod() with parameters. . . I know it's not so useful, but it can be interesting to create such a grammar.
stackexchange/codereview
I've worked on many projects where I've been given code by others to update. More often than not I compile it and get about 1,000+ compiler warnings. When I see compiler warnings they make me feel dirty, so my first task is to clean up the code and remove them all. Typically I find about a dozen problems like uninitial...
stackexchange/codereview
I have two collections which have property Email in both collections. I need to get a list of the items in the first list where Email does not exist in the second list. With SQL I would just use "not in", but I do not know the equivalent in LINQ. How is that done? So far I have a join, like... var matches = from item1 ...
stackexchange/codereview
I have a web application (asp.net) where work items are submitted and allocated to users according to their workload. A user's workload is calculated using an algorithm based on the number of items currently allocated to the user (and some other factors). Each new item is allocated to the user with the lowest current w...
stackexchange/codereview
In SP2007/MOSS I need to run a CAML query against a single list like so: <Where> <Or> <Eq> <FieldRef Name='URL' /> <Value Type='URL'>/path/item1.aspx</Value> </Eq> <Eq> <FieldRef Name='URL' /> <Value Type='URL'>/path/item4.aspx</Value> ...
stackexchange/codereview
Coming from a C# background the naming convention for variables and methods are usually either camelCase or PascalCase: // C# example string thisIsMyVariable = "a" public void ThisIsMyMethod() In Python, I have seen the above but I have also seen snake_case being used: # python example this_is_my_variable = 'a' def th...
stackexchange/codereview
I would like to handle an OracleException thrown when my network/database connection is interrupted, where can I find out what error codes I might can receive? I guess since we are talking about a connection interruption these would be technically TNS errors such as ORA-12560 "TNS:protocol adapter error." But I have no...
stackexchange/codereview
I'm not sure if this even exists or not, so I figured I would tap the wisdom of others.. I was wondering if there are any Java libraries out there that can be used to validate a SQL query's syntax. I know that there are many deviations from common SQL spec, so it would probably only work against something like SQL:200...
stackexchange/codereview
I work on a small web team where I am the only .NET developer currently using Visual Studio 2008 Professional to build and maintain a few web applications. I am about to start training another member of our team so we purchased him a copy of Visual Studio 2008 Professional. I've looked into Visual Source Safe, but I'm...
stackexchange/codereview
I've had a go at solving the Eternity puzzle (1,000,000 GBP prize) and Netflix Prize ($1,000,000) in the past. I didn't win either, but they motivated me to find out about a new area. What other contests with prizes do you know about / have competed in yourself?
stackexchange/codereview
I intend to develop a system that is entirely based on modules. The system base should have support for finding out about plugins, starting them up and being able to provide ways for those modules to communicate. Ideally, one should be able to put in new modules and yank out unused modules at will, and modules should b...
stackexchange/codereview
I am trying to implement in windows scripting host the same function as windows Send To/Mail Recipient does. Did not find anything usefull on google except steps to instantiate Outlook.Application and directly calling its methods. I need to go the same path as windows do, as there is a mix of Outlook and Lotus Notes in...
stackexchange/codereview
How can I send an email from C++? Is there a good cross-platform (MS Windows, Linux etc) library that I can use? I'm using GCC (cygwin on MS Windows).
stackexchange/codereview
i've noticed that plenty of games / applications (very common on mobile builds) pack numerous images into an image strip. I figured that the advantages in this are making the program more tidy (file system - wise) and reducing (un)installation time. During the runtime of the application, the entire image strip is allo...
stackexchange/codereview
I am looking for something like like FCKEditor that allows users to follow links by left clicking them. For example, the markdown editor in StackOverflow does not allow you to click the links you add as you are entering data into the editor. I would like to render a text area pre-populated with some links to lab resul...
stackexchange/codereview
I'm creating a invoice crystal report for sage mas 500 AR module. In it, I'm attempting to add the tarinvoice.balance field with the following formula: if {tarPrintInvcHdrWrk.Posted} = 1 then ToText({tarInvoice.Balance}) I'm assuming that when the {tarPrintInvcHdrWrk.Posted} = 1 conditional statement holds FALSE...
stackexchange/codereview
I know its possible to get the top terms within a Lucene Index, but is there a way to get the top terms based on a subset of a Lucene index? I.e. What are the top terms in the Index for documents within a certain date range?
stackexchange/codereview
Would it be possible to execute a JSP page and capture its output outside of a web application? Mode specifically, in my case there still exists a usual web application, but it loads JSP pages not from its classpath, but from an arbitrary source. It seems like I cannot simply get RequestDispatcher and point it to a J...
stackexchange/codereview
Using web forms I know that you can only have one ASP.NET form on a page. I've done some implementations where I've used Javascript to add other forms to a page to support things like logon controls (that post back to Logon.aspx instead of the current page). I'm wondering if the single form per page is still present ...
stackexchange/codereview
I was recently considering using GoogleData for a hobby project to store my service's old data, (say 24+hours old), while I keep the fresh data on my servers (hobby project==cheap home server). However I haven't really heard of anyone using GoogleData, so I was wondering about what other's experiences have been. Edit: ...
stackexchange/codereview
I need to merge a forked project. Unfortunately, the CVS $Id lines are different so the merge tools I tried report that all the files are different (and 95% of them have only this line different) Is there a merge tool that can be configured to ignore line comparison results based on a pattern ? [edit] I discovered tha...
stackexchange/codereview
I have an "ldquo", "rdquo" and several other entities under my RSS feed. Seems like if I add <!DOCTYPE rss [ <!ENTITY % HTMLspec PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent"> %HTMLspec; below the xml tag and above the rss tag then I'll be able to include ...
stackexchange/codereview
I'm using a whole bunch of CALayers, creating a tile-based image not unlike GoogleMaps (different versions of the same image with more/less detail). The code I'm using to do this is: UIImage* image = [self loadImage:obj.fileName zoomLevel:obj.zoomLevel]; [CATransaction setValue:(id)kCFBooleanTrue forKe...
stackexchange/codereview
I have never quite understood how/why I would use Maven modules (reactor builds). We have tens of libraries that we share (as dependencies) among our products, and between libraries as well. If we were to switch to making them Maven modules, how would we set it up, both in SVN and in our working copies? Do Maven modul...
stackexchange/codereview
In a C++ file, I have code like this: #if ACTIVATE # pragma message( "Activated" ) #else # pragma message( "Not Activated") #endif I want to set this ACTIVE define to 1 with the MSBuild command line. It tried this, but it doesn't work: msbuild /p:DefineConstants="ACTIVATE=1" How can I do it?
stackexchange/codereview
I'm considering building a framework for VB.NET, and using the My namespace to plug it into VB seems like a reasonable idea. What is "My" used for?
stackexchange/codereview
I use public boolean mouseDown(Event ev, int x, int y) to detect a click of the mouse. I can distinguish between the right mouse button (ev.metaDown() is true) and the left and middle. How can i differentiate the left from the middle button? Or if it is impossible with mouseDown, what should i use?
stackexchange/codereview
How can I protect a ClickOnce deployed application with a password? Do I have to change the IIS settings of the web or is there a way to do it programmatically? I'm using Visual Studio 2005 (.NET 2.0). If I have to use web credentials, are auto-updates of the application still possible? Would be great if you could prov...
stackexchange/codereview
I often have nothing more than an FTP access to a server on which the application is placed. What I usually use now is "Keeping remote directory up to date" feature of WinSCP. Files of the local copy (in theory at least) keep being uploaded to a remote server as soon as they get saved and then all I need is to refresh ...
stackexchange/codereview
I deploy a webapp on two different containers (Tomcat and Jetty), but their default servlets for serving the static content have a different way of handling the URL structure I want to use (details). I am therefore looking to include a small servlet in the webapp to serve its own static content (images, CSS, etc.). The...
stackexchange/codereview
My company starts a new project next week. We have planned to develop the application with eclipse rcp. The build process should be fully automated, so we're prepared to set up a continuous integration environment (e.g. Continuum). For the build-automation-part I intended to use maven2, because I want use its dependenc...
stackexchange/codereview
I use emacs for viewing and editing code and other text files. I wanted to know if there is a way to search forward or backward for text which is marked in the current buffer. Similar to what I can do in notepad or wordpad. As in can I mark some text in the buffer and do a C-s or C-r and be able to search with the mark...
stackexchange/codereview
Is there a way in the .NET framework to validate that a process has access to a specific WCF address namespace without attempting to call ServiceHost.Open and capturing the resulting AddressAccessDeniedException? Right now if that exception is thrown I restart the service in elevated (administrator) mode so that I can ...
stackexchange/codereview
Which is faster? someCondition has the same probability of being true as it has of being false. Insertion: arrayList = Array("apple", "pear","grape") if someCondition then ' insert "banana" element end if Deletion: arrayList = Array("apple","banana","pear","grape") if not someCondition then ' remove "banana" ...
stackexchange/codereview
Probably a really simple one this - I'm starting out with C# and need to add values to an array, for example: int[] terms; for(int runs = 0; runs < 400; runs++) { terms[] = runs; } For those who have used PHP, here's what I'm trying to do in C#: $arr = array(); for ($i = 0; $i < 10; $i++) { $arr[] = $i; }
stackexchange/codereview
This question is fairly straightforward -- I am trying to debug a memory leak in a silverlight application using s.o.s. I was able to get some good info using !gcroot to determine what objects have open references to the one that should be getting cleared; but in these cases they tend to be core UI elements (like grid...
stackexchange/codereview
I need to rebuild an apache server, but the original source is no longer available. Is there any way ( command line switch to httpd? ) to get the build options which were originally used?
stackexchange/codereview
How do I launch Windows' RegEdit with certain path located, like "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0", so I don't have to do the clicking? What's the command line argument to do this? Or is there a place to find the explanation of RegEdit's switches?
stackexchange/codereview
I tried to follow PHP.net curl site and even this link: http://curl.phptrack.com/forum/viewtopic.php?t=52 and try to install the CURL in my window laptop. It doesn't work.. CURL is not installed. I wonder do I need to run it on windows server... Anyone has good sites guiding me how to install CURL? thanks.
stackexchange/codereview
If you had to fix and stabilize a MVC application, where would you start: the Model, Controller or View? The problems are spread equally throughout the application, with bad programming practices that make it hard to add functionality. The application is written in PHP if it makes a difference.
stackexchange/codereview
I am looking for a reporting service/tool for visual Studio. My only restraint is my web server is off limits to me as far as installing ANYTHING. So I need something I can just include in my project. My users need to be able to export a report to PDF and without being able to use Crystal I am pretty much lost. Any i...
stackexchange/codereview
I have been working with relational databases for sometime, but it only recently occurred to me that there must be other types of databases that are non-relational. What are some examples of non-relational databases, and where/how are they used in the real world? Why would you choose to use a non-relational database o...
stackexchange/codereview
I am trying to start a service from the command line using "net start SERVICENAME" and I get an access denied error. I am an administrator on this server since I am in a domain group that are admins on the server. I can start/stop the service from the Services tool. I am new to 2008/Vista so maybe I am just missing som...
stackexchange/codereview
I am learning WPF and was wondering if there is a way to show a WPF Window from an existing C# WinForm without 'hosting' WinForm in WPF? I tried using myWPFWindow.show() on button click event for displaying the Window. The window is getting displayed but the textboxes displayed in the window are preventing me from t...
stackexchange/codereview
I would like to embed a light weight web server in a Windows application developed in .NET. The web server has to support PHP. I have looked at Cassini, but it seems it is ASP.NET only.
stackexchange/codereview
I am getting the following error: Open OLE error code:80004005 in Microsoft OLE DB Provider for SQL Server [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. HRESULT error code:0×80020009 Exception occurred. I have tried following the directions here with no luck. Any ideas? FIXED My sp...
stackexchange/codereview
I have a little utility that converts .dbc files to .csv files, trouble is, somewhere in the conversion some data is lost/destroyed/whatever. I input a.dbc into converter, it produces a.csv. I delete a.dbc,and then run a.csv back through the converter, and I come back with a "slightly" different .dbc file then I had st...
stackexchange/codereview
Is it possible to highlight text inside of a textarea using javascript? Either changing the background of just a portion of the text area or making a portion of the text selected?
stackexchange/codereview
The class method to create an index path with one or more nodes is: + (id)indexPathWithIndexes:(NSUInteger *)indexes length:(NSUInteger)length How do we create the "indexes" required in the first parameter? The documentation listed it as Array of indexes to make up the index path but it is expecting a (NSUinteger *)....
stackexchange/codereview
What is an example of a fast SQL to get duplicates in datasets with hundreds of thousands of records. I typically use something like: SELECT afield1, afield2 FROM afile a WHERE 1 < (SELECT count(afield1) FROM afile b WHERE a.afield1 = b.afield1); But this is quite slow.
stackexchange/codereview
This example is from php.net: <?php function Test() { static $a = 0; echo $a; $a++; } ?> And this is my code: function getNextQuestionID() { static $idx = 0; return $idx++; } And I use it in JavaScript: 'quizID=' + "<?php echo getNextQuestionID(); ?>" Returns 0 everytime. Why?
stackexchange/codereview
I'm trying to do the following without too much special case code to deal with invalidated POSITIONs etc: What's the best way to fill in the blanks? void DeleteUnreferencedRecords(CAtlMap<Record>& records) { for(____;____;____) { if( NotReferencedElsewhere(record) ) { // Delete record ...
stackexchange/codereview
I am fairly new to WPF. I want to develop a datagrid control which supports databinding. There is a lot of information available about databinding to existing controls, but I cannot find any information how to develop a control from scratch which supports databinding. I do not expect a simple answer to this question, ...
stackexchange/codereview
Is there any way to automatically rename accessor/mutator when a variable they get/set gets refactored -> renamed (Eclipse 3.4)?
stackexchange/codereview
I am having huge lines data which could accomdate in Textbox. While I am exporting to excel the wrapping up of data occurs and the data is being cut off. When i manually change the textbox height i can see the full data but i need the full data to be displayed in the first time itself.
stackexchange/codereview
Is there any good bug tracker based on .NET which is free?
stackexchange/codereview
How do I make my application always use English when displaying win32/.net exceptions messages? I got this message, it looks like someone used babelfish to translate it (it's Swedish): "System.ComponentModel.Win32Exception: Programmet kunde inte starta eftersom programmets sida-vid-sidakonfiguration är felaktig." Extre...
stackexchange/codereview
I am writing a compiler in F# and I want to be able to access the unmanaged metadata COM interfaces in the .net runtime. Before anybody mentions it, Reflection.Emit is not suitable for my purposes, nor do I want to use any other method than the metadata COM interfaces. I've imported mscoree.tlb but it doesn't seem to i...
stackexchange/codereview
I have a C# module responsible for acquiring the list of network adapters that are "connected to the internet" on a windows Vista machine. The module uses the "Network List Manager API" (or NLM API) to iterate over all network connections and returns all those for which the IsConnectedToInternet value is true. I receiv...
stackexchange/codereview
Actually, I wanted a custom cell which contains 2 image objects and 1 text object, and I decided to make a container for those objects. So is it possible to hold a image in object and insert that object in any of the collection objects, and later use that object to display inside cell?
stackexchange/codereview
Is there anyway to have items in an ASP.NET DropDownList have either their Text or Value bound to a method on the source rather than a property?
stackexchange/codereview
I have a data table with a variable number of columns and a data scroller. How can I enable server side sorting? I prefer that it be fired by the user clicking the column header. <rich:datascroller for="instanceList" actionListener="#{pageDataModel.pageChange}"/> <rich:dataTable id="instanceList" rows="10" value="#{pag...
stackexchange/codereview
Trying to find the sqlserver adapter for rails on windows. I have tried getting it from (without luck): gem install activerecord-sqlserver-adapter --source=http://gems.rubyonrails.org Where else can I get this gem? UPDATE: Make sure to run the command prompt as the administrator. Right click on the command prompt and c...
stackexchange/codereview
I'm building small web site in Java (Spring MVC with JSP views) and am trying to find best solution for making and including few reusable modules (like "latest news" "upcoming events"...). So the question is: Portlets, tiles or some other technology?
stackexchange/codereview
Is there an api to bring the vista side bar to the front (Win+Space) programatically and to do the reverse (send it to the back ground).
stackexchange/codereview
I’m trying to debug a memory leak problem. I’m using mtrace() to get a malloc/free/realloc trace. I’ve ran my prog and have now a huge log file. So far so good. But I have problems interpreting the file. Look at these lines: @ /usr/java/ibm-java2-x86_64-50/jre/bin/libj9prt23.so:[0x2b270a384a34] + 0x1502570 0x68 @ /usr/...
stackexchange/codereview
I need to develop a small-medium sized desktop GUI application, preferably with Python as a language of choice because of time constraints. What GUI library choices do I have which allow me to redistribute my application standalone, assuming that the users don't have a working Python installation and obviously don't ha...
stackexchange/codereview
I do not understand how I can authenticate a user in a Facebook Flash application. I have read from the documentation that Facebook platform gives arguments, such as user id and session secret, to the Flash application, but how can I inside the Flash application make sure that these arguments are correct and not fake? ...
stackexchange/codereview
I have TurtoiseSVN and ankhSVN installed. I created a repository on my computer: C:\Documents and Settings\user1\My Documents\Subversion\Repository\. I am trying to connect to this repository from my co-worker's computer. What should this URL be?
stackexchange/codereview
I created an ObjectInputSteam and ObjectOutputStream on a blocking SocketChannel and am trying to read and write concurrently. My code is something like this: socketChannel = SocketChannel.open(destNode); objectOutputStream = new ObjectOutputStream(Channels.newOutputStream(socketChannel)); objectInputStream = new Obje...
stackexchange/codereview
Have any bridge libraries been developed for PHP that provide access to the jQuery framework? Ideally it would be nice to have something fairly extensible so that creating jQuery-based content using PHP code would be fairly easy and customizeable. Does such a thing exist yet?
stackexchange/codereview
just wanted to gather different ideas and perspectives as to which layer should (and why) LINQ fall into?
stackexchange/codereview
In Moss 2007 you have the ability to set the target audience for each individual web part within a page. Is there a way to preview how the page will look to another user without logging in as that user? What I am looking for is a way for someone with full control/design permissions on a site to be able to preview how...
stackexchange/codereview
In our development environment each developer has their own dev server. Often times they do not actually develop on that server but develop from their local machine, deploy to their dev server, and then attach with the remote debugger to do debugging. My question is; how can I use MSBuild to execute a different set of...
stackexchange/codereview
Can I create a Controller that simply returns an image asset? I would like to route this logic through a controller, whenever a URL such as the following is requested: www.mywebsite.com/resource/image/topbanner The controller will look up topbanner.png and send that image directly back to the client. I've seen example...
stackexchange/codereview
I've been profiling some queries in an application I'm working on, and I came across a query that was retrieving more rows than necessary, the result set being trimmed down in the application code. Changing a LEFT JOIN to an INNER JOIN trimmed the result set to just what was needed, and presumably would also be more pe...
stackexchange/codereview
I have a website which uses the custom 404 error handling in PHP/Apache to display specific pages. e.g. http://metachat.org/recent I've a feeling this is a bad way of doing this, but it's code I inherited... Although the page displays correctly on most browsers, I'm getting a situation where AVG Anti-Virus is hijackin...
stackexchange/codereview
How do I set the background colour of a listbox? I have a listbox with textblocks in it and there does not appear to be anyway that actually works to set the background colour of these controls, why is this seemingly so hard? In the interests of full disclosure I asked a similar question earlier
stackexchange/codereview
I'm writing a Java app that is accepting URL parameter values that may or may not be encoded. I need an easy way to tell whether or not I need to encode the parameter string. In other words, I want a function boolean needsEncoding(String param), which will return true if I pass in the String "foo@test.com", and false ...
stackexchange/codereview
JPEG, GIF and PNG can be displayed with the img tag and will work in all browsers, the object element can be use for displaying images specifying its MIME type, but what other graphic formats are supported by img or object tag in most browsers without installing plugins? (TIF, SVG, PCX, PICT, etc..)
stackexchange/codereview
I'm learning DirectX as part of a hobby project. I've been looking for some good online resources for DirectX9 (using C++, if that distinction matters), but haven't found anything that's a) great for a beginner and b) up to date. Any recommendations?
stackexchange/codereview
I'd like to create a sparse file such that all-zero blocks don't take up actual disk space until I write data to them. Is it possible?
stackexchange/codereview
What is the difference between bool and Boolean types in C#?
stackexchange/codereview
I am currently working on a program to immediately clear the list of previously-run-commands which appears in the Windows Start -> Run dialog. The procedure for clearing this list by removing the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU key is well documented; however, before these c...
stackexchange/codereview
I have a postgres table. I need to delete some data from it. I was going to create a temporary table, copy the data in, recreate the indexes and the delete the rows I need. I can't delete data from the original table, because this original table is the source of data. In one case I need to get some results that depends...
stackexchange/codereview
When do you think we can expect the full release version of ASP.NET MVC?
stackexchange/codereview
I personally use var_dump, but lots of people like print_r. What does everyone use? Pros and Cons? Does someone have a special home brew function of their own?
stackexchange/codereview
I am working on a robot automation project and I have run into a road block. To control the robot, one needs to connect with it wirelessly via telnet and send commands through the tcp/ip protocol. (ex. The 'Mabc' command moves it forward based on the left wheel speed (a), the right wheel speed (b) and time (c)). What I...
stackexchange/codereview
I'm planning to develop an ASP.NET server control to provide asynchronous username availability validation for new user registrations. The control will allow a developer to point it at a "username" TextBox and it will provide an indication of whether or not the username is available. Like this example, but without th...
stackexchange/codereview