instruction
stringlengths
0
30k
I don't have TFS but I know in regular VS there is an Open With... option in most items' contextual menu that even let you change the default editor. Very useful when you are tired of the Designer opening instead of the Code file on Windows forms.
For a 3x3 system of linear equations I guess it would be ok to roll out your own algorithms. However you might have to worry about accuracy, division by zero or really small numbers and what to do about infinitely many solutions. My suggestion is to go with a standard numerical linear algebra package such as [LAPACK][1...
Are you just talking about the interface and storage, or the implementation of sending the emails as well? Yes, a SQL table with FROM, TO, Subject, Body should work for storage and, heck, a textbox or even maybe a RichText box should work for editing. Or is this a web interface? For actually sending it, check ...
From a high level, yes. :D The main thing is some place to store the templates. A database is a great option unless you're not already using one, then file systems work fine. WSIWIG editors (such as fckeditor) work well and give you some good options regarding the features that you allow. Some sort of token re...
Who knows of a decent yacc/bison type LALR parser generator for .net?
|lalr|.net|yacc|
Thanks in advance.
Is there a good yacc/bison type LALR parser generator for .NET ?
|.net|yacc|lalr|
In access I never figured out how to properly use the OLE object data type without real performance problems (and structural too -- lots of compact and repair jobs). The solution path I've always taken (mind you I haven't used Access in anger now for ***years***) is to just store the blogs onto disk somewhere and stor...
[SableCC][1] can generate c# code. It's pretty good but you need a few days to figure out how it all works, because the documentation ist not that great [1]: http://sablecc.org/
I've worked with terrible coding standards that forced a single exit path on you and the result is nearly always unstructured spaghetti if the function is anything but trivial -- you end up with lots of breaks and continues that just get in the way.
If the Java way is the OO way, then yes, creating a class with public fields breaks the principles around information hiding which say that an object should manage its own internal state. You also can't take advantage of the support for JavaBean naming compliant classes, which will hurt if you decide to, say, use th...
If the Java way is the OO way, then yes, creating a class with public fields breaks the principles around information hiding which say that an object should manage its own internal state. (So as I'm not just spouting jargon at you, a benefit of information hiding is that the internal workings of a class are hidden behi...
Just an idea: Mapping the hostname to 127.0.0.1 in the hosts ($WINDOWS$\system32\drivers\etc\) file may help. This way you should be able to pull up the local IIS site by typing the hostname as if it's a remote server
Maybe I am not understanding the question, but what's wrong with just typing in the URL for the website? If it's the matter of domain name resolution, you can point to the right DNS or put it in [hosts][1] file. [1]: http://en.wikipedia.org/wiki/Hosts_file
Or did you want to just see if a column only has NULL values (and, thus, is probably unused)? Further clarification of the question might help. -- Kevin Fairchild
Or did you want to just see if a column only has NULL values (and, thus, is probably unused)? Further clarification of the question might help. **EDIT:** Some little stuff to help... select c.name as ColumnName from syscolumns c inner join sysobjects o on c.id = o.id and o.name = 'YourTableName' and o.xtype =...
Or did you want to just see if a column only has NULL values (and, thus, is probably unused)? Further clarification of the question might help. **EDIT:** Ok.. here's some really rough code to get you going... SET NOCOUNT ON DECLARE @TableName Varchar(100) SET @TableName='YourTableName' CREA...
Using SVN for backups can work. However, over time it can be difficult to delete old revisions that are not needed. Say you only wanted to keep 30 or 60 days of backups. SVN does not provide an easy way to remove any history older than X days. If you don't have a way to purge old history you will eventually run you...
|.net|exif|
I am looking for simple straightforward solution for accessing EXIF information of jpeg images in .Net. Does anybody has experience with this?
|.net|exif|
Comparison of Javascript libraries
|javascript|comparison|
After the suggestion to use a library for [my ajax needs][1] I am going to use one, the problem is that there are so many and I've no idea how to even begin telling them apart. Thus, can anybody A) Give a rundown of the differences or B) Point me (and others like me) somewhere that has such a list. Failing that plan...
|javascript|comparison|
how does unix handle full path name with space and arguments ?
|path|unix|
how does unix handle full path name with space and arguments ? in windows we quote the path and add the commandline arguments after, how is it in unix ? > "c:\foo folder with space\foo.exe" -help
|unix|path|
how does unix handle full path name with space and arguments ? in windows we quote the path and add the commandline arguments after, how is it in unix ? > "c:\foo folder with space\foo.exe" -help update: i meant how do i recognise a path from the command line arguments.
|unix|path|
Drawing Library for Ruby
|ruby|graphics|drawing|
I am trying to code a flowchart generator for a language using Ruby. I wanted to know if there were any libraries that I could use to draw various shapes for the various flowchart elements and write out text to those shapes. I would really prefer not having to write code for drawing basic shapes, if I can help ...
|ruby|graphics|drawing|
I am trying to code a flowchart generator for a language using Ruby. I wanted to know if there were any libraries that I could use to draw various shapes for the various flowchart elements and write out text to those shapes. I would really prefer not having to write code for drawing basic shapes, if I can help ...
|ruby|graphics|drawing|
In the markup after the image, insert something like `<div style="clear:left"/>`. A bit messy, but it's the easiest way I've found. And while you're at it, put a bit of margin on that image so the text doesn't butt up against it.
Thanks [DannySmurf][1], you're first answer made me see sense. (*Why do we always look for that magic solution?*). For reference, here's what I ended up doing: (*Warning: VB below, may not contain enough semicolons*) Case ListItemType.Footer e.Item.Cells(0).Text = "Average" For i As Inte...
Thanks [DannySmurf][1], your first answer made me see sense. (*Why do we always look for that magic solution?*). For reference, here's what I ended up doing: (*Warning: VB below, may not contain enough semicolons*) Case ListItemType.Footer e.Item.Cells(0).Text = "Average" For i As Intege...
Can Ruby convert an acts_as_nested_set to a JSON hash cleanly without recursion?
|ruby|ruby-on-rails|recursion|
Is there a fast and clean way of returning a JSON hash back from any node in a Ruby on Rails' acts_as_nested_set without using recursion? Here's the recursive solution for reference: class Node < ActiveRecord::Base has_many :products def json_hash if children.size > 0 childre...
How do I write Firefox add-on that automatically enters proxy passwords?
|firefox|proxy|authentication|passwords|
Suppose someone worked for a company that put up an HTTP proxy preventing internet access without password authentication (NTLM, I think). Also suppose that this password rotated on a daily basis, which added very little security, but mostly served to annoy its employees. How would one get started writing a Firefox add...
Using SVN for backups can work. However, over time it can be difficult to delete old revisions that are not needed. Say you only wanted to keep 30 or 60 days of backups. SVN does not provide an easy way to remove any history older than X days. If you don't have a way to purge old history you will eventually run you...
I'd say that the best way of solving this is to use Aspect-Oriented Programming (AOP). Mats Helander did a [write up on this on InfoQ][1]. The article is a bit messy, but it's possible to follow. There are a number of different products that does AOP in the .NET space, i recommend PostSharp. [1]: http://www.in...
Structs are just like classes that live in the stack. I see no reason why they should be "unsafe".
There are no consequences to a struct implementing an interface. For example the built-in system structs implement interfaces like `IComparable` and `IFormattable`.
Does generated code need to be human readable?
|language-agnostic|code-generation|readability|
I'm working on a tool that will output an interface and a couple classes implementing that interface. My output isn't particularly complicated, so it's not going to be hard to make the output conform to our normal code formatting standards. But this got me thinking: how human-readable does auto-generated code need to...
|language-agnostic|code-generation|readability|
I think the problem is that it causes boxing because structs are value types so there is a slight performance penalty. This link suggests there might be other issues with it... http://blogs.msdn.com/abhinaba/archive/2005/10/05/477238.aspx
The reference dhclient from the ISC should run forever in the default configuration, and it should acquire a lease later if it doesn't get one at startup. I am using the out of the box dhcp client on FreeBSD, which is derived from OpenBSD's and based on the ISC's dhclient, and this is the out of the box behavior. ...
The author here dropped in a blob of C# code that handles the scenario you're having a problem with: [http://stackoverflow.com/questions/1898/csv-file-imports-in-net#6111][1] Shouldn't be too difficult to translate. [1]: http://stackoverflow.com/questions/1898/csv-file-imports-in-net#6111
[Beanstalk](http://beanstalkapp.com) has built-in post-commit hooks for deploying to development, staging, and production servers.
I guess a simple but probably non optimized algorithm is to - Escape the quoted commas in the first pass. - Split on the un-escaped commas on the second pass.
I guess a simple but probably non optimized algorithm is to - in the first pass : Escape the quoted commas and remove the quotes - in the second pass : Split on the un-escaped commas
If my language of choice didn't offer of way to do this without thinking then I would initially consider two options as the easy way out: 1. Pre-parse and replace the commas within the string with another control character then split them, followed by a post-parse on the array to replace the control character used p...
We use a very simple but yet effective solution. For new installs, we have a metadata.sql file in the repository which holds all the DB schema, then in the build process we use this file to generate the database. For updates, we add the updates in the software hardcoded. We keep it hardcoded because we don't like...
Rather than URLs like this: http://example.com/user/783 Why not have: http://example.com/user/yukondude Which is friendlier to humans and doesn't leak that tiny bit of information?
I am thinking that if these are automated notifications, then this means they are probably going out as a result of some type of event in your software. If this is a web based app, and you are going to have a number of these being sent out, then consider implementing an email queue rather than sending out an email on e...
Random questions and large banks of questions help. Randomizing even the same question (say changing the numbers, and calculating the result) helps too. None of these will prevent cheating though. In the first case, if the pool is large enough, so that no two students get the same question, all that means is that st...
You could also return the interface ILeg that both Leg and/or DogLeg implement.
Did you try to install the MS Loopback Adapter and try sniffing on that adapter with you favorite sniffing application? Also if I remember correctluy NAI Sniffer [link][1] did use to have loopback sniffing capabilities, but it's been a while I used either solution... [1]: http://www.sniffer.com
abstract class Animal { public virtual Leg GetLeg () } abstract class Leg { } class Dog : Animal { public override Leg GetLeg () { return new DogLeg(); } } class DogLeg : Leg { void Hump(); } Do it like this, then you can leverage the abstraction...
Findbugs dumps its results into an XML file in your workspace's .metadata folder. Look for the subfolder that's named something like findbugs. You can also download a standalone version of Findbugs that will save the results wherever you like. Once you have the results file, you might be able to import from XML t...
Perhaps it's easier to see the problem with an example: Animal dog = new Dog(); dog.SetLeg(new CatLeg()); Now that should compile if you're Dog compiled, but we probably don't want such a mutant. A related issue is should Dog[] be an Animal[], or IList&lt;Dog> an IList&lt;Animal>?
The important thing to remember is that you can use a derived type every place you use the base type (you can pass Dog to any method/property/field/variable that expects Animal) Let's take this function: public void AddLeg(Animal a) { a.Leg = new Leg(); } A perfectly valid function, now l...
We are targeting Office 2003 and Office 2007, but using the Office 11 (2003) dlls as Office 2007 is backward compatible. The problem occurs only for Microsoft.mshtml.dll file. This file is setup as a prerequisite in the ClickOnce app. On this particular install we tried installing both the Office 2003 and Office ...
[Craig](http://stackoverflow.com/questions/54866/best-way-to-parse-space-seperated-text#54880) is right &#8212; use regular expressions. [Regex.Split](http://msdn.microsoft.com/en-us/library/8yttk7sy.aspx) may be more concise for your needs.
I find using addAll works fine. ArrayList(String) copy = new ArrayList(String)(); copy.addAll(original); parentheses are used rather than the generics syntax
You might also want to look into [Comet][1]. It's used by GTalk, Meebo, and many [other chat applications][2]. A few years ago when I was experimenting with it, there weren't very many libraries or details about server architecture to implement it, but it looks like there is a lot more stuff out now. [1]: htt...
You might also want to look into [Comet][1]. It's used by GTalk, Meebo, and many [other chat applications][2]. A few years ago when I was experimenting with it, there weren't very many libraries or details about server architecture to implement it, but it looks like there is a lot more stuff out now. Have a look ...
Ctrl+Shift+o to organize imports, which will format them nicely, remove unneeded imports, and add missing imports.
As long as you are using the [MailAddress][1] object, I think you're fine, because injections will only manage to throw FormatExceptions for the specified address. Examples of how to properly use the System.Net.Mail components are included in that MSDN page; be sure to follow them and you will be fine. [1]: h...
I think this should work: ArrayList<String> orig = new ArrayList&<String>(); ArrayList<String> copy = (ArrayList<String>) orig.clone()
Java: Make a JPanel not draw its background
|java|user-interface|
Is it possible, in Java, to make a JPanel skip drawing its background thus being transparent except for the components on it?
I would highly recommend using something like jquery where this is trivial: $("#someId").addClass("newClass); so in your case: $("p[height='30']").addClass("h30"); so this selects all paragraph tags where the height attribute is 30 and adds the class h30 to it.
I would highly recommend using something like jquery where adding classes is trivial: $("#someId").addClass("newClass"); so in your case: $("p[height='30']").addClass("h30"); so this selects all paragraph tags where the height attribute is 30 and adds the class h30 to it.
You have several options: 1. While you don't have an IP address, restart dhcpcd to get more retries. 2. Have a backup static IP address. This was quite successful in the [embedded devices I've made][1]. 3. Use [auto-IP][2] as a backup. Windows does this. [1]: http://itwatchdogs.com [2]: http://www.du...
Using EMACS as an IDE
|emacs|development-environment|
Currently my workflow with Emacs when I am coding in C or C++ involves three windows. The largest on the right contains the file I am working with. The left is split into two, the bottom being a shell which I use to type in compile or make commands, and the top is often some sort of documentation or README file that ...
Currently my workflow with Emacs when I am coding in C or C++ involves three windows. The largest on the right contains the file I am working with. The left is split into two, the bottom being a shell which I use to type in compile or make commands, and the top is often some sort of documentation or README file that ...
The most annoying issue with EclipseME for me was the "broken" debugger, which just wouldn't start. This is covered in docs, but it took me about an hour to find this tip when I first installed EclipseME, and another hour when I returned to JavaME development a year later, so I decided to share this piece of knowledge ...
I personally prefer SimpleTest. There is a command line test runner and web-based test runner, and there is even an Eclipse [plugin][1] to let you run unit tests from the IDE itself. I found the Zend to PHPUnit connection much harder to get working, especially with the debugger. The way we use SimpleTest in-house is...
Here's a scenario: What's to stop two employees, let's call them 'Eric' and 'Tim', from running their own little SSH tunnel back home to prevent 'the Man', in this case *you*, from narc'ing out their use of the Internet. Now you have a useless report. If you're serious about getting real data, you'll want something ...
For portability, one thing to try is using try-catch blocks for most vanilla exceptions and then set a terminate handler (set_terminate_handler) to have a minimal hook available for catastrophic exit conditions. You can also try adding something like an atexit or on_exit handler. Your execution environment may be biz...
Not that it is much use, but it is maybe interesting to note the Java does support covariant returns, and so this would work exactly how you hoped. Except obviously that Java doesn't have properties ;)
Javascript and CSS parsing performance
If this is for installation or distribution, have you considered using the Windows Installer SDK? It has the ability to patch binary files. [http://msdn.microsoft.com/en-us/library/aa370578(VS.85).aspx][1] [1]: http://msdn.microsoft.com/en-us/library/aa370578(VS.85).aspx
May I suggest the [jQuery Media Plugin][1]? Provides embed code for all kinds of video, not just WMV and does browser detection, keeping all that messy switch/case statements out of your templates. [1]: http://malsup.com/jquery/media/
I've used the following database project structure in Visual Studio for several projects and it's worked pretty well: Database >Change Scripts > >>0.PreDeploy.sql > >>1.SchemaChanges.sql > >>2.DataChanges.sql > >>3.Permissions.sql > >Create Scripts > >>Sprocs > >>Functions > >>Views Our build sys...