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

Coursera Deep Learning Specialization Notes

Posted on Sal 30 Ekim 2018 in new • 10 min read

These do not contain answers to quizzes or assignments per Honor Code. If you are looking for those, look elsewhere.

Binary Classification

Given a picture, classify it as cat or non-cat. The result is \(\hat{y} = P(y=1 | x)\). In other words, given \(x\), we calculate the probability that …


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

When `y` and `p` commands in IdeaVim doesn't work

Posted on Çrş 14 Şubat 2018 in new • 1 min read

I began using IdeaVim plugin for Android Studio, some time ago. It's nice, but as a Vim newbie, I wasn't aware that Vim doesn't use system (Windows, macOS, XWindow, etc.) clipboard for copy/paste by default. So when you use y command in IdeaVim, it doesn't paste to other applications …


Continue reading

The Sorry State of NDK testing in Android

Posted on Prş 08 Şubat 2018 in new • 1 min read

I'm writing a C library to use in Android, iOS and Python applications. Although the C library has its own unit tests, I wanted to write a few more to ensure that data transfer between C and Android layers are correct.

In Android, one needs to put unit test files …


Continue reading

Regular and Recurring Tasks in todo.txt

Posted on Sal 06 Şubat 2018 in new • 1 min read

I'm using todo.txt format to keep some of my daily tasks. It's a plain text format and both iOS and Android has apps, like SimpleTasks. Emacs and Vim has support for the format too. Actually you don't need a special editor for it, the format is so simple that …


Continue reading