instruction
stringlengths
0
30k
100% agree with Mendelt. It is not only a maintenance problem, but can also be a linguistic one. In all Latin languages the gender, number, and case of the subject affect other elements. Example for Romanian The printer is on: Imprimanta este pornită // feminine The printer is off: Imprimanta este ...
Those are all slightly different, and generally have an acceptable usage. - var.[ToString][1]() is going to give you the string representation of an object, regardless of what type it is. Use this if var is not a string already. - [CStr][2](var) is the VB string cast operator. I'm not a VB guy, so I would sug...
Those are all slightly different, and generally have an acceptable usage. - var.[ToString][1]() is going to give you the string representation of an object, regardless of what type it is. Use this if var is not a string already. - [CStr][2](var) is the VB string cast operator. I'm not a VB guy, so I would sug...
assuming you are talking about inputting numbers, double precision would get you up to 1.7976931348623157 x 10^308
A Subversion "branch" is just a copy of something in your repository. So if you wanted to branch a file you'd just do: svn copy myfile.c myfile_branch.c
Getting at the Listbox's ItemContainer
|silverlight|
Is there a way to get at the ItemContaner of a selected item in a listbox? In Beta 1 i could, but the container is hidden in 2.0.
Is there a way to get at the ItemContaner of a selected item in a listbox? In Beta 1 i could, but the container is hidden in 2.0. I'm trying to resize the listbox item when it is unselected to a specific size and when selected to a variable size. I also want to get the relative position of the selected item for...
Getting at the Listbox's ItemContainer when data binding
Is there a way to get at the ItemContaner of a selected item in a listbox? In Silverlight 2.0 Beta 1 I could, but the container is hidden in Beta 2 of Silverlight 2.0. I'm trying to resize the listbox item when it is unselected to a specific size and when selected to a variable size. I also want to get the rela...
How bind an event handler to an instance in JQuery
|jquery|events|javascript|dom|
Say I have a "class" as follows: function Car(owner) { this.owner = owner; } Car.prototype = { drive: function() { alert("Driving "+this.owner+"s car!"); } } And an instance: var myCar = new Car("Bob"); I now want to bind an event to the drive "method" of...
How can I bind an event handler to an instance in JQuery
Like: - [http://search.cpan.org/~thaljef/Perl-Critic-1.092/lib/Perl/Critic.pm][1] - [http://www.slideshare.net/joshua.mcadams/an-introduction-to-perl-critic/][2] Loks like a nice tool! [1]: http://search.cpan.org/~thaljef/Perl-Critic-1.092/lib/Perl/Critic.pm [2]: http://www.slideshare.net/joshua.mca...
Like: - [http://search.cpan.org/~thaljef/Perl-Critic-1.092/lib/Perl/Critic.pm][1] - [http://www.slideshare.net/joshua.mcadams/an-introduction-to-perl-critic/][2] Looks like a nice tool! [1]: http://search.cpan.org/~thaljef/Perl-Critic-1.092/lib/Perl/Critic.pm [2]: http://www.slideshare.net/joshua.mc...
The examples have "unspecified behaviour". For a non-POD, the order by which the compiler lays out an object (all bases classes and members) is unspecified (ISO C++ 10/3). Consider the following: struct A { int i; }; class B : public A { // 'B' is not a POD public: B (); ...
Anything that can be viewed and understood by a human can be viewed and stored by a computer. The best you can do is obfuscate and attempt to confuse, but any suitably determined user will succeed. You could deliver text as an image, an image with a watermark, an encrypted file with public/private keys but the best...
The short answer is: use -Ox and let the compiler do its job. The long answer: the effect of different kind of optimizations is impossible to predict accurately. Sometimes optimizing for fast code will actually yield smaller code than when optimizing for size. If you really want to get the last 0.01% of performance...
I second olt's pointer to [Dive into Python](http://www.diveintopython.org/http_web_services/redirects.html). Here's an implementation using urllib2 redirect handlers, more work than it should be? Maybe, shrug. import sys import urllib2 class RedirectHandler(urllib2.HTTPRedirectHandler): def http_error_3...
It's not clear how you gonna use it. If you want double create GetDouble() method, for integers - GetInteger()
It's not clear how you gonna use it. If you want double create GetDouble() method, for integers - GetInteger() EDIT: Ok, now I think I understand your use case Try this: using System; using System.ComponentModel; static Nullable<T> ConvertFromString<T>(string value) where T:struct { ...
What I think we'll be seeing is that some functional stuff will migrate into C# such as the increase use of immutable types and the marking functions as pure etc. I can't see F# having a wider role in enterprise development its just too mystifying to the average developer.
All developers on your team can have their own branches on the server as well (can be per ticket or just per dev, etc). This way they don't break the build in master branch but they still get to push their work in progress to the server that gets backed up. [My own git\_remote\_branch][1] tool may come in handy for ...
Using c# and SharpSvn (from <http://sharpsvn.net>) the code would be: //using SharpSvn; long revision = -1; using(SvnClient client = new SvnClient()) { client.Info(path, delegate(object sender, SvnInfoEventArgs e) { revision = e.Revision; }); } ...
Put enough of the business logic in the database to ensure that the data is consistent and correct. But don't fear having to duplicate some of this logic at another level to enhance the user experience.
What's the router hardware and software version? Are you trying to do this with a linux box? Stop now and go get a router. It will save you money long-term.
[BetterExplained.com][1] has some great math lectures. Its not video lectures but the author gives easy-to-understand explanations on math concepts. [1]: http://betterexplained.com/articles/category/math/
I have recently started to love the simplicity of Bazaar to solve the problem of starting version control after already having hacked on an application for a while. With bazaar it is really only a few simple commands: 1) bzr init 2) bzr add [the files you are interested in] 3) bzr commit Note that this does <b...
It depends on your math level. You should start by revising what you should know till that moment and then go further to algorithm mathmatics, geometry (transforms and etc), statistics and more. There are tons of places on the internet were you can learn: http://www.math.cornell.edu/Courses/courses.html http:/...
If your custom program is an executable the easiest way would be to call the executable with Exec: <Exec Command="your executable" /> I would recommend writing a custom MSBuild task though. You can look at the [SDC Tasks][1] for samples on how to do it. [1]: http://www.codeplex.com/sdctasks
F5 to run the current query is an easy win, after that, the generic MS editor commands of **Ctrl-K,C** to comment out the selected text and then **Ctrl-K,U** to uncomment.
I wouldn't store data in XML in the cookie - there is a limit on cookie size for starters (used to be 4K for *all* headers including the cookie). Pick a less verbose encoding strategy such as delimiters instead e.g. a|b|c or separate cookie values. Delimited encoding makes it especially easy and fast to decode the va...
Joining other tables in oracle tree queries
|oracle-database|sql|connect-by|tree|
Given a simple (id, description) table t1, such as id description -- ----------- 1 Alice 2 Bob 3 Carol 4 David 5 Erica 6 Fred And a parent-child relationship table t2, such as parent child ------ ----- 1 2 1 3 4 5 ...
Those are all slightly different, and generally have an acceptable usage. - `var.`[`ToString`][1]`()` is going to give you the string representation of an object, regardless of what type it is. Use this if `var` is not a string already. - [`CStr`][2]`(var)` is the VB string cast operator. I'm not a VB guy, so...
How does c# figure out the hash code for an object?
|c#|internals|hash|
|c#|hash|internals|
This question comes out of the discussion on [tuples][1]. I started thinking about the hash code that a tuple should have. What if we will accept KeyValuePair class as a tuple? It doesn't override the GetHashCode() method, so probably it won't be aware of the hash codes of it's "children"... So, run-time will call...
After you commit your object into the db the object receives a value in it's ID field. So: myObject.Field1 = "value"; // Db is the datacontext db.MyObjects.InsertOnSubmit(myObject); db.SubmitChanges(); // You can retrieve the id from the object int id = myObject.ID;
When inserting the generated ID is saved into the instance of the object being saved (see below): protected void btnInsertProductCategory_Click(object sender, EventArgs e) { ProductCategory productCategory = new ProductCategory(); productCategory.Name = “Sample Category”; productCategor...
Cheat single inheritance in Java
|java|
I have heard there is a way to cheat single inheritance and implement multiple inheritance in Java. Does anyone know how to implement this?
I have heard there is a way to cheat single inheritance and implement multiple inheritance in Java. Does anyone know how to implement this(with out using interface)?
Cheat single inheritance in Java!!
Cheat single inheritance in Java !!
I have heard there is a way to cheat single inheritance and implement multiple inheritance in Java. Does anyone know how to implement this(with out using interface)?
|java|c|c++|
|java|
I have heard there is a way to cheat single inheritance and implement multiple inheritance in Java. Does anyone know how to implement this(with out using interface)? Just out of curiosity ;-)
|java|oop|
Long answer: Only let users browse your site by visiting your office and using a machine located there - under strict supervision, of course. Short answer: No.
Just making the window transparent is very straight forward: this.BackColor = Color.Fuchsia; this.TransparencyKey = Color.Fuchsia; You can do something like this to make it so you can still interact with the desktop or anything else under your window: protected override void WndProc(ref Message me...
My first thought would go to the drivers. Years ago I had to link DB2 to SQL Server 2000 and it was extremely difficult to find the correct combination of drivers and setup parameters that would work... So maybe I'm biased because of that, but I would try upgrading or downgrading the driver or changing the setup so...
You can add outlets from either delegate to the other delegate. There are two ways to add an outlet to an object in IB (assuming you're using Xcode/IB version 3.0 or later: 1. If you have not generated the code for your delegate classes yet, select the desired delegate, then open the "Object Identity" tab in the IB...
I'm not familiar with .NET's regexes. This will do what you want in Perl. /^\w+\.\w+(?:\.\w+)?$/ If .NET doesn't support the non-capturing `(?:xxx)` syntax, use this instead: /^\w+\.\w+(\.\w+)?$/ Note: I'm assuming that when you say "non-whitespace, non-dot" you really mean "word characters."
You can use DataSet, which you bind to the form. And you can save/restore it.
You could just use sections, or are you breaking out to other files for a specific reason?
The unmodifiable wrapper only prevents changes to the structure of the list that it applies to. If this list contains other lists and you have threads trying to modify these nested lists, then you are not protected against concurrent modification risks.
[Scott Hanselman](http://www.hanselman.com/blog/SpeechRecognitionInWindowsVistaImListening.aspx) uses voice recognition [quite a bit](http://www.hanselman.com/blog/TypingTestTwiceOnceWithVoiceRecognition.aspx).
You are using the * duplication, which allows for 0 iterations of the given component. You should be using plus, and putting the final .[^.]+ into a group followed by ? to represent the possibility of an extra set. Might not have the perfect syntax, but something similar to the following should work. ^[^.\s]+[...
This question comes out of the discussion on [tuples][1]. I started thinking about the hash code that a tuple should have. What if we will accept KeyValuePair class as a tuple? It doesn't override the GetHashCode() method, so probably it won't be aware of the hash codes of it's "children"... So, run-time will call...
The cheaper solution than 'dependency tracker' is the data dictionary table sys.sql_dependencies which from which this data can be queried from the data dictionary. Oracle has a data dictionary view with similar functionality called DBA_DEPENDENCIES (plus equivalent USER_ and ALL_ views) . Using the other data dictio...
The cheaper solution than 'dependency tracker' is the data dictionary table sys.sql_dependencies which from which this data can be queried from the data dictionary. Oracle has a data dictionary view with similar functionality called DBA_DEPENDENCIES (plus equivalent USER_ and ALL_ views) . Using the other data dictio...
What's wrong with defining a variable on one line and using it in a with-statement on the next? I realise it keeps the variable alive longer but is that *so* appalling? Dim x = new SomethingOrOther() With x .DoSomething() End With x = Nothing ' for the memory conscious Two extra lines ...
What's wrong with defining a variable on one line and using it in a with-statement on the next? I realise it keeps the variable alive longer but is that *so* appalling? Dim x = new SomethingOrOther() With x .DoSomething() End With x = Nothing ' for the memory conscious Two extra lines ...
A partial answer: the easily readable format you are looking for might be [DocBook][1]. From there it is very easy to go to PDF, html, RTF, etc. etc. [1]: http://www.docbook.org/
OpenGL would be my choice, .NET bindings exist from many open source wrappers, with OpenGL your set for cross platform.
I personally prefer Shoulda to RSpec. I find that Shoulda has less magic syntax than RSpec. My problem with RSpec is that yeah it's very readable when I read it aloud, but when I get to writing it, hmmmm, I'm never sure _how_ a given assertion should be written. [Prag Dave explains the problem better than me][1]. He al...
Firefox status bar is 3/4" above the bottom border
|firefox|
Somehow my FireFox 2 got corrupted, and the status bar is about 3/4" above the bottom window border. Anyone have an idea on how to get it back to being flush with the bottom window border?
There are certain debuggers listed here on Charlie Arehart's site. [http://www.carehart.org/cf411/#debug][1] [1]: http://www.carehart.org/cf411/#debug This CF411 site has a whole lot of great info on various subjects.
On most of embedded system i worked there was no profiling tools, so it's nice to say use profiler but not very practical. First rule in speed optimization is - **find your critical path**. Usually you will find that this path is not so long and not so complex. It's hard to say in generic way how to optimize th...
Say I have a "class" as follows: function Car(owner) { this.owner = owner; } Car.prototype = { drive: function() { alert("Driving "+this.owner+"s car!"); } } And an instance: var myCar = new Car("Bob"); I now want to bind an event to the drive "method" of...
|javascript|jquery|events|dom|
I am trying to bind an event to a "method" of a particular instance of a Javascript "class" using JQuery. The requirement is that I in the event handler should be able to use the "this" keyword to refer to the instance I originally bound the event to. In more detail, say I have a "class" as follows: function ...
Stripes : pretty good. a book on this has come out from pragmatic programmers : http://www.pragprog.com/titles/fdstr/stripes. No XML. Requires java 1.5 or later. tapestry : have tried an old version 3.x. I'm told that the current version 5.x is in Beta and pretty good. Stripes should be the better in terms of t...
I find [NameValueCollectionHandler][1] the easiest and best, and I generally would link off to an external config file via the configSource attribute. I try to put the ABSOLUTE MINIMUM configuration in config files, with most of it being configured in code with an Application that is self-aware of its deployment env...
You are using the * duplication, which allows for 0 iterations of the given component. You should be using plus, and putting the final .[^.]+ into a group followed by ? to represent the possibility of an extra set. Might not have the perfect syntax, but something similar to the following should work. ^[^.\s]+[...
Use an .htaccess file with some mod_rewrite rules: RewriteEngine On RewriteRule ^www.SERVERNAME(.*) http://SERVERNAME$1 [L,QSA] I'm not sure I got the syntax right with the `$1` there, but it's well documented. L sends a location: header to the browser, and QSA means Query String Append.
The syntax is a matter of taste, Lua is like Javascript but with curly braces replaced with Pascal-like keywords. It has the nice syntactic feature that semicolons are never required but whitespace is still not significant, so you can even remove all line breaks and have it still work. As someone who started with C I'd...
I sometimes get this with TortoiseSVN on windows. The solution for me is to `svn update` the directory, even though there are no revisions to download or update. It does something to the metadata, which magically fixes it.
I tried Dragon a couple of years ago and it was a nightmare of mish-mashed words and phrases - not recommended. I understand that it was the best thing going at that point in time so I'm not optimistic. As a fellow sufferer, recommendations would be: 1. Find a job that demands as little OT as possible 2. Try ...
What's the best method to enable or disable a feature in a .net desktop application
|.net|user-controls|
It can be either at compile time or at run-time using a config file. Is there a more elegant way than simple (and many) if statements? I am targeting especially sets of UI controls that comes for a particular feature.
Well, considering they are random, there is no really way to make sure, but testing for 100 000 password should clear most doubts :)
Not a general one but QT supports this via a meta compiler, and is GPL. My understanding from talking to the QT people was that this isn't possible with pure C++, hence the need for the moc.
The cheaper solution than 'dependency tracker' is the data dictionary table sys.sql_dependencies which from which this data can be queried from the data dictionary. Oracle has a data dictionary view with similar functionality called DBA_DEPENDENCIES (plus equivalent USER_ and ALL_ views) . Using the other data dictio...
The cheaper solution than 'dependency tracker' is the data dictionary table sys.sql_dependencies which from which this data can be queried from the data dictionary. Oracle has a data dictionary view with similar functionality called DBA_DEPENDENCIES (plus equivalent USER_ and ALL_ views) . Using the other data dictio...
To expand a little on the previous answer... 1) Create a new SVN repository<br /> 2) Commit all the code you've worked on so far to it<br /> 3) Check all that code OUT again, to create a working copy on your dev machine<br /> 4) Work! It's definitely not a hurdle, really.
You should look at [Visual SVN][1], which integrates seamlessly into Visual Studio. [1]: http://www.visualsvn.com/VisualSVN
Subversion Server install... Subverison Client Libraries instal... Install Ankh for integration with VS Install Tortoise for File Manager integration In File Manager, right click on top level direction with Solution... Import...
A branch in SVN is just a copy. I believe that to do it the way you are hoping to, you'd have to have each version of the file in a separate directory in the repository, and check it out into your source folder. I.E. treat that file like a separate project.
I tend to use const wherever possible. (Or other appropriate keyword for the target language.) I do this purely because it allows the compiler to make extra optimizations that it would not be able to make otherwise. Since I have no idea what these optimizations may be, I always do it, even where it seems silly. For ...