Blog Syndicate content

  • » About being a Nerd

    Tue, 04/07/2009 - 23:41

    A quick meta-blog about nothing directly KDE related, but I think those of you who can understand German should see it nonetheless. Hope you don’t mind me spreading it on the planet:

    I just stumbled upon a great video about the definition of “being a nerd”. You can watch it here:

    http://www.elektrischer-reporter.de/elr/video/115/ (note: it’s in German!)

    I have to say that I can identify myself with the message of the video, very nicely done. Must see for anyone! I’ll spread it in my circle of friends so they understand me better when I talk (proudly) about being a geek.

  • » KDevelop Hack Sprint

    Thu, 04/02/2009 - 01:38

    Huzza! The KDevelop Hack Sprint 09 is now official.

    Thanks to the huge engagement of Alexander Dymo we will meet from the 19th to 26th April 2009. The meeting will take place at Alexander’s university, the national university of shipbuilding in Odessa Mykolayiv, Ukraine. Thanks to the people there responsible for making this sprint possible by providing us with the premises, internet, power etc.

    Since this is my very first Hack Sprint and considering that I only recently started contributing to KDE in general and KDevelop in particular I am very excited. The topics I will plan to hack on include (all related to PHP language support plugin):

    • add auto completion after require(_once) and include(_once), just like it works for #include in CPP
    • add auto completion of PHP statements (think echo, exit, require(_once, include(_once) etc. pp.)
    • add auto completion for build-in PHP keywords
    • fix auto completion of interfaces / classes after the keywords implements and extends (working on that right now)
    • fix KDevplatform and the Generic Plugin Manager to support remote projects, i.e. via fish or ftp (or anything else supported by KIO)

    Since I’ll have a whole week of hacking time I hope to get all that done. And more. Since another great thing about the Sprint will be that I can finally meet Niko (nsams) in person. For those of you who don’t know: He’s the one who started the PHP language support plugin. Expect some additional points from our roadmap getting implemented / fixed during that time!

    Furthermore it looks like Mr DUChain himself - David Nolden - will attend as well. I have some ideas regarding parts of the PHP plugin I want to refactor but need additional insight to the way the DUChain works. Let’s see if David and I can work it out.

    And maybe I can even take a look at Quanta 4 itself… Let’s see!

    I’m very much looking forward to the Sprint and meeting some of the other developers! And much thanks again to Alexander for planning all this. Oh and also a very great Thank You goes to the KDE e.V. for sponsoring the event. I wouldn’t have been able to attend otherwise!

    Keep an eye on the planet for more blog posts during the Hack Sprint, I’ll try to write some daily coverage. Now lets see if I can get to sleep…

    Update: The meeting actually takes place in Mykolayiv, 120km from Odessa :) Thank god that I will be picked up at the airport and don’t have to find it myself…

  • » Building KDevplatform, KDevelop and the PHP plugin from Git

    Fri, 03/06/2009 - 01:21

    In a follow up to my last post about the PHP plugin for KDevelop and Quanta I want to detail how I setup my build environment. Since I’m only working on KDevelop I only want to compile that. For all other applications, I use the packages my distribution makes available. Below you this is possible.

    Note: I use Kubuntu and hence some commands like aptitude and the package names etc. will have to be adapted to your specific distribution. But the general idea should be the same and the packages should be called at least somewhat similar. You could always take a look at the techbase article on compilation of KDE 4 to get a more general HowTo.

    It is generally a very good idea to read some articles on the techbase. Especially in the Getting Started section.

    getting the dependencies

    First, you’ll need to install some packages to satisfy dependencies and to get a working compile chain (think cmake, gcc and stuff). The following command only lists very few packages but they have a huge list of dependencies which your package manager will take into account automatically. Don’t be suprised by a possibly huge list of packages ;-) So some disk space will be required (though I doubt it’s more than 250MB in total).

    Note: You’ll need the KDE 4.2.x versions of the KDE libraries and development packages. When you use Kubuntu, you can follow this article to get up to date packages for the 8.10 release.

    1. # I hope these are all, it's been a time since I did that the last time
    2. # please report if anything is missing
    3. aptitude install kdelibs5-dev kdebase-workspace-dev \
    4. libqt4-dev build-essential subversion kdesdk-scripts \
    5. bison flex
    removing old cruft

    To prevent binary compatibility issues that will result in crashes, you have to remove all KDevelop & KDevplatform packages provided by your package maintainer. In karmic it should be enough to remove kdevplatform, and it will remove all dependent packages:

    1. aptitude purge kdevplatform libsublime
    setting up your environment

    Inspired by the techbase article on improved productivity in KDE4, particularly the bashrc listed there, I’ve come up with the following way to configure my system:

    First visit my shell helper git repo on GitHub and download the two files kde4_setup_build_environment.sh and bash_setup_kde4_programming.

    set the environment variables

    Move the file kde4_setup_build_environment.sh to ~/.kde/env and make it executable. You might want to adapt the paths for the variables KDE_BUILD, KDE_SRC and KDEDIR inside that file to your likings.

    This part is required to make sure that compiled programs will act just like normal programs installed globally (e.g. with your package manager) right from the start of your KDE session. I.e. KRunner works fine and custom plugins are found etc.

    make your life easier with some bash magic

    Now alter your ~/.bashrc and to the bottom of that file add the following line:

    1. . ~/.bash_setup_kde4_programming

    NOTE: This assumes that you saved the afore mentioned bash_setup_kde4_programming file to ~/.bash_setup_kde4_programming. You might have to change the path.

    NOTE: That file also sources the above script to set the environment variables. I’m not sure it’s required, but it doesn’t hurt. So make sure the path is correct there.

    Now to the fun part

    Once all that’s done, you have to log out of your bash session to get the environments. Maybe even logout of your KDE session to make it aware of the new paths as well.

    checking out KDevplatform, KDevelop and the PHP plugin

    Get the latest and greatest directly from Git Master (see also git.kde.org Manual on techbase). But first make sure you setup the Git URL prefixes, by putting the following into your ~/.gitconfig file:

    1. [url "git://anongit.kde.org/"]
    2. insteadOf = kde:
    3. [url "git@git.kde.org:"]
    4. pushInsteadOf = kde:

    Now checkout the sources:

    1. cs # cs is not a typo! see above
    2. git clone kde:kdevplatform
    3. git clone kde:kdevelop
    4. # if you only want KDevelop, you can stop here. The rest is for PHP
    5. git clone kde:kdevelop-pg-qt
    6. git clone kde:kdev-php
    7. git clone kde:kdev-php-docs
    compiling and installing

    Now it’s time to compile all that code you just checked out. Hopefully you got all required dependencies. If you need all bells and whistles, you’ll have to install some more packages I’m sure. If you run the code below, take a good look at the output of the cmakekde command (especially at the beginning). It lists not-found dependencies.

    Note: cmakekde is supposed to be run from inside your source folder (e.g. cs $FOLDER; cmakekde).

    1. for p in kdevplatform kdevelop kdevelop-pg-qt php php-docs; do
    2. cs $p
    3. cmakekde
    4. done;
    5. kbuildsycoca4 # make sure new plugins etc. are found

    Pretty easy, hum? Let’s hope everything worked fine :)

    staying up to date

    That above command is only required once. Everytime after that, you can simply do the following which will make sure you are running the latest and greatest:

    1. for p in kdevplatform kdevelop kdevelop-pg-qt php php-docs; do
    2. cs $p
    3. git pull --rebase && make install
    4. done
    The End

    Hope I have not forgotten anything and that this (rather lengthy…) HowTo is of some help to a few of you out there. Looking forward to feature requests, bug reports etc.

    UPDATE 30/03/11: updated to git.kde.org location

    UPDATE 18/05/10: updated to include kdevelop-pg-qt, introduced for loops in setup snippets

    UPDATE 07/05/10: updated to git locations

    UPDATE 08/01/10: updated to extragear location of php & php-docs

    UPDATE 01/12/09: added php-docs, updated to extragear location of kdevplatform & kdevelop.

    UPDATE 17/12/09: updated to kdereview location of php & php-docs

  • » PHP support for KDevelop 4 (and eventually Quanta+)

    Tue, 03/03/2009 - 00:28

    Hello Planet KDE!

    I want to give you a little insight on the current state of PHP support in KDevelop4:

    Me and Nikolaus Sams (nsams) are working diligently on a plugin for PHP support in playground. It’s somewhat stable, i.e. we fix any crashes we stumble upon, but I would call it Alpha state at most. It may eat your babies so to speak. Yet I’m happy to say that at least one user is already using it for production (hi leinir ;-) ).

    implemented PHP support

    Well, here’s a (not complete) list of features that are already working. Though I have to warn you: no screenshots included ;-) It’s actually all very similar to the C++ screenies you can see on the web.

    sematic highlighting

    Let’s start with a feature that only very recently was added for PHP - semantic highlighting. Niko moved some language independent parts of the C++ plugin from KDevelop to KDevplatform and now PHP has the same code highlighting features as C++.

    I personally love this feature since it makes it even easier to grasp code and it makes the code highlighting more consistent since there is no visual difference between PHP built-in functions/constants and your own.

    code completion

    Arguably one of the most useful features the DUChain enables us to write is code completion. There’s already full support for:

    • PHP built-in functions, classes, constants, superglobals
    • user-defined functions, classes, constants, superglobals, variables, etc.
    • proper code completion for objects which respects access modifiers (private, public, protected) and differentiates between static/non-static members and methods
    • code completion for overridable and implementable functions inside classes
    • hints in the argument list of function- and method class
    • sane code completion after keywords such as “extends, implements, catch(), new, throw” and some more I think

    There’s still some bugs to fix and a few features to implement. But I can easily say that even the current state of code completion makes one wonder how he could use Quanta (from KDE3 times) for such a long time! It’s simply nothing compared to this!

    The next feature I hope to add is support for type hinting in function calls. I.e. only show arrays where arrays are requested and the same for objects of a given type. Also no PHP keywords are currently completed at all

    other DUChain/UseBuilder stuff

    Thanks to the DUChain you already get lots of information about declarations, such as uses (which files, which lines etc.). Also very neat is the hover popup you might now from C++ which among others shows you phpdoc comments inside your browser. I also plan to integrate the php.net documentation into KDevelop, similar to what is already possible for QtHelp.

    inline validation / syntax checking / linting

    Another feature which saves lots of time is on-the-fly syntax checking: You won’t have to fire up your web-app inside a browser just to be greated by that pesty “syntax error, unexpected ‘CHAR’ in FILE on line XYZ” message… No! Instead you will see a nice reddish zig-zag line where you made the error and can fix it before heading off to the browser.

    But we don’t only do basic syntax checking. We do more than that, thanks again to the power of the (holy?) DUChain. You can spot undeclared variables, function/method/class/constant redeclarations and more. Actually I hope that one day we spot most of the notices, warnings and errors PHP could emit.

    tests

    We already have a multitude of regression tests which will make sure that we don’t mess up any existing stuff. Lets hope for even more of them :) I love test-driven development.

    The End

    Well, thats pretty much it for the moment. You can have a look at what we are up to at the Quanta Feature plan on techbase.

    If you are a PHP developer and can write C++ with Qt, why not get in touch with us? You can find us both on the KDevelop mailinglist and at least me and leinir are often found in #kdevelop on freenode.

    PS:

    Let me finish with a quick introduction of myself:

    My name is Milian Wolff, I study Physics at the FU Berlin (just finished the 3rd semester). I started learning programming when I was around 14 with PHP. Over the years I became very good in it and the other webdevelopment techniques like Css, JavaScript etc. Recently I started to fullfill my biggest geek dream by learning C++/Qt/KDE and starting to contribute to the KDE project.

    Some of you might now my from the LinuxTag in Berlin where I could be found at the Kubuntu-De.org community booth. At least with some of you I had a beer (well, I doubt it was only one). I hope to repeat this tradition in 2009. Every once in a while I can also be spotted at ubuntu-berlin events.

  • » Kate linter plugin

    Thu, 01/15/2009 - 18:58

    Just a quicky: I wrote a little plugin for KTextEditor which supplies you with basic error checking when you save documents. Currently only PHP (via php -l) and JavaScript (via JavaScript Lint) are supported.

  • » PHP "is_whitespace" performance

    Fri, 08/22/2008 - 00:09

    Easy question: What is the fastest way to determine if a string in PHP is whitespace-only?

    Easy answer: !preg_match('[^\s]', $string);

    Read on for the explanation:

  • » recent GeSHi contributions (apache, xorg, apt, performance, ...)

    Wed, 06/18/2008 - 22:46

    Your favourite syntax highlighter for web applications, GeSHi, recently got some new features and bug fixes. By yours sincerely. A rough summary of what I contributed:

    • various performance improvements, i.e. some speed optimizations and reduced memory consumptions (especially peak memory usage is down by roughly 1MB when highlighting geshi.php by itself)
    • minor bugfixes, including one which prevents some nasty PHP notices on PHP 5 systems to contaminate your precious log files
    • improved language files: bash, apache
    • added language files: GNU Gettext, Xorg configuration and Apt sources.list

    Some of those features were already shipped with the recent 1.0.7.22 release. But the two new language files and the improvements to the existing apache language file are currently only available via SVN. Wait for the next stable release which should be 1.0.8.

    To see two pretty examples, read on after the break:

  • » Drupal modules and other configuration

    Wed, 06/11/2008 - 22:04

    Drupal is such a pleasing piece of software.

    Just a few days ago I found some very cool new (to me) hidden functionality. Additionally I’ve installed some more modules which I want others to be aware of.

    available updates email notification

    Let’s start with the “hidden” functionality: Drupal 6 incorporates some parts of a Drupal 5 module which notifies you about available updates (see /admin/reports/updates). Pretty easy to stay updated with that alone. But I thought I’d had to check that page frequently for new updates. Not so! Say hello to the tab “Settings” on the very page and insert your email address to stay updated via email. Satisfying and built-in… dumb me searches in vain for a module with that functionality…

    Yet it brought my interest to other useful modules:

    Logging and alerts

    The Logging and alerts module gives you a way to send emails to an email address of your choice in case of errors etc. Pretty neat since I don’t want to lose time by regularly scanning my log entries…

    Comment subscribe

    Give your readers a way to stay up2date with comment threads by installing comment subscribe. You can check it out in the comment field below.

    XML Sitemap

    The latest unstable build of the XML Sitemap module is working with Drupal 6! Finally a simple way to notify google & co of updates and site content. Must have addon imo.

    Paths

    Actually this are three modules, some of which I’ve used since day one. Pathauto automatically creates URL aliases of node titles and taxnonomy names, just like on my site - no more meaningless URLs like /node/123. Yay! But with this module alone you could still visit those numeric URLs which is - SEO wise - not a good idea. Every unique side should have a unique URL on your page. This is were the Global redirect module comes into play. Just install it, no configuration needed.

    The last module in this trio is Path Redirect, a recommended extension to the Pathauto module. It enables you to specify URL redirects on your website. E.g. when you change the title of one of your nodes pathauto can automatically create an updates URL and setup a moved permanently (header 301) redirection from the old URL to the new one. No dead ends from external pages anymore!

    That’s it

    Together with Mollom, Filter by Node Type, Get Content Type, Marksmarty and GeSHi this are all modules I use.

    Do you use any modules I might want to check out?

  • » LinuxTag Day One

    Wed, 05/28/2008 - 15:29

    Like last year I’m again standing at the Kubuntu Community booth at this years LinuxTag. Just now I’ve attended the keynote held by Aaron Seigo, ambassador of the KDE project. It was a very interesting talk which covered topics like Internet-Mobile-Desktop interaction, security, effects, Nokia and more. The most important parts roughly listed are:

    • you’ll one day be able to use the same (KDE) applications everywhere - Marble and Plasma for example already just compile and work on mobile devices
    • the internet will get much more embedded into your everyday applications. Marble with OpenStreetMap & Wikipedia support or Amarok with its storage backends (Lastfm, Jamendo etc. etc.) are good examples in this regard.
    • KDE4 is much more accessible than KDE3 thanks to QAccessible
    • security and privacy is not forgotten! This is free software, don’t forget that. Plasma Applet packages will get GPG signed (just like the DEB packages in Apt). And you have control over what data is send where - no Stasi 2.0 here!
    • Nokia is actively supporting KDE, fear not! And of course never underestimate the power of the Free Qt Foundation.

    All in all it was a very good presentation with good questions - very informative! I’m totally going to check out kde4daily now - KDE 4.1 is impressive!

    Just on a sidenote: LinuxTag is going well but Kubuntu and Ubuntu did not get any CDs shipped by Canonical which is a shame of course… Nevertheless the social aspect of this fair is awesome again - you get to know so many people and meet some which you’ve talked to over IRC for ages. Yesterday we went to a bar at Hackescher Markt with the KDE and Amarok guys and had a few beers, tomorrow will be the social event, which was absolutely humongous (to use a word Aaron teached me yesterday ;-) ) last year. And on Friday we’ll go to a restaurant with the Trolls (just like last year - thanks for the invitation!) and maybe go into a Karaoke Bar afterwards. Great! And of course on Saturday there is a Ubuntu Grill at the C-Base, organized by Ubuntu Berlin - neat! Last year that was a great finishing to a good fair.

    If anybody wants to drop by we are in hall 7.2b, booth 124 (together with Amarok). If you need a free ticket, just send me an email (mail@milianw.de). See you here!

  • » How to generate proper DIN A4 sized plots with Gnuplot

    Fri, 05/16/2008 - 21:04

    I’ve had a major annoyance today: The plot generated by gnuplot looked good inside the wxt terminal but I simply couldn’t get a proper fullsized DIN A4 postscript exported. This is how I’ve done it now:

    1. Inside gnuplot:
      1. set size ratio 0.71 # this is the ratio of a DIN A4 page (21/29.7)
      2. set terminal postscript enhanced landscape "Arial" 9 # you can change landscape to portrait and the fontname and -size
      3. set output 'yourfilename.ps' # this is your export file
      4. replot # or put your custom plot command here
    2. In a shell:
      1. ps2ps -sPAGESIZE=a4 yourfilename.ps new_dina4_file.ps
    3. Now you can simply print `new_dina4_file.ps` from within KGhostView for example. Have fun!