How to resolve TensorFlow 2.0 Error – Could not load dynamic library ‘cudart64_100.dll’

Recently I came across an issue while building ANN with TensorFlow 2.0, where IntelliJ complained about not being able to load the dynamic library ‘cudart64_100.dll’. The below instructions outline the approach for fixing the issue and would apply also to errors that refer to other NVIDIA GPU Computing Toolkit dynamic libraries, such as cufft64_100.dll, cufftw64_100.dll, cuinj64_100.dll, nppig64_100.dll, nppim64_100.dll, nppist64_100.dll, nppisu64_100.dll, nppitc64_100.dll, npps64_100.dll, nppif64_100.dll, nppia164_100.dll or nppicc64_100.dll, all of which are part of the older version of CUDA platform for general computing on graphical processing units (GPUs) developed by NVIDIA . [Read more…]

Python: How to Create/Edit Windows Registries with Python 3.7

Just a short demo of how to go about creating/editing of Windows registry keys by using Python. This should be trivial, but as a matter of fact, not that many examples I could find online were working with Python 3.7. Below code should be pretty self-explanatory. Anyways, to put in in good use, let’s disable Cortana Assistant in Windows 10. If you have any questions about the process, just text me below.

[Read more…]

Visualizing JPEG Exif using Python: How to convert JPEG Meta-Data into Excel Travel Log and Google Map of All Visited Places

Over the past 20+ years, my family took tens of thousands of photos while visiting countries all around the world. As the years went by, the total number of stored images seems to grow every time we travel and even though we organize our images, sometimes it’s hard to recall when (exactly which year and month) we visited a specific place. Thinking about it, I realized that nowadays most photos are captured on smartphones or digital cameras that come equipped with GPS and automatically geotag each photo with GPS coordinates, as well as date and time of each image capture. That said, it shouldn’t be hard to convert the Exif information stored inside photo meta-data into easily readable Excel Travel Log, or too complicated to create a Google Map of all places I ever visited.

[Read more…]

How to create a spell check enabled MySQL query by leveraging SOUNDEX and Levenshtein Distance algorithms

Recently I came across a situation where I needed to perform the MySQL search in such way, that it would account for typos in user search queries. For example, if the database of words in MySQL contained only the word “assistance” and the user typed the misspelled word “asistence”, I had to be able to return the correct word “assistance” as a closest possible suggestion from the database. It seemed like a trivial task at first, but it took me quite a while to figure the SQL query that had a good balance between performance and overall quality of results. [Read more…]

How to use Python global keyboard hooks (& SQLite) to automatically add foreign accents to any text typed in Windows/Linux

The following article presents the programming solution to automatically add the diacritics to unaccented words typed using a regular English keyboard. There are solutions for Chrome browser or Firefox, but I wanted to have this option everywhere, in any program on any OS. Hence I decided to code it in Python. In this short article, I demonstrate how to use global keyboard hooks and SQLite database in Python to automatically add Slovak accents (diacritics) to text typed to any program running under Windows or Linux. This example can be easily used to adjust the program to any other foreign language. [Read more…]

How to query and visualize Apache logs in Splunk with Python

Splunk Enterprise is presumably one of the best platforms for gaining real-time intelligence from data. The following short tutorial explains how to install Splunk server (on Windows or Linux server) and how to use Python to programmatically query Splunk and visualize Apache data by plotting them on a graph by using the Matplotlib library. In this post, show step by step, how to add Apache logs to Splunk, and illustrate how relatively easy is to use Python to query how much bandwidth was consumed by one of my websites (in the past week, in megabytes). [Read more…]

Python Tutorial: How to create a Python GUI using Tkinter

The following is a short article on the basics of creating graphical user interfaces (GUI) in Python by leveraging Tkinter (interface to the Tk GUI toolkit). We’ll cover fundamentals such as creating a brand new window, centring the window on the screen, sizing it to desired dimensions, as well as giving the window a title and configuring it with its own icon. We also cover the basics of placing a new label and button on the window and wiring a new function that changes the text of our label with each button click. [Read more…]

Python Tutorial: How to Read-Write Excel Files, Web-Scrape Google and Create Interactive Maps in 20 lines of Code

The following short article shows just how simple it is to use Python programming language in a data science project. In this example, we’ll first go to (public dataset provider) and download the MS Excel dataset that contains the list of 100 largest companies in the world. The file contains only two columns, the company name and their current market value. Our goal is to use Python to read the rows and cells inside the Excel file and use it to search the internet for some additional information, such as the company’s headquarters location and it’s map coordinates (latitude and longitude). You’ll see how easily this can be done by using Python web-scraping capabilities. We’ll also show how to write the newly found information back into the Excel sheet and use it to create an infographic that shows the headquarter location of 100 of the world’s top companies on the map.

[Read more…]

Converting UTZOO Usenet archive from magnetic tapes to MySQL database using Java

Recently, I came across a post from 2001 which allowed downloading the entire collection of UTZOO NetNews Archive of earliest USENET posts. These were essentially the earliest available discussions posted to the Internet by folks working for various Universities connected to the Internet. Millions of posts created between Feb 1981 and June of 1991.

Until 2001, these early Usenet discussions were considered being lost, but miraculously Henry Spencer from the University of Toronto, Department of Zoology was backing it up onto magnetic tapes and kept them stored for all these years (apparently at the great cost).

H. Spencer had altogether 141 of these magnetic tapes, but there were of no use, so eventually, him and a couple of motivated people such as David Wiseman (who dragged 141 tapes back and forth in his a pickup truck), Lance Bailey, Bruce Jones, Bob Webber, Brewster Kahle, and Sue Thielen; embarked on a process of converting all of these tapes into regular format, accessible to everyone.

And that’s the copy I downloaded. What a treasure, right?

Well, not so fast, once I unzipped the data, I realized that the TGZ format contains literally millions of small text files (each post in its own file). While it was certainly nice to have, it wasn’t something that I or anyone else could read. Certainly not in a forum like discussion format, it wasn’t obvious which post is the one that starts the discussion or which ones are the replies to the thread. And forget about searching through these files, that was utterly not possible. Just to put things into perspective, it took me over 5 hours to just unzip the archives.

That said, it didn’t take long for me to decide to develop a Java-based converter that would attempt to convert the entire collection from millions of flat files into a fully searchable MySQL database. The following post talks about the process and also includes the Java code of the solution released as open source.

[Read more…]

How to take screenshots using Flameshot in KDE Plasma Desktop (Ubuntu 18.10) and associate it with the PRINT (PRT SC) keyboard shortcut

As SnagIt currently doesn’t support Linux, the Flameshot is likely the only screenshot taking utility worthwhile to consider if you’re a Linux user. Here are step by step instructions on how to install Flameshot under Kubuntu KDE Plasma Desktop and also how to associate it with the PRT SC button.

[Read more…]