Cronohub: Archive from anywhere to anywhere

Intro Good afternoon folks. Today, I would like to talk a little bit about Cronohub. It’s a Python application which you can use to archive anything from anywhere to anywhere. It uses plugins to archive this versatility. Let me show you some of its features. Main Usage Cronohub is a python application which uses the power and ease of usage of Python to give the user a framework. This Framework can then be used to implement concrete functionality in the form of plugins. ...

March 19, 2019 · 4 min · hannibal

Django – RPG – Part 3

Hello folks. A small update to this. I created the model now, which is the database design for this app. It’s very simple, nothing fancy. Also, I’m writing the app with Python 3 from now on. Here is the model now: from django.db import models from django.contrib.auth.models import User # Create your models here. class Item(models.Model): name = models.CharField(max_length=100, default="Item") damage = models.IntegerField(default=) defense = models.IntegerField(default=) consumable = models.BooleanField(default=False) def __str__(self): return self.name class Inventory(models.Model): items = models.ManyToManyField(Item) def __str__(self): return self.items class Character(models.Model): # By default Django uses the primery key of the related object. # Hence, no need to specify User.id. user = models.OneToOneField(User, null=True) name = models.CharField(max_length=100) inventory = models.ForeignKey(Inventory) def __str__(self): return self.name Worth noting a few things here. The __str__ is only with Python 3. In Python 2 it would be unicode. And the OneToOne and the foreign key are automatically using Primary keys defined in the references model. The __str__ is there to return some view when you are debugging in the console instead of [<Item: Item object>]. ...

April 21, 2015 · 2 min · hannibal

Django – RPG – Part 2

Hello. Continuing where we left off with the Django RPG project. Next up is implementing a rudimentary registration and adding the ability to create a character. Maybe even, design the database through django’s modelling. ...

April 12, 2015 · 3 min · hannibal

Django – RPG – Part 1

Hi folks. So last time, we tried to implement a little RPG of mine using Meteor, which failed miserably. This time we are going to try and use Django. Let’s have at it, shall we? ...

April 10, 2015 · 5 min · hannibal

Small Python GUI to Calculate Lever Distance

Hi folks. Just a small script which calculates your distance from a lever focal point if you know your weight, the object’s weight and the object’s and the distance the object has from the focal point of the lever. Like this: This script will give you D1. And this is how it will look like in doing so: So, in order for me (77kg) to lift an object of 80kg which is on a, by default, 1 meter long lever, I have to stand back ~1.03meters. Which is totally cool, right? ...

April 10, 2015 · 2 min · hannibal

Python and my Math commitment

Let’s talk about plans. It’s good to have one. For example, I have a plan for this year. I kind of like math. So, I have this book: It’s 1400 pages long and basically, has everything in it. It’s a rather exhaustive book. Hence, my plan is to finish the book by the end of 2015 and write a couple of python scripts that calculate something interesting. (2021 Hindsight): Yeah, I didn’t manage this… But it’s a cool idea, let’s see if I can get around coming further. I managed to get until 500 pages or so, before life stepped in. ...

March 15, 2015 · 1 min · hannibal

Sphere Judge Online – Python Kivy Android app – Part 2

Here we are again. I will attempt to further this little journey of mine into the land of Android and Python. This is the second part of the advanture you can read the first one a little bit back. The Script We left off at a point where I successfully configured my environment and compiled my first hello world APK. At that point it took a little bit fiddling to get it to work on my phone. ...

March 2, 2015 · 5 min · hannibal

Sphere Judge Online – Python Kivy Android app

Hello folks. Today I would like to take you on a journey I fought myself through in order to write a python android app, which gets you a random problem from Sphere Judge Online. Then you can mark it as solved and it will be stored as such, and you can move on to the next problem. With the words of Neil deGrasse Tyson, Come with Me! Beginnings When I first embarked on this endeavour I ran into numerous errors, many amongst them being compilation issues when I was trying to install libraries. ...

February 26, 2015 · 4 min · hannibal

Updating All Jenkins Jobs Via Jenkins API – Python

Hello everybody. I would like to share with you a small script I wrote to update all, or a single, Jenkins job from a Python script remotely. This will enable you to update a Jenkins job from anywhere using an admin credential based on a config.xml template that you have. With this, if you want to apply a config change to all or just a single job in Jenkins, you don’t have to go and do it for all the rest. You just call this script and it will cycle through all the jobs you have and update them if the begin with “yourpipelinedelimiter” or if they aren’t in a restricted list of jobs. The delimiter helps to identify pipelines which are dev pipelines. If you have multiple pipelines which are helpers or builders and you don’t usually apply the same config to them, than the delimiter can help identify the dev pipelines you actually want to update. ...

November 7, 2014 · 2 min · hannibal

Python Course Review

Hello Everybody. Today I’d like to write a little bit about a python course I did. It’s an 8 week course on algorithmic programming with fun little projects. I’d like to write down some of my solutions with pseudo code for my own better understanding and for the sake of sharing knowledge. I won’t, however, share full projects since that would be against the honour code. Let’s begin. ...

August 25, 2014 · 13 min · hannibal