Tag: programming
Poster merket med «programming»:
Things that don't need javascript
The web browser’s support for Javascript allows web developers to embed small (or large) programs into their websites. This can of course be a good thing that enhances the user interaction for the site, but over the past decade we have seen that Javascript has been used to replace existing functionality in the web browser.
Moreover, the number of websites that require that you download and run these javascript programs to even function is growing. This is not a good thing.
97 Things Every Programmer Should Know
As the title suggets, this is a book filled with pretty obvious advice for programmers. That is not the same as to say it’s not worth reading though. On the contrary: I like this book, and think it is a good addition to any programmers bookshelf.
Why Java is not good as a first language
During the spring semester of the last year, a friend of mine was trying to learn Java as part of her studies. I think it’s great when anybody shows an interest in programming so I of course volunteered to help her out a bit. That was an interesting experience in many ways.
How big is "Hello, world?"
Rust
I accidentally got an extra day off from work, so then I figured I could have a go at some initial dabblings in Rust. I haven’t had time to play with this language at all yet, but skimming through the tutorial online a while ago got me interested. So off I went and wrote the mandatory intro-program: “Hello, world!”
fn main() {
println!("Hello, world!");
}
A quick script to import data from my bank to GnuCash
Here’s a quick awk script I did to convert the bank statements from my bank to a format recognizable by GnuCash:
# A simple filter to mould the csv from nordea into
# something that can be swallowed by gnucash.
BEGIN {
FS = ";";
RS = "\n";
OFS = ";";
ORS = "\n";
# Regex for matching a date
DATE = /^[0-9]{4}\.[0-9]{2}\.[0-9]{2}$/;
}
# Only lines starting with a date should be printed
$2 ~ DATE {
# Strip negative sign from withdraw column
withdraw = gensub(/\-/, "", "g", $8);
print $2,$4,$6,withdraw,$10;
}
It could probably be shorter. I could drop setting the RS/ORS, but I like to be explicit. In addition to fixing the polarity of the withdrawals column it strips away all the lines that don’t contain any transactions. I don’t need them, and this saves me from having to do it manually in GnuCash.
Not anything revolutionary, but thought I’d share it anyways.