instruction_seed stringlengths 1 35.8k | _source stringclasses 1
value |
|---|---|
What is the difference between == and ===?
How exactly does the loosely == comparison work?
How exactly does the strict === comparison work?
What would be some useful examples?
| stackexchange/codereview |
How do I register a custom protocol with Windows so that when clicking a link in an email or on a web page my application is opened and the parameters from the URL are passed to it?
| stackexchange/codereview |
I may be wrong, but if you are working with SmtpClient.SendAsync in ASP.NET
2.0 and it throws an exception, the thread processing the request waits
indefinitely for the operation to complete.
To reproduce this problem, simply use an invalid SMTP address for the host
that could not be resolved when sending an email.
... | stackexchange/codereview |
Could someone please demystify interfaces for me or point me to some good examples? I keep seeing interfaces popup here and there, but I haven't ever really been exposed to good explanations of interfaces or when to use them.
I am talking about interfaces in a context of interfaces vs. abstract classes.
| stackexchange/codereview |
I am working on an application that detects the most prominent rectangle in an image, then seeks to rotate it so that the bottom left of the rectangle rests at the origin, similar to how IUPR's OSCAR system works. However, once the most prominent rectangle is detected, I am unsure how to take into account the depth co... | stackexchange/codereview |
Does anyone know how to get/set the call divert settings in codes running on Windows mobile 5/6? I am new to windows mobile development and wonder if there is anyway to do it using C# and .NET CF?
| stackexchange/codereview |
I want to send email with Exchange by using telnet to port 25. Until two week ago I was able to, but now a "security fix" from Microsoft has removed this possibility.
When I try, I get this message:
421 4.3.2 Service not available, closing transmission channel
What can I do?
| stackexchange/codereview |
In the process of learning TinyOS I have discovered that I am totally clueless about makefiles.
There are many optional compile time features that can be used by way of declaring preprocessor variables.
To use them you have to do things like:
CFLAGS="-DPACKET_LINK" this enables a certain feature.
and
CFLAGS="-DP... | stackexchange/codereview |
I have a simple database table called "Entries":
class CreateEntries < ActiveRecord::Migration
def self.up
create_table :entries do |t|
t.string :firstName
t.string :lastName
#etc.
t.timestamps
end
end
def self.down
drop_table :entries
end
end
How do I write a handler that ... | stackexchange/codereview |
I want a nice 2 column layout using CSS float's.
Column#1 160 px
Column#2 100% (i.e. the rest of the space).
I want to place the Col#2's div first, so my layout looks like:
<div id="header"></div>
<div id="content">
<div id="col2"></div>
<div id="col1"></div>
</div>
<div id="footer"></div>
What has to be get... | stackexchange/codereview |
I'm writing a game which is taking user input and rendering it on-screen. The engine I'm using for this is entirely unicode-friendly, so I'd like to keep that if at all possible. The problem is that the rendering loop looks like this:
"string".each_byte do |c|
render_this_letter(c)
end
I don't know a whole lot a... | stackexchange/codereview |
I need a framework for generating charts for data visualization. I picked up Processing www.processing.org/ but at the moment i can not run that in the "headless" mode from a web server. Is there any other candidate for this domain? What are the options if you need more chart type than what is supported by out-of-the-b... | stackexchange/codereview |
I'm running Server 2008 64bit with Hyper-V. I've created a virtual machine with Vista 64bit and installed it. I can't get the Vista virtual machine to see the network adapter.
I've set-up an external network on the Virtual Network Manager (Hyper-V) and associated that with the virtual machine (Vista). I've also tried u... | stackexchange/codereview |
I'd like to integrate a Python IDLE-esque command prompt interface into an existing NI-CVI (LabWindows) application. I've tried to follow the Python.org discussions but seem to get lost in the details. Is there a resource out there for dummies like me?
| stackexchange/codereview |
In an application where users can belong to multiple groups, I'm currently storing their groups in a column called groups as a binary. Every four bytes is a 32 bit integer which is the GroupID. However, this means that to enumerate all the users in a group I have to programatically select all users, and manually find o... | stackexchange/codereview |
We are migrating our works repository so I want to do a cull of all the unreferenced files that exist in the source tree before moving it into the nice fresh (empty) repository.
So far I have gone through by hand and found all the unreferenced files that I know about but I want to find out if I have caught them all. On... | stackexchange/codereview |
I want to create a class that, for example, extends HttpServlet? My compiler warns me that my class should have a serialVersionUID. If I know that this object will never be serialized, should I define it or add an annotation to suppress those warnings?
What would you do and why?
| stackexchange/codereview |
One of the best tips for using vim that I have learned so far has been that one can press Ctrl+C or Ctrl+[ instead of the Esc key. However I use a dvorak keyboard so Ctrl+[ is a little out of reach for me as well so I mostly use Ctrl+C. Now I've read somewhere that these two key combinations don't actually have exactly... | stackexchange/codereview |
I have a large codebase, and I'd like to refactor the package structure so that classes which interact heavily go in the same package.
It seems that it should be possible to create a tool that could look at the interactions between classes, and then group together those classes that interact heavily. These groupings m... | stackexchange/codereview |
Phantom References serve for post-mortem operations.
The Java specification states that a phantom referenced object will not be deallocated until the phantom-reference itself is cleaned.
My question is: What purpose does this feature (object not deallocated) serve?
(The only idea i came up with, is to allow native code... | stackexchange/codereview |
I've started refactoring some legacy code recently and came across two functions for drawing a coordinate grid, the problem is that these functions differ only in orthogonal variables they treat, something like that
void DrawScaleX(HDC dc, int step, int x0, int x1, int y0, int y1)
{
for(int x = x0; x < x1; x += ste... | stackexchange/codereview |
I would like to find a user's IP address when he/she enters my page. How do I programmatically do that?
| stackexchange/codereview |
Sometimes my c++ program crashes in debug mode, and what I got is a message box saying that an assertion failed in some of the internal memory management routines (accessing unallocated memory etc.). But I don't know where that was called from, because I didn't get any stack trace. How do I get a stack trace or at leas... | stackexchange/codereview |
Can somebody please provide me some important aspects I should be aware of while handling Unicode strings in C#?
| stackexchange/codereview |
public static Logger getLogger() {
final Throwable t = new Throwable();
final StackTraceElement methodCaller = t.getStackTrace()[1];
final Logger logger = Logger.getLogger(methodCaller.getClassName());
logger.setLevel(ResourceManager.LOGLEVEL);
return logger;
}
This method would return a logger tha... | stackexchange/codereview |
Why would one choose YAML over XML or any other formats?
| stackexchange/codereview |
I am currently using Hibernate Tools 3.1; I customized naming convention and DAO templates. The database (SQL Server 2005) in early development phase and I'm in charge of rebuilding the mappings, entities, DAOs, configuration, whatever. Each time I have to reverse-engineer the tables and so I lose every customization I... | stackexchange/codereview |
From what I can find online about using VS2008 to create a integration/reporting services project it appears I need to have SQL 2008. Does anyone know of a work-around that would allow me to use VS2008 with SQL 2005?
| stackexchange/codereview |
I have an Asset object that has a property AssignedSoftware, which is a collection.
I want to make sure that the same piece of Software is not assigned to an Asset more than once. In Add method I check to see if the Software already exist, and if it does, I want to throw an exception.
Is there a standard .NET excep... | stackexchange/codereview |
I'm searching a small Java based RSS/Feed Generator, something like the FeedCreator.class.php library, any suggestions?, thanks!
| stackexchange/codereview |
Is there any sort of free control which does what the Occupation field does on http://monster.ca? That is allow for grouping of the options in a drop down box with expandable sections? I just learned about the optgroup tag which is close to what I want, but not quite.
| stackexchange/codereview |
Lifehacker had a post a couple days ago asking people about the best mouse you've ever had and it appears some people have traded their mouse for a tablet.
I'm curious if anyone here has traded their mouse in for a tablet? Does it work well for development? Looking for pros and cons from people who have tried it or a... | stackexchange/codereview |
Within SQL Server Integration Services (SSIS) there is the ability to setup a connection to a flat file that can hold millions of records and have that data pushed to a SQL DB. Furthermore, this process can be called from a C# app by referencing and using the Microsoft.SqlServer.Dts.Runtime namespace.
Would a flat fil... | stackexchange/codereview |
My Tomcat instance is listening to multiple IP addresses, but I want to control which source IP address is used when opening a URLConnection.
How can I specify this?
| stackexchange/codereview |
I believe strongly in using unit-tests as part of building large multi-platform applications. We currently are planning on having our unit-tests within a separate project. This has the benefit of keeping our code base clean. I think, however, that this would separate the test code from the implementation of the unit. W... | stackexchange/codereview |
DOING THE POST IS NOT THE PROBLEM! Formatting the message so that I get a response is the problem.
Ideally I'd be able to construct a message and use WinHTTP to perform a post to a WCF service (hosted in IIS) and get a response, but so far I've been unable to construct something that works properly.
Does anyone have a... | stackexchange/codereview |
I'm looking into a mechanism for serialize data to be passed over a socket or shared-memory in a language-independent mechanism. I'm reluctant to use XML since this data is going to be very structured, and encoding/decoding speed is vital. Having a good C API that's liberally licensed is important, but ideally there ... | stackexchange/codereview |
If i have lots of directory names either as literal strings or contained in variables, what is the easiest way of combining these to make a complete path?
I know of Path.Combine but this only takes 2 string parameters, i need a solution that can take any number number of directory parameters.
e.g:
string folder1 = "fo... | stackexchange/codereview |
How can I find the 2nd, 3rd, ... nth maximum value of a column?
| stackexchange/codereview |
I have a war file that I have to deploy as root on glassfish. Deploying the application with "/" as its context root happens successfully. But when I try to run that application by http://localhost/, it throws a 503 saying the requested service() is not currently available. The log file server.log has an error saying "... | stackexchange/codereview |
I've seen a number of postgresql modules for python like pygresql, pypgsql, psyco. Most of them are Python DB API 2.0 compliant, some are not being actively developed anymore.
Which module do you recommend? Why?
| stackexchange/codereview |
I want to get a files these attributes as integer values.
| stackexchange/codereview |
So I'm programming along in a nice, up to date, object oriented fashion. I regularly make use of the various aspects of OOP that PHP implements but I am wondering when might I need to use closures. Any experts out there that can shed some light on when it would be useful to implement closures?
| stackexchange/codereview |
I have the need to be able to cycle my linksys router via a program, the reason I want to do this is complex, so let's just assume there is no better option.
Is there anyway to do this? I think there is because when I install a firmware update to the router via the admin console, it cycles the router.
| stackexchange/codereview |
I need to store a list of key value pairs of (integer, boolean) in .NET
When I use a dictionary it re-orders them. Is there a built in collection that will handle this.
| stackexchange/codereview |
For some reason when I create a new namespace in Visual Studio 2008 its not being recognized. I'm using asp.net mvc, I don't know if that has anything to do with it.
Has anyone come across this before?...and how do you fix it?
Also is there a way to force Visual Studio to maybe re-examine new namespaces?
Answer:
I fig... | stackexchange/codereview |
I am working on a database application that runs on various independent servers.
Each server runs an Instance of SQL Server 2005 with the same database. We would have a Master Server where that would be the definitive source of information and various "Client" Servers that would be distributed around (with no network ... | stackexchange/codereview |
> jruby -S gem install warbler
JRuby limited openssl loaded. gem install jruby-openssl for full support.
Successfully installed warbler-0.9.11
1 gem installed
Installing ri documentation for warbler-0.9.11...
Installing RDoc documentation for warbler-0.9.11...
> jruby -S warble
<snip>/jruby-1.1.4/bin/warble:1: undefine... | stackexchange/codereview |
I want to search for $maximumTotalAllowedAfterFinish and replace it with $minimumTotalAllowedAfterFinish. Instead of typing the long text:
:%s/$maximumTotalAllowedAfterFinish/$minimumTotalAllowedAfterFinish/g
Is there a way to COPY these long variable names down into the search line, since, on the command line I can't... | stackexchange/codereview |
Inspired by another question asking about the missing Zip function:
Why is there no ForEach extension method on the IEnumerable interface? Or anywhere? The only class that gets a ForEach method is List<>. Is there a reason why it's missing, maybe performance?
| stackexchange/codereview |
When I used to write libraries in C/C++ I got into the habit of having a method to return the compile date/time. This was always a compiled into the library so would differentiate builds of the library. I got this by returning a #define in the code:
C++:
#ifdef _BuildDateTime_
char* SomeClass::getBuildDateTime() {
... | stackexchange/codereview |
I'm setting up a new development server and want to install the latest version of SQL Server 2008 Express.
Will our existing sql2005 databases work with 2008 without modification?
If so is there any reason to install both versions on the same server?
| stackexchange/codereview |
Unfortunately I have to use Windows Server 2003 on my 32 bit workstation due to memory constraints of Windows XP.
In Windows XP, when you connect via Remote Desktop the current session I am logged in is instantly shared on the Remote Desktop. I can see all the applications I have opened on my workstation and can contin... | stackexchange/codereview |
Greetings,
I'm trying to find either a free .NET library or a command-line executable that lets me convert M4A files to either MP3s or WMA files. Please help :).
| stackexchange/codereview |
Is there a way to track changes in Windows registry? I'd like to see what changes in the registry are made during installation of various programs.
| stackexchange/codereview |
I'm talking about an action game with no upper score limit and no way to verify the score on the server by replaying moves etc.
What I really need is the strongest encryption possible in Flash/PHP, and a way to prevent people calling the PHP page other than through my Flash file. I have tried some simple methods in th... | stackexchange/codereview |
How can I combine multiple PDFs into one PDF without a 3rd party component?
| stackexchange/codereview |
I need a real DBA's opinion. Postgres 8.3 takes 200 ms to execute this query on my Macbook Pro while Java and Python perform the same calculation in under 20 ms (350,000 rows):
SELECT count(id), avg(a), avg(b), avg(c), avg(d) FROM tuples;
Is this normal behaviour when using a SQL database?
The schema (the table holds ... | stackexchange/codereview |
Do anyone have good ideas of how to modify the toolbar for the WinForms version of the ReportViewer Toolbar?
That is, I want to remove some buttons and varius, but it looks like the solution is to create a brand new toolbar instead of modifying the one that is there.
Like, I had to remove export to excel, and did it th... | stackexchange/codereview |
Beside the obvious person to person instant message chat, What else have you used a Jabber server's functionality to enable?
Edit: links to working code to really show it off are particularly useful - and will be more likely to be voted up.
| stackexchange/codereview |
In a user defined wizard page, is there a way to capture change or focus events of the controls? I want to provide an immediate feedback on user input in some dropdowns (e.g. a message box)
| stackexchange/codereview |
How can I create an empty one-dimensional string array?
| stackexchange/codereview |
Our git server will be local, but we want an server where our local repo is also kept online but only used in a push to fashion.
How can one do that?
| stackexchange/codereview |
Ruby setters—whether created by (c)attr_accessor or manually—seem to be the only methods that need self. qualification when accessed within the class itself. This seems to put Ruby alone the world of languages:
All methods need self/this (like Perl, and I think Javascript)
No methods require self/this is (C#, Java)
O... | stackexchange/codereview |
I have downloaded a font that looks less than desirable if it is not anti-aliased. I can not figure out how to enable anti-aliasing in VS, I have changed the 'Smooth Edges of Screen Fonts' in the system performance options but that does not seem to help.
VS2008 on XP SP3.
What am I missing?
| stackexchange/codereview |
How do I authenticate against AD using Python + LDAP. I'm currently using the python-ldap library and all it is producing is tears.
I can't even bind to perform a simple query:
import sys
import ldap
Server = "ldap://my-ldap-server"
DN, Secret, un = sys.argv[1:4]
Base = "dc=mydomain,dc=co,dc=uk"
Scope = ldap.SCOPE_S... | stackexchange/codereview |
I'm used to working with PHP but lately I've been working with Java and I'm having a headache trying to figure this out. I want to save this representation in Java:
Array (
["col_name_1"] => Array (
1 => ["col_value_1"],
2 => ["col_value_2"],
... | stackexchange/codereview |
I am working with jQuery Form and ASP.NET MVC. Preview 5 of ASP.NET MVC has an Extension Method on HttpRequest called IsAjaxMvcRequest that detects if the POST was an Ajax request. This Extension Method basically "sniffs" for a form value called __MVCASYNCPOST and (basically) returns true if it sees this element.
What ... | stackexchange/codereview |
When I'm in Windows, I use the excellent MicroOLAP Database Designer for PostgreSQL, but its not open source or multiplataform.
Do you know or can recommend me an alternative to this software, that I can use in Linux?
EDIT: Just to clarify, I don't want to use wine to emulate MicroOlap for PostgreSQL, it doesn't work t... | stackexchange/codereview |
Is it possible to build Visual Studio solutions without having to fire up MonoDevelop?
| stackexchange/codereview |
It's getting close to the time when I need to submit training and travel requests. I'm looking for conferences and classes in the coming 12 months that are geared toward improving coding and software development, best practices, system architecture, etc. They need to be in the US or Canada since I'll never get approval... | stackexchange/codereview |
I'm trying to optimize several bottlenecks on an application which is supposed to run on a really wide range of CPUs and architectures (some of them very close to embeded devices).
The results of my profiler, however, aren't really significant because of the speed of my CPU. Is there any way (preferably under Windows o... | stackexchange/codereview |
I'm posting this in the spirit of answering your own questions.
The question I had was: How can I implement the Levenshtein algorithm for calculating edit-distance between two strings, as described here, in Delphi?
Just a note on performance:
This thing is very fast. On my desktop (2.33 Ghz dual-core, 2GB ram, WinXP),... | stackexchange/codereview |
I got a typed (not connected) dataset, and many records (binary seriliazed) created with this dataset.
I've added a property to one of the types, and I want to convert the old records with the new data set.
I know how to load them: providing custom binder for the BinaryFormatter with the old schema dll.
The question i... | stackexchange/codereview |
I have been reading a lot of XQuery tutorials on the website. Almost all of them are teaching me XQuery syntax. Let's say I have understood the XQuery syntax, how am I going to actually implement XQuery on my website?
For example, I have book.xml:
<?xml version="1.0" encoding="iso-8859-1" ?>
<books>
<book>
<title>Do... | stackexchange/codereview |
Ok, if i've got a binary file encoded either in little endian or big endian under .NET, what is the best way to read / write to it?
In the .NET framework i've only managed to found BinaryWritters / BinaryReaders which use little endian as default, so my approach was implement my own BinaryReader / BinaryWritter for rea... | stackexchange/codereview |
Any ideas how to determine the number of active threads currently running in an ExecutorService?
| stackexchange/codereview |
I'm trying to get IKVM to build (see this question) but now have encountered a problem not having to do with IKVM so I'm opening up a new question:
When running nant on the IKVM directory with the Visual Studio 2008 Command Prompt (from the Start Menu), I get the following error:
ikvm-native-win32:
... | stackexchange/codereview |
What is the best way to start developing Windows Mobile Professional applications in Python? Is there a reasonable SDK including an emulator? Is it even possible without doing excessive amount of underlaying Windows API calls for UI for instance?
| stackexchange/codereview |
Typically when writing new code you discover that you are missing a #include because the file doesn't compile. Simple enough, you add the required #include. But later you refactor the code somehow and now a couple of #include directives are no longer needed. How do I discover which ones are no longer needed?
Of course... | stackexchange/codereview |
Scenario: Several people go on holiday together, armed with digital cameras, and snap away. Some people remembered to adjust their camera clocks to local time, some left them at their home time, some left them at local time of the country they were born in, and some left their cameras on factory time.
The Problem: Tim... | stackexchange/codereview |
I have a small app which references the Microsoft.SqlServer.Smo assembly (so I can display to the user a list of servers & databases to which they can connect).
My application originally referenced Microsoft.SqlServer.Smo and Microsoft.SqlServer.ConnectionInfo. Things worked as expected on my dev box.
When I installed ... | stackexchange/codereview |
I have been hired to help write an application that manages certain information for the end user. It is intended to manage a few megabytes of information, but also manage scanned images in full resolution. Should this project use a database, and why or why not?
| stackexchange/codereview |
I've been doing some work with the JAX-RS reference implementation (Jersey).
I know of at least two other frameworks (Restlet & Apache CXF).
My question is: Has anyone done some comparison between those frameworks and if so, which framework would you recommend and why?
| stackexchange/codereview |
If I have a large number of SQLite databases, all with the same schema, what is the best way to merge them together in order to perform a query on all databases?
I know it is possible to use ATTACH to do this but it has a limit of 32 and 64 databases depending on the memory system on the machine.
| stackexchange/codereview |
I've been wondering, is there a performance difference between using named functions and anonymous functions in Javascript?
for (var i = 0; i < 1000; ++i) {
myObjects[i].onMyEvent = function() {
// do something
};
}
vs
function myEventHandler() {
// do something
}
for (var i = 0; i < 1000; ++i) {... | stackexchange/codereview |
I initially designed my system following the s# architecture example outlined in this codeproject article (Unfortunately, I am not using NHibernate). The basic idea is that for each domain object that would need to communicate with the persistence layer you would have a corresponding Data Access Object in a different ... | stackexchange/codereview |
Argghh. I have a site that offers audio previews of songs hosted elsewhere. Some file names have an ampersand in them - see below where it passes "soundFile." Anytime there's an ampersand, Flash can't get the file - I think it drops the filename after the ampersand. It doesn't matter if I pass it as an "&" or an HTML e... | stackexchange/codereview |
As someone who is only barely proficient in javascript, is jQuery right for me? Is there a better library to use? I've seen lots of posts related to jQuery and it seems to be the most effective way to incorporate javascript into ASP.NET applications.
I've been out to jQuery's site and have found the tutorials and oth... | stackexchange/codereview |
I'm trying to store an xml serialized object in a cookie, but i get an error like this:
A potentially dangerous Request.Cookies value was detected from the client (KundeContextCookie="<?xml version="1.0" ...")
I know the problem from similiar cases when you try to store something that looks like javascript code in a f... | stackexchange/codereview |
I want to run javascript/Python/Ruby inside my application.
I have an application that creates process automatically based on user's definition. The process is generated in C#. I want to enable advanced users to inject script in predefined locations. Those scripts should be run from the C# process.
For example, the cr... | stackexchange/codereview |
I'm currently writing an interface to allow applications to send exception data to a central repository for support purposes. I'm at a quandary about how to pass extra contextual data:
public interface IExceptionNotifier
{
void Notify(Exception ex, NameValueCollection context); //this
void Notify(Exceptio... | stackexchange/codereview |
On a file path field, I want to capture the directory path like:
textbox1.Text = directory path
Anyone?
| stackexchange/codereview |
I'm building Desktop Software for over 10 years now, mostly it's simple Data-Input Software. My problem is, it's always looking the same: A Treeview on the Left and a lot of Text/Data Fields to the right, depending on the type of data currently is worked on. Are there any fresh ideas how such software nowadays should l... | stackexchange/codereview |
Does anyone know of a library or bit of code that converts British English to American English and vice versa?
I don't imagine there's too many differences (some examples that come to mind are doughnut/donut, colour/color, grey/gray, localised/localized) but it would be nice to be able to provide localised site content... | stackexchange/codereview |
Let me start off with a bit of background.
This morning one of our users reported that Testuff's setup file has been reported as infected with a virus by the CA antivirus. Confident that this was a false positive, I looked on the web and found that users of another program (SpyBot) have reported the same problem.
A now... | stackexchange/codereview |
Why use one over the other?
| stackexchange/codereview |
I recently built an API and was often asked to replace the StringCollections I was returning by objects containing a single property, The reason being that it was easier to bind with a listview or other controls in ASP.Net.
Since the API was used by the web application, the Web service and the dataloader I decided on k... | stackexchange/codereview |
How can I fetch data in a Winforms application or ASP.NET form from a SAP database? The .NET framework used is 2.0. , language is C# and SAP version is 7.10.
| stackexchange/codereview |
There is a Microsoft knowledge base article with sample code to open all mailboxes in a given information store. It works so far (requires a bit of copy & pasting on compilers newer than VC++ 6.0).
At one point it calls IExchangeManageStore::GetMailboxTable with the distinguished name of the information store. For the ... | stackexchange/codereview |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.