Showing posts with label workspace. Show all posts
Showing posts with label workspace. Show all posts

Monday, July 14, 2008

Firefox 3 Instant Crashes

I use Mozilla Firefox as my browser. I started from version 2, when I migrated from Opera because it wasn't supported by some Google web applications. Version 2 frustrated me with periodical freezes - they lasted for about 30 seconds and then FF came back to live. Now I'm using FF 3. There was a lot of buzz about it. I found that it has some new valuable features that still keep me from downgrading to FF 2. But FF 3 on my computer crashes several time per day. At first it was happening at notebook with Vista. So I had some suggestions that this are the problems with OS. But I found that these crashes happen on desktop computer with XP. Moreover recently I reinstalled OS on notebook and firefox crashes on almost "clean" OS also.

I don't use any *not very popular* extensions. Even more - I disabled them all, but FF 3 continue to crash. May be I should disable some plugins? I don't know. And I didn't heard any significant buzz about "FF crashes on my PC every hour!" so I come to conclusion that these are problems with my environment (Russia, ISP, some software on PC, anything else). But Opera works finely. So I have three ways:
  1. With great patience continue to use FF 3
  2. Downgrade to FF 2 (remember the buzz "downgrade to XP from Vista")
  3. Use another browser: Opera, Maxthon, IE, Safari.
But... I've been waiting for FF 3 and wanted to use it. And now I found it to be a big piece of crashes for me.

Monday, May 26, 2008

NAnt over MSBuild

While working on my C# projects I found it useful for me to start using a build tool. Visual Studio builds assembly files, but many other tasks such as generating documentation are not part of assembly build and can not be just added to "pre-build" and "post-build" actions. So I've decided to use NAnt.

After some working with NAnt I decided to try MSBuild. There were some reasons for that: MSBuild is a part of .NET Framework so there is no extra dependencies; moreover it provides a good integration with project files generated by VS. But after a day of converting my NAnt project to MSBuild I've decided to return back to NAnt. There a plenty of reasons for that, which I found during this day.

The most important (for me) is that almost all settings to MSBuild tasks are set through attributes. The question "What to use: attributes or elements?" is long living and still doesn't have a clear answer (e.g. see this and this articles), but I found it a little inconvenient to set up all parameters of task through attributes. I won't speak here about what as I think should be element or property, but properties with long length data doesn't look good (e.g. lists of files).
In NAnt I feel very comfortable with setting tasks up through elements and attributes and in most cases I think that type of XML node is chosen right for property. And what is more NAnt provides and ability to define in custom tasks to define what property should be: attribute or element, while MSBuild follows it's convention and all properties are set up through attributes. Quite inflexible, though it removes a headache of deciding of type of node.

Secondly writing long lists or properties is a little inconvenient in VS: I prefer to have lines of code not very long and I need to write attributes on several lines. And if I press Enter after a property on a new line VS doesn't suggest me a list of possible items. It is need to start typing on previous line and press Enter only after writing property in editor. Of course I can write all in one line and use Wrap lines ability of text editors, but I prefer not to do so.

All-in-all I've returned to NAnt as a build tool. Sometimes I write additional tasks for it (those that are not in NAnt.Contrib) which gives me an ability to use not only for application builds but for other purposes.

Links:

Wednesday, April 23, 2008

RescueTime

For a month I'm using a web-based application RescueTime. It counts the usage of software and websites on computer so you can find which application you use the most. What is more RescueTime provides ability to assign tags to applications to group them, and to assign efficiency score to each tag. It draws some diagrams shiwing your efficienty so it's much easier to find out whether your are doing something useless to your or perform a productive tasks. And moreover in RescueTime you can create goals on using software, e.g. "Spend less than 1.5 hours per day on games." or whatever can be interpreted as "use something less/greater than..."

I think RescueTime is rather an interseting application that could help better manage time spent with computer.

Wednesday, December 05, 2007

Visual Studio 2008

In the end of November MS released the new version of its IDE Visual Studio 2008. I've used Beta version already. It that post I've written that first impression was that is is very buggy, and later practice showed that there are some mistakes. I usually had some problems with Intellisense and IDE crashed. I have to note that I used Professional Edition.

Now I'm using Express Edition. I'm not so rich to buy IDE now, so use free edition. Of course it's not so functional as Pro version and for each language (C#, C++, VB.NET, Web development) there is it's own IDE. However I'm currently programming only on C# so this is not a big problem for me. Visual Studio is rather comfortable IDE (especially comparing to Turbo C we have in unversity :(. The problem is that it can't be used for editing all types of files I need with syntax coloring. So for editing files such as Nullsoft installation scripts, Python files and others I use PSPad. But for C# Visual Studio is much more preferable because autocompletion, Intellisense and many other small but very useful features.

One interesting note about Visual Studio: with IDE many other components are installed (SQL Server Compact, etc.). But uninstalling them is a manual operation. Not rather comfortable.

I have to say that Visual Studio is one of my favorite MS products and I haven't a lot of complains about it.

Sunday, October 07, 2007

Implementing custom tool in Visual Studio 2008

I've recently wrote about making tool to generate C# code. We may say that are macros for C# (it fact it is only one defined macro — for fields and properties).

And how to implement this tool? There can be two ways: write tool on scripting language that generates C# code file and is called before compilation. Another way is to use ability of Visual Studio to switch user custom tool for generating files. Firstly I've implemented tool by first way on Python and now I want to make a custom tool for Visual Studio written on C#. But how to plug custom tools in Visual Studio? Now I've got an answer, though I've spent much time to understand this.

Firstly, to develop plug-ins for Visual Studio it is needed to download Visual Studio SDK (for appropriate version of Visual Studio). I have to say that after installing it my Visual Studio 2008 Beta 2 became very unstable: IntelliSense regularly produces errors which crashes the whole Visual Studio.

After that Visual Studio will add templates of its addins. That's a base for future project (although may be addin can be created without all that stuff that is in template).

To make custom tool for generation of files the one must implement IVsSingleFileGenerator interface. I've spent a lot of time trying to make this and fails mainly because if this problem: in some places of documentation it is said that function generate gets a parameter of type out IntPtr[], in some it is said that it is out IntPtr and in fact interface has just IntPtr[]. Not any out! So how should I return value of pointer? Ok, I'm not a great specialist in .NET and arrays a sent be reference. Even if this is not a problem why there is an array not one pointer? Another outgoing parameter of function on exit must contain an amount of bytes in that array but how this will help if I'll allocate a different amount of bytes in different pointers in array. However I don't see a use for an array and just tried to allocate it and use only index 0. But this doesn't helped me and I failed in implementing that interface. May be that a bug in SDK and interface must have out IntPtr[]? Don't know I'm not a guru in Visual Studio.

I've failed to get a proper answer from MSDN documentation and my attempts so I've googled this problem.I've found some solutions but the most notable part is that in Visual Studio 2003 there was an abstract class which covered that horrible interface under much more comfortable interface. However "evil" Microsoft removed that class from version 2005. But good guys placed dll with it in Internet, i.e. here. So It's needed to implement function GetCode from that class and tool is ready to use!

However it is still needed to plug it in Visual Studio. First step is to register it as a package. This can be done by tool regpkg. It is placed in <%MVS SDK Dir%>\Tools\Bin\ directory. Just run it with a path to our compiled tool as a argument. This step can also be done manually,

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\<%MVSVersion%>\CLSID\{<%guid%>}]
@=<%Tool name%>
"InprocServer32"="C:\\WINDOWS\\system32\\mscoree.dll"
"ThreadingModel"="Both" "Class"=<%class name of tool%>
"Assembly"="<%asm name%>, Version=<%asm version%>, Culture=<%culture%>, PublicKeyToken=<%public key%>"


As you may noticed custom tool must be in GAC. May be there is a way to keep it somewhere else but I don't know.

What is next? Registered custom tool need to be registered as a generator. In registry dir of Visual Studio there is a directory Generators. There is some dirs in it: FA... is a C#, 16... is a VB.NET. It is needed to register tool for each language separately. In directory of proper language add directory with name of your tool, i.e. for my tool called CSGen:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Generators\{fae04ec1-301f-11d3-bf4b-00c04f79efbc}\CSGen] @="CSGen tool to generate code on C#"
"CLSID"="{<%clsid registed in \CLSID\%>}"
"GeneratesDesignTimeSource"=dword:00000001


After that start Visual Studio choose file in project and in properties type name of custom tool. After each save file will be regenerated. It is also can be forced manually: right-click on file in Solution Explorer and "Run custom tool".

These articles with examples could be helpful (I'm not a good explainer, just learning):

Monday, September 17, 2007

Asciidoc

I've recently found new tool for me: asciidoc. It is intended to create documentation in various formats from plain text. What is good that markup elements are not like but more simple symbols so text can be easily written and read without conversion to other formats. I think I'll find use for asciidoc in my projects. Documentation is always needed.

Monday, September 03, 2007

Home network

As I've already posted I had bought a notebook. An now I'm writing from it. I get a wifi card to my desktop computer. It's a D-Link DWL-G510. Both notebook and card supports 802.11g so I've expected rather speedy communication (54 Mbps). I've got it. But only after some "adventures".

Firstly, I found that by default my computers try to found wireless router and communicate across it. So I've needed to create "computer-computer" connection. Really it took me a lot of time to understand this. May be I should google theory of wireless networks, but it's not my habit to google something :(

However after a lot of clicking-and-typing I've got my computers connected in a network. But there was another problem: I wanted my notebook to be connected to internet through desktop PC. I shared my internet connection on it, as my friend advised, but this gave me nothing. After some stumbling with that problem I found that the solution is to set correct IP-addresses on wireless connection on notebook. May be something is spare but for know I haven't got a desire to make new experiments: set DNS-server IP to same as in internet connectio; set mane gateway to IP-address of wifi-card on desktop. After that my connection started to work!

I have to say that there is no significant slowdown on working with internet on notebook. Despite added wireless connection all works fine and rather fast. Sometimes there are pauses in connection to internet but they also exist on desktop so I think they are the result of a work of an ISP (or my software).

All in all I'm pleased that I've got a wireless connection at home and now can work with internet both on PC and notebook.

Thursday, August 30, 2007

My notebook

Today I have bought a notebook. It's an Acer Extensa 5610. And it is with Vista Home Premium. So soon I will be able to say me opinion about Vista. At first it looks impressively. I hope my new notebook will improve my productivity: now I'm not wired to any particular workplace and can even work in university in my preferred environment.

Soon I'll write about my first impressions!

Thursday, August 02, 2007

Microsoft Visual Studio 2008 Beta 2 — too bugy

I've recently started to try latest release of upcoming Visual Studio 2008 — Beta 2. But I found it having much problems on my system: Visual C# Express Edition crashed on compiling of my project and I've needed to reinstall it. After installing Express Editions I've tried to install Professional version. After installing MSDN I've experienced problems with my context menus in explorer — Explorer was just crashing after right mouse click. Of course may be not MSDN was a source of problem, but all in all I was needed to Recover my system. And what is more Professional stopped in the end and even refused to perform command to abort installation. After that I've recovered my system to morning state.

What is more bad, that now Visual Studio refuses to load my projects! I again trying to reinstall it... I've liked C# and .NET Framework (not in all, but in whole) and I'm wanting to program on them more, but... May be the solution is to come back from Visual Studio 2008 (all in all it is beta) to 2005. Another way is to practice on Java. The latter is better in aspect of migrating to another platforms, for example of I would want to work on Linux more that now (now it is equivalent to zero...)

Morale? I was trapped by my aptitude to use the latest versions of software... It isn't problem in many cases but not in that...

Tuesday, July 24, 2007

Ubuntu — first try

Recently I've tried to use Ubuntu Feisty Fawn. On virtual machine.

I've tried Linux and FreeBSD a few times before. Not very successful. Though I have to say that these attempts make my brain to think how to use, not just simply "install and use". However I wasn't able to move from familiar Windows environment to unknown *nix.

Some days ago I've decided to try Ubuntu on virtual machine. I've used two of them: VM and VirtualBox.

VirtualBox was the first. What was bad: progress bar of user interface which must be orange was instead almost invisible. But that is not serious bug. Much worse was that while installing OS on virtual HDD it failed on some step without any warning and I wasn't able to start OS from hard drive, the only choice was live-cd but that is not very good because I need to install some software on my OS to feet my purposes.

Then I've tried VM player. It hadn't got problems with progress bar and it installed successfully and now I can run it from virtual HDD. But... I couldn't find how to switch my audio card to OS (that was rather easy on VirtualBox) and, what is much more worse, it had problems with Internet. Internet is too much important for me to use OS without access to it.

As a result of this faulty attempts I've putted Ubuntu on virtual machine in a long-term box and decided.... to try it on real machine. I've already wrote that I'm studying C# now, so I don't think I could leave Windows for a long time, but I could try Ubuntu as an OS for browsing Internet :) Time will show...

Sunday, June 24, 2007

Launchy

I have a very nice desktop — I've removed all icons from it. Now it is clear and rather beautiful. Moreover I've set Start Menu of Windows to auto-hide. Because I'm needed it in very rare cases. To call applications I now use Launchy.

It's a free utility that scans through set directories and remembers all executable files and shortcuts. When you start in typing in Launchy name of application you want to start Launchy automatically suggests it and if it is right you don't need to type full name of application. Moreover Launchy remembers your choice and when you again type this part of application name Launchy suggests it firstly, so starting frequently used applications is an easy task. Although starting rarely used applications is also rather easy.

You can download Launchy from its site: http://www.launchy.net