Possua pataan (postgres)

Reading Time: 2 minutes

PostgreSQL eli ‘possu’ oli jäänyt sellaiseksi kummajaiseksi itselleni. Tiesin, että kyseessä on jotakuinkin samanlainen aparaatti kuin MySQL, eli tietokannasta on kyse.

Ennenwanhaan kaikki opettelivat perusteet tietokantoihin MySQL:n kautta. MySQL on aika normi SQL-toteutus. SQL on varsin pitkän historian omaava teollisuusstardardi tietokantojen luomiseen ja niiden käyttöön. SQL:n rooli on tärkeä, sillä se luo yhteisen kielen asialle, joka toistuu melkeinpä jokaisessa web-pohjaisessa sovelluksessa: tietojen käsittely ja pitkäaikainen tallentaminen.

Tietokannat luotiin alunperin siksi, ettei datan tallennus ja haku olisi joka kerta tervanjuomista sovellusohjelmoijan näkövinkkelistä. Itse tehdyt viritelmät jumittuivat samojen ongelmien ratkaisuun, joka vei paitsi aikaa, usein tuotti myös teholtaan ja käyttöliittymältään heikkolaatuista koodia. Sen sijaan että SQL:ssä antaa ytimekkään käskyn SELECT * from table;

Lähes kaikkien “domainien” eli tietojenkäsittelyn ala-alueiden kanssa asiainlaita on samalla tavalla: itse kääritty (koodi) ei monestikaan yllä siihen, mihin pääsee joukko asialle omistautuneita experttejä, jotka ovat tehneet vuosien ajan yhä parempia ratkaisuja. Jos nämä ratkaisut on laitettu avoimen lähdekoodin pariin, silloin niitä voi myös suuri joukko ulkopuolisia hyödyntää.

En ole erityisen osaava tietokantojen kanssa. Kokemukseni rajoittuu ihan käytännön tason työskentelyyn, erityisesti “kuluttajana” eli tietokantasuunnittelu on myös ollut aivan perus-case:ihin rajoittunutta. Osaan lukea kannasta tavaraa ulos, SELECT-lauseilla, ja alustaa softapuolelta yhteyden tietokantaan. Tietokannat ovat tulleet eniten vastaan olemassaolevan softan osana, jolloin kyky ymmärtää ja tarvittaessa muokata hakujen ja tallennuksen logiikkaa on muodostunut tarpeelliseksi.

Uusia teknologioita on helppo kiertää kuin kissa kuumaa puuroa, vielä siinäkin vaiheessa kun on jo päättänyt opiskella lisää. Siksi sukelsin eräänä iltana alkajaisiksi rohkeasti artikkeliin PostgreSQL Ruby tutorial

Tehdään tutkintaa ensin

On helpompi tutustua uuteen asiaan, kun ei kirjoita (eli ei tee muutoksia) tietokannan dataan. Periaate siis: yksi askel kerrallaan — tutkitaan vain, mitä tietokannasta löytyy.

Linuxissa postgresiä käytetään psql -työkalulla. Se on komentorivityökalu sekä interaktiiviseen että eräajoina tehtäviin Postgres-operaatioihin.

Asennukset: postgresql ja Ruby

Ruby on niin tuttu ja laajalle levinnyt myös oppaiden suhteen, että sen asennusta ei käsitellä tässä. Voit tarkistaa, onko koneellasi jo ruby:

$ which ruby

Jos vastaus on luokkaa “äitis oli!”, niin asenna ensin Ruby.

Postgresql asennus

Postgresql asennus Ubuntu 16.04 :lle on mm. DigitalOceanin artikkelissa. Kun asennus on tehty, postgresql asustelee kivana daemonina eli palveluna. Asennuksen jälkeen kokeile:

$ service postgresql status

Kun molemmat on asennettuna koneella, olemme tässä vaiheessa tyytyväisiä.

Basis for the prophets of Remote

Reading Time: 2 minutesThe world seems to be talking about digitalization. It’s rather elusive subject at times. I like to think of digitalization in very simplistic way: how much does it save effort?

The core of digital work (in software) is keeping your eyeballs on the screen, your mind concentrated, and the environment in a shape that supports you physically. The rest is minor things. There’s thus quite few real pre-requisites for successful work:

  • fast Internet access
  • 220V outlet for laptop charger (ie. normal electricity)
  • a table for work
  • decent weather (preferably indoors)
  • calm atmosphere (not too much buzz and noise around)

There are of course some aspects of team work involved, but basically for the sake of keeping the story simple, we can think of the software and consultancy work as place-independent.

Enter Sowell

In the spirit of American economist Thomas Sowell, let’s ask “what’s beyond the obvious”. We ask the “what implications does remote working actually have”, beyond this explicit definition we just gave.

  • work quality
  • work amount
  • customer benefit
  • benefit for the corporation (employer)
  • environmental benefits
  • any other pros?
  • what about cons?

One of the biggest promises of digitalization is that it makes location (and time) irrelevant. That’s one really interesting feature I found, working at Mainio Tech, a Helsinki-based software consultancy company. The infrastructure was in its native form designed so that it supported remote work. The tools and setup was there, no need to “start thinking” of how to enable remote work. It made a big impression on me. It was also a strong “Eureka!” moment to observe what it takes for things to click properly.

Sometimes there are technical barriers to remote work. They’re often in reality overcome with technology. The question remaining is the shared vision of what can be achieved with a distributed workforce.

 

 

2017 for Jukkasoft – second most pop year!

Reading Time: 3 minutes77 to 950 unique visitors, yearly. That’s the min and max of yearly Jukkasoft.com blog reach. I’ve been on a hosted WordPress since 2013, so that is the time span for visitor statistics. It’s interesting to see and get feedback from “the engine”, so to speak.

The blog has been quite private, not a “viral hit” or anything. I’ve yet to also strike the proper balance with things. My style is quite geeky, I think. Perhaps some of the articles could be more timely and some could be more generous in readability. Then again, it’s not a good idea to try to please everyone. I very well acknowledge that this is a blog about “Uncovering technology”, but you won’t likely find the latest reviews of a gadget in here.

One thing that might be a bit confusing, is that I write both in English and Finnish.
I like to keep things rolling also with the “minority” language, which happens to be my native. Of course Finnish is also easier, as it’s “straight from the mind to screen”.

English is of course really a de facto language for technical things. I started learning English originally at around the age of 7 or 8. Some of the games I played with Commodore 64 (a home computer) came packed with a hefty 80 pages of manual, in English. If you wanted to make your mark in the battle simulation, you better read that manual. Medals were awarded in school yard, when we exchanged battle stories among like-minded friends.

About 50% of my output in Jukkasoft is about programming and other technically inclined topics.

On to 2018 – outlook

I promised a couple things in the posts during 2017.

Getting out a proper introduction to React framework. Second, I wrote about my personal goal with Project #pruners in Twitter, and 255

The Twitter pruning programme stands. I started the project last year. (And currently following more people than in the beginning – so… )

Both of these efforts (spreading React knowledge and doing my personal pledge on Twitter) require some thought. And action. Plus determination.

Reducing the number of people I follow on Twitter on my behalf is an attempt to see, how that kind of thing affects my personal “filter bubble“. As I’ve wanted to reach a more versatile audience here, I’m also interested in being equally informed on Twitter. I mean it’s really fun to meddle in the geek world, but definitely, that’s not all there’s to “life”.

I’m perhaps a bit worried that not all the things high tech offers, on a daily basis, is that good. I’m at least curious. I want to see more of the unfiltered.

Jukkasoft and hosted WordPress

What comes to Jukkasoft (the blog), it’s living on a WordPress hosted blog, that is, I bought a 100 eur worth of features, which keeps the blog clean of any ads (for your convenience), and enables very nice editing features on the backend (where I do writing and editing). So you don’t have to see ads, I don’t have to spend hours doing the stuff
that I would anyway do day-in-day-out in my work.

Jukkasoft has been always a hobby project – this platform doesn’t have direct commercial interests. Blogging is a form of self-reflection and I’m still very much the same guy that used the possibility to “blog” back 17 years ago, during studies, when there was a free web page to host content on in Aalto University. Things have changed, completely free platforms often carry some penalty, so that’s why I see that this hosted WordPress is a perfect solution for my lifestyle and ambitions.

Writing in general

I enjoy writing. Perhaps more than ever. In the beginning of 2017 I also started jotting some words into a techno novel. It’s been going forward, but currently I’m having some trouble getting the “final plot elements” in place. Written in Finnish, it would be my very first one. It stands currently at around 30-35 pages and I would like the length to be double that. Shouldn’t be that hard, there’s plenty of stuff in my mental pipeline. Mostly a question of priorities and getting the final sparks in my brain.

Blogging and text as a media form, in general, is something very dear to my heart. I’ve been an essayist for as long as I can remember. English feels good as a language in the written medium.  It’s also the language that I use daily in work, making and selling software and projects.

But I’ll keep this at convenient length for both me and You!

Be seeing!

P.S. feel free to give tips of your year in review.

J

 

Present History of Man (2018)

Reading Time: 2 minutesIn 2001 I wrote an item list about certain things related to technology, culture and inventions. Back then I looked at the world with the eyes and experiences of quite fresh technical university undergraduate student.

I also predicted in the same text, rather vaguely, but nevertheless some aspects of the future and how it might turn out.

The list

 

  1. you had to actually carry things called “shades” to protect your retina from too much bright light.
  2. you had to swallow chemicals, called drugs or medicine, which affected your metabolism in a way that made you feel a bit relieved. You never really understood why you took it, but because of its relieving effect you actually sort of became addicted to the substance.
  3. you had to carry either metal pieces called coins or plastic cards called credit cards to indicate you were eligible to buy things. From time to time, some genius decided the unit should be changed from one well-established to a new one.
  4. you had to manually synchronize and move bits from place to another for them to be accessible. Automatic secure pan-synchronization of data was not invented yet.
  5. the clerks at the shops made rude mistakes in calculating return money.
  6. in computer operating systems, thing some times worked and another time they did not. There was no logic in all that. There were relatively quite big lag times between the interaction with the system.
  7. pictures were imitated in computers with discrete elements called ‘pixels’ or picture elements. They had not yet discovered Unlimited Natural Graphics.
  8. disk drive space actually run out. Worse; this was noticed at the moment you ‘saved’ your documents. You had to manually do that oftentimes.
  9. Computer documents were static and lasted on the disk as long as somebody did something about it. Documents did not imitate natural memory and disappear when irrelevant. Relevance links (RL) were not yet discovered.
  10. Computer interaction between human and the machine was done with crude devices like the
    mouse (pl. ‘mice’); it was a piece of plastic with a rolling ball inside it. The movement of
    the ball was registered by 2 rotating rollers. Both the X- and the Y- axis had their own rollers.
    “Explicit Intention”-, “thought pattern”-, “Task relevance”- and physical indication measurement methods were unknown in Human Computer Interaction of that age.
  11. the displays were a legacy from around the 1960s. The most central piece of electronics was the
    Cathode Ray Tube (CRT). LCD and plasma displays were claiming space during the turn of the millennia, but still CRTs were widely used.
  12. you had to remember tens or even hundreds of little codes during the day to manage your life in the so-called Information Age. You could not concentrate fully on your ambitions. Codes were required to operate your personal communication device, computer, car, doors, etc.

Found an obsolete item?

Tell me when you see an item has disappeared or the fact is now obsolete. Write a comment here at Jukkasoft blog (or email me), and mention:

  • mention the “Present history list 2018” as subject (if mail)
  • which point on the list
  • has the issue resolved completely or partially?

Emacs: Melpa ja paketit

Reading Time: 1 minuteMELPA on Emacs-editorille tarkoitettu pakettivarasto ja helppo menetelmä pakettien käyttöönottoon. Aiemmin, kuten monien ohjelmointiympäristöjen kanssa, myös Emacsin paketit olivat levällään ja aikaa kului turhaan metsästämiseen.

Emacs nielee .el -päätteistä koodia. Näillä laajennetaan editorin omia ominaisuuksia, ja voidaan myös yliajaa toimintoja halutun kaltaisiksi. .el on eLisp -kielen standardi tiedostopääte. eLispistä muutama sananen alempana.

Kannattaa muistaa, että eLisp on nimenomaan “Emacsin oma Lisp”. Editorissa on siis Lisp-tulkki, joka on tehty tarkoitukseen sopivaksi, ja lisäksi ajonaikainen eLisp -koodi “näkee” Emacsin skoopin; määritelmät eli muuttujien ja funktioiden nimet. Puhdas kielen syntaksi on sinänsä Lispiä, mutta tuo ‘e’ eLispissä viittaa Emacs-terästykseen.

Paketeista

Emacsissa ehkä alkuun vierastuttaa koko jytkyn olomuoto. Onko se Emacs nyt koodia, skriptoja, paketteja, ja mikäs ihme tämä eLisp sitten on?! .el pääte ei kovin monelle ole tuttu ennen Emacsin aikaa. Ja Emacsiakin voi käyttää aivan täysin rinnoin ilman eLisp-gospelia!

Näppärät komennot eLisp (.el) debuggaamiseen

Emacs voi jouhevasti suorittaa koodia suoraan editorissa, eli “kyseisessä kontekstissa”.

Helpoin tapa kokeilla suoritusta on komennolla (e = “evaluate”):
C-c C-e

Lisp kielenä

Lisp painottaa kaunista skooppia; kieli on lisäksi varsin yksinkertainen syntaksiltaan. Kun Lispiä opetettiin Scheme-murteella esimerkiksi Aallossa vuoden 1998 paikkeilla, muistan erityisesti muutamat asiat:

Ainoa mikä yleensä aluksi pistää silmään ja saattaa painaa alas, on tuo “pelätty” sulkeiden määrä, ja käänteinen puolalainen notaatio. Siihenkin tottuu, voin sanoa. Kaikki Lispissä perustuu vain aivan muutamalle, kouralliselle ohjelmoinnin perusasioita; eLisp ei paljoa krumeluureja ole lisännyt. Itse asiassa jos luet tarkemmin esimerkiksi Scheme -kurssin materiaaleja (työkalupaketin nimi on “Racket” nykyään), jotka ovat vapaasti saatavilla

Jatkan seuraavaksi toisessa osassa mm. käymällä hieman lisää .el tiedostoista ja niiden pakatuista vastineista. Näkymisiin!