• Home
  • Events
  • About
  • Hackergarten at Canoo 27.05.2011

    May 26th, 2011

    Don’t forget! Tomorrow night is Hackergarten.

    On the last Friday of the month Canoo opens our doors for an open source programming group called Hackergarten. Our goal is to contribute in some way to open source software, to meet new friends, and to generally have a good time. In the past we have made contributions to Groovy, Gradle, NetBeans, Griffon, GPars… and the list goes on and on. Canoo provides food, drinks, and wifi. Please note, there is a Hackergarten tomorrow! If you’re coming tomorrow then please let me know because I am cooking American hamburgers for everyone and need to know how much food to buy. To learn more about Hackergarten you can see our main site at http://hackergarten.net/ or join the low-volume mailing list at http://groups.google.com/group/hackergarten.

    This month we have an open topic. There is always interest in hacking on Gradle and other Groovy technologies, and contributing to IntelliJ IDEA was also proposed. The topic can be anything you’d like… so please just show up with ideas. As always, Canoo provides food and drink, and the party starts at 5 PM. We are grilling hamburgers tomorrow, so if you’d like one please respond to the active mailing list thread.

    I hope to see you tomorrow night!

    Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
    • email
    • Print
    • Twitter
    • LinkedIn
    • XING
    • Facebook
    • Google Bookmarks

    IntelliJ IDEA 10.5 for the Groovy and Grails Developer

    May 23rd, 2011

    The formal release of IntelliJ IDEA 10.5 came out this month, and the new Groovy features are all part of the free and open source Community Edition, and the Grails features are part of the Ultimate Edition. IDEA X (or 10 to you non-Romans) was a larger release of the product, and I already blogged about IDEA X for Groovy and IDEA X for Grails. There’s still plenty of nice features in 10.5 though. The prices for IDEA recently dropped between $100 and $50, and anyone purchasing IDEA since last November gets 10.5 as a free upgrade.

    Here’s what 10.5 is all about (or skip straight to the release notes).

    Groovy 1.8 Support
    A big push in IDEA 10.5 was Groovy 1.8 support. Groovy 1.8 contains many compile time AST transformations that do things like write out new methods and fields into the Groovy .class files. Normal IDEs will show in-IDE compile errors when using these annotations yet still allow you to compile and execute the script. This has been fixed in IDEA, so the IDE should give you proper code completion and support when you use @Field, @TupleConstructor, and @Log. This is especially helpful when invoking these synthetic members from Java code.

    Introduce Parameter and Introduce Field Refactorings
    Introduce Parameter is one of my favorite refactorings. Select a local variable within a method, press Ctrl+Alt+P, and the local variable is extracted into a method parameter. It doesn’t yet work for closures, but you can vote for that feature. Introduce Field is also handy: select a local variable in either a method or a closure, press Ctrl+Alt+F, and the local variable is extracted into a field on the enclosing class. IDEA is not capable of extracting a field in a script yet, which would logically create an @Field script field, but feel free to upvote the issue.

    Go To Test (and vice versa) Support
    Tests and production source follows a naming convention, for example MyClass and MyClassTest. You can now press Ctrl+Shift+T to jump to the test (if you’re in production code) or jump to the production code (if you’re in the test). And if there is no test, then it will prompt you to create a new one. This works great in most cases. Of course, with Groovy it is not so rare to have several top-level classes in a single source file. In these cases the feature can sometimes get confused. Upvote the fix here if you want it to be just that much smarter in the future.

    More Code Completion and Intentions
    The “add static import” intention is nice for those who use a lot of static imports. Just set your cursor in a constant referenced from your code, press Alt+Enter, and viola… the constant is statically imported. Also, code completion is now available when creating an object using named parameters, which makes them a little easier to use. A whole bunch of other code completion issues were fixed as well, but these were technically marked as bugs not features. You can always peruse the release notes to see the whole story.

    Performance
    JetBrains claims that file indexing (typically at IDE startup) is now faster and that working with large Groovy files is more performant. It is hard for me to see a difference since I use the EAP versions and don’t currently work on any massive projects currently.

    Grails Code Generation & Completion (Ultimate Edition)
    Some small but nice things here. If you reference a controller action from a GSP, and that action does not exist, then pressing Alt+Enter creates an empty action for you. Also, the type inference for values on the GrailsPlugins has been improved, such as the closure parameters for doWithApplicationContext, doWithDynamicMethods, etc, and code completion for controllers and action in custom plugins are now discovered automatically. Finally, the code inside <r:script> tags from the Grails Resource plugin is now parsed as JavaScript, so full IDE JavaScript is available within them. This is supposed to become a standard for Grails 1.4, so it should continue to work with that release.

    Improved Grails Resource Bundle and i18n Support
    With 10.5, if you reference a property using the <g:message> tag in a GSP, and that property does not exist, then the property will be underlined in red and you’ll be given an Alt+Enter Intention to create it for you. Nifty. Also, the existing i18n intentions should now work better when you have GString syntax in your text. For instance, the string “Hello, ${user}” should now be properly handled when extracting to a resource bundle.

    Various Usability Improvements
    Last on the list are a few odds and ends around usability. Closures can now have the separator line between them in the IDE, the way methods show a line between them. GSP stacktraces have correct (and clickable) hyperlinks. The scripts folder is visible in the Grails view. And code navigation and formatting has been improved for several Grails Artefacts.

    That’s it. Enjoy the upgrade, may your solid state disk never fail, and may your caches always be valid. Caio!

    If you like this sort of thing, then there is also a whole bunch of other IDEA related content on my own blog and on the Canoo blog. Enjoy.

    Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
    • email
    • Print
    • Twitter
    • LinkedIn
    • XING
    • Facebook
    • Google Bookmarks

    What to Expect at Hackergarten

    May 12th, 2011

    Hackergarten is on tour again, and in the next few days we have an all day coding event at GeeCON in Krakow (Saturday 14th May) and all night event at GR8 in Copenhagen (Tuesday 17th May). So what is Hackergarten anyway?

    Hackergarten is a group of people that come together to write open source code. If you come to Hackergarten, then expect to do some pair programming, learn better how to write code, and make a contribution to the open source world. The idea of the event is to create a hands-on user group, where you don’t sit an listen to a presentation, but instead you learn through doing and creating. Conferences give people tons of energy and excitement, and here’s a way to continue your conference experience and make a positive impact on the world while you’re still amped up from the conference.

    Here’s a run-down of some important aspects of hackergarten:

    • there will be coding – most of your the time is spent pair programming on a small task for an existing project
    • you will submit a patch – your goal is to write a feature or fix for a project and then submit the patch (or make a commit)
    • there is no agenda – the session starts with chaos as people suggest coding ideas and naturally from into small teams and groups
    • you don’t need a laptop – If you have a computer then please bring it! If you don’t then come anyway and don’t worry about it
    • you don’t need specific skills – All skills and backgrounds are welcome: beginner to expert, assembler to Scala, and everything in between
    • you can recruit for your open source project – got an OS project of your own? Come to Hackergarten and convince other people to work on it with you

    There will be some Hackergarten veterans to help out with the event. We have our own project ideas and can lead some teams if you want.

    Andres Almiray – Andres is the lead on the Griffon Framework (among other things) and he’s always ready to lead people through contributing
    Rene Groeschke – Rene is a frequent plugin contributor to the Gradle build system and will to help people with working on Gradle
    Hamlet D’Arcy – I am a committer on CodeNarc (static analysis for Groovy) and the Groovy language. I have a ton of static analysis rules that are ready to be implemented for Groovy, and just need some help from you.
    You – Got your own project? Please show up and help people contribute!

    There is one last important thing: drinks and food are provided. Canoo sponsors Hackergarten (thanks Canoo!), so you’ll at least be fed and watered.

    See you soon!

    Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
    • email
    • Print
    • Twitter
    • LinkedIn
    • XING
    • Facebook
    • Google Bookmarks

    Git training at Canoo with Matthew McCullough

    May 6th, 2011

    Yesterday I was lucky to attend an excellent git training at Canoo headquarters in Basel. Matthew McCullough of Ambient Ideas, Denver USA was invited by Canoo to share his expert Git knowledge with the people of Basel and nearby. Matthew is a first class trainer, speaking about Git at many conferences and also providing the online git training (https://github.com/training/online).

    The training was open to everyone and very well attended, probably because it was very affordable. Over the one-day workshop “fast-forward” became a new meaning to me. Starting at the very beginning, such as where to get, install and host git repositories, Matthew quickly passed over all the base concepts and commands including comprehensive exercises. The workshop was rounded off by more advanced concepts like how to handle your revision graph in every imaginable way, including highlights like “fast-forward” and “octopus” merges, “cherry-picking“, “rebasing” and “bisecting“. The hours flew by and over the full day Matthew never lowered his fast pace not in the slightest.

    Before attending the training my perception of git was merely of “yet another version control system, but distributed”, but this changed significantly afterwards. Now I believe the distributed nature of Git is not the most important aspect. Git’s value derives from its most fundamental concept: make the handling of branches easy and treat all branches equally. This opens up the door for a much more fine grained revision management, having branches literally for single features or experiments. Treating branches equally opens up the door for distribution on a larger scale …

    Liberating branching wouldn’t work if you didn’t have tools to bring back together you and your colleagues’ work. This is another aspect where git excels and impresses. Similarity detection, multi-branch merges and rebasing techniques, together with sophisticated revision graph inspection tools, help you with this normally non-trivial task. As an interesting side aspect Matthew also talked about the design principals behind git, which are very cunning. Git actually tracks content, not files and is designed to be very reliable and fast.

    If possible I’ll switch to git for my next software projects. Thank you Matthew for the excellent training and multiple insights.

    Matthew can be reached at twitter: @matthewmccull and maintains a blog under: http://ambientideas.com/blog/. He is the author of a huge amount of git tutorials, documentation and related links: http://bit.ly/gitlinks.

    As a suggestion to programmers: if you want to have a famous speaker at your office then just send them an email and ask. At a minimum they will be thankful; at best they will come and speak at your office! That’s what we did, and the result was great.

    Did you not know that Canoo was offering a Git training? Canoo is offering a lot of free (or very affordable) public events. Basel does not have a permanent Java User Group, but we hold “Reading Groups” every few months. The best way to be kept informed is to follow @Canoo on Twitter or send an email to info@canoo.com. Also, we host Hackergarten (http://www.hackergarten.net) every month, which is your chance to come and hack on open source software with some great friends. We have pizza and drinks on a Friday and then try to make a patch or contribution to an open source project. Our goal is to make Basel a great technology community. Care to help us make it so?

    Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
    • email
    • Print
    • Twitter
    • LinkedIn
    • XING
    • Facebook
    • Google Bookmarks

    Command Line Usage for Diff Viewer from IntelliJ IDEA, RubyMine, and PyCharm

    May 4th, 2011

    The Diff Viewer from JetBrains is by far my favorite file diff and merge tool, and I’ve used a ton of different diff tools over the years. I finally figured out how to run the tool reliably from the command line, so now you can easily use it as a standalone tool. The diff tool was first featured in IntelliJ IDEA, is the exact same tool now seen in RubyMine and PyCharm, and is part of the IDEA Community Edition. If you use these products then you already have it installed. If you’re on WebStorm or PHPStorm (or anything else), you can still install the IDEA community edition and use the diff viewer as an external diff tool.

    The diff tool shows the lines and blocks of a file that have been added, removed or changed. And it does a good job of it, allowing you to easily move, edit, and remove lines between files. Within the IDE there are more options as well, like code completion, syntax highlighting, intentions, and more. From the command line it is a little more basic because it doesn’t have a project file sitting behind it. But it does give you the nice “accept changes” interface and you won’t have to learn and use a second, inferior diff tool.

    PLEASE NOTE: This is tested on the IDEA 10.5 EAP. If you are on an earlier version, then it works correctly as long as IDEA is not already open. If IDEA is open, then you’ll simply open the two files in the editor. Bear with me while I find a solution…

    So here is what I do… I wrote a shell script so that it compares two files:

    Which opens up the Diff Viewer. If IDEA is already opened, then it uses the running IDEA process and the window opens very quickly. If no IDEA is running then there is a few second startup time; but there are no files to parse so the startup time is only a few seconds and nothing like the startup of a full Java project.

    screenshot

    Without my shell script it is a little difficult to run. You need to change to the $IDEA_HOME/bin directory and then invoke:

    There is also an inspect_diff.sh script you can run, but I found my method just as easy. The problem with the IDEA provided shell scripts is that file1 and file2 must be absolute paths because you’re in the IDEA/bin directory. If you’re on Windows (without cygwin) then perhaps this is the best you can do. On any system with Bash you can use my bash script (available here). Basically, the script is called “diffx”, and it handles the directories and paths correctly so that you can invoke diffx from anywhere with parameters of either relative or absolute paths. If anyone has improvements then please let me know! You’ll need to have a symlink that points ~/bin/idea/bin to the IDEA/bin directory, do a “chmod +x diffx” to give the file execute permissions, then drop it in your path (you have ~/Dropbox/bin on the path, right?). Otherwise it should all work.

    There are a lot of tools that allow you to configure an external diff viewer, and you can always point those tools to this diffx script to use IDEA as the tool. Also, coming in IDEA 10.5 is the ability to compare directories using the Diff Viewer, and this script should work for directories at that point, however I don’t have it working yet. You can read about the directory diffs over at the idea blog if you’d like.

    Thanks everyone, and I look forward to seeing some Bash script refactorings. This is the first bash function I’ve ever written.

    Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
    • email
    • Print
    • Twitter
    • LinkedIn
    • XING
    • Facebook
    • Google Bookmarks

    css.php