Friday, 18 December 2009
IronRuby LinkedIn Group
Saturday, 21 November 2009
Diving into RIA architectures with Flex as an example
Friday, 20 November 2009
Fixing IronRuby error when installing Rake
>igem install rake
ERROR: While executing gem ... (ArgumentError)
C:/Program Files/IronRuby 0.9.2/
Obviously it's not longer than 255 characters, so the reason is possibly in spaces. I've reinstalled IronRuby to:
E:/bin/ironruby
PS C:\Users\Ivan Suhinin> igem install rake
Successfully installed rake-0.8.7
1 gem installed
Installing ri documentation for rake-0.8.7...
Installing RDoc documentation for rake-0.8.7...
Yahoo! :) Hope this post will help someone with same problem.
Thursday, 19 November 2009
Running IronRuby 0.9.2 with RubyMine 2.0
Here goes step-by-step manual:
1. Download IronRuby 0.9.2 from here and install it.
Wednesday, 18 November 2009
Use remote desktop connection faster with PowerShell
$prodServers =
@{
'prod-01' = '1.2.3.2';
'prod-02' = '1.2.3.3';
'prod-03' = '1.2.3.4';
'prod-db-01' = '1.2.3.6';
'prod-db-02' = '1.2.3.8';
}
Set-Alias rdcx 'c:/WINDOWS/system32/mstsc.exe'
function rdc([string]$serverName)
{
$param = ''
if ((![System.String]::IsNullOrEmpty($serverName)) -and ($prodServers.Contains($serverName)))
{
$param += '/v:' + $prodServers[$serverName]
}
rdcx $param
}
Monday, 16 November 2009
Use PowerShell to determine MS SQL table used data space
ls tables | sort -Property DataSpaceUsed -Descending | ? {$_.DataSpaceUsed -gt 1024} | % {$_.Name + " takes " + [math]::Round($_.DataSpaceUsed / 1024 ) + " Mb"}
ls tables
sort -Property DataSpaceUsed -Descending
? {$_.DataSpaceUsed -gt 1024}
% {$_.Name + " takes " + [math]::Round($_.DataSpaceUsed / 1024 ) + " Mb"}
Friday, 13 November 2009
Enlarge your Build System!
That's only 9th message!
Delete all MSMQ queues at some PC with PowerShell
What to do? Powershell, of course! :) Here goes the script:
[Reflection.Assembly]::LoadWithPartialName("System.Messaging")
[System.Messaging.MessageQueue]::GetPrivateQueuesByMachine("someserver") | % {".\" + $_.QueueName} | % {[System.Messaging.MessageQueue]::Delete($_); }
You may also filter them by name if you do not need to remove them all as I need:
[System.Messaging.MessageQueue]::GetPrivateQueuesByMachine("someserver") | % {".\" + $_.QueueName} | ? {$_ -match "SOME_REGEX_FILTER"} | % {[System.Messaging.MessageQueue]::Delete($_); }
Saturday, 26 September 2009
What do we need to use IronRuby?
jschementi: Time to start building real #ironruby and #ironpython websites: what content (other than the obvious get/learn/etc) would you like to see?I'm not going to speak about creating new applications, I'm going to describe a switch of existing ASP.NET application written in C# to IronRuby. Let's have a real-world example. I'm working on a rather huge ASP.NET application dealing with user photos. We use NAnt to build our application, NUnit to test it. Application is layered, we have separate layers for presentation, business logic, data access, etc. We're using ASP.NET 3.5 and have started switching new functionality to ASP.NET MVC 1.
Friday, 28 August 2009
Resharper doesn't see assemblies from GAC
Thursday, 28 May 2009
Twitquake!
Sad!
Sunday, 24 May 2009
Back online!
P.S. BTW, I'm now at Twitter and StackOverflow too :)
Monday, 19 January 2009
NAnt HowTo #4: How To Create And Use Custom NAnt Task
new class named OK, let's start. What is a NAnt task? Formally, it's a class that extends NAnt.Core.Task class from NAnt.Core.dll assembly located in your NAnt installation folder. As any class it will be placed in an assembly, and this assembly is the way you interact with NAnt. So, let's get it! The following steps describe how to create a simple HelloTask task.
1. Create new project
Create an empty class library project that will compile to .dll file.
2. Create new class derived from NAnt.Core.Task
Create new class named HelloTask and derive from NAnt.Core.Task:
public class HelloTask : Task
{
}
3. Override ExecuteTask method
As NAnt.Core.Task class is abstract VS will suggest you to override the ExecuteTask method - do it. Put the following implementation into it (assume that Person property is already defined ;)):protected override void ExecuteTask()Have a look at Project.Log() call - it will output some message with needed level.
{
Project.Log(Level.Info, String.Format("Hello, {0}!", Person));
}
4. Define task name
To define task name, you should apply NAnt.Core.Attributes.TaskNameAttribute attribute to your class:[TaskName("hello")]
public class HelloTask : Task
5. Define task attributes
To define task attributes, you should define property of appropriate type and mark it with the NAnt.Core.Attributes.TaskAttributeAttribute attribute:[TaskAttribute("person", Required = true)]Attribute constructor allows you to specify several options, like whether this attribute is required.
public String Person
{
get;
set;
}
6. Load assembly with you class in NAnt
To use your new task you should place your assembly somewhere NAnt has access to. Two most appropriate options are in NAnt installation folder and in build execution folder. Though I prefer the last one, the first one may be useful if you use your custom tasks regularly though not changing them often.As soon as assembly is properly placed, you should load tasks from it in your build file. Use loadtasks attribute to load it:
<loadtasks assembly="Leaves.NAnt.Custom.dll" />
7. Use your task
Just use it in the most obvious way:<hello person="world" />The output will be the following:
It works!all:
[loadtasks] Scanning assembly "Leaves.NAnt.Custom" for extensions.
Hello, world!
8. Summarize
This is what we've got in our task:using System;And build file:
using NAnt.Core;
using NAnt.Core.Attributes;
namespace Leaves.NAnt.Custom
{
[TaskName("hello")]
public class HelloTask : Task
{
protected override void ExecuteTask()
{
Project.Log(Level.Info, String.Format("Hello, {0}!", Person));
}
[TaskAttribute("person", Required = true)]
public String Person
{
get;
set;
}
}
}
<?xml version="1.0"?>
<project name="NAnt HowTo 4" default="all" xmlns="http://nant.sf.net/release/0.85-rc2/nant.xsd">
<target name="all">
<loadtasks assembly="Leaves.NAnt.Custom.dll" />
<hello person="world" />
</target>
</project>
Friday, 16 January 2009
ASP.NET MVC impressions
It's awesome! As a fan of Ruby on Rails I can tell you: ASP.NET MVC is f*cking awesome!
Monday, 5 January 2009
NAnt HowTo #3: How To Run NUnit Tests From Your Build File
This post continues my NAnt HowTo series. In previous posts I've covered topics of compiling your project and splitting your build file. Today I want to tell you how to run NAnt unit tests from your NAnt build script.
First of all you may notice that main NAnt distribution has TWO NUnit tasks: nunit and nunit2. First one is designed to work with NUnit 1.0 and second one with NUnit 2.2. This simple moment can warn you that something is not as good as it seems here. And you will be right :) Me personally had a problem running NUnit of some lately version using this nunit2 task. After some googling I've found a solution in Scott Hanselman's blog where he spoke with his friend on same topic. As a result of this conversation Scott recommended using nunit-console.exe instead. I've tried it - it works :) Now changing NUnit version will not break as nunit-console command-line specification is not something to change when switching from 2.x to 2.(x+1).
How can we do this? Simple enough:
<target name="tests.unit.run" description="Run unit tests">
<exec program="D:/bin/nunit/nunit-console.exe"
workingdir="D:/projects/MyProject/Integration"
commandline="MyProject.Tests.dll /xml:TestResults.xml /nologo"/>
</target>
So, step by step.
- We use <exec> task to run an executable. This also means that if our nunit-console.exe executable fails (read: some test fails) it will break our build. Of course, you may use failonerror="false" attribute on your <exec> task but I do not recommend doing so - why would anyone ever need tests if their failure will be ignored?!
- We specify path to our nunit-console.exe executable via the program attribute.
- We specify working directory (usually it's integration dir where you have all needed assemblies) via the workingdir attribute.
- We pass command line parameters via the commandline attribute.
- First non-keyed (with no preceding /im-a-key: keys) several arguments specify assemblies to run tests from.
- Argument after /xml: key is a bit more interesting. It indicates the XML file where test results will be stored. You may not need it at the moment but you'll definitely need this file when you'll be integrating your NAnt build script with CruiseControl.NET or any other integration software.
- /nologo key suppresses NUnit copyright information display on each run
That's the end :) Next time I will probably speak on writing NAnt custom tasks. Stay online.