Tag: Computer/Programming

  • TiddlyWiki as SVG editor

    During the weekend an idea jumped into my mind:

    Since SVG is a standard for graphics on the web and TiddlyWiki is an self-contained micro-wiki, what about integrating an live-SVG-editor into TiddlyWiki.

    I’m thinking of something similar like a small MS Paint. Something like that is already existing, the ASCIIsvg Editor, but that is currently better suited for mathematical drawings and will very likely have to be modified a bit for inline and convient SVG editing. It’s based on ASCIIsvg.js. This "library" has already been used to create a SVG-enhanced version of TiddlyWiki for math-equations. See the ASciencePad for this.

    I wonder if anyone before me had the idea (and wrote it down) of an inline SVG painting tool…

  • TOR in the news

    Since TOR had a bit of press coverage with the Anonym.OS Release and the EFF statement about Google’s resistance to government subpoena I think the prime time for TOR is slowly approaching.

    TOR is an application which enables the user to anonymize the IP traffic to and from his computer. This is done by providing an SOCKS proxy on the clients side which receives the IP packets, encrypts them and sends them to several TOR servers on the internet via HTTPS. Those servers then exchange the requests a few time until one finally decrypts the packet and sends it into the internet. It also receives the internet-reply, encodes it again and delivers the result back to the client again using the TOR servers.

    This way everything which can be seen going in and out at a client are some encryptet HTTPS connections to a handful of servers in the internet.

    The advantage of using HTTPS is that it’s widely used for secure websites and so the traffic is more difficult to recognize for an outside attacker or surveyor. It also allows to bypass certain restrictions for example if a company or state blocks specific websites for its employees or inhabitants.

  • Linux shell scripting – testing for numeric argument

    I’ve been tinkering on the problem of checking if an argument is numeric or not inside shell scripts for quite a time already. I searched the internet for a way to test if a variable in a bash script is consisting only of digits but haven’t found a clear solution yet. Either that or I’m unable to bring up the right search terms. The main problem is that it has to be cross-Unix-compatible (Linux, Solaris, AIX).

    A few weeks ago I completed an in-corporate eLearning course about Unix Shell Scripting. This course also contained lessons about basic Unix commands like sed and awk.

    Today this tiny problem struck at me again and I tried to bring in my new knowledge from the course. What I came up with is:

    #!/bin/bash
    
    # check first argument
    number=$1
    
    # test if argument present, then compare original string to the string without non-digit characters
    # if string is the same, it only consist of digits
    if [ ! -z "$number" -a "$number" = "$(echo $number | sed 's/[^[:digit:]]//g')" ]
    then
     echo "Argument is full numeric"
    else
     echo "Argument is not full numeric"
    fi

    I tested it and it seems to work on all the platforms I need it. I don’t like the inline call of sed but for the sake of compatibility I’ll settle with that.

    Perhaps I’ll find an easier solution in the future but now that’s not a priority anymore…

  • Wikipedia changes

    According to this article on CNet News.com some recent events and discoveries around and inside the Wikipedia have forced the founder Jimmy Wales to change some of the basic handling flow of the whole engine. Until now it was possible to create and edit all articles anonymously. But Wikipedia is now big enough and so commonly known and accepted that the personal thoughts and impressions which sometimes are hard to keep out are the cause for conflicts with almost political influence.

    So it was decided to disallow posting and editing for anonymous users although most changes and edits already originate from registered people.

    I personally think that this is a bit a sad step but a necessary one.