Tigraine

Daniel Hoelbling-Inzko talks about programming

Project Thesis - Introduction

I think I mentioned a time or two that I have been studying computer science at the University of Klagenfurt for quite some time now. I officially took leave from work to get my thesis done and today marks the first day of honest work on the project. To start things off I decided to write about what the project is all about and will keep a diary of stuff I learned while developing my thesis.

What's this about?

My thesis will consist of a Android game that provides a framework for researchers to test games with a purpose without having to implement the game part over and over again. The initial idea here is to create a game similar to Clicker Heroes, a simple, yet addictive time-killer game that is played in stages and can be played forever with little effort from the players. By being played in levels I am planning on injecting a mini-game into the (already mini) game for the user to earn extra-points, providing something like a boss-level. This boss-level is where the science comes in.

During the boss-level I am planning on using the users to verify the results of a deep-learning computer vision algorithm on an arbitrary image-database. This is also where I want to enable others to just take the working game and plug in their own game with a purpose to test a theory without having to do their own full-fledget game. Granted, you still have to implement your mini-game, but you don't need to make it fun - just reward your users for playing it with money and points towards the actual base game. (Similar to how some games display ads in between levels to make money, I am planning on annoying the user for science!)

alt

So how is this going to happen? The game will be open-source and available on GitHub shortly and will obviously be written in Java (yay - haven't done any serious Java in years). To speed things along I am planning on implementing it using libGdx so I get cross-platform support without too much work. Besides that I haven't decided yet on how far to take this. There will be a sample game-with-a-purpose implementation I will be testing that is probably using Caffe from Berkley Vision and Learning Center to generate a model I can then verify using the players.

The project will be open-source and reside on GitHub for everyone to follow, licensed unter Apache2 License. Please let me know if you have any questions or want to follow the progress along, you can reach me on Twitter at https://twitter.com/tigraine

Filed under thesis, projects, oss

New team member on dotless: Luke Page

You may have noticed that my blog is filling itself slowly with stuff about Ruby and Unix in general. This has to do with the fact that for now 3 months I am working on Rails full time with very little to no .NET work in between.

While this is awesome for me and I am really enjoying it - it also means that I don't have a .NET dev environment available at work and quickly merging in a pull request and testing it has become quite a hassle. So dotless has had quite some open tickets that where already fixed but where not yet merged into the mainline due to me lagging behind on responding to pull requests.

Fortunately, most/all pull requests have come from our very active Luke Page who has been busily fixing bugs and contributing features - so adding him to the dotless core team is a logical choice to cut down on the lag I or James where inducing into the process.

Since James felt the same we are happy to announce that Luke Page is now part of the dotless team with commit access and everything. So, welcome onboard Luke! Thanks for being part of dotless :)

dotless v1.2.1 released

Remember dotless, the awesome little framework that makes writing CSS a enjoyable and nice experience? Well, it's time to announce a new major/minor version!

Major? Yes - James in all secrecy tagged a v1.2 without me putting out a formal NuGet package. So v1.2 has been available for quite some time but only to the few interested souls that follow us on GitHub and those who got it to compile.

So it's been about time we formally push out v1.2 (and me writing about it). But, as with all software 1.2 had some open issues that got patched by the community and that's why we are calling it 1.2.1 :)

The binaries are now available through NuGet with a simple:

PM> Install-Package dotless

Or you can simply grab the binaries from GitHub . If you care to build the code yourself from source: knock yourself out

Hope you enjoy writing lesscss - I for sure do.

Filed under dotless, projects

New website for dotless is up at www.dotlesscss.org

After some trouble with our previous hoster the old domain www.dotlesscss.com went offline.
Chris tried to resolve this issue, but things didn’t work out so the website was offline for almost 2 months now.

We where not completely offline since, I migrated the website to GitHub Pages some time ago and all documentation was moved over to the new GitHub Wiki. But we were still missing our shiny domain name we could point people to.

So I finally decided to give up on waiting for our old domain to come back and registered a new one:

http://www.dotlesscss.org

The old site is now available at the new name and we are trying to update all references to the new .org domain.
(And .org is more fitting for an OSS project anyway).

As for the project itself, I am planning a 1.2 release fairly shortly that should incorporate a ton of bug fixes and some improvements we made since version 1.1.

Please spread the word about this domain change. Thanks!

Ps: On a technical side, the new website is now powered by Jekyll on GitHub and the source is contained in the gh-pages branch on our GitHub repository.

The fastest way to install dotless : nubular (nu)!

Did you know that dependency management in the .NET open source space really sucks? For a long time have we been looking at Ruby Gems in envy of the ease of use and simplicity, spawning projects like Horn or  Bricks. And while some of these projects were promising, none really took off in a big way, so here comes another take at it: Some clever guys just talked to the RubyGem people about (ab-)using their existing infrastructure for .NET assemblies. And hey, they agreed to let us use their Gem system to distribute .NET assemblies just the way Ruby people can get Rails and all other Ruby projects.

And behold there it is: nubular (nu)

I won’t go too deep into what nu does and why it’s awesome, read Rob Reynold’s article and you’ll see the light pretty soon. Suffice it to say that nu is to assemblies what apt-get and gems is to Linux people. You just drop to the command line and tell nu you need assembly X, and if a package exists with that name it will automagically pull it down and with it all dependencies and install it to your /lib folder. Best of all, it also allows you to install binaries with it, a feature that turned out to be really cool for dotless.

Anyway, I promised you a really fast way to install dotless. Well, it can’t get any simpler than this, just drop to the command line and type (install instructions on nu are further down in this article):

nu install dotless

And now nu goes out to the gem server and just fetches dotless for you:

image

The installation just took 3 seconds, and we have the dotless.Core.dll now sitting neatly in our <currentdir>/lib/dotless folder alongside all other libraries we got through nu.

What this install also gives you is a shortcut to the dotless.Compiler.exe. Nu will install a dotless.bat in your C:\Ruby\bin (that should be in your PATH) that you can now use to compile .less files from anywhere:

image

That’s pretty cool I dare say. And now the best part: Updating dotless just got a lot easier too. Whenever we publish a new version to nu you can just hit

gem update dotless

Installing nu

So far I’ve shown you how to get dotless installed once you already run ruby gems + nubular, but for that all to work you need to install Ruby on your machine first.

Doing so is probably the simplest thing in the world right now, just hit http://rubyinstaller.org/ and you are almost set. You just need to install the nu gem afterwards and you are done installing (takes together under 2 minutes). (Note: Make sure to let the installer add Ruby to your PATH or the whole exercise is futile)

To install the nu gem just type:

gem install nu

It can’t get any simpler than this does it? Oh and btw: Ruby is completely xcopy deployable and will leave no traces behind on your machine. No services are being run and no bad things can happen to you, so there is really no excuse for a developer out there to no just go ahead and install it.

Oh, and after you’ve installed nu you can then go ahead and fetch a complete Fluent Nhibernate + Castle Windsor stack in a matter of seconds, disregarding all dependency issues since nu is handling that for you. And people are putting more stuff there by the minute: Rhino.Mocks, Fluent Nhibernate, Nhibernate, Castle Windsor, Castle DynProxy, Automapper.. etc etc.. Look at the full list and see for your self how much easier you life can become by a simple installation!

Filed under net, dotless, projects

www.dotlesscss.com is down

In case you haven’t noticed, the main dotless website is down. To be frank: We have no clue why, and I couldn’t reach Chris who owns the server we are running on.
Unfortunately Chris also owns the hostname so we can’t easily migrate to a new host so see this post as a guide to where to get your stuff while we are working to resolve this.

Getting the Source is straight forward, just hit the GitHub repository.

Documentation: I’ve moved all our Documentation to the GitHub Wiki. We do lose the ability to let you try out dotless, but at least the docs are somewhere to be found.

Binary releases: Unfortunately we don’t have a build server, but I’ll try to keep the latest version of the binaries uploaded to the GitHub downloads page.

dotless Version 1.1 Released!

logo

After a lot of work we finally released a new version of dotless. And this release is really sweet. We switched parsers from the troubled PEG parser we had to an all-new implementation of the less.js parser that gave us a ton of room for improvements and little tweaks.

Here’s a rundown of the most important features:

New Parser

New parser also means we finally have meaningful error messages and if there are syntax errors we tell you what line the error occured and what went wrong. So that’s a huge improvement for all the people who saw empty .css files trying to figure out what broke the compilation.

Parameter passing

One thing users have  been asking us for are parameters to be passed to the scripts. We finally found a good way to implement this and now it’s in.

If you use the HttpHandler you can simply pass parameters through the querystring. Let’s say you have a basecolor you want to pass to your .less file you simply call it from the site like this:

http://www.myserver.com/site.less?basecolor=#34679a

and the variable @basecolor will be set to #34679a for you in your script. This is especially handy if you are using the HSL functions where you can modify saturation, lightness etc.

If you are using the console compiler you can also leverage this new functionality through a very Ant like parameter syntax:

dotless.Compiler.exe test.less –Dbasecolor=%2334679a

Note: Parameters in querystrings have to be URL encoded or some browsers will act up.

Improved Caching

We also made sure that the cache works properly with parameters, so if two requests have the same parameters the cache will be used. If not, dotless will insert for every parameter/file combination one cache entry. Since parameters are by no means user-input values but usually limited to a set of values the designers specify this should still give you very good performance. Behind the scenes we are still using the ASP.NET cache infrastructure.

While at the topic of caching, we also improved cache invalidation. The old version did not watch all imported files for changes but only the main .less file. This has changed, you should now never have to think about disabling the cache during development.

The same change was also applied to the console compiler, if you start it with –watch the compiler will regenerate the CSS whenever any of the imported changes or the main file gets changed.

Runnable in medium trust

Well, nothing really exciting here, but you should now be able to run dotless in a shared hosting environment.

Other improvements

  1. Cleaner output
  2. better support for CSS3
  3. Many more..
    A big thanks goes to James Foster who did most of the heavy lifting involved with bringing you this new release. You can download the new version from our website at http://www.dotlesscss.com. Remember, dotless is open source and released under the Apache License, Version 2.0, the source can be easily found on GitHub.

.less repository has moved to it&rsquo;s own GitHub account

github Until now we stored the main source of the .less project in Chris Owen’s GitHub account. We now decided to create a dedicated GitHub user to host the project since Chris is no longer actively contributing and may or may not want to add changes that are not meant to be immediately committed into the mainline.

The new repository is at: http://github.com/dotless/dotless

We are still updating all references to the old project (website etc) but the move should be done fairly soon. If you are watching Chris’ repository make sure to also watch the new one as Chris’ repository may start lagging behind the mainline (depends on how often Chris will update his fork).

Oh, and btw: Thanks to the GitHub guys for providing this awesome service. Git + GitHub has simply revolutionized the way I write code and collaborate with people.

.less Compiler now supports &ndash;watch

It’s been on our feature list for some time and it’s been in the code for some time too. But after fixing a final bug today I guess we can tell the world about it.

The main idea behind –watch is to free you of the burden of having to configure anything but lets you just run the console-compiler once and it keeps refreshing the resulting .css files whenever a change occurs to the .less input file.

How to use? Well, simple. First grab the latest release from our website http://www.dotlesscss.com and then go to your favorite commandline and start the compiler with the –watch parameter:

dotless.Compiler.exe <filename> –watch

You will then get a nice console output telling you what is going on (and informing you of errors if any happen during compilation)

image

New stuff in .less

Do you remember that little project I am involved in? That .less thingy I always forget to write about? Well, it’s still around and we are going very strong. We are seeing a decent amount of activity on our mailing list and people throw code at me at various occasions for fixing different problems within the the project.

One of those persons is James Foster, a really nice guy from the UK with some mad programming skills who set out to make .less awesome. Well, he sort of did already, by contributing some major code changes to the .less parser that enabled him to port over some SASS functions to .less. Sadly he does not blog himself, so the honor is mine to report to the world what he did.

Color functions

Before going into details, the main idea is that you are now able to modify any component of a color separately. So far .less has only supported arithmetic operations on colors (like #abc000+ #000def => #abcdef) so if you e.g. want to darken a color while adding 10 points of green to it you where out of luck, making the feature not really all that useful. Well, thanks to James now we can!

Creating colors

.less understands that #FFFF is supposed to be treated as a color, so if you start working off web colors you can just use the hex notation and ignore the following functions. In case you are more the designer type settled in the RGB world and want to have lightness and alpha around, you will need functions to create the colors. And while at it James also added color literals so .less detects a @color: blue; instruction just like it would a @color:#0000FF one. Anyway, if you have your colors RGB or HSL you need to use the following functions to create them:

rgb(red, green, blue) rgba(red, green, blue, alpha) hsl(hue, saturation, lightness) hsla(hue, saturation, lightness, alpha)
You might guess from the parameter names how they work. But to be thorough:
@mainColor: rgb(0, 0, 255); //Blue
Modifying colors

Now, once you hold on to a variable that contains a color you can do some pretty exciting stuff with the following color manipulation functions:

red(color, value) green(color, value) blue(color, value) hue(color, value) saturation(color, value) lightness(color, value) alpha(color, value)

the value can be positive or negative, for instance, to darken a color by 20% you can use "lightness(color, -20%)".

You pass in a color and then the amount you want to change it. If you omit the change value part the method will return the appropriate component of the given color (meaning: red(@color) will return the red portion of that color, while red(@color, 10%) will increase the amount of red by 10%).

And while at it, James also added some convenience functions for good measure to make your day easier:

greyscale(color) this is equivalent to saturation(color, -100%)

complement(color) this is equivalent to hue(color, 180)

mix(color1, color2, weight) mixes 2 colors together. The weight argument is optional and specifies the percentage of the first color to use compared to the second color. it also takes into account transparency - if a color is more transparent it has less effect on the resulting color.

You can get all of that functionality through the latest .less build from our website http://www.dotlesscss.com or just grab the code from GitHub. If you have any questions or suggestions feel free to participate through our mailing list.

And lastly, let’s give credit where credit is due: Thanks to James for the great work he put into .less. James himself stated that he based most of his work on stuff he saw on the Sass project, you can read about their color functions implementation here: Powerful Color Manipulation with Sass. The initial code for Sass was created by Chris Eppstein for the “compass-colors” project which has now been merged into the main Sass codebase. You can also see his pretty impressive demo here: http://chriseppstein.github.com/compass-colors/

My Photography business

Projects

dynamic css for .NET

Archives

more