Pack your health

I tend to be a fairly well prepared traveller. My wife and I take trips without any outsider travel arrangements, and go to places with poor medical help, so I need to pack one mean medical box. Most of the things in the box never get used, but when you need something (whatever it may be), you sure don’t want to be left without it. So, this post is intended as a checklist for all those travellers that find themselves stranded and in the same predicament. I intend to use it as my checklist whenever needed. So here we go:

  • broad spectrum antibiotics
  • activated carbon
  • antifungal agents
  • antihistamines
  • antiseptics
  • bandages, band-aids, scissors, tweezers etc.
  • calamine lotion
  • cold/flu pills and lozenges
  • DEET based repellent
  • sunscreen/lip balm/sun glasses
  • eye drops (visine)
  • ear cleaning solutions and drops
  • rehydration mixtures
  • water purification pills
  • a digital thermometer
  • anti-inflammatory pills (ibuprofen)
  • pain killer
  • wet/dry tissues (as toilet paper)
  • nail cutter and shaving utensils
  • toothbrush and a toothpaste
  • citronella oil

That’s about it. There are a few more specialized items one might need (like an ear cleaning syringe), but the most important stuff is there. Pack it in a small container, as well as you can, and hopefully forget about it during your entire trip. Get your vaccinations and anti-malarics if needed and have a “Bon voyage”!

Posted in Do It Yourself, Travel | Tagged , , , , , , , , , , , | Leave a comment

An American in Croatia

My wife is from Puerto Rico and we are at this time living in Croatia. Being in a mixed-nation marriage, one starts to notice various faults and perks of different cultures. Well, sometimes, the best way to get to know your county is trough the eyes of the foreigner. You know that story when you go to a touristic visit, you try to visit as much of the museums and other famous sights in a very short period of time. Usually, you don’t do the same thing in your own town.

Beside of all the sightseeing, I was always more into meeting people and seeing how do people from different culture live they everyday life. So I was very pleased when I got the info about this blog – an American in Croatia. In a very humoristic way, this  guy describes his everyday life in Zagreb. And as I could read, the habits of an average Croat are very exotic to a foreigner. 🙂 But he writes about it so nicely that you just have to love your everyday simple life habits. I felt it would be nice to share this blog along, in Croatia it has already gone viral. Enjoy!

Posted in Uncategorized | Tagged , , , , , , , | Leave a comment

Bike assembly – final parts (chain, brakes and shifters)

The final part of the bike to deal with depends heavily on the bike type – but it is always the chain, the brakes and the derailleurs (also known as shifters). I completed my custom bike a while ago, but never wrote on this, since I felt it is very bicycle and component specific. Here are some short steps though…

Ingredients and tools:

  • chain and chain tools
  • allen key set
  • derailleurs (back and/or front or none)
  • gear shifters (again, possibly none)
  • brakes and cables to mount them
  • teflon grease, fourth hand tool (optional)

Time and cost:

This can take anything from ten minutes to a full working day, again depending on what you want to have/do.



1. Every bike needs a chain. To measure the proper chain length, put the chain on thelargest ring on your crankset and the largest ring on your cassette. Measure the length and ADD 2 links. This will keep the tension of the chain right. Break the chain with a breaker tool (you really should have one of these, for example:

Next, put the chain aside, you won’t need it right away.


2. Now is the time to install your derailleur. The installation instructions are againspecific to the derailleur you have, but in general, you should bolt the derailleur to your frame with a derailleur hanger. There is usually a screw which determines how close the derailleur will come close to the frame. You will deal with that later. After installing it, guide the chain through. I installed only a rear derailleur since I don’t feel the need to have a front derailleur for city biking. If you do have a front derailleur, make sure to install it first (according to the instructions) before guiding the chain through the whole system.

3. Decide on what kind of brakes you want on your bicycle. Again, I felt that the normal v-brakes will be just enough for the occasional town ride. These brakes are very simple and use a single cable to pull them taut on the rim of the wheels. The brakes are operated via levers, which you place on the handlebar. Some people prefer to install brake levers to the inside of the derailleur shifters, some the opposite. This is entirely up to you.


Installing the brakes and levers is very simple. There are places on your frame/fork where you have to put the brake, so just plug them in there. Attach a cable to the brake and the lever. Now do the same for the derailleur shifter. In the image you can see a tool that holds the cable taut while you fasten it. If you don’t have this tool, just use some pliers, or, better yet, ask someone to hold it for you.

4. The final step is to adjust your derailleurs and brakes. I will not describe how this is done, since, once more, it depends heavily on the type you are using. Basically, for any type imaginable you can find short instructions online, so you should be fine.

That’s it folks! From an empty frame and components lying around, you got your complete bike – enjoy it, you made it!

Posted in Cycling, Do It Yourself | Tagged , , , , , , , , | Leave a comment

162 stairs – a different kind of race

Hello everyone! It’s been a while since my last post, but what can I say – winter and work got the better of me, so it’s been difficult to catch some time to write.

I’d like to share some info regarding a race I’ve been to last month.

The road race “162 stube” (162 stairs) is already a traditional race organized by the Medical faculty in Zagreb. It is held every year to promote health and sport as a way of preventing cardiovascular diseases. The trail is 4200m in length, connecting two medical facilities and being run through the city streets. It is special because near the end one has to climb 162 stairs, after which the race got it’s name. It is always held around Valentine’s to promote love – towards your own health!

I never tried the race before, so I wasn’t sure what to expect. I even got a non-running friend to join me for the fun of it. In the end, he came only 10 seconds behind me (both at 18min 30sec), and he is not even into running! The race was fun, but the end part was unexpectedly difficult. Still, we made it and hope to go again next year. After all, we have to remember to give a gift to our health every year, and running is one of the cheapest gifts you can get!


PS. The number 1 you see on the image is our city major, a well-known long distance politician runner.

Posted in Crossfit, Running | Tagged , , , , , , , , | 2 Comments

Install Win 7 on Macbook Pro retina from a USB stick

So you’ve gotten the new macbook and want to install Windows on it (only Win7 will work, don’t try Win8). Although you could run a virtual box (like parallels) you might still want to make a dual-boot system for some reason or other. The problem is the laptop has no optical drive, meaning you’ll probably have to buy an accessory that costs around $80 to do the job, or use a USB disk. So, here it goes…

What you need is an image of Windows 7 installation (ISO image), a 4GB or larger USB thumbdrive and about an hour of free time. Here are the detailed steps.

1. Back up the contents of the thumbdrive as they will be completely erased during this process.
2. Open the bootcamp assistant (in OsX Utilities) and select all the options. Follow the instructions – effectively, this will create a windows 7 installation USB, download some support software and help you install windows (this tool does mostly everything now, it used to be much more technical).
3. Once bootcamp downloads windows support, it will ask to partition your drive. Simply drag the slider to determine the size of the windows partition you’d like. Keep in mind – you will be able to see the windows files from mac, so you don’t need to make this partition too large. The standard Win7 x64 installation can take up to 20Gb.
4. Once the windows installation starts, you will reach a screen asking where you want to install windows. You will note that you can NOT install to the disk created by bootcamp – reason – it creates a FAT32 partition, and you need an NTFS partition. Simply select the bootcamp partition and format it (there is an option in the menu). Continue with installation.
5. Soon enough, the installation will be done. Pull the stick out. Restart the computer. When restarting, press the option (alt) key. This will enable you to chose which system to boot to (windows is now default). Boot into OsX.
6. Go to preferences -> Startup disk and select the default boot mode (probably OsX). There you have it, dual boot. Whenever you want to boot into windows, press the option key.

Posted in Computing | Tagged , , , , , , , , | Leave a comment

Bike assembly – wheels

Building a wheel from scratch is a science for itself. Further, I will assume that you have some wheels that are already built (or get them) instead of starting from hub/rims/spokes/nipples. This will describe shortly how to place a cassette on the rear hub and assemble the wheels.

Ingredients and tools:

  • wheels, 26 inch for MTB
  • a MTB cassette, 9 speed in this case
  • a cassette tool (necessary)
  • tubes and tires, the kind you want/need
  • rim tape (if there is none on the rims)
  • a pump and some tire levers
  • some rags or toilet paper for cleaning
  • some bike grease (optional)

Time and cost:

About 30 minutes. Cost, as always, depends on what you have handy.


Materials1. Take the rear wheel, the cassette and some grease. You will also need a cassette lockring tool. When choosing a cassette, keep in mind that your rear derailleur, your shifter, cassette and the chain have to MATCH (as in 9-speed, 8-speed etc.). First of all, clean the rear hub of all the dirt and grease. Re-grease the hub from the outside. You can also place a small amount of grease on the place where the cassette sits. The hub and the cassette have a special profile to make sure you can Lockringonly place the cassette in the proper position. Place the cassette, either part by part, on in a single piece, on the hub. After placing all the parts, put the last, smallest part, called the lockring. It is used to lock the cassette in place. It should be tightened to 40Nm with a special tool (again, depending on which cassette you have).

2. After placing the cassette, take both wheels and clean the quick release (the axle Tiresgoing through the wheels). Re-grease the quick releases for optimum efficiency.

3. Take the wheels, the tubes and the tires. In this step, all you need is a pair of hands and some tire levers. If there is no rim tape on your rims, place it there now. Choose the tire width depending on what you intend to use the bike for. I plan only to use it for low-profile cycling, so I am taking some narrower Complete(26×1.5) tires. Place one side of the tire on the rim. Make sure it fits completely. Place the tube on the rim, in the tire. Finally, place the other side of the tire on the rim. For this, you might need some tire levers. When it is on, start pumping the tube. Pump slowly and make sure the tire sits well on the rim at all points.

4. Place the wheels on the bike using the quick releases. That’s it!

Posted in Cycling, Do It Yourself | Tagged , , , , , , , , , , , | Leave a comment

Season opening – New Year’s race

This year (actually, last year) I found out about a unique race in the world that has been going on for 35 years. The race is a mere 10 miles away from me, but I never heard of it.

The traditional 35. New Year’s race Varaždin 2013. had over 200 participants from 4 countries. The race traditionally starts exactly on midnight on New Year’s day – so, when the crowd counts down to zero, all the runners blast off! This makes the race unique in the world (at least by their claim and my google findings). The course is laid throughout the town, with women competing on one lap (3.2K) and men on 2 laps (6.4K). There is no entry fee and everything is well sponsored. The money prizes are also relatively good, which is confirmed by the foreign professional athletes competing every year. The race record is sub-19 minutes (making it sub-15 on the 5K mark), so the competition is quite stiff. This year, the temperature at the start was just above zero.

Well, this was the first year that I tried and I plan to do it again. I finished with a time of about 27 minutes, which was OK for my expectations. It was fun to start the new season exactly at the start of a New Year!


Posted in Crossfit, Running | Tagged , , , , , , , | Leave a comment

Bike assembly – fork and headset

To complete the frame, we have to put the fork on the bike. The part that connects the fork to the frame is called the headset. It is responsible for holding the fork in place and allowing it to rotate with the front wheel. This is a 3 step process – placing the headset on the frame and measuring the proper fork length, cutting the fork and installing it on the frame.

Ingredients and tools:

  • a fork of choice, for city driving, 80-100mm (or a rigid fork)
  • a headset fitting your frame and some grease
  • a rubber mallet
  • a marker and a bike stem (just for measuring)
  • a metal saw and a fork holder (optional)
  • a starnut and a starnut setter (optional)
  • some rags or toilet paper for cleaning

Time and cost:

Half an hour. The cost depends on the number of components you already have or need to buy.


Stuff1. Collect all the materials you need. For starters, this is just the headset, the frame, some grease and a rubber mallet. Clean the headset as well as you can and grease the bearings. You should be able to rotate it’s parts without noticeable friction or sounds. Headsets come in different forms and sizes, so you need to get one that fits your frame. Most of them are intercompatible, so this shouldn’t be too difficult. Use the rubber mallet to put the parts of the headset in the head tube.

2. Next, there is a part of the headset that fits on the fork crown. Place it there, make sure it is tight. Use a screwdriver and a mallet to fit it all the way if needed. On the next image this part is already placed on the fork. SizingInsert the fork through the frame and place all the parts of the headset on it. Also, place the stem you intend to use on the bike on the fork. Make sure everything fits snuggly. When you do that, mark (line with a marker) the place where the fork protrudes out of your setup (headset+stem). You will have to cut the fork about 3-4mm below this mark, otherwise, it will be too long. Use a metal Sizingsaw to do this. Try to get a nice, clean cut. Your fork is now properly sized.

3. Finally, you have to insert the star nut in the fork tube. This nut is used to hold the stem to the tube more securely. The star nut is usually quite difficult to put in the tube with normal tools. You can get a star nut tool online. A very high quality setter can beStarnut bought here. If you don’t want to buy this tool, you can use a screwdriver to put the nut in the tube (you will need significant force and patience to do this). Once the nut is in the tube, you are done. Feel free to install the fork on the frame at this point. To do it, you will also need to install the stem, which should be very simple. Make sure the alignment of the stem-fork-frame is good before you tighten the stem nuts. In the end, tighten all the nuts, including the star nut. If you don’t have a torque wrench, use common sense – tighten well, but don’t overtighten.

Posted in Cycling, Do It Yourself | Tagged , , , , , , , , , , , , | Leave a comment

How your chess program humbles you every time

I found the source of this article a long time ago somewhere. I can’t find it any more, but I have made a chapter in my chess book about it (not sure if this is the original or modified, so the credits may go to the original author).
I assume that you are not a computer geek, or you would probably already know how your computer chess program works and would therefore not be reading this.  Since you are not a geek, I will write this so anyone can understand it without specialized geek training. Under the assumption that it is wise to understand your enemy, this post will explain, if not all the nuances, at least the fundamentals of how your computer program regularly defeats you in a game of chess. Let us refer to our common digital enemy as ‘Chessifer’.

It is an oversimplification, but not totally inaccurate to say that Chessifer considers each move on the board, thinks of all your likeliest replies, then his replies again, and so on as far into the future as time and processing power permits.  At the end of this process he evaluates the resulting positions, decides which is the best and then makes the move that gets him closer to that outcome.

If you think that is not unlike how you play chess, you would be correct, only Chessifer does it much faster and much further into the future than you possibly can.  If you have read Kotov’s book “Think Like a Grandmaster”, you are aware that he advocates imagining a ‘tree’ of possibilities as you think ahead.  That is, the current position is regarded as the root of the tree.  Your potential moves are branches that emanate out from this root, and your opponent’s replies to your moves branch outward from each of those.  The leaves of the tree represent the farthest positions that you can imagine with your necessarily limited brain power.

This kind of a chess game tree is precisely how computers represent the game. The top square or ‘root’ of this tree represents the initial position before any moves have been made.  All of the possible moves by white are shown as branches from this root that lead to the next board position from which Black plays.  The label on each square, or node, of the tree indicates the move that was played to reach it.  But the node itself actually represents the entire board position after that move is played.  We follow the convention in computer science where trees grow downward, but don’t let this confuse you.

TreeAs I said above, Chessifer builds as much of this tree as he can, and when he reaches a leaf node (any node that does not have branches to any lower nodes), he uses a program referred to as the ‘evaluation function’, but which we will refer to as ‘Eval’, and assigns a numeric score to that position. The higher the score, the more valuable that position is deemed to be for Chessifer. Eval is the part of the program that encodes actual chess knowledge.  Thus it will award points to a position based on material, mobility of pieces, pawn structure, and so forth. Programmers work with chess masters, and if a chess master can explain in concrete terms why a given position is better for one side or the other, then this knowledge can be encoded into Eval.

But when the two of you run out of book moves to play, or (more likely) when you depart from the book because you don’t know it as well, then Chessifer reverts to the basic process noted above.  He computes as much of the chess tree as he can, starting with the current position as the root, evaluates the leaf nodes (which are just board positions, remember), and selects the move that maximizes his chances of reaching the best such leaf node.

In the Middle is Minimax

But exactly how does Chessifer maximize his chances of reaching that desirable position he lusts after?  In your own studies with chess books you have probably read that you should always assume that your opponent will choose the best move available to him or her, and make your own move accordingly.  Once again this is what Chessifer does using a procedure called ‘Minimax’, which we can explain using the partial game tree:

It is Chessifer’s turn to move, and we will refer to the current position as Position A. There are only two legal moves that lead to Position B or Position C. If is your move from each of those.  Let us suppose that you have two legal moves from each of those, and it will again be Chessifer’s move.  From Position D he would have three moves, from Position E only one, from Position F he would have four,  and from Position G there are none. This could simply be the case because Chessifer ran out of time to compute more branches, or it might be a stalemate. I have not labeled the actual moves on this tree since that is irrelevant.  We are only interested in how values are assigned. After the above tree is created, Chessifer uses Eval to assign values only to the 9 leaf nodes, namely Positions G through O.  The numbers on these leaf nodes represent the values assigned by the Eval function.

The values for the non-leaf nodes, Positions A through F, are actually selected from the previously-computed leaf nodes according to the following rules.

Max:  From nodes where it is Chessifer’s turn to move, that node receives the same score as the maximum value of the nodes at the next level down.

Min:  From nodes where it is your turn to move, that node receives the same score as the minimum value of the nodes at the next level down.

There are a few points to recognize here.  First, since non-leaf nodes get their values from the nodes directly below them, this forces the process to assign values starting from the bottom of the tree, working upwards toward the root.  Second, the Max rule is nothing more than the rule that says to choose your best move.  Third, the Min rule is equivalent to the assumption that your opponent will choose his or her best move.

At Position D it is Chessifer’s turn to move, so he uses the Max rule and finds the highest value at the next level down, assigning that value (47) to Position D.  In other words, Chessifer would move to best position for him if he first reaches Position D.  Since there is only one move from Position E, he has to assign 27 to E, and then Position F again receives the value from the largest value below it, or 59.

We are now ready to assign values to Positions B and C, from which it is your move.  Remember that the numbers from Eval are according to Chessifer’s point of view.  So larger numbers are worse for you.  Thus, you would play the move to the smallest value position, so for your nodes, the numbers assigned are the minimum of the ones below.  For Position B that means 27 is assigned, and for Position C it is 42.

Finally, Chessifer can now decide which of his two moves from Position A would be best for him, which again would be the maximum of the two choices he has.  So the ultimate answer to the question currently facing Chessifer is, interestingly enough, 42. Chessifer would play the move that gets him to Position C.

Chessifer would like to compute as far ahead as possible, but he does not want to waste time following branches of the tree that are stupid, wasting his time. Fortunately for Chessifer (not you), there is a way to identify parts of the game tree that are useless to explore, allowing Chessifer to spend his time in more promising parts of the tree.

Healthy Trees Must be Pruned

There is a procedure called alpha-beta pruning that can determine when exploring certain portions of the game tree is not useful.
PruningHere one can ask an interesting question:  should Chessifer continue expanding the game tree at Position G?  Notice that Eval has already given a value of 18 to Position F.  What will happen when Minimax is ready to give a value to Position C?  Since C is a Min Position its value will be 18 or less.  And since that cannot be larger than the value 27 at Position B, the value at A can be assigned right now from B, and Position G can be ignored altogether.  If there are a large number of positions under G, this could result in a significant savings of processing time. The example is an instance of “alpha” pruning.  The next figure shows the related “beta” pruning:BetaConsider when it is your move at Position B.  Obviously, you would avoid moving to E since Chessifer could then go to Position F with a value of 62.  You would be better off moving instead to D, which has a value to Chessifer of only 47.  Thus, 47 can be immediately assigned to Position B, and there is no need at all to expand the tree from Position G or perform any evaluations on those positions.  Once again there could be a great many positions that are avoided, saving a tremendous amount of processing.

In the End is the Beginning

I explained how Chessifer uses a very large table to play the opening, rather than performing tree search.  The same basic idea is used to play the end game, although the end game can be played even better than the opening.  That is, the opening is based on current chess theory, as it is called, which is simply the collective wisdom of chess masters around the globe and which is collected into large reference works such as ECO, MCO-14, and others.  But just as medical wisdom changes over time, so does chess wisdom, which is why these works are periodically updated.

But endgame databases are different in that, within bounds, they encode perfect play.  By perfect play, I mean just that.  If there is a win, the end game database can tell Chessifer how to get it.  If the best that he can do is draw, then Chessifer will draw.

Endgame databases are created by what is called retrograde analysis.  An ending position, either a win or a draw, is investigated backwards by finding all moves that can result in that end position, and then all moves that lead to those pre-final positions are found, and so forth.  Such perfect end game databases have been constructed for all endings with 6 or fewer pieces and pawns.  You can even download some end game databases from the web, if you search on “endgame tablebase”. Here you can use all the 6 man tablebases.


There is much more than Minimax and Alpha-Beta pruning that goes into a full-featured chess engine, but these are the essentials of what your computer is doing when it humbles you repeatedly.  Other procedures and issues for the computer include such things as iterative deepening, the horizon effect, node ordering and critical nodes, the killer heuristic and more.

Posted in Chess | Tagged , , , , , , , , , , , , | 1 Comment

Bike assembly – crankset and bottom bracket

The second part of the bike to deal with is the drivetrain – the crankset and the bottom bracket (further on BB). Cranksets (and BBs) come in many different varieties. If you look at the first posted image, you can see three different cranksets I had around – Shimano Deore, using the so-called Hollowtech technology, an older Shimano sqaure taper crankset and a newer FSA crankset using the BB30 technology. Not to get too technical – there are many standards out there and you can easily get lost. The first thing you should check is what kind of a BB your frame supports. See if the BB shell (lowest part of the bike) has threads. Next, measure the width of the shell. When you go around looking for a crankset, this info should be enough. In my case, the shell is threaded and has a width of 73mm. To read more about these standards, you can look at wikipedia or, even better, here.

Ingredients and tools:

  • crankset (w/wo chainrings)
  • extra chainrings (if you’d like) with threads
  • anti-seize compound – ASC (very useful)
  • bike grease (car lithium grease will also be fine)
  • torque wrench (optional)
  • specialty tools for BB/crankset assembly (optional)
  • some rags or toilet paper for cleaning

Time and cost:

This can take about 15-20 minutes. The cost depends mostly on what you have lying around or have to buy.


1. Get all the parts you need in one place. I find this the best way to start a job. It is unfortunate when you start doing something only to find you are missing a part. In this image you can see all the listed stuff. Besides the parts that I used, there are also some extra cranksets, crank arms and chainrings. This is just so to get a feeling of all the things you can combine.All_the_stuff

Chainring_buildChainring_torque2. We will start with putting a chainring on the drive-side crank arm. Since I am making my bike to be a city-bike, I plan to use only the large chainring. Place the ring on top of the arm. To fix it, you need crankset bolts, which are a bit special and come with troubles of their own (particularly, specialty nuts). Place some ASC on the bolts and loosely connect the ring on the arm. To tighten, it would be ideal to use a torque wrench and the crank tool (little tool in the center of the picture). The tool is used to provide a counter-torque on the crank nuts (simply put, to stop them from rotating). If you don’t have this tool, then you can hold them with a small screwdriver or some small pliers. Tighten the bolts as good as you can. In the end, wipe clean the whole setup, which is probably messy from the ASC. Also, check if the chainring is sitting tightly on the crankset – there are substantial forces in play when the chain is pulling it.

3. BB_allThe next step is to install the BB/crankset on your bike. First, clean the whole system and apply some grease on the crankset axle. Now, put the BB in the BB shell on the bike. Usually, the BB’s have the drive-side and the non-drive side designated on them. If not – here is how you find out – on the drive side of the bike (right side when you are on top), the BB thread should be such that it tightens clockwise. On the non-drive side, it tightens counter-clockwise. BB_insertPlace some ASC on the cups, put both cups (separately) in the shell and tighten. Again, if you don’t have the tool, use something else. The tightening torque should be high, so tighten well. After inserting both sides, you can insert the drive-side part of the crankset in the BB. After doing that, wipe everything very well to remove extra grease/ASC. Finally, we need to tighten the crank arm.

4. To tighten the crank arm, you sometimes Hollowtechneed some specialty tools (but often not). What I used was a hollowtech II BB, so I needed a special tool. Unfortunately, there is no escaping it. You can see the tool attached to a torque wrench in the image. The torque you should apply depends on the type of crankset (find specs on Internet – here is a handy guide for most you’ll ever need). If you don’t have a torque wrench, tighten well, but not too tight, since this can also be damaging. Finally, there are usually some extra bolts on the crank arm. Mine said to tighten to 12-14 Nm, so that’s what I did. This completes the build-up of your crankset and bottom bracket!


Posted in Cycling, Do It Yourself | Tagged , , , , , , , , , , , , , | Leave a comment