instruction
stringlengths
0
30k
I know this is going to seem old-fashioned, but I don't think much of using online tutorials to learn programming languages or platforms. These generally give you no more than a little taste of the language. To really learn a language, you need the equivalent of a "book", and in many cases, this means a real dead-tre...
TortoiseSVN, at least, has an option called Relocate which you can use if the location of the repository has changed. Also, this is a good example why you should always, always use DNS/hostnames instead of the IP address directly.
I don't believe you can. You might be better off aliasing commonly used commands in a script that you call from your profile script. Example - Set-Alias np c:\windows\notepad.exe Then you have your short, easily typeable name available from the command line.
CSV (or sheet in XLS) to SQL create (and insert) statements with .Net?
|.net|sql|csv|xls|
Does anyone have a technique for generating SQL table create (and data insert) commands pragmatically from a CSV (or sheet in a .xls) file? I've got a third party database system which I'd like to populate with data from a csv file (or sheet in a xls file) but the importer supplied can't create the table structure...
Paul's right. In PowerShell, function parameters are not enclosed in parenthesis. (Method parameters still are.) Your initial call was just passing one big array to the function, rather than the three separate parameters you wanted.
Matt Sheppard's answer is great (mod up), but I would take account these factors when thinking about a spindle: 1. Structure : does it obviously break into pieces, or are you making tradeoffs? 2. Usage : how will the data be analyzed/retrieved/grokked? 3. Lifetime : how long is the data useful? 4. Size : how ...
Here is a couple of ideas that may help 1. long running processes, they are not asp.net best friend. 2. scaling, using client side processing as compared to bigger or more servers reduces cost etc.
@Mark > scaling, using client side processing as compared to bigger or more servers reduces cost etc. I'm not sure I would entirely agree with this. It would seem to cost less to buy 1 powerful server and 1,000's of "dum terminals" than an average powerful server and 1,000 of powerful desktop computers.
You could use <a href="http://search.cpan.org/~rgarcia/perl-5.10.0/lib/DirHandle.pm">DirHandle</a>: <pre> use DirHandle; $d = new DirHandle "."; if (defined $d) { while (defined($_ = $d->read)) { something($_); } $d->rewind; while (defined($_ = $d->read)) { something_else($_...
Currently these are the most popular video frameworks available on Win32 platforms: 1. Video for Windows: old windows framework coming from the age of Win95 but still widely used because it is very simple to use. Unfortunately it supports only AVI files for which the proper VFW codec has been installed. 2. Direct...
Anonymous types have nothing to do with the design of systems or even at the class level. They're a tool for developers to use when coding. I don't even treat anonymous types as types per-se. I use them mainly as method-level anonymous tuples. If I query the database and then manipulate the results, I would rather c...
Use them with Linq.
I would advice following the advice from @Sean, but if that fails for whatever reason, it should be possible to configure dhclient to not request DNS servers in /etc/dhcp3/dhclient.conf
Be careful when using smart pointers and container classes.
How to save persistent objects databound to a DataLayoutControl (DevExpress tools) ?
|devexpress|xpo|
I have a small form displaying the DataLayoutControl component. If I use a GridControl the objects get saved. If I use the DataLayoutControl (which shows them individually) they do not get saved after they are changed. The underlying object is changed after the user interface edits, but doesn't get saved. How c...
|.net|devexpress|xpo|
If you are using a database that supports map-reduce, like couchdb, storing tags in a plain text field or list field is indeed the best way. Example: tagcloud: { map: function(doc){ for(tag in doc.tags){ emit(doc.tags[tag],1) } } reduce: function(keys,values)...
UDP vs TCP, how much faster is it?
|c++|networking|udp|
For general protocol message exchange, with loss tolerant. How much more efficient is UDP over TCP?
|networking|udp|
Here's code that may give you ideas: <style> .containerdiv { float: left; position: relative; } .cornerimage { position: absolute; top: 0; right: 0; } </style> <div class="containerdiv"> <img border="0" src="http://www.gravatar.com/avatar/" alt="" width="100px;" height="100px;">...
FogBugz is great as others have mentioned. I use it for my bug/feature tracking system, but I like to separate out my support ticketing system for my support staff to use. Another tool that has great email integration also is called [HelpSpot][1], they have hosted and non-hosted versions for purchase, depending on yo...
If you don't want to go the SMO route you can search and replace "GO" for ";" and the query as you would. Note that soly the the last result set will be returned.
Bug tracker setup with Git integration?
|git|version-control|bugtracking|integration|
I know I can do most of this by hacking Trac and using Git hooks, but I was wondering if someone has / knows of something ready. Commenting on (and closing) tickets from commit messages would be nice, specially if the diff appears inline with the comment/closing remark. sha1 hashes should be auto-linked to gitweb...
|git|bug-tracking|version-control|integration|
I guess there are a couple of options: 1. For a pure CLI solution, use something like gnuplot. See [here](http://t16web.lanl.gov/Kawano/gnuplot/intro/working-e.html) for example usage. I haven't used gnuplot since my student days :-) 2. Not really a pure CLI solution, but download something like [JFreeChart](ht...
Business Application UI Design
|wpf|user-interface|
Basically I'm going to go a bit broad here and ask a few questions to get a bit of a picture of how people are handling UI these days. Lately I've found it pretty easy to do some fancy things with UI design and with WPF specifically we're finding new ways to do layouts that are better looking and more functional for...
What's the best approach to naming classes?
|naming|
Coming up with good, precise names for classes is notoriously difficult. Done right, it makes code more self-documenting and provides a vocabulary for reasoning about code at a higher level of abstraction. Classes which implement a particular design pattern might be given a name based on the well known pattern name...
Try adding CONNECT_DATA=(SID=myDB)(SERVICE_NAME=ORCL) in the connection string.
@GateKiller when i speak of scaling i was talking about the cost of buying more servers and not clients. most workstations in an organization barely use 50% of their computing power right through the day. If i was to use a click once deployed application i would be using the grunt of existing workstations therefo...
Check out [Linq to XML](http://www.hookedonlinq.com/LINQtoXML5MinuteOverview.ashx) - it's really good way to write and read Xml based data. Easier than the System.Xml.XmlDocument mechanisms. Given that you are supplying the XSLT and the CSS, why not build the page in XHTML and inline the CSS? Alternatively just add ...
An easy way is to use an online domain tool. My favorite is [Domain Tools][1] (formerly whois.sc). I'm not sure if they can resolve conflicting DNS records though. As an example, the DNS servers for stackoverflow.com are NS51.DOMAINCONTROL.COM NS52.DOMAINCONTROL.COM [1]: http://whois.domaintools....
Why does Splint (the C code checker) give an error when comparing a float to an int?
|c|lint|splint|
Both are mathematical values, however the float does have more precision. Is that the only reason for the error - the difference in precision? Or is there another potential (and more serious) problem?
I have a <a href="http://www.preshweb.co.uk/cgi-bin/dns-propagation-tracker.pl">DNS propagation tool</a> designed to answer these kind of questions. Source is released under the AGPLv3. (Yes, the interface is rather basic at the moment :) ) You could also find out the nameservers for a domain with the "host" c...
Because it probably isn't a very good idea. Not all floats can be truncated to ints; not all ints can be converted to floats.
% Matches any number of characters _ Matches a single character I've never used Full-Text indexing but you can accomplish rather complex and fast search queries with simply using the build in T-SQL string functions.
One thing worth keeping in mind is that leading wildcard queries come at a significant performance premium, compared to other wildcard usages.
I've had great success using [NUnit][1] as well. I've also used [NMock][2] when the need arose for mock objects. As an added bonus, the factory for creating your mock objects is called the Mockery. To facilitate the running of unit tests, I've used [TestDriven.NET][3] to run unit tests as I coded. Also, I've used...
[Instant Rails][1] is a good way to get started quick. I can verify that it works well on Vista. [1]: http://instantrails.rubyforge.org/wiki/wiki.pl
The problem with leading Wildcards: They cannot be indexed, hence you're doing a full table scan.
Greg, The wildcard character in MS SQL is the % sign and it works just fine, leading, trailing or otherwise. That said, if you're going to be doing any kind of serious full text searching then I'd consider utilising the Full Text Index capabilities. Hope this helps.
Greg, The wildcard character in MS SQL is the % sign and it works just fine, leading, trailing or otherwise. That said, if you're going to be doing any kind of serious full text searching then I'd consider utilising the Full Text Index capabilities. Using % and _ wild cards will cause your database to take a seri...
You might want to take a look at this: [http://www.sapphiresteel.com/][1] There's a free personal edition too [1]: http://www.sapphiresteel.com/
You might want to take a look at this: [http://www.sapphiresteel.com/][1] There's a free personal edition too (Updated: Assuming that you already have Visual Studio Full Fat Edition) [1]: http://www.sapphiresteel.com/
Options for Google Maps over SSL
|ssl|google|https|iframe|maps|
We recently discovered that the Google Maps API does not play nicely with SSL. Fair enough, but what are some options for overcoming this that others have used effectively? > [Will the Maps API work over SSL (HTTPS)?][1] > > At this time, the Maps API is not > available over a secure (SSL) > connection. If you...
If you set the Modifiers property of your components to strict protected makes them accessible without the use of a components collection. Edit: Discoverability could be done using reflection to walk over each field. Although that might be suboptimal in your case.
A WYSIWYG Markdown control for Windows Forms?
|markdown|html|winforms|asp.net|
[We have a Windows Forms database front-end application that, among other things, can be used as a CMS; clients create the structure, fill it, and then use a ASP.NET WebForms-based site to present the results to publicly on the Web. For added flexibility, they are sometimes forced to input actual HTML markup right into...
|asp.net|html|winforms|components|markdown|
C++ rarely uses the “generics” terminology. Instead, the word “templates” is used and is more accurate. Templates describes one *technique* to achieve a generic design. C++ templates is very different from what both C# and Java implement for two main reasons. The first reason is that C++ templates don't only allow c...
|asp.net|user-controls|webforms|
|asp.net|user-controls|webform|
|asp.net|webforms|user-controls|
Preventing accidental double clicking on a button
|asp.net|javascript|button|
I have a few controls that inherit from ASP.NET buttons and use 'onserverclick'. If the user clicks twice, the button fires two server side events. How can I prevent this? I tried setting "this.disabled='true'" after the click (in the 'onclick' attribute) via javascript, but that blocks the first postback as well...
|asp.net|javascript|button|
a more generic visitor pattern
|design-patterns|visitor|c++|
A more generic visitor pattern
|c++|design-patterns|visitor|
|c++|design-patterns|visitors|
I'm sorry if my question is so long and technical but I think it's so important other people will be interested about it I was looking for a way to separate clearly some softwares internals from their representation in c++ I have a generic parameter class (to be later stored in a container) that can contain any k...
What OS is this? Is it on a 64-bit system? What is the nature of the failure: silent or is an exception thrown? You could try running [ProcessMonitor][1] and seeing if it sees the attempt to set the value. [1]: http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx
If you store it as a secure string and save the secure string to a file (possibly using [Isolated Storage][1], the only time you will have a plain text password is when you decrypt it to create your mbstore. Unfortunately, the constructor does not take a SecureString or a Credential object. [1]: http://msdn.mic...
Is there any reason that you have to do it through the registry? If not, you can use Environment.SetEnvironmentVariable() since .NET 2.0. It allows you to set on a machine, process or user basis.
The sanctified method is to use CryptoAPI and the Data Protection APIs. To encrypt, use something like this (C++): DATA_BLOB blobIn, blobOut; blobIn.pbData=(BYTE*)data; blobIn.cbData=wcslen(data)*sizeof(WCHAR); CryptProtectData(&blobIn, description, NULL, NULL, NULL, CRYPTPROTECT_LOCAL_MACHINE | CRYPT...
Here's how I've done this in my current project. First I've defined a class (as @Daren Thomas said - just a plain old C# class, no associated XAML file), like this (and yes, this is a real class - best not to ask): public class PigFinderPage : Page { /* add custom events and properties here */ ...
Cannot create an environment variable in the registry
|c#|registry|environment|
Here's code that may give you ideas: <style> .containerdiv { float: left; position: relative; } .cornerimage { position: absolute; top: 0; right: 0; } </style> <div class="containerdiv"> <img border="0" src="http://www.gravatar.com/avatar/" alt="" width="100;" height="100;"> ...
Here's code that may give you ideas: <style> .containerdiv { float: left; position: relative; } .cornerimage { position: absolute; top: 0; right: 0; } </style> <div class="containerdiv"> <img border="0" src="http://stackoverflow.com/Content/Img/stackoverflow-logo-250.png" alt=""...
I typically do it by iterating over the keyset instead of the entry set. I find the code looks a bit cleaner. You also know that you are always looking at items in keys order for ordered maps such as the LinkedHashMap: for (String key: map.keySet()) { System.out.println(key + "/" + map.get(key)); } ...
I managed to solve this problem on my own. I put the following lines in a file named visitors.cgi: #!/bin/sh printf "Content-type: text/html\n\n" exec visitors -A /home/logs/access_log
[JCharts][1] is another option. It is similar to JFreeChart but the documentation is free. It does not have direct support for SWT but you can always generate an image and embed it in an SWT frame. [1]: http://jcharts.sourceforge.net/
Anyone have experience with [Aqua Connect][1]? Found them from Google, and they claim the next version works on RDP as well as VNC. Wondering if it's just a nice wrapper around the VNC capabilities `@Soeren Kuklau` pointed out. Thanks for the link to Vine Server, that's worth investigating. [1]: http://www.aqua...
Hyposaurus, It is possible to have multiple versions of Python installed simultaneously. Installing two versions in parallel solves your problem and helps avoid the problems laid out by Jason Baker above. The easiest way, and the way I recommend, is to use [MacPorts][1], which will install all its software separ...
In Java, generics are compiler level only, so you get: a = new ArrayList<String>() a.getClass() => ArrayList Note that the type of 'a' is an array list, not a list of strings. So the type of a list of bananas would equal() a list of monkeys. So to speak.
I think you might want to rethink your design (that is, if you have control over the design yourself). If you're using so many timers that this is actually a concern for you, there's clearly some potential for consolidation there. Here's a good article from MSDN Magazine from a few years ago that compares the three ...
Take a look at [sctp][1] which has a combination of tcp and udp features. There is a windows [implementation][2] available. [1]: http://en.wikipedia.org/wiki/Stream_Control_Transmission_Protocol [2]: http://www.sctp.be/sctplib/index.htm
Yoy should take a look at the Norm (NACK-Oriented Reliable Multicast) specification. You can find [information about Norm here][1]. > The NORM protocol is designed to > provide end-to-end reliable transport > of bulk data objects or streams over > generic IP multicast routing and > forwarding services. NORM uses...
According to [this][1] you need to call VEMap.GetDirections every 25 points until you reach the end of the route and then plot a custom shape of the complete route. [1]: http://www.lightmaker-manchester.com/blog/post.aspx?id=f081ca81-88a1-4958-9e15-b935d52e99cd
I've read something similar to what you said in the past, Lars. Unfortunately, I'm somewhat restricted with what I can do with the machine in question (in other words, I can't go creating user groups willy-nilly: it's a server, not just some random PC). Thanks for the answers, Will and Lars. Unfortunately, they didn...
You can use the whois service. On a UNIX like operating system you would execute the following command. Alternatively you can do it on the web at <http://www.internic.net/whois.html>. whois stackoverflow.com You would get the following response. ...text removed here... Domain servers in listed order: NS51....