Yes, today I also walked to the Betahaus, I’m getting fit so now it takes me “just” 45 minutes instead of almost 1h, which is nice more time to enjoy breakfast!
But today it has been one of these days that make sense to go walking and take advantage of the sun rays. Sun sometimes shines, basically it means the beginning of winter but tt feels good. Berlin looked like this, this morning, nice right?
But also, every morning as I cross this part of the city, not any city but what is considered the capital of Europe,รย you find people in the street, with a lost expression in their faces, wandering around, and is not something occasional but actually you see it many times during the day.
So continuously we can see the two sides of things, this keeps coming back, something may happen in the long-term future.
Meanwhile, I arrived at the Betahaus just in time for the 10am stand up round. I must day that I do repeat myself, doing unit tests.
But today we had a Regex session, yep, regex that kind of unreadable thing that you always end up needing, and that when you get the feeling somehow you enjoy it.
The session was cool, because it explained just the very basics in an easy way, so perhaps this time I may be able to retain it.
Some of the basics learned
[MF]
words starting with M or F
.
anycharacter once
*
0 or more
+
1 or more
{min max}
{, 2} up to two characters
{2,} two or more characters
\
– magic backslash to scape character, they imply character classes \w
word \r
return \t
tab \s whitespace
\S \D means the “opposite” to Whitespace o to Digital
[A-Z]
all character
[0-9]
all integers
inside the [] the character order does not matter
()
brackets are used to group
^
start of a string
An example, if we have name written Name Surname but we want to change it so that they are formatted to Surname, Name, the steps would be
given:
Jurgen Einstein
Wilhem Habermus
you would create the regex
(^[^\s]+)\s([^\s]+)
which can be read as
start string, match everything that is not a whitespace, from 1 to n characters, add a space, match everything that is not a whitespace
then put brackets so you group things that can be used to “save” things in memory.
Then thnaks to the brackets we can change the order by
\2, \1
so the info in the second brackets will be put before then a comma then the info in the first brackets
by default [.*] will take the longest string that it finds, so to turn off the “greedy match” you put a ?,so with ? it will take the shortest string
To have some fun with regex http://regexone.com/
You can get addicted to regex expressions, they trigger the same stimuli as riddles ๐
After the workshop, coming back to our working place I found a friend!! My RailsGirls Summer of Code pair ๐ … nice to see her when she is in Berlin, we really had fun in Summer, so had some lunch, got updated on what she was doing, on how was the hackership going on, exchanging plans for the future, that has changed quite a lot just in the last few months.
Then back to testing, actually today in the morning I had done none, just had to do some pending mails stuff that always takes me more than expected, writing mails requires its time and attention.
Did some more unit tests that I had pending, re-factor some other and then decided that it was time to start with integration tests, at some point I should see something else than the console, so did a couple ofรย integration tests so that in the morning I don’t have to break the ice.
But it always happens something else, and the thing is that another of the side effects of the hackership is to learn human languages, so once at home, after dinner, time to chat!! some exchange of words, grammar, sentences in Spanish, German …so yes we are in a never-ending learning process ๐
Although I really enjoy doing stuff at night , it’s time to go to bed.