Posts

Showing posts with the label programming

The Computer Language Benchmarks Game

= The Computer Language Benchmarks Game The Computer Language Benchmarks Game is a free software project for comparing how a given subset of simple algorithms can be implemented in various popular programming languages. The project consists of: * A set of very simple algorithmic problems * Various implementations to the above problems in various programming languages * A set of unit tests to verify that the submitted implementations solve the problem statement * A framework for running and timing the implementations * A website to facilitate the interactive comparison of the results = Supported languages Due to resource constraints, only a small subset of common programming languages are supported, up to the discretion of the game's operator. https://benchmarksgame.alioth.debian.org/ * Ada * C * Chapel * Clojure * C# * C++ * Dart * Erlang * F# * Fortran * Go * Hack * Haskell * Java * JavaScript * Lisp * Lua * OCaml * Pascal * Perl * PHP * Python ...

Minification is not enough, you need tree shaking

This is one of the reasons I advocate improving your tools before you start to solve complicated projects. ECMAscript was created in the past millennium for messing around with your cursor and making text blink. Any serious use is a kludge . Big respect for people making superhuman efforts to develop working web applications, but why make your life more difficult than it needs to be? "If I had eight hours to cut down a tree, I would spend six hours sharpening my axe" - attributed to Abraham Lincoln Check out  Minification is not enough, you need tree shaking on Seth Ladd's google engineer's blog

DVB-T XMLTV EPG grabber complete

It runs on over the air broadcast, so you won't see any more grabber failures because of a website that decided to change their design (deliberately). bkil-open: tv/grab-dvb-epg.sh

Ergonomy - provide editing context

A good rule of thum is to always provide proper context for the user. In case of a text editor, it's the de facto standard to only scroll the screen when the text cursor would leave the visible window. However, consider the use case of composing an answer to a letter. It feels more comfortable to be able to read a bit ahead, as well as back in this case. Toggling full screen via scroll lock was a working strategy in the past, though only a few editors support it, and nowadays less and less keyboards have a button for it... There exist another breed of editors which, on automatic page scroll, advance only a small proportion of the editing window at a time. A third possible implementation would scroll in such a way as to always position the cursor in the middle of the editing window. I have constructed a few prototypes on this paradigm way back in primary school which worked nicely to me.

Participatory cloud computing - help cure cancer?

How come so few donate their free resources to volunteer computing projects ? Depending on the exact computer configuration, the difference in system power consumption between using and near-idling the CPU (~35W-80W) or GPU (~30W-100W) can be reasonably small . The difference is usually smaller than the difference between a power efficient (25-60W) and a basic system (100-200W). Hence in my view, it usually worths it to put your free resources to use in some way if your daily work does not strain your machine continuously at 100%. There's an a project of special interest that has similar aim to what I have invented earlier: It is special in that any participant can freely use the communal grid for their own purposes . Prioritization is fair - it is based on previous record of contribution. This type of project is also useful for the selfish kind, as if you think it over, you can eventually get back the contributed CPU time and energy, but at a much faster pace. It would stil...

Fractals of mine

Image
Although, I have uploaded these previously , here's a version which you can copy & paste into the online interpreter : to flake :s :n ifelse :n=0 [fd :s] [flake :s/3 :n-1 rt 60 flake :s/3 :n-1 lt 120 flake :s/3 :n-1 rt 60 flake :s/3 :n-1] end to koch :s :n pu fd :s*57/100 pd rt 210 repeat 3 [flake :s :n lt 120] lt 210 pu bk :s*57/100 end to put1 :s :n :k setpencolor :n+2 koch :s :n pu fd :s*12/10 pd rt 360/:k if :n>0 [put1 :s :n-1:k] end to put :s :n pu lt 135 fd :s rt 135 put1 :s :n-1 :n end cs put 100 5

Software Quality at Top Speed

Fine literature has been available for decades now, but some still don't seem to get it right. Software Quality at Top Speed by chief software engineer Steve McConnell (Software Development, August 1996) highlights reasons for project overruns and the importance of taking time to design and do reviews Quality Cost Analysis: Benefits and Risks by Cem Kaner (Software QA, Volume 3, #1, 1996, p. 23.) details the economic side

purifying your thoughts

"Always aim at complete harmony of thought and word and deed. Always aim at purifying your thoughts and everything will be well." - Mahatma Gandhi on unit testing .

Ergonomy - placement of buttons of destruction

Putting the two buttons "quicksave" and "instantly and permanently delete without confirmation" right next to each other is a no-no, especially for a service that offers gigabytes of free space and a trashcan folder for most other operations. Thankfully, they've introduced a quick undo feature, and later on extended the time-out of this button. It's still a bit scary if you think about this adjacency being implemented on many interfaces.

Javascript Logo interpreter

Online JavaScript Logo interpreter some very beautiful and terse Logo examples The following is one of my favorites from there. Hypercube, by Frank Caggiano, U.S.: repeat 8 [repeat 4 [rt 90 fd 100] bk 100 lt 45] edit: You can also find two simple examples of mine at my repository .

My programming language usage

In recent months, I've been developing Python (Geany, Netbeans), BASH (gedit, Geany) and a bit of HTML/Javascript (Netbeans, Geany) for work, Java (Eclipse) for coursework, Erlang (Emacs, sometimes Geany) and a bit of Emacs LISP (Geany) for labwork, and Haskell (Geany) for my own needs. I have also refreshed my Logo (Geany) skills recently to refactor two of my homeworks. I will move to C++/Qt/FFmpeg/SQLite (Qt Creator) again in the upcoming days for some time. I have dug into Gnome's Genie (and Vala) and will write a short overview of the language soon. That's 8-10 languages at my fingertips, but a few more aren't deep down below either, like C (you never forget the horror), Ada (hard to forget the beauty), Pascal (need to find a way to convert to Ada), Eiffel (have seen it, but no professional coding done in it yet). Sadly, I'm not allowed to share my Python code, and some of my more interesting BASH scripts. You also can't enjoy some unpublished parts of Refa...

Sharing my source the Proper way

I plan to share my sources via a software project management suite. From now on, you could even contribute if you wish! You could also follow project updates (commits, documentation pages, releases, etc.) in your feed reader. I don't have a problem with using Google's products for open source development, but do tell me if you think otherwise. Kosi had recommended GitHub, but it doesn't offer all features I need, and I'm hesitant to spread over many service providers. For more information, visit the bkil's personally developed and used tools project summary page.

BUG: has even more options than ls

This seems to be some kind of an easter egg in man pages. Exuberant Ctags bug at SourceForge: ctags doesn't have more options than ls - ID: 2707519 (- after all) wodim man page (formerly cdrecord) - see the top of the BUGS section

Install Hugs under Puppy Linux to program Haskell

Hugs is a nice little interpreter if you'd like to try out the language Haskell. It has few dependencies and it requires moderate resources to run. The download for a minimal install is less than 1.5MiB in size. If you have an operating system with package management, you can simply install the package 'hugs', or 'hugs98'. For example, on Debian-based systems (including Ubuntu) this amount to simply running: aptitude install hugs On distributions without a decent package manager (like Puppy Linux), you can install the Debian packages manually (refer to your distribution for details, but it usually involves clicking on each downloaded package or typing dpkg -i name.deb ). You first need to select a Debian major distribution version which matches with the versions of libraries on your system. On the Pupeee (Puppy 4.3) I had been using till now, choosing Lenny seems to work fine. So I've downloaded each i386 version from a mirror close-by of the following packages:...

Replayable keylogging for yourself

It would be feasible to protect as much information created by the user as possible. Certain software have evolved the ability to partially provide a feature similar to this via periodically created temporary document copies (editors) or constantly refreshed configuration files (browsers). Most of them use their own, unconfigurable, error-prone ad-hoc solutions. I propose that a solution be found at the operating system level which any software can reuse. Keyboard input could be considered the most entropy rich for most users, however, selection and positioning via the mouse pointer must also be taken into account. The good solution would probably model widget activation in an abstract manner.

online interpreter and collaboration tools: codepad, ideone, tryhaskell

Visit the cool site codepad.org , where you can try out any esoteric programming language online which you never had the spirit to install so far. You can also view, try out or even modify programs that others have typed in previously. Supports the following languages: C, C++, D, Haskell, Lua, OCaml, PHP, Perl, Python, Ruby, Scheme, Tcl. (via verdelyi) ideone.com also supports a heapload of languages: Ada, Assembler, AWK, Bash, bc, Brainf**k, C, C#, C++, C99, CLIPS, Clojure, COBOL, Common LISP, D (dmd), Erlang, Forth, Fortran, Go, Haskell, Icon, Intercal, Java, JavaScript, Lua, Nemerle, Nice, Ocaml, Pascal, Perl, PHP, Pike, Prolog, Python, R, Ruby, Scala, Scheme, SmallTalk, Tcl, Unlambda, Visual Basic .NET, Whitespace. tryhaskell.org - specialized for Haskell, but does its job in light-weight JavaScript !

Sorted and aggregated disk usage script

I've been asked for this script many times lately, so I'll publish it. It lists the disk usage of subdirectories in a given directory in descending order, right justified and suffixed with kilobytes or megabytes appropriately. #!/bin/sh display() {  local DIR=$1  du -sk $DIR/..?* $DIR/.[!.]* $DIR/* 2>/dev/null |   sort -n |   awk '    {     size = $1;     sum += size;     name = $2;     if ($1 < 1024){      printf("%9ik %s\n",size,name);     } else {      printf("%9.3fM %s\n",size/1024,name);     }    }    END{     print sum " kiB"    }   ' } main() {  local DIR=$1  if [ "$DIR" = "" ]  then   display $HOME   quota  else   display $DIR  fi } m...

Haskell IDE

Gtk+: Leksah - Haskell IDE in Haskell built on Gtk+ and gtk2hs ( HaskellWiki: Leksah ) Eclipse : EclipseFP - functional programming support for Eclipse (Installation experience and comments: 1 , 2 ) Emacs : Haskell Mode for Emacs from Svein Ove Aas (previous maintainer was Stefan Monnier: 1 , 2 ) (TODO: is (setq haskell-font-lock-symbols 'unicode) the default?) , MMM (Multiple Major Modes) Mode for Emacs , scion-lib Haskell IDE library , HaRe -- The Haskell Refactorer Vim : Haskell mode for Vim , Superior Haskell Interaction Mode (SHIM): GHCi integration for VIM , Vim as a Haskell IDE, first steps illustrated tutorial, scion-lib Haskell IDE library , HaRe -- The Haskell Refactorer And of course we all know what xkcd: Real Programmers use. I'm eagerly awaiting your feedback!

Converting between Bird-literate and plain Haskell

Literate programming is a good idea, and there exist many creative ways in which you could take advantage of it, like one described in Literate Haskell with Markdown and Syntax Highlighting . However, if you're using the text editor Geany version 0.18, you will be faced with a bug that makes it unable to interpret Bird-style literate source. As a simple fix, I provide two programs to convert between simple Bird-literate and non-literate source code. You could also convert your Bird-literate to TeX-style . # bird_lhs2hs sed '   s/^>//   t   s/^ *$//   t   s/^/-- /  ' in.lhs > out.hs # hs2bird_lhs sed '   s/^-- //   t   s/^ *$//   t   s/^/> /  ' in.hs > out.lhs

DataRow.Delete with SqlDataAdapter

A note to myself. I've figured this out few years ago, but it looks like I forgot it... :-D Always use the Delete() method on the DataRow object instead of Remove(DataRow) on the DataRowCollection, or else the corresponding SqlDataAdapter.DeleteCommand won't trigger for an Update. So deleting from the table won't work, no execution will be done.