instruction stringlengths 0 30k ⌀ |
|---|
You need to re-architect your solution. Even if you *could* do it (you can't), the question simply doesn't have a sensible answer.
Imagine a get_name method.
a = 1
get_name(a)
Everyone could probably agree this should return 'a'
b = a
get_name(b)
Should it return 'b', or 'a', or an arra... |
Are you sure you included all of the right headers? The following compiles for me in VS2003:
#include <iostream>
#include <sstream>
#include <iomanip>
int main()
{
int SomeInt = 1;
std::stringstream StrStream;
StrStream << std::setw(2) << SomeInt;
return 0;
... |
How do I get the most recently updated form item to "stick" in Firefox when I copy its container? |
|javascript|firefox|dom| |
I have a dl containing some input boxes that I "clone" with a bit of JavaScript like:
var newBox = document.createElement('dl');
var sourceBox = document.getElementById(oldkey);
newBox.innerHTML = sourceBox.innerHTML;
newBox.id = newkey;
document.getElementById('boxes').appendChild... |
Check http://g4j.sourceforge.net/. There is a minimal gmail client built using this API. |
Astoria vs. SQL Server Data Services |
|ado.net|data|service|astoria|ssds| |
What are in your opinion big differences between areas of usage for "Astoria" (ADO.NET data services) and SQL Server Data Services? |
What advantages does jQuery have over other JavaScript libraries? |
|javascript|jquery| |
I am trying to convince those who set standards at my current organization that we should use jQuery rather than Prototype and/or YUI. What are some convincing advantages I can use to convince them? |
|javascript|jquery| |
It also depends heavily what kind of application you're working on. For a commandline app, for example, its probably easy enough to just create a shell script that calls it with a whole bunch of different options and compares its result to a previously known stable version, warning you if any of the output differs so ... |
I found some ideas by Googling.
- [Someone had issue with "SSRS server configured for Sharepoint Integrated mode with Cumulative update package 3 for SQL Server 2005 Service Pack 2" but "the problem vanished after installing the .NET framework 3.0 SP1"][1]
- You can get this error if you have ["old instances of... |
Check your Visual Studio options for the following check box:
Projects and Solutions - Build and Run - For new solutions use the currently selected project as the startup project.
Uncheck that and see if the behavior changes. |
Yes, such a thing is possible.
In fact, your example is very close to the solution.
Try
foo["method"]();
instead of
foo.method(); |
You will need to use some LDAP queries
Here is some code I have used in a previous script (it was taken off the net somewhere, and I've left in the copyright notices)
----
' This VBScript code gets the list of the domains contained in the
' forest that the user running the script is logged into
... |
Difference between NULL and null in PHP |
|php| |
Is there a difference between NULL and null in PHP? Sometimes they seem to be interchangeable and sometimes not.
I know that you must set a variable to NULL in order for it to be considered "null", but what about when testing it for... nullity... Do you have to say "$var == NULL" or can you say "$var == null"? |
Is there a difference between NULL and null in PHP? Sometimes they seem to be interchangeable and sometimes not.
edit: for some reason when I read the documentation linked to in the answer (before posting this question) I read it as "case sensitive" instead of "case insensitive" which was the whole reason I posted t... |
I've always used For Each... |
Anyone know of an on-line free database? |
|c#|database| |
I wrote an application that currently runs against a local instance of MySql. I would like to centralize the DB somewhere on the Net, and share my application.
But, I'm cheap, and don't want to pay for it. Does anyone know of a free on-line relational DB service that I could connect to via C#? |
I agree with using events for this. Since I suspect that you're building an MDI-application (since you create many child forms) and creates windows dynamically and might not know when to unsubscribe from events, I would recommend that you take a look at the "Weak event pattern" at <http://msdn.microsoft.com/en-us/libra... |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Centering</title>
<style type="text/css" media="screen">
body, html {height: 100%; padding: 0px; margin: 0px;}
... |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Centering</title>
<style type="text/css" media="screen">
body, html {height: 100%; padding: 0px; margin: 0px;}
... |
How do you backup IIS's metabase in C#? |
|iis|directoryservices|metabase| |
exact code will be helpful. I assume the DirectoryServices namespace does it but I can't find the method that does it. |
ImageMagick has a [C API to connect to its libraries][1]. There's also what they call a ["low-level interface" between C and the ImageMagick libraries][2].
[1]: http://www.imagemagick.org/script/magick-wand.php
[2]: http://www.imagemagick.org/script/magick-core.php |
[DevIL][1] is often recommended. Whether or not it does what you want, I don't know.
[1]:http://openil.sourceforge.net/ |
I used [FreeImage][1] for PSP games in the past, but it was for pre-processing the data rather than in-game.
[1]: http://freeimage.sourceforge.net/ |
How to pass password to scp? |
|linux|batch-file|scp| |
I know it is not recommended, but is it at all possible to pass the users password to scp?
I'd like to copy a file via scp as part of a batch job and the receiving server does of course need a password (no, I cannot easily change that to key-based authentication).
TIA
Argelbargel
|
How can I prevent URLDownloadToFile from retrieving from the cache ? |
|c++|winapi|wininet| |
I am using URLDownloadToFile to retrieve a file from a website. Subsequent calls return the original file rather than an updated version. I assume it is retrieving a cached version.
|
We have an MS-Acces application, developped with Access 2003 and used on either full or runtime version of Access 2003 and Access 2007 (Access 2007 Runtime being free, we are making a great use of it!). There is no particular issue except the references management. Our code analyses the Office version installed on the ... |
[RhinoMocks][1] makes an intersting use for `using`.
[1]: http://www.ayende.com/wiki/Rhino+Mocks+Record-playback+Syntax.ashx |
<img src="http://ecx.images-amazon.com/images/I/519J3P8ANML._SL500_AA240_.jpg"/>
Took my programing to a whole new level. |
This may seem obvious, but anyway.
Do you initialize this dropdown with an initial value in some other event handler like OnLoad ?
If so you should check if that event is risen by a postback or by the first load. So you should have something like
if(!IsPostback) d.SelectedValue = "Default" |
How do I get the name of a python class as a string? |
|python| |
What method do I call to get the name of a class? |
Nant and changing file properties (read-only to writable) |
|nant| |
As part of the Nant copy task, I would like to change the properties of the files in the target location. For instance make the files "read-write" from "read-only". How would I do this? |
In general, having multiple versions of Access installed on the one machine is unsupported and will result in the issues you are seeing with the object references.
If the database is authored in Access 2003, compiled to an .MDE, and then deployed onto a separate Windows instance running Access 2007, you should not h... |
There are two approaches to endian mapping: _address invariance_ and _data invariance_.
##Address Invariance
In this type of mapping, the address of bytes is always preserved between big and little. This has the side effect of reversing the order of significance (most significant to least significant) of a part... |
If you believe the [rdoc](http://www.ruby-doc.org/stdlib/libdoc/socket/rdoc/index.html) for ruby sockets, they don't implement `gets`. This leads me to believe gets is being provided by a higher level of abstraction (maybe the IO libraries?) and probably isn't aware of socket-specific things like 'connection closed.'
... |
If this is 'Which language runs better on the CLR,' then right now, IronPython wins hands down.
For the long term though, 'which language will teach me more, and serve me better in my career as a programmer', I would definitely say IronRuby (this would be true of CPython vs CRuby also)
Ruby will expose you to mor... |
Include CSS or Javascript file for specific node in Drupal 6 |
|drupal| |
What is the best method for including a CSS or Javascript file for a specific node in Drupal 6.
I want to create a page on my site that has a little javascript application running, so the CSS and javascript is specific to that page and would not want to be included in other page loads at all. |
Hardly seems worth it since you can do the following:
var o = incrediblyLongObjectNameThatNoOneWouldUse;
o.name = "Bob";
o.age = "50";
|
How to determine the size of the button portion of a Windows radio button |
|windows|user-interface|winapi|gdi| |
I'm drawing old school (unthemed - themed radios are a whole other problem) radio buttons myself using DrawFrameControl:
DrawFrameControl(dc, &rectRadio, DFC_BUTTON, isChecked() ? DFCS_BUTTONRADIO | DFCS_CHECKED : DFCS_BUTTONRADIO);
I've never been able to figure out a sure fire way to figure out what to ... |
Not sure about library, but you can call gacutil.exe to install/uninstall assemblies. |
Not sure about library, but you can call [gacutil.exe][1] to install/uninstall assemblies.
[1]: http://msdn.microsoft.com/en-us/library/ex0ss12c%28VS.80%29.aspx |
If g[0]["MyUntypedDateField"] is really a DateTime object, then the cast is the better choice. If it's not really a DateTime, then you have no choice but to use the Parse (you would get an InvalidCastException if you tried to use the cast) |
The best solution I've come up with so far is to enable the PHP input mode, and then call [drupal_add_css][1] and [drupal_add_js][2] as appropriate in a PHP block in the start of the body of your node.
[1]: http://api.drupal.org/api/function/drupal_add_css
[2]: http://api.drupal.org/api/function/drupal_add_js |
Generally speaking, what you do is encrypt the data with a randomly generated key, and then append versions of that random key that have been encrypted with every known key. So anybody with a valid key can discover the 'real' key that was used to encrypt the data. |
What's the best way to represent a hierachy in a SQL database?
The hierachy is mostly read, but isn't completely static. Let's say it's a family tree.
Here's how not to do it:
create
table person (
person_id integer autoincrement primary key,
name varchar(255) not null,
dob d... |
What's the best way to represent a hierachy in a SQL database? A generic, portable technique?
Let's assume the hierachy is mostly read, but isn't completely static. Let's say it's a family tree.
Here's how not to do it:
create table person (
person_id integer autoincrement primary key,
name ... |
What's the best way to represent a hierachy in a SQL database? A generic, portable technique?
Let's assume the hierachy is mostly read, but isn't completely static. Let's say it's a family tree.
Here's how not to do it:
create table person (
person_id integer autoincrement primary key,
name ... |
I think the most important points one has to learn regarding source control systems are the following:
- the value of small, frequent check-ins/commits
- tagging, branching and merging
- rollbacks
- conflict resolution
- exclusive vs. non-exclusive checkout
- continuous integration
- Test-driven... |
I think I found the reason. While trying to get this work, I think I installed another version of the package that removed or deactivated my current version. The control I was dropping on the form belonged to the older version that had no assemblies referenced. I removed all installations of ActiveReports, installed th... |
Try it without using the /exchange in the server properties field. Here's a link with relevant [info][1].
[1]: http://www.robichaux.net/blog/2006/09/using_entourage_with_exchange_2007.php |
I've never heard of such a thing. A few years ago, many hosts (Brinkster, etc) offered some minimal database capacity with their free web hosting accounts, but I think you'd find it difficult to find something like that now. Even if you could, most hosts no longer allow you to connect to a database (even on an account ... |
Have you taken a look at <http://creator.zoho.com/>?
I haven't tested it myself but it might be a good idea to check it out. |
Oops, didn't read the question properly that time! :P
Haven't tried this yet, and their site says they had had a major crash recently, but it looks promising: [http://www.freesql.org/][1]
[1]: http://www.freesql.org/ |
What about <http://freesql.org> ? Seems like you can't be too picky when you're asking for free, and this seems to offer something. |
You could also download the full VS2008 SP1 ISO image from [here][1].
Then you can either burn it to DVD or use a tool such as [Virtual CD-ROM Control Panel from Microsoft][2] to mount the ISO as another drive.
After mounting the ISO as a virtual drive, you can run the SP1 install from there.
[1]: http://w... |
Are you sure that the 32-bit version doesn't just run on 64-bit Windows, without modification? Most things do.
Failing that, have you actually tried just compiling it for 64-bit? A brief scan of a few Google Groups etc where people asked this same question suggests that that may be exactly the solution to this. I th... |
using can be used to call IDisposable. It can also be used to alias types.
using (SqlConnection cnn = new SqlConnection()) { /*code*/}
using f1 = System.Windows.Forms.Form; |
I used it to edit files on the webserver which was linux instead of using FTP. That was 9 years ago and I have since mastered the skills.
The other thing is find something great you can do in VI such as global search and replace or something even more powerful, and use VI whenever you need to do that. |
C# 3.0 definitely does.
C# now has
1. Lambda Expressions
2. Higher Order Functions
3. Map / Reduce + Filter ( Folding?) to lists and all types which implement IEnumerable.
4. LINQ
5. Object + Collection Initializers.
The last two list items may not fall under proper functional programming, anyways t... |
Sending an email may not be possible if you are getting a runtime exception like OutOfMemoryError or StackOverflow. Most likely you will have to spawn another process and catch any exceptions thrown by it (with the various techniques mentioned above). |
"using" can also be used to resolve name space conflicts. See http://www.davidarno.org/c-howtos/aliases-overcoming-name-conflicts/ for a short tutorial I wrote on the subject. |
Detecting concurrent modifications? |
|java|collections| |
In a multi-threaded application I'm working on, we occassionally see ConcurrentModificationExceptions on our Lists (which are mostly ArrayList, sometimes Vectors). But there are other times when I think concurrent modifications are happening because iterating through the collection appears to be missing items, but no ... |
In a multi-threaded application I'm working on, we occassionally see ConcurrentModificationExceptions on our Lists (which are mostly ArrayList, sometimes Vectors). But there are other times when I think concurrent modifications are happening because iterating through the collection appears to be missing items, but no ... |
In a multi-threaded application I'm working on, we occassionally see ConcurrentModificationExceptions on our Lists (which are mostly ArrayList, sometimes Vectors). But there are other times when I think concurrent modifications are happening because iterating through the collection appears to be missing items, but no ... |
I love this [reference site][1] for stream questions like this.
/Allan
[1]: http://www.cplusplus.com/reference/ |
How about [ZenCart][1]? It's open source so you can read and modify the source directly.
There's also a decent template system.
[1]: http://zencart.com/ |
> alias mycommand = 'verylongcommand -with -a -lot -of -parameters'
> alias grep='grep --color'
find more than one word with grep :
> netstat -c |grep 'msn\|skype\|icq' |
[osCommerce][1] seems to be pretty popular, and advertises ease of integration as one of it's main features.
[1]: http://www.oscommerce.com/solutions/oscommerce |
When do hal properties get updated |
|dbus|hal| |
I'm calling GetProperty on a org.freedesktop.Hal.Device from my handler during a PropertyNotified signal. I'm only calling GetProperty on properties that have been added or changed.
When I call GetProperty during property adds, I'm getting a org.freedesktop.Hal.NoSuchProperty exception. I'm also worried that durin... |
YUI Compressor does a pretty good job at compressing both Javascript and CSS. |
What you want is a modifier:
sprintf(S, "%.10f", val);
man sprintf will have many more details on format specifiers. |
Any way to programatically wrap a .NET WebService with a SoapExtension? |
|c#|.net|web-services| |