instruction_seed stringlengths 1 35.8k | _source stringclasses 1
value |
|---|---|
I need a way to determine whether the computer running my program is joined to any domain. It doesn't matter what specific domain it is part of, just whether it is connected to anything. I'm coding in vc++ against the Win32 API.
| stackexchange/codereview |
I have this bit of script to widen a text box on mouseover and shorten it on mouseoff.
The problem I am having is that Internet Explorer doesn't seem to extend it's hover over the options of a select box.
This means in IE I can click the select, have the options drop down, but if I try to select one, they vanish and th... | stackexchange/codereview |
I use Visual Studio to do a lot of my coding. I find the open containing folder feature quite helpful. But I don't want the folder to be "opened" by the windows explorer, instead I want to "explore" the folder -- you know, get the nice little frame showing me all the other folders on the left hand side. Does anyone kno... | stackexchange/codereview |
I have a site a few years old that contains about 30 aspx Web Form pages with code behind.
I want to add a common master page to all these with the minimum amount of work.
Essentially, I just need to add everything in the body tags to the Content Placeholder, and preserve the code behind.
Is there a fast way to do thi... | stackexchange/codereview |
I have hit upon this problem about whether to use bignums in my language as a default datatype when there's numbers involved. I've evaluated this myself and reduced it to a convenience&comfort vs. performance -question. The answer to that question depends about how large the performance hit is in programs that aren't g... | stackexchange/codereview |
I'm using MessageFormat to format some addresses with a template like this:
"{0}\n{1}\n{2}\n{3}, {4} {5}"
where
0 = street 1
1 = street 2
2 = street 3
3 = city
4 = state
5 = zip
Most of these fields are optional when captured. How do I avoid having an empty line when for instance, there is not street 3? I could us... | stackexchange/codereview |
Most statistics out there for browser stats show you the resolution of the screen.
Thats fine for Windows where browsers typically open full screen and most people leave it as that. So if the browser stats say 1024x768 you just need to subtract a little width for the browser chrome.
On a Mac however browsers typically ... | stackexchange/codereview |
Does anyone know if there is an equivalent to .htaccess and .htpassword for IIS ? I am being asked to migrate an app to IIS that uses .htaccess to control access to sets of files in various URLs based on the contents of .htaccess files.
I did a google search and didn't turn up anything conclusive. Is there a general a... | stackexchange/codereview |
Before anyone recommends that I do a google search on this, I have. I just need a bit more clarity around what codepages and encodings.
If I use UTF8 encoding, and use an italian code page and then a french code page, does this mean ill get different characters even though the bytes havent changed?
| stackexchange/codereview |
I'm pretty new to JSF and the many many related technologies out there.
I'm trying to make a website that has a header which includes a logo, navigation links, and a login box, such that this header can easily be included in all of the site's pages unless the user logs in, in which case a different header will appear. ... | stackexchange/codereview |
In any socket API the close() method closes a connection with a FIN. If I want to abort a connection with a RST how can I do it?
| stackexchange/codereview |
We have recently implemented Transparent Data Encryption in SQL Server 2008 for local databases on our developers laptops to keep them protected in the case a laptop is stolen or lost. This works fine.
Now we are trying to figure out a way to have the certificate expire everyday, forcing an automated process (a script... | stackexchange/codereview |
At times I find a very brittle test to be a good thing because when I change the intent of the code under test I want to make sure my unit test breaks so that I'm forced to refactor ... is this approach not recommended when building a large suite of regression tests?
| stackexchange/codereview |
What does it mean:
"First-chance exception at in : 0x000006BA: The RPC server is unavailable"
?
this debug message appears in Debug output of visual studio debugger when I using socket connection, but I don't know what operation initiates this message...
| stackexchange/codereview |
I've got two applications I'm developing using Qt on windows. I want the user to be able to press a button in one application which makes the other application come to the foreground. (The programs communicate using QLocalSocket and named pipes.)
Currently I'm using Qt's QWidget::activateWindow() which occasionally bri... | stackexchange/codereview |
Is it possible in CSS using a property inside an @page to say that table headers (th) should be repeated on every page if the table spreads over multiple pages?
| stackexchange/codereview |
Let's say I 've added a library foo.so.1.1.1 to a path that is included in /etc/ld.so.conf
When I run ldconfig on the system I get the links foo.so.1.1 and foo.so.1 to foo.so.1.1.1
How can I change the behavior to also get the foo.so link to foo.so.1.1.1?
| stackexchange/codereview |
How do I write the SQL code to INSERT (or UPDATE) an array of values (with probably an attendant array of fieldnames, or with a matrix with them both) without simple iteration?
| stackexchange/codereview |
I was told by a professor that using C code one could heat a single pixel on an old monitor to the point that the monitor would overheat and smoke. Have any of you come across anything that would support this? I am having a debate in my office on whether this is possible or not.
| stackexchange/codereview |
How do you insert page breaks in Dynamic AX reports?
| stackexchange/codereview |
As part of learning jQuery, I decided to do a simple tic-tac-toe game in JavaScript and, at the moment, I'm using a HTML table for spacing and using graphic images within the table.
The images are either a small circle or a big X or O. When the user clicks on a circle, it changes to an X or O then checks whether the g... | stackexchange/codereview |
You often see, on sites like The Daily WTF, examples of overengineered code that should have just been a call to a built-in method within the .NET framework.
What namespaces/classes should be considered essential knowledge for a developer starting his/her first .NET job?
As per Joel Spolsky's instruction for these type... | stackexchange/codereview |
I have 2-3 different column names that I want to look up in the entire database and list out all tables which have those columns. Is there any easy script?
| stackexchange/codereview |
Is LINQ a kind of Object-Relational Mapper?
| stackexchange/codereview |
I've been tasked with build an accessible RSS feed for my company's job listings. I already have an RSS feed from our recruiting partner; so I'm transforming their RSS XML to our own proxy RSS feed to add additional data as well limit the number of items in the feed so we list on the latest jobs.
The RSS validates via ... | stackexchange/codereview |
Is there a way to test the type of an element in JavaScript?
The answer may or may not require the prototype library, however the following setup does make use of the library.
function(event) {
var element = event.element();
// if the element is an anchor
...
// if the element is a td
...
}
| stackexchange/codereview |
I am looking for a drawing library or code examples to draw images or vector shapes repeated along a path which could be curved.
I found a cocoa library which is what I am looking for http://apptree.net/drawkitmain.htm but for .NET.
| stackexchange/codereview |
Environment:
Windows Server 2003 R2 Enterprise 64bit, SP2
.NET framework is supposedly installed (2.0 SP2, 3.0 SP2, 3.5 SP1)
I say "supposedly" because they are listed as installed under Add/Remove programs. I'm not sure it's properly installed, because the "ASP.NET" tab isn't added to any of the sites in IIS.
In the I... | stackexchange/codereview |
In emacs there is a handy way to launch the gdb and gui options for gdb, the C debugger.
Is there a similar option in gvim?
| stackexchange/codereview |
I learned about Microsoft BizSpark the other day and started the sign up process. Has anyone else heard about it or had success with it?
| stackexchange/codereview |
Is it better in C++ to pass by value or pass by reference-to-const?
I am wondering which is better practice. I realize that pass by reference-to-const should provide for better performance in the program because you are not making a copy of the variable.
| stackexchange/codereview |
I am using the Skype4Com COM object to intercept audio from the microphone. I know that it is 16 bit mono, but how do I find out what its sample rate is?
| stackexchange/codereview |
I want to write a program that would print every combination of a set of variables to a text file, creating a word list. Each answer should be written on a separate line and write all of the results for 1 digit, 2 digits, and 3 digits to a single text file.
Is there a simple way I can write a python program that can ac... | stackexchange/codereview |
I'm building a mobile application in VB.NET (compact framework), and I'm wondering what the best way to approach the potential offline interactions on the device. Basically, the devices have cellular and 802.11, but may still be offline (where there's poor reception, etc). A driver will scan boxes as they leave his tru... | stackexchange/codereview |
In .Net Activator.GetObject(Type type, string url, object data) returns a proxy to the object. I guess that proxy inherits from MarshalByRefObject and can be sent across AppDomains. Am I right?
In my app, I am creating an object in appdomain A and using it appdomain B. The object's members are proxyobjects created usin... | stackexchange/codereview |
In Reporting Services I would like to add a parameter that contains data from a custom code block. Ideally, I would be able to run the following code (this is a simple testing example):
Function GetPeriods() As String()
Dim values As System.Collections.ArrayList =
New System.Collections.ArrayList()
For i as int... | stackexchange/codereview |
Can I access a users microphone in Python?
Sorry I forgot not everyone is a mind reader:
Windows at minimum XP but Vista support would be VERY good.
| stackexchange/codereview |
How can I change a file's extension using PHP?
Ex: photo.jpg to photo.exe
| stackexchange/codereview |
When IE8 is released, will the following code work to add a conditional stylesheet?
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="ie-8.0.css" />
<![endif]-->
I've read conflicting reports as to whether this works with the beta. I'm hoping someone can share their experience. Thanks.
| stackexchange/codereview |
I'm looking for a "quick and dirty" C++ testing framework I can use on my Windows/Visual Studio box. It's just me developing, so it doesn't have to be enterprise class software.
Staring at a list of testing frameworks, I am somewhat befuddled...
http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks#C.2B.2B
| stackexchange/codereview |
I want to set IE as my default browser for running Silver light applications from Expression Blend, but I don't want to change my windows default from Mozilla. Is there a settings option in Blend to do this?
| stackexchange/codereview |
How do I use Windows Vista's FOLDERID API in order to retrieve filepaths for "known folders" such as System or Windows? I've seen some APIs but I don't know how to import them properly. And yes, I know this is a very newbie question, but I spent a half hour googling and couldn't find the answer; I'd also appreciate a w... | stackexchange/codereview |
There are some good examples on how to calculate word frequencies in C#, but none of them are comprehensive and I really need one in VB.NET.
My current approach is limited to one word per frequency count. What is the best way to change this so that I can get a completely accurate word frequency listing?
wordFreq = New ... | stackexchange/codereview |
I have always found this to be a very useful feature in Visual Studio. For those who don't know about it, it allows you to edit code while you are debugging a running process, re-compile the code while the binary is still running and continue using the application seamlessly with the new code, without the need to rest... | stackexchange/codereview |
Short of putting a UIWebView as the back-most layer in my nib file, how can I add a repeating background image to an iPhone app (like the corduroy look in the background of a grouped UITableView)?
Do I need to create an image that's the size of the iPhone's screen and manually repeat it using copy and paste?
| stackexchange/codereview |
Is there a way to download older versions of Visual C++ Express? I'm particularly interested in Visual C++ 2005 Express (PRIOR SP1) and Visual C++ Toolkit 2003. I tried googling for them, but all the sites linked to microsoft.com, from where microsoft (for some reason) has taken them down.
| stackexchange/codereview |
I'm implementing my app as a drag source. When I call DoDragDrop (Win32 call, not MFC) it enters into a modal loop and I don't get repaint messages in my main window until DoDragDrop returns. Unfortunately if I do a drop in the shell (a file) and the filename is already there the shell asks if I want to replace the fil... | stackexchange/codereview |
Yesterday @headius / Charles Nutter came up with a very interesting idea on twitter:
@danny_l Gafter made the same mistake; I don't mean a forked Java any more than Groovy is a fork. I want a "mostly Java" with closures.
or the reply by @danny_l / Danny Lagrouw:
@headius or could the BGGA prototype be "bolted on" a... | stackexchange/codereview |
in a web application I am building I need to upload photos without using a form, otherwise it will come up with form embedded in an outer from which is not permitted in XHTML.
I think uploading files is what jQuery.post should be able to do, but I currently can't figure out how to do this using jQuery.
| stackexchange/codereview |
I have two tables (renamed/refactored for illustrative purposes) with a Many-To-Many relationship in an HSQL database. I want everything to be wiped out when I delete from one side of a Many-to-Many relationship (without querying the table; this is performance critical)
Here are my main tables:
CREATE TABLE PERSON
(
... | stackexchange/codereview |
Are there ways to programmatically simulate connection problems (slow connection, response does not complete, connection gets dropped, etc.) when using the HttpWebRequest class?
Thanks
EDIT: To elaborate more, I need this for debugging but would want to turn it into a test eventually. I'm using the async methods BeginG... | stackexchange/codereview |
In C# code can you catch a native exception thrown from deep in some unmanaged library? If so do you need to do anything differently to catch it or does a standard try...catch get it?
| stackexchange/codereview |
Despite the rather clear documentation which says that parseFloat() can return NaN as a value, when I write a block like:
if ( NaN == parseFloat(input.text) ) {
errorMessage.text = "Please enter a number."
}
I am warned that the comparison will always be false. And testing shows the warning to be correct.
Where is t... | stackexchange/codereview |
A client of our has recently upgraded a ASP.NET 1.1 web application to ASP.NET that uses COM+ transaction processing and received the following exception while trying to process a transaction:
Exception Type:
System.Transactions.TransactionManagerCommunicationException
Message: Communication with the
underlying... | stackexchange/codereview |
I have a SQL Server 2000 database instance that is rarely updated. I also have a database table which has no columns holding each row's created date or modified date.
Is there any way that I can determine the last time an update or insert was performed on the database as a whole, so that I can at least put a bound o... | stackexchange/codereview |
I am coding a program that reads data directly from user input and was wondering how could I (without loops) read all data until EOF from standard input. I was considering using cin.get( input, '\0' ) but '\0' is not really the EOF character, that just reads until EOF or '\0', whichever comes first.
Or is using loops t... | stackexchange/codereview |
What is the best method of performing an scp transfer via the Java programming language? It seems I may be able to perform this via JSSE, JSch or the bouncy castle java libraries. None of these solutions seem to have an easy answer.
| stackexchange/codereview |
How would you go about converting a reasonably large (>300K), fairly mature C codebase to C++?
The kind of C I have in mind is split into files roughly corresponding to modules (i.e. less granular than a typical OO class-based decomposition), using internal linkage in lieu private functions and data, and external linka... | stackexchange/codereview |
I'm reading data from a device which measures distance. My sample rate is high so that I can measure large changes in distance (i.e. velocity) but this means that, when the velocity is low, the device delivers a number of measurements which are identical (due to the granularity of the device). This results in a 'steppe... | stackexchange/codereview |
In writing some test code I have found that Selector.select() can return without Selector.selectedKeys() containing any keys to process. This is happening in a tight loop when I register an accept()ed channel with
SelectionKey.OP_READ | SelectionKey.OP_CONNECT
as the operations of interest.
According to the docs, selec... | stackexchange/codereview |
I am trying to make my window manager conform to the ICCCM specifications. I fully understand the reason for the _NET_SUPPORTING_WM_CHECK atom - this ensures that no invalid information stays whenever the window manager isn't running anymore.
What I don't understand is why are no other atoms like _NET_NUMBER_OF_DESKTOP... | stackexchange/codereview |
After some find and replace refactoring I ended up with this gem:
const class A
{
};
What does "const class" mean? It seems to compile ok.
| stackexchange/codereview |
Is there any meaningful distinction between:
class A(object):
foo = 5 # some default value
vs.
class B(object):
def __init__(self, foo=5):
self.foo = foo
If you're creating a lot of instances, is there any difference in performance or space requirements for the two styles? When you read the code, do... | stackexchange/codereview |
Is there a quick tcpdump one-liner to print out a TCP stream that matches a particular substring -- or, if that's not easy, how about printing out just the single TCP packet that matches the substring?
| stackexchange/codereview |
Is there a way of using an 'OR' operator or equivalent in a PHP switch?
For example, something like this:
switch ($value) {
case 1 || 2:
echo 'the value is either 1 or 2';
break;
}
| stackexchange/codereview |
I'm working on a project where we're doing a lot of remote object transfer between a Java service and clients written in other various languages. Given our current constraints I've decided to see what it would take to generate code based on an existing Java class. Basically I need to take a .class file (or a collection... | stackexchange/codereview |
We've been creating banners using the getURL linking method (in a blank window). For many people, it works just fine. You click the banner and are taken to our site. For others (me included), clicking the flash object triggers a pop-up warning in FireFox (both 2 and 3, default settings). The weird thing is that it does... | stackexchange/codereview |
I'm getting this error:
javax.servlet.ServletException: bean not found within scope
on a page with this at the top.
<jsp:useBean id="bean" type="com.example.Bean" scope="request" />
The class exists in the classpath, it worked this morning, and I don't get what not found within scope means.
How is this caused and how... | stackexchange/codereview |
Is there a way to compile multiple java source directories in a single maven project?
| stackexchange/codereview |
I recently got a notification from a McAfee service (what used to be called HackerSafe) that my website is using SSLv2 and it should be using SSLv3. I don't know anything about the versions of SSL. My site is using IIS 6.0, is there a setting somewhere to turn on SSLv3 or do I need to install something to make this hap... | stackexchange/codereview |
I'm all for language diversity, but Objective C is insane. So I'm curious: is it possible to code iPhone apps with C++ while using the Cocoa API, etc?
| stackexchange/codereview |
I am building a really basic Cocoa application using WebKit, to display a Flash/Silverlight application within it. Very basic, no intentions for it to be a browser itself.
So far I have been able to get it to open basic html links (<a href="..." />) in a new instance of Safari using
[[NSWorkspace sharedWorkspace] open... | stackexchange/codereview |
I want subversion to commit a file even if it's unchanged. Is there a way to do this?
| stackexchange/codereview |
We are moving our database server to a bigger box. I have several databases with full text indexes. What is the best way to move the full text indexes?
| stackexchange/codereview |
What is the best way to add "copy to clipboard" functionality to a ListView control in WPF?
I tried adding an ApplicationCommands.Copy to either the ListView ContextMenu or the ListViewItem ContextMenu, but the command remains disabled.
Thanks,
Peter
Here is an xaml sample of one of my attempts...
<Window.Resources>
... | stackexchange/codereview |
I have a desktop (winforms) application that uses a Firebird database as a data store (in embedded mode) and I use NHibernate for ORM. One of the functions we need to support is to be able to import / export groups of data to/from an external file. Currently, this external file is also a database with the same schema... | stackexchange/codereview |
I was wondering which of the built in python libraries, support DTD validation.
I've been looking around and haven't been able to get a straight answer. I know ElementTree does NOT Support DTD validation.
Which ones do?
| stackexchange/codereview |
Can anyone please let me know the procedure to perform silent installation of SQL Server Express 2005 and the way to specify the installation parameters.
| stackexchange/codereview |
Wordpress provides a function called "the_permalink()" that returns, you guessed it!, the permalink to a given post while in a loop of posts.
I am trying to URL encode that permalink and when I execute this code:
<?php
print(the_permalink());
$permalink = the_permalink();
print($permalink);
print(urlencode(the_permalin... | stackexchange/codereview |
I have a very painful library which, at the moment, is accepting a C# string as a way to get arrays of data; apparently, this makes marshalling for pinvokes easier.
So how do I make a ushort array into a string by bytes? I've tried:
int i;
String theOutData = "";
ushort[] theImageData = inImageData.DataArray;
//thi... | stackexchange/codereview |
GNU gcc 4.3 partially supports the upcoming c++0x standard: among the implemented features the rvalue reference. By means of the rvalue reference it should be possible to move a non-copyable object or return it from a function.
Are std::streams already movable by means of rvalue reference or does the current library i... | stackexchange/codereview |
I have read about a technique involving writing to disk a rendered dynamic page and using that when it exists using mod_rewrite. I was thinking about cleaning out the cached version every X minutes using a cron job.
I was wondering if this was a viable option or if there were better alternatives that I am not aware of.... | stackexchange/codereview |
How would you design a content voting mechanism that could be applied polymorphically to multiple models / classes. (in a ruby on rails context preferably, but others are fine)
Given that instances of these classes can be voted on:
- Article
- Question
- Product
Voters should not be required to register.
Best effort sh... | stackexchange/codereview |
I'm trying to get CellID using AT commands, but I dont get any response from the modem, mine code looks like below, I send AT+CCED command, but never get any response.
HANDLE hCom;
char * xpos;
char rsltstr[5];
DWORD returnValue;
DWORD LAC;
DWORD CellId;
int bufpos;
DCB dcb;
COMMTIMEOUTS to;
DWORD nWritten;
DWORD event... | stackexchange/codereview |
My computer at home is set up to automatically download some stuff from RSS feeds (mostly torrents and podcasts). However, I don't always keep this computer on. The sites I subscribe to have a relatively large throughput, so when I turn the computer back on it has no idea what it missed between the the time it was turn... | stackexchange/codereview |
Is there a complete list of Google Gears enabled sites? I'm aware of rememberthemilk.com, google docs and google calendar
| stackexchange/codereview |
I need to open a Microsoft Word 2003 file and change its file properties. Such as changing the Subject in the Summary Tab.
| stackexchange/codereview |
My solution includes these two projects:
MyNamespace.Web.UI
MyNamespace.Web.Core
UI references Core, and Core references Foobar.dll, which exists nowhere except my library. When I build from Visual Studio 2008 Foobar.dll is in the UI project's Bin folder as expected. I have made certain it was not there before the ... | stackexchange/codereview |
Ok, so I have a Rails app set up on DreamHost and I had it working a while ago and now it's broken. I don't know a lot about deployment environments or anything like that so please forgive my ignorance. Anyway, it looks like the app is crashing at this line in config/environment.rb:
require File.join(File.dirname(__F... | stackexchange/codereview |
I need to catch the HTML of a ASP.NET just before it is being sent to the client in order to do last minute string manipulations on it, and then send the modified version to the client.
e.g.
The Page is loaded
Every control has been rendered correctly
The Full html of the page is ready to be transferred back to the cli... | stackexchange/codereview |
I'm using WebORB as a remote gateway for Flex projects. I was wondering what would be the best architecture to use on the Server .NET side. At this moment we are using SubSonic to generate a Data Access Layer. Besides that each call from Flex uses a little bit a transaction script pattern because the server side really... | stackexchange/codereview |
I am using VC++. Is assert(false) ignored in release mode?
| stackexchange/codereview |
I am looking for a way to display a modal window in WPF the same way as a window in Cocoa can be displayed as a sheet, i.e. it slides down from the titlebar in front of the main parent window.
My guess is that this would be accomplished by having the modal window as a user control which is loaded into a panel when disp... | stackexchange/codereview |
The calculations in my code are well-tested, but because there is so much GUI code, my overall code coverage is lower than I'd like. Are there any guidelines on unit-testing GUI code? Does it even make sense?
For example, there are graphs in my app. I haven't been able to figure out how to automate the testing of the g... | stackexchange/codereview |
How do I programmatically force the deletion of files that are locked by the operating system or any other program with C/C++? The functionality should be similar to the software "Unlocker" at http://ccollomb.free.fr/unlocker.
| stackexchange/codereview |
I'd like to develop an ecommerce site where I could allow others to sell items, things like pictures, videos, flash, etc. I want to be able to keep a percentage, and pay the rest back to the seller.
Is there anything available, DotNetNuke, etc. that would do this or help get this started. If not what's a good way to ap... | stackexchange/codereview |
I've got a simple little WPF app with a TextBox and a WebBrowser control. As I type into the TextBox the WebBrowser updates with its content.
But on each keystroke, when the WebBrowser updates, it makes a click sound. How can I disable the WebBrowser control's refresh click sound?
WPF TextBox and WebBrowser controls ... | stackexchange/codereview |
What is the string concatenation operator in Oracle SQL?
Are there any "interesting" features I should be careful of?
(This seems obvious, but I couldn't find a previous question asking it).
| stackexchange/codereview |
How do I view the history of an individual file with complete details of what has changed?
git log -- [filename] shows me the commit history of a file, but how do I see the file content that changed?
| stackexchange/codereview |
An XSLT-newbie problem: I need to substitute a text value in XML-file. All other nodes must be left unchanged. Here's my input file (in.xml):
<?xml version="1.0" encoding="UTF-8"?>
<root>
<level1 attr1="val1">
<level2>in</level2>
</level1>
</root>
Here's my XSLT-transformation (subst.xsl):
<?xml versio... | stackexchange/codereview |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.