Franjo Kluz, nikako da umre!

Spoiler alert – možete samo kliknuti ovdje https://www.binarni.net/projects/franjo/2.0/.

Na projektu Franjo Kluz sam počeo raditi prije 10 godina (negdje 2008.). Tada, isto kao i sada, nisam imao nikakve ideje što bi to trebalo biti (a nije da nisam imao ideja!).

Sve je krenulo kad sam odlučio napraviti Web based igricu sa aviončićima. Canvas je tad bio furka. Drugi svjetski rat i lokalna priča sa Franjom Kluzom mi je djelovala dosta simpatično. Kao mali sam obožavao “Partizansku eskadrilu” a kao stariji sam otkrio tko je bio Bekim Fehmiu i Hans Reiter u “Salon Kitty” od Tinte Brassa. Rekoh, bit će to dosta simpatično. Složio sam neki algoritam za generiranje terena, sklepao neku grafiku (pretežno pokrao grafiku i malo modificirao) i napravio aviončić koji se može kretati gore-dolje te bacati bombe. Naravno, prva misija se zvala “Stukas im Visier”.

Pažnja me držala dobre 2-3 minorne verzije (čak sam složio i neki osnovni web site) i onda sam nakon dosta pauze odlučio to sve prebaciti na telefon. Jer, zašto da ne! To je bilo neke 2011. godine. “Hej vazduhoplovci” kako svira u pozadini i aviončić koji ide s lijeva na desno. Zar treba i spominjati da je sve stalo na tome?

Četiri godine kasnije (2015.) sam nakon work overloada i godina neodlaženja uzeo 1-2 tjedna godišnjeg sa idejom da dovršim Franju. Zabrijao sam, to će biti moja duhovna obnova koja mi je falila. Trebao sam svaki dan izbaciti video i neki kratki blog što sam tog dana napravio. Završio sam sa jednim blog postom i 2 videa na Facebooku. I to je nešto.

Rekoh si tada – nemaš puno vremena pa si uzmi neke realnije ciljeve. Znao sam da sam loš s grafikom pa sam se odlučio za nešto jednostavniju grafiku tipa Luftrausers. Odlučio sam iskoristiti PixiJS. Nitko više ne piše svoje game engine, pa čak ne i za JavaScript (za Rust još uvijek možda ima smisla) ! Zabrijao sam da bi bilo dobro da igrica bude malo više casual tipa – 1 button ili maksimalno 2 button game. Aviončić cijelo vrijeme automatski pada, jednim buttonom ga dižemo gore a drugim eventualno napucavamo Švabe.

Dodao sam intro priču sa dosta nekih referenci (Kiklop, Ko to tamo peva, …). Generalna ideja je bila da se krene sa nacističkim napadom na Kraljevinu Jugoslaviju te da se igrač seli kroz različite stvarne bitke koje su se dešavale. Pače, čak sam istraživao i koji modeli aviona su se koristili u napadu. Treba biti autentičan, zar ne! Tu se desila i prva promjena aviončića – Potez XXV je odjednom postao Rogožarski IK-3!

Onda sam dobio druge ideje. Franjo je prvo bio u kraljevskom zrakoplovstvu, nakon toga je bio u NDH dok nije prebjegao u partizane. To mi je djelovalo kao zanimljiva ideja da krenem sa napadom na Beograd, prebacim se na Franju u NDH (vozi avion i upucava srbizme koji lete na njega; srbizmi kao riječi koje su bile zabranjene u NDH) i završi sa Franjom u partizanima.

Priča sa Franjom mi je dodatno bila zanimljiva jer mi je netko ispričao tračeve kako je Franjo pobjegao u partizane jer je mutio za zapovjednikovom ženom te odglumio svoju smrt jer je upao u kartaške dugove! Nije li ovo priča koja se može samo poželiti!

Deborah Hustić je uvrstila “igricu” na Radioninu izložbu “Gaming playground”. Kažem “igrica” jer i nije bilo nečega za igrati u toj fazi.

Nekih godinu dana kasnije odlučio sam staviti i leteće patke, Švabe i metke… Red je ipak da to igrica ima.

Onda sam negdje 2017. otkrio Defold – 2D engine u Lui te si rekoh – idealno za napraviti mobilnu verziju Franje. Pogledah malo dokumentaciju od Defolda i što se može s tim napraviti. Napravio sam ovo – https://www.binarni.net/projects/franjo/defold/. To je to, nema više od toga. Ako ikad skužim što želim napraviti možda nečeg više i bude.

Što je od svega ostalo? Postoji zadnja playable verzija na ovom linku (JavaScript HTML5 – https://www.binarni.net/projects/franjo/2.0/.

Najveći problem je oduvijek bio oko gameplaya. Nemam nikakve ideje kakva bi ovo trebala biti igrica. 2 button casual gdje letiš, skupljaš i lagano se zabavljaš sa šaljivim komentarima Josipa Broza koji te potiče da ideš dalje? Možda opaka pucačina kao Luftrausers gdje imaš potpunu slobodu kretanja? Tko zna… to mi osobno ne djeluje zanimljivo. Nisam siguran da ću ja osobno ikad shvatiti ali više sam nego zainteresiran za feedback. Što ti dragi čitaoče misliš da bi Franjo trebao biti? Nemoj se sramiti!

Sve postove o Franju možete pronaći na ovom linku – https://www.binarni.net/tag/franjo/.

Dorade na zmiji

Napokon sam napravio nekoliko dorada na 404 stranici za http://kur.ac/ site.

Za početak, sve je malo usporeno. Igrači su se bunili da nisu u stanju pogoditi tabletu jer im je sve prebrzo. Dodan je zvuk koji daje 8bit ugođaj. Tableta je plave boje sada. Ne znam kako mi to do sada nije palo na pamet?!

Najveća promjena je da se sada treba obraćati pažnju i na testise. Moguće je dodirnuti zid i pogoditi tabletu s njima. Mašala! Treba viditi koliko će, obzirom da je igrica sporija, ovo olakšati igranje.

Igricu možete isprobati na ovom linku.

Remember the sabbath day

remember_the_sabbath

I made a small Python script for checking how many Git commits have been done during the weekend days. It is a simple idea. Only mark the days when commits have been done. Don’t think too much about number of commits or how many changes have been done. It is up to us to interpret the graph, but you apply it on a project which has been going on for a very long time you can kind of read some things out of it.

Look at the picture above. Graph in the top left corner is from a commercial project. Clearly, nobody cares about it over the weekend. Percentage of activity is around 20%, which means that work has been spread proportionally.

Graph in the bottom right corner is from Django repository. More or less this is how all big Open Source projects look like with lot of participants. Work evenly spread over the entire week.

You can find out more here:
https://github.com/aerkalov/sabbath

Importer 3000!

importer3000

Importer 3000 is here! What is it? It could be the most important moment in the history of Booktype! It could be, but in reality it is just a basic upload form I did for testing new ebook library.

importer_basic

And yes, it could easily look like this but would anyone believe me I have spend more then 5 minutes on this task? Can that simple form explain why am I so excited about new ebook library? Probably not and that is why we have Google fonts and shiny colors! If you are trying to present couple of months of research and work you have spend on backend code, try to use them. It can not hurt.

github

 

Booktype developer’s review: The Django Circus comes to

Original post is here:
https://www.sourcefabric.org/en/community/blog/1878/Booktype-developer%27s-review-The-Django-Circus-comes-to-town!.htm

If I only knew how awesome the Django community is, I would have started attending DjangoCons way earlier. This year the European DjangoCon was held in Warsaw from the 15th to the 19th of May and believe it or not, it was in a Circus tent! It was organised by members of the local Django community and they have really raised the bar for the next DjangoCon in France. Because Django is a central programming language for Booktype I decided to go and check the action from this community of developers and aside from learning a lot of cool new tricks I also had an amazing time!

Fun in the sun

The first three days of the conference were organised at the horse track, next to a weirdly big fountain and an old swimming pool. There was only one track at the time and that proved to be more than enough. The tent was open to the outside providing good airflow and easy access to the lectures. It was outfitted with power, WiFI, projectors, tables for those who can not escape their work and even a refrigerator filled with cold water and drinks. During the day people could easily grab coffee, fruit, sandwiches, homemade energy bars, ice-cream and popcorn in the smaller tent. The organisers provided us with hammocks, deckchairs, bean bags, blankets, frisbees, badminton rackets and many other toys. Many times it just felt like we were at a music festival and not a developers conference.

Django experts visit the festival

But it was not just about the food and frisbee. The event was packed with interesting people and projects, and this is what conferences are all about, meeting new people. Russell Keith-Magee (President of the Django Software Foundation), Andrew Godwin (Django and South), Tom Christie (Django REST Framework), Kenneth Reitz (Requests and Python Software Foundation), Steve Holden (Python Software Foundation), Zed Shaw and Aymeric Augustin (Django) were all present, just to name a few.

You could feel the spirit of open source and the Django community at the festival. Everyone was more than friendly and very approachable. I guess all the stories about how the Django and Python have one of the friendliest communities are true after all! The best place to see this was during the last two days of the conference. The coding sprint was organised at the Gamma Factory and the first day it was attended by more than 200 people. Instead of junk food the organisers provided us with more healthier meals. But enough about the food. Members of the Core Django team and developers who have already contributed to Django were more than helpful and patient with the newbies and people who just wanted to help with coding, documentation, testing or sometimes just organising old tickets in the system.

It was a very positive and enriching experience. I encourage you to think about participating at DjangoCon next year or just visit one of the local Django/Python gatherings in your country. You will not know how stimulating it can be until you try it!

As they say, a picture tells a thousand words! Check out the video from the festival.

E-Book Web Reader ~ Rheya ~

info

I had a small coding sprint over the weekend. It would probably be better if I played Minecraft entire weekend but somehow i couldn’t stay still until I put my thoughts into code….

The code is not really representative, I just wanted to check the feeling of using this new Web interface for the books. I have two not fully functional interfaces: desktop and mobile one. I am aware it does not work on Android (the footer), the inner frame do not resize as they should and some buttons do not work. Like I said… just a proof of concept for now. But a proof of concept which has support for keyboard shortcuts and you can change color/text theme. What more do you need?!

mobile_font

But when it is finished… ohhhhh when it is finished! It will work in offline mode, it will support bookmarks, sharing, annotations and many many more things. It can read epub2/epub3 books for now but I will integrate it with Booktype online books when I get some free time.

You can check the code here:
* https://github.com/aerkalov/ebook-web-reader/wiki

Demo books:
* https://www.binarni.net/projects/rheya/metropolis/ (Desktop version)
* https://www.binarni.net/projects/rheya/the-binary-chronicles/ (Desktop version)
* https://www.binarni.net/projects/rheya/metropolis/mobile.html (iPad version)
* https://www.binarni.net/projects/rheya/the-binary-chronicles/mobile.html (iPad version)

Soooo…. what do you think? Would this be a good interface for online/offline books?

Booktype-scrolls: Ubuntu installation

First in a series of screencasts – How to use Booktype-scrolls script to install Booktype on Ubuntu.

Script is smart enough to figure out what needs to be installed on Ubuntu, Debian, CentOS or Mac OS X. You will be informed about every step and nothing will be installed on the system without your confirmation or knowledge. At the moment script works with Sqlite and builtin Python server. That will be changed in next version but for now this is more then enough if you had problems installing it for yourself. You can read more about the script in my previous post – https://www.binarni.net/2012/07/booktype-easy-install/.

For more information check out official installation docs – https://wiki.sourcefabric.org/display/Booktype/Installing.

Styling your book on the Web

As you know, you can use Booktype to publish your books into different formats but you can also view them on the web. In this blog post I will try to show how that web view can be customized with simple template modification. By default Booktype comes with predefined templates but they can all be easily customized to your own needs (templates can also be multilingual).

Let us imagine we are publishing shop “Awesome Sun” who is interested in publishing books about solar power. Booktype project has been installed in /var/www/awesomesun/ directory on our web hosting server. We are not so happy with the default look and feel so we decided to change it. Where should our web designers look at? In the case of “Awesome Sun” template files should be placed in /var/www/awesomesun/templates/ directory while all static files (CSS files, JavaScript files, images, …) should be placed in /var/www/awesomesun/static/ directory. Fairly simple for now. Before doing any work it would be wise to check documentation how to work with Django templates. As you could guess, examples in this blog post are oversimplified.

By default, to present books on the web Booktype comes with Django application called “Reader” and we will customize templates for that application. Original templates for this application are placed in $BOOKTYPESOURCE/lib/booki/reader/templates/ directory and our customized templates will be placed in /var/www/awesomesun/templates/reader/ directory. All you have to do is either copy original template files into awesomesun project and modify them or write new templates from scratch.

What kind of modifications are we making? As you can see on the screenshots bellow we want to have very simple book view, we want our “Table of contents” to be always visible while we scroll the page and we want our header to be fixed on top with name of the book and chapter we are currently reading.

To make it work I created new base template called new_base.html and placed it in /var/www/awesomesun/templates/ directory. This is a base template which other templates for “Reader” application should include. This template just includes jQuery library and creates place holders for future content.


{% load i18n messaging_tags booki_tags %}



{% booki_site_favicon %}
{% booki_site_metadata %}

{% block header %}
{% endblock %}

{% block content %}
{% endblock %}



Then I had to create /var/www/awesomesun/templates/reader/book_chapter.html template file. This is where I include additional JavaScript library, CSS file, display “Table of contents” and content of chapter. Besides HTML and CSS there are just two important things to look at. Chapter content is inserted with {% booki_format content %} and “Table of contents” is inside of variable chapters. It all depends how you want to show your “Table of Contents” but here I am using “for” loop to construct unordered list with chapter titles. Everything else is just CSS styling.


{% extends "new_base.html" %}
{% load i18n booki_tags %}

{% block header %}
{% blocktrans with book.title as booktitle %}/book: {{ booktitle }}{% endblocktrans %}

{% endblock %}

{% block content %}

{% booki_format content %}

{% endblock %}

Essentialy this is how you customize Booktype templates. I have compiled all needed files (with CSS and additional JavaScript) from this blog post here. Please download it if you are interested in more details.