Yearly Archives: 2013

Symbolic Links in Windows

Since Windows Vista we have possibility to create symbolic links on Windows. Yay!

To do that, we have command mklink in Command Prompt:

C:\Users\jj\Desktop>mklink link_to_some_file.txt c:\Dropbox\some_file.txt
symbolic link created for link_to_some_file.txt <<===>> c:\Dropbox\some_file.txt

Symbolic link is not a shortcut. However, its icon desktop looks the same:

link and shortcut icons in Windows

You can find out whether it is a link or shortcut by looking on the properties (left – link, right – shortcut):

link vs shortcut in Windows

You can also check it from the command prompt:
C:\Users\jj\Desktop>dir
Volume in drive C has no label.
Volume Serial Number is A425-1CEF

Directory of C:\Users\jj\Desktop

11/15/2013 10:36 AM <DIR> .
11/15/2013 10:36 AM <DIR> ..
11/15/2013 10:35 AM <SYMLINK> link_to_some_file.txt
11/15/2013 10:36 AM 921 some_file - Shortcut.lnk
2 File(s) 921 bytes
2 Dir(s) 15,738,155,008 bytes free

OT: Don’t you think dir command is to verbose? Who needs e.g. Volume Serial Number each time during listing directory?

In PowerShell, you need to use following command: cmd /c mklink (precede mklink with cmd /c).

I use it for my PowerShell config file. Original one is in Dropbox and symlink just point to it from MyDocuments directory (where it has to be, to be applied by PowerShell).


Windows PowerShell profile

Windows PowerShell is very powerful tool. It contains many useful commands. One of my favorite features is possibility to use some well-known bash commands such as: ls or pwd, which are missing in Windows Command Prompt. The cool thing is the fact, that PowerShell contains combination of Windows Command Prompt and Bash shell commands. E.g. for copying you can use copy (Windows) and cp (Bash).

You can also have personal configuration file (like .bashrc in Unix) to set some persistent settings. To find out, where it is located use command:

PS C:\> echo $PROFILE
C:\Users\jj09\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

I needed to create directory ‘WindowsPowerShell’ and profile file before adding some custom settings. Additionally, I needed to enable scripts on my system (it is disabled by default).

PS C:\> Set-ExecutionPolicy RemoteSigned

More info about Execution Policies can be found here.

My Microsoft.PowerShell_profile.ps1 file:

set-alias subl "C:\Program Files\Sublime Text 2\sublime_text.exe"
set-alias grep select-string
set-alias ssh New-PSSecureRemoteSession
set-alias sh New-PSRemoteSession
set-alias l ls

There is also ‘Power’ version of PowerShell called ISE (Integrated Scripting Environment). Be aware, that it has different profile file (for me it is: C:\Users\jj09\Documents\WindowsPowerShell\Microsoft.PowerShellISE_profile.ps1). You can check it with the same command like for standard PowerShell (echo $PROFILE). Here is a list of top 10 killer features, which are in ISE, but not in standard PS (Intellisense is my favorite).

PowerShell-autocomplete

Disadvantage of PowerShell is its loading time. Windows Command prompt loads instantaneously, but PS need ~1 second. It is even worse in case of ISE, which needs ~3 seconds (on my Thinkpad X220: i5/8GB/SSD).

You can add custom configuration to Windows Command Prompt too. To do that you need to run command prompt with some arguments.


BeagleBoard – your personal computer smaller than your wallet

BeagleBoard XM

It is amazing how big progress was made in embedded systems recently. I remember when I had microcontrollers class at Wroclaw University of Technology (about 3 years ago) and we were programming in Assembly. When I heard (3 years ago) that the main language for programming microcontrollers is C++ I was so excited. It would be so much easier than in Assembly. Now (3 years later), I started working on my Master Thesis at Kansas State University. The ultimate goal is to create prototype of medical device using embedded computer BeagleBoard XM.

This board has 1GHz ARM processor (Cortex-A8), 512MB RAM, 4 USB ports and even HDMI output. Moreover, it has MicroSD slot which allows you to run Linux or Android Operating system!

shocked

There is also Ethernet port, which allows to update the Operating System without any external PC. The key part of the device is set of PWM pins, which will allow me to control the medical device engine.

I will use Ada programming language with cross-compiler from AdaCore. However you can install Java VM and run Java programs if you want! It blows my mind! Programming microcontrollers in Java (the very high-level programming language) instead of doing it in Assembly.

The cost of this Board is $149, which is another advantage of this device.

More info about the board can be found here.
It usually comes along with MicroSD card and Angstrom Linux on it. Additionally, you can find Angstrom images here. To update existing installation (of Angstrom) just do

opkg update
opkg upgrade

More info about OPKG Package Manager (Angstrom’s Package Manager) can be found here.


Cannot run JUnit tests, after debugging in ANTLRWorks

In this semester I am taking the best course I have ever had: CIS706 – Translator Design aka “Compilers”. During this class, we are building a compiler for subset version of Java language. Homeworks looks like that: you get requirements and unit tests. Your score depends on number of passed tests. If all passed – you get 100%.

For development we use Java, JUnit and eclipse. To generate parser and lexer we use ANTLRWorks. The workflow is classic TDD style: you run tests, then try to fix bugs (e.g. your grammar) and run tests again.

Yesterday I spent almost 1 hour because I couldn’t rerun tests. When I clicked run, they started and…nothing. I needed to terminate, then tried again, but still nothing. Even the fundamental solution for all kinds of problems with your machine – turning it off and on again – didn’t help. I was trying to clean and build project, even remove .metadata directory. Still nothing.

Finally, I started debugging JUnit tests and I noticed, that it hangs on call to parser class generated by ANTLR. I removed it, regenerated…and run the tests! What happend? Debbuging in ANTLRWorks (which I did) locks or do some magic with generated files. That means: after each time you debug in ANTLRWorks, you need to regenerate parser/lexer.


The Story of dotNetConfPL

It is all about people and cooperation!

Long story short

April 25-26 – dotNetConf took place, online conference for .NET developers, organized by Scott Hanselman and Javier Lozano

April 27 – I text Pawel Sawicz, that we can organize something similar with Polish speakers and name it dotNetConfPL, he said: “it’s a good idea”. (motivation++)

April 28 – Pawel told me that Michal Franc is also interested and we created google doc to write down ideas and todos. (motivation++)

May 24 – We ask Scott Hanselman whether we can use dotNetConfPL as a name of the conference (because it’s very similar to name of his conference). He and Javier Lozano confirmed in the same day and wished us good luck. (motivation++)

June 6 – We sent e-mail to Maciej Aniserowicz, with a proposition to be a speaker at our conference.

June 7 – He responded: yes (we had first speaker!). (motivation++)

After that, we were inviting rest of speakers and most of them accepted our invitations. We really appreciate this, because they didn’t get any benefits from that.

July 14 – We announced dotNetConfPL on facebook and gain almost 50 registrations for the event within 1 hour! (motivation++)

The week of the conference

A few days before the conference we did initial testing with speakers. To check, whether their microphone, resolution, etc. is set properly. Sometimes we had issues with Google Hangouts. Solution for that was simply disconnect and create a new ‘hangout’. Our initial plan was to make only 1 hangout for entire conference, because each one has different link. We wanted to avoid forcing people to refresh the website or use of SignalR. However after that, we decided it will be better (safer and more flexible) to create separate ‘hangouts’ for each speaker and update link using SignalR.

Website for conference was created in ASP.NET MVC framework. The SignalR+CounchDB feature was implemented day before conference. After the conference I found interesting file in our solution:

dotnetconfpl - code

It is worth to mention that during the conference I was in Manhattan, KS, while Pawel and Michal were in Wroclaw, Poland. The image below, is my Command Center. ThinkPad X220 is connected with 2 monitors and through it I am connected to speakers. On MacBook I am connected via Skype with Michal and Pawel. On Surface I have live streaming (about 30 seconds delay) to be sure everything is working fine. The only issue I had, was not enough ears. I had only two: in one I was connected to the speaker, second – Michal and Pawel, and if I had third, I would be able to track the live streaming 🙂

dotNetConfPL - center

Sessions

All sessions were in Polish. If you don’t speak Polish, you can mute the sound, play this in background and watch 🙂 You won’t get full experience, but still can get a lot from each session!

What is cool, all of them are for beginners and non-beginners in the same time. Which means, everybody will learn something from each session. Additionally: all of them are in HD (720p). Google enabled it by the end of August.

Maciej Aniserowicz: Unit testing in .NET

Maciej shows TDD live example. From nothing to well-tested communication with external API.

Filip Wojcieszyn: scriptcs – C# on diet

Filip shows how to use C# in Console and/or in SublimeText.

Jakub Gutkowski: JavaScript for C# developer

Jakub shows differences between C# and JavaScript, and language flavors every developer should be aware of, which may cause hard to track bugs.

Tomasz Janczuk: Node.js, Edge.js and Windows Azure

This session blew my mind (and not only mine). Edge.js allows you to mix Node.js, C#, F#, IronPython, PowerShell and T-SQL code in one file!

Maciej Grabek: Windows Phone 8 Tips & Tricks

Maciej shows set of useful(8) tricks for WP8 developers. From displaying helper-grid during development, to how to get more ratings for your app.

Summary

Everything went well. We didn’t have any problems with streaming (thanks Google Hangouts) and website (thanks Windows Azure and SignalR). I noticed that sometimes, on my Surface RT, IE11 wasn’t refreshing the link. But, come on…it’s IE, so we can ignore it 🙂

We had room on JabbR for discussion and ask questions to speakers. For a few minutes, even David Fowler (one of SignalR developers) visited it.

I am very glad that many people attended the conference. We had more than 600 registrations, almost 100 people in JabbR room and around 100-200 online viewers. But many people were watching the conference together, and in this case 1 online viewer = more that 1 physical viewers.

dotNetConfPL - atCompany
dotNetConfPL - pizza

Thank you very much for all speakers! You did a great job guys, all sessions are international level!
Thanks to Michal and Pawel for organizing this conference with me.
Thanks to Scott Hanselman and Javier Lozano for inspiration.
And…thank you very much for all of you who were watching the conference and spreading the news!

EDIT:
Short list of tools/technologies we were using for the conference:

  • Google Hangouts
  • ASP.NET MVC
  • SignalR
  • CouchDB
  • Windows Azure (to be able to scale the instance, depends on the number of users)
  • Google Docs (as a database for most important information)
  • Trello (for tasks management)
  • AppHarbor (as test server)