Posted on Pzt 03 Aralık 2018 in new • 1 min read

When you need a simple dialog to get input from the user or just some piece of information in a GUI dialog, zenity helps. It allows scripts to receive user input by dialog.

zenity --info --text="Merge complete. Updated 3 of 10 files."


Continue reading

Python Data Science Handbook

Posted on Prş 22 Kasım 2018 in new • 1 min read

The book has the chapters on iPython, Numpy, Pandas, Matplotlib and Machine Learning. It looks, it doesn't delve into technical/theoretical aspects but focuses on Python libraries regarding data science.

Github page for the book.

Continue reading

SSH keys for Multiple Accounts in Github

Posted on Paz 18 Kasım 2018 in new • 1 min read

I have multiple Github accounts and some of these are collaborator in others. I don't like to write passwords every time I push, so I set up SSH keys for my accounts. But Github (understandably) doesn't accept a key in more than one account. (Otherwise how can it know?)

But …

Continue reading

Fixing Pip Timeout Problems

Posted on Cum 16 Kasım 2018 in new • 1 min read

For a large package like tensorflow I was experiencing the following error in pip

pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

    v = self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

I noticed the pip has a timeout parameter …

Continue reading

How to convert Numpy image to QImage?

Posted on Sal 06 Kasım 2018 in new • 1 min read

When writing the GUI code in Qt for a deep learning system, a general problem is to convert an image (read from disk or camera using OpenCV) in the form of a Numpy array, to a QImage to be shown in a form or widget.

There are basically two problems …

Continue reading

Query Logging in Databases when using Parameters

Posted on Sal 06 Kasım 2018 in new • 1 min read

We don't construct the database queries using the string formatting due to security problems. SQL injection attacks stem from lack of escapes and building queries from given strings.

We use parameter passing to database engine, e.g.

SELECT * FROM people WHERE name = ? 

and use this query and pass the parameters …

Continue reading

Numpy ValueError while using dlib's face detector

Posted on Prş 25 Ekim 2018 in new • 1 min read

For two days, I was trying to find a bug in my code, because an assertion in the code that uses numpy.max was giving an error like ValueError: zero-size array to reduction operation maximum which has no identity which didn't seem reasonable.

I'm building a face recognizer with dlib …

Continue reading

Static Variables in Python

Posted on Prş 25 Ekim 2018 in new • 1 min read

I'm using this too much in different projects and would like to keep it here.

Python doesn't have C style static variables natively. (Although it supports class variables which can be used for similar purpose in OOP.) However, as the functions are also objects in Python, it's possible to embed …

Continue reading

Development Journal, June 9

Posted on Paz 10 Haziran 2018 in new • 2 min read

I began implementing Ottoman translator using Finite State Transducers via OpenFST. Instead of using ad hoc algorithms to translate Ottoman and Turkish into each other, I'll be creating FSTs.

In the past I have used FOMA and TRmorph, as a building block and basis for Ottoman conversion. However I saw …

Continue reading

Adding version information to executables in CMake projects

Posted on Cum 16 Şubat 2018 in new • 2 min read

In programming, versioning your code files are of immense importance. Most of the files needs to be updated, renamed, merged constantly. You also need backups, as one learns through losing work due to various computer problems.

Another problem that we face is establishing a connection between an executable file or …

Continue reading