2010-03-04
Selfelected - ideas
http://selfelected.wordpress.com/
Feel free to implement anyone of them.
2010-01-09
This is my visual setup of Visual Studio.
Notice how the real estate is used for tools I use and not for buttons that just happens to be there by default.
shift-alt-return maximises the window so not even the caption bar is visible. I know which program I am working in so I don't need to waste the whole top for this.
I have removed all toolbars. The buttons I need I have put to the right of the menu.
There are also two macros in the menu bar, one for connecting the bugger to nunit and ditto to IIS.
I have set all toolbars to auto hide. When I debug, the call stack and autos (unfortunately hard to find among the menus with C# projects - open a VBNet project and see what it looks like), toolbox are visible.
I have also moved all toolbars to the right. When one is working heavily with the forms designer it is good to have the Toolbox toolbar constantly open on the left but only then, and for the 2% of the project I handle the forms I can move it there manually. The rest of the time I hack code and need nothing but code and debug tools.
I know shortcuts to almost all toolbars. Those I don't know I don't use that often anyway. I don't know why some banjo player at Microsoft decided that underlines and shortcut tips should be invisible as default. Fix it through Tools->Customize.
This way I use all of the precious display area for stuff I have use of.
2009-07-28
Tools I use
Below are the tools, sites and stuff I use. I plan to update it as it goes.
7-zip
http://www.7-zip.org/
Even though I have a Winzip license I haven't bothered installing it for several years. I guess Microsoft killed Winzip through having simple zip support out of the box and for all other needs there are 7-zip.
Open source.
Winzip deserves an extra mentioning though due to their license: your payment is also valid for all updates. Many many other software companies have something to learn there.
Agent ransack
http://www.mythicsoft.com/agentransack/
The built in searching software in Windows XP and forward sucks big time. To its defense I must say that it searches Microsoft office documents. But since it doesn't search all folders it is rendered useless for a developer like me. Agent ransack searches fast, very fast, and has a simple regex tool to refine searches.
Autohotkey
http://www.autohotkey.com/
This open source solution is handy for global shortcuts. I use it to set the size of windows to cover half the left, right, top or bottom. I also send my windows between my monitors with a similar keystroke. It has a wierd scripting language and some bugs regarding how big monitors and windows are.
Blogger
http://blogger.com/
A blogging site. Less-than-good user interface for writing. And the UI hasn't been updated for ages.
Gratis.
Connectionstrings.com
http://connectionstrings.com/
In Windows one have to have a connection string to connect to a database. These come in all colours and tastes. This site has a comprehensive list. Gratis.
Dpack
http://www.usysware.com/dpack/
It is an addin to Visual Studio. Gratis. A must-have if you develop in Visual studio.
The most used shortcuts, for me, are alt-u to open files and alt-m to go to a method. With this there is no more searching for files in the solution explorer or scrolling up and down looking for the right method.
Filezilla
http://filezilla-project.org/
Filezilla is a free FTP server and client. I only use the client. I cannot say if it is the best of its crop or has some whiz-bang stuff that oushines the competition but it is free and fairly simple to use.
Keepass
http://keepass.info/
I have lots of passwords and so do most of us. Instead of having the same password for most places or a system of passwords, use unique ones; then you don't have to worry about people getting your hotmail because they got hold of the passwords for a small site somewhere and successfullly try it on hotmail too.
I have the same database synchronized with my Windows mobile phone; this requires an older version of the software unfortunately, but I keep the passwords with me without the need of a computer.
It is open source so you can inspect the source code at will.
Media-convert.com
http://media-convert.com/
A gratis site for converting all sorts of formats, not only video and sound.
MyGeneration
http://www.mygenerationsoftware.com/
I am a sucker for not writing code I don't have to. Automatic code generation is the way to go.
Open source.
Notepad2
http://www.flos-freeware.ch/notepad2.html
http://code.kliu.org/misc/notepad2/
I don't think Notepad2 is the best editor out there. Not even close really. But it makes it easy to exchange your Notepad.exe with the vastly superior and open source Notepad2. Notetab does the same pre WinXP and possibly many other editors too but this is the only I have tried (post win2k) and I use it.
NUnit
http://nunit.org/index.php
Automatic testing is considered good. I might be too much to test everything but the important things and the difficult things are worth while to test automatically.
Open source.
NUnitEx
http://code.google.com/p/nunitex/
This open source extension lib to NUnit makes it more fluent to write assertions. The best return of investment is when writing tests for exception throwing.
Opera
http://www.opera.com/
This is my primary web browser and has been since before 2000. For certain development things Firefox is better and one must have Internet explorer around for about one site a year but for the other 8759 hours Opera is to prefer.Web browsers are a pain to user with the keyboard. Opera lets you navigate between the controls with shift-arrows; so much easier debugging when one doesn't have to grab for the mouse all the time.
Gratis.
Opera mobile
http://www.opera.com/mobile/
Arguably the best mobile browser for fat mobile phones. It is gratis.
For smaller phones I would use Opera mini that renders the web page in a farm and then sends just the result. It doesn't work with javascript heavy sites though.
There is an application, Skyfire, that I believe works like Opera mini.
Pastebin.com
http://pastebin.com/
If you ever have tried sending a snippet over email or especially chat you know bad how the layout gets scrambled. Enter Pastebin.
Paste the code into Pastebin and send the unique URL. It even has history so when chatting you can update the code and resend.
Gratis.
There are competitors but I havn't found any as good.
PDFCreator
http://sourceforge.net/projects/pdfcreator/
To create PDF documents I use an open source solution. It installs itself as a printer so it is usable for everything from everywhere. For reading I use OpenOffice instead of the competitor-for-the-worst-software-written-ever program from Adobe themselves.
PowerCommand for Visual Studio 2008
http://code.msdn.microsoft.com/PowerCommands
Gratis. Source code available but I don't know if there are any strings attached.
It has Copy reference and Open folder and Open command prompt. No more tedious searching for references or walking all over the hard drive to find the correct folder.
Spam gourmet
http://www.spamgourmet.com/
An online solution for one time email addresses. Good for avoiding spam. It is gratis but it sometimes takes a while for the emails to pass through.Approximately the same result can be gained by having a spare email account for this but Spam gourmet comes with a number-of-possible-sendings solution that might be handy.
VLC
http://www.videolan.org/vlc/
There are many media players. VLC is one of them. I use it since it takes most formats.
It went version 1 in 2009.
Open source.There is another well known application, Media player classic, that does approximately the same. To be honest, I use both.
Winmerge
http://winmerge.org/
This is an open source diff tool. It has a nice keyboard navigation, something that the diff program that comes with Visual studio has totally messed up. None of these two have any knowledge about classes and methods so if you swap two methods it is recognized as add and delete instead of the move it really is.
Somewhere I found a program that can diff 3 files at once but the URL is since long forgotten.
2009-07-13
Visual studio net database edition does not handle data
The title is not totally correct; it does handle data. But it cannot do version management on your database if you have data in it properly.
Like this:
A year into the project you/the customer realize that a Customer can be split into InternalCustomer and ExternalCustomer and a decision is made to make Customer the base class and the other two children. An accordingly correct decision is made to create two new tables in the database and have them have their corresponding fields.
Technically, or database script wise, this means
1) create two new tables
2) select data from the Customer table into the two child tables <- oops
3) drop some fields in the Customer table
Visual studio database edition can handle 1) and 3) but there is no way to tell it to run a custom script in between.
This unfortunately makes the product useless for me.
2009-02-20
Which open source license to choose
So if you ever think of choosing a license for you work this is a good place to start.
2009-02-09
Sortable IBindlinglist
Datagridviews in dotnet work well with datasets. They work less good with "normal" objects; for instance sorting is much more of a hassle to implement.
The sorting problem is solved nicely in this http://groups.google.co.uk/group/microsoft.public.dotnet.languages.csharp/msg/2b7528c689f9ef84 piece of code. It is more or less just to copy the code and violà, a sortable object list.
2009-02-04
Annotate in TFS
There is a somewhat hidden feature in Visual Studio TFS edition (or whatever it is called) for checking who changed a row. It is called Annotate and can be reached through the context menu. After some number crunching it gives you a semi graphic view of which row was edited by who.
Further Annotate can be done on other rows but not the same row again; I don't know why.
2008-12-11
Change control name in Visual Studio
VSNet remembers which attribute use used lastly so just start typing, there is no need to click.
Like so:
You layout a WinForm in Visual Studio. Either when you are finished or as you layout the controls you name them. There is no need to click and mark the Name attribute in the Atribute panel; VSNet remembers which attribute you typed last.
Example: Drop a label on the form. Click the Name attribute. Write the name. Drop another label on the form. Just start typing the new name without clicking anywhere. What you type goes right into the right property.
Might save some time.
2008-11-17
Change window in Visual Studio
Change window in Visual Studio 2008 through the shortcut ctrl-tab. It goes through the windows in recent order so you get back to where you where.
If you want to get back to where you where in the same window use ctrl-minus. Go forward again with ctrl-plus.
Note: for older versions of Visual Studio you have to have the US keyboard layout, the swedish does not work with ctrl-minus.
To show the open windows either use the Window menu (alt-w-w) or the "small window menu" dropdown ctrl-alt-down.
2008-11-01
Open source - which licens to choose
When you have decided that open sourcing your code would be a good idea the next question follows; which license?
Claes Mogren wrote a short and good description about some licenses and the thoughts behind them: http://informationhunger.blogspot.com/2008/10/open-source-license-primer.html
WPF and shortcuts
Forcing the user to sprout a third arm to use a mouse is considered bad programming.
All menus should have shortcuts. To be frank almost all controls should have shortcuts. To use a few seconds to add shortcuts to the controls as they are made is considered good.
Shortcuts in WPF is done by prefixing with underscore, like E_xit and _Open. (WinForm is done by prefixing with ampersand, like E&xit. Web applications should have this too and there it is called Accesskey.
Then to add the nice "Ctrl-O" text beside Open and "Ctrl-S" beside Save is trickier in WPF. By no special order these are the pages I had to read to understand CommandBinding and RoutedUICommand:
http://anuraj.wordpress.com/2008/06/23/shortcuts-keys-in-wpf-menu/
http://en.csharp-online.net/WPF_Concepts—Built-In_Commands
http://colbycavin.spaces.live.com/blog/cns!5FFDF795EBC7BEDF!129.entry
2008-07-18
Retrieve the plain text from the RTF control in WPF
Versatility often means more complex and more complex means that the simpler things are sometimes lost. Like for instance retrieving the plain text from a RTF control.
It is not hard to do but I didn't find any good example through google so here is an example of how to retrieve the plain text from a WPF rich text control:
TextRange textrange = new TextRange(
rtfControl.Document.ContentStart, rtfControl.Document.ContentEnd);
string plainText = textrange.Text;
HTH
2008-07-07
Writing code or conducting it
A friend of mine said something wise. A programmer's job could be to conduct the code instead of writing it. Think of it like components that all handle their part very well and plays well together. The conductor is there to facilitate and point in the right direction. I believe he is on to something.
2008-06-08
XamlParseException in WPF
System.Windows.Markup.XamlParseException was unhandled
Message="Cannot create instance of 'FormMain' defined in assembly 'Kopain2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Exception has been thrown by the target of an invocation. Error in markup file 'Forms/FormMain.xaml' Line 1 Position 9.
which does not give much of a clue.
So copy exception details to your favourite editor (Copy exception detail to the clipboard...) and scroll down. Typically at the second last row you can read something like
at Kopain2.FormMain..ctor() in C:\Data\Projects\Kopain2\Kopain2\Forms\FormMain.xaml.cs:line 101
which is a magnitude more helpful.
2008-05-04
WPF and how to move between graphics and XAML
F7 moves from designer to code.
Shift-F7 is the reverse and moves from code to designer and in the designer toggles between the graphics pane and the XAML pane.
Update: Now I can only switch from XAML to code behind but not back and not between the xaml/designer panes. New machine, new OS, new service pack, new addons. I don't know what to blame.
2008-02-27
Search IMDB through Opera
http://imdb.com/find?s=all&q=%s
in the dialogue described here.
Or use
http://sv.wikipedia.org/wiki/%s
to search swedish wikipedia.
If you get too many hits it is very easy to navigate in Opera without having to grab the mouse - just shift-arrow around.
I use
http://selfelected.blogspot.com/search?q=%s
to search my own blog.
2008-02-18
Bad menus
So first we have File, a noun. There is supposed to be things to manipulate Files there.
Then comes Edit, a verb. Is this where you look for ways to edit things?
View which often follows is both a noun and a verb which is good because then you can have lots of stuff in it. Which is bad because you can have lots of stuff in it.
After this there is usually a group of menus that are application specific so I have no opinion of them.
Ending the group of application specific menus is the menu Tools that really is a misspelled acronym for Things Out Of The Standard; or possibly Things That Go Nowhere Else.
The finale is Help that contains ways to get help. And the version number of the application.
Am I the only one who feels this as a bit illogical?
Shouldn't all top menus be nouns or am I missing something?
2008-01-25
Coloured layers
But wouldn't it be nice to have an extra signal? I am thinking of changing the colour of the background or frames or something. Not from red to green but something more subtle. Ridiculous thought? That is what I thought too when I first encountered coloured source code. "colouritis" whas my response. Today I cannot live without it and wouldn't mind using different fonts the same way.
Ok, ok. "cannot live without" was an aggravation.
2008-01-17
Replace Notepad with something better
Notepad.exe är en editor knappt värd namnet. Den väger in på 68k vilket inte är så mycket för en windows-app.
Men så innehåller den två kända buggar också. En som plockar bort text om du använder notepad mycket / har stora filer och en som inte klarar av vissa teckenkombinationer i början.
Tidigare använde jag NoteTab som är en alldeles utmärkt editor som är gjord för att ersätta Notepad. Den både hade ".log -i-början-av-filen"-funktionaliteten och i installationen ingick det en fråga om man ville byta ut Notepad. Det ville man.
Men sedan WinXP har inte det gått. Testa att byt namn på Notepad.exe i %windir%\System32 och den poppar rätt tilbaka igen. Så om du undrar var din hårddisk tagit vägen så ligger det uppenbarligen 2 st operativsystem på den.
Men räddning finns: http://blogs.msdn.com/omars/archive/2004/04/30/124093.aspx
Notepad.exe is an editor hardly worth mentioning. It lacks functionality but has still managed to cramp in 2 bugs into 68k.
I used to use NoteTab earlier which was built as a Notepad replacement. It even had the ".log -in-the-beginning-of-the-file"-functionality and the installtion procedure contained a question whether to replace Notepad. That was the obvious choice.
But since WinXP this has not been possible. Locate Notepad.exe in %windir%\System32 and change its name. A new Notepad.exe will pop up from nowhere. So if you wonder where all your hard disc space is gone you now know - there are two installations of Windows on it.
But Notepad can be replacede byt following this link.
Dogfood and Kopain
"Eat you own dog food" är ett uttryck för att använda det man själv tillverkat. I mitt fall bestämde jag mig för att använda Kopain från den förste i år.
Det är en enkel editor med RTF-möjlighet och framför allt en hierarkisk meny på sidan. Helt enkelt en rip-off av KeyNote som jag använt i flera år.
När jag började använda Kopain hade den 2 kända buggar. När jag använt applikationen en dag hade jag hittat fem till. Plus att ett par av sakerna på feature-listan (någon som vet en översättning av "feature"?) hade eskalerat till buggar i och med att de störde användningen för mycket.
Varför bygger jag en ersättare till KeyNote? (i den mån den kan kallas ersättare då den inte kan en bråkdel så mycket)
För att jag vill. Och för att jag kan.
Men framför allt att den sparar på ett format jag inte gillar. Det sparade formatet måste vara lätt att läsa och läsbart med något annat än ursprungsapplikationen.
Är det någon som vet en editor/ordblandare jag kan integrera som sparar annat än RTF? Jag vill ha något som är mer lättläst och generellt typ HTML då RTFstandarden verkar vara ungefär "det som WordPad lämnar från sig".
Jag är nu inne på den 17e användningsdagen av Kopain och jag har fortfarande två kända återskapningsbara buggar. Jag har kraschat applikationen en handfull gånger och den har en gång zappat 2 dagars noteringar. Jag är nöjd.
"Eat you own dog food" is an expression for using what you have created. In my case I started using Kopain from the first day this year.
It is a simple editor with RTF possibility and above all an hierarchical menu to sort the notes. Simply put a rip off of KeyNote which I have been using for several years.
When I started using Kopain it had 2 known bugs. When I had used the application for a day five more had surfaced. Plus two things on my feature list had escalated to Bug status since they had to big an impact on the usability.
Then why did I build a replacement to KeyNote? (if it can be called a replacement at all since it contains a fraction of the functionality)
Because I want. And because I can.
But above all that is saves in a format more easily read. The saved format must require the original application to read.
Is there someone who knows of an editor with formatting capabilities I can integrate instead of the RTF thing I have today? I must be able to save in a more open and easily read format like HTML since the specification for RTF seems to be "whatever WordPad spits out".
I am now on my 17th day of eating. I still have 2 recreatable bugs. I have crasched a handfull of times. I have lost 2 days of work. All summed I am satisfied.
