Skip to content

Content classified under "Software"

Page 4 of 21

Convert Timestamp to DateTime for Pandas DataFrame

August 8, 2017Categories: Software, Tutorial
To convert a pandas data frame value from unix timestamp to python datetime you need to use: where: timestamp is the column containing the timestamp value unit='s' defines the unit of the timestamp (seconds in this case) You can actually replace the column altogether: Unfortunately, the…

Save Pandas DataFrame as Django Model

August 7, 2017Categories: Software, Tutorial
TL;DR: use bulk_upload coupled with a comprehension to speed up loading. Initially, I started to convert the data frame to a Model object row by row and save it. While easy, it's also arguably the slowest method to load records, because the save() call performs a commit . Then I looked up…

Styling HTML to PDF with iText 2.1.7

July 8, 2017Categories: Software, Tutorial
There are various solutions for producing PDFs from a HTML file, some with excellent results (e.g. ones based on the chrome renderer). Unfortunately, they usually mean adding more dependencies to an existing system. To keep things in check, we've chosen to use iText to generate PDFs. Following the…

HTML to PDF with iText 2.1.7

July 7, 2017Categories: Software, Tutorial
Sometimes you need to use an older version of a product die to e.g. licensing changes. It's my case with iText. While the new version looks fantastic, their changes (and removal of e.g. RTF output) are deal breakers for the feature set we need to maintain. Therefore, 2.1.7 is the most recent version…

Load Templates with Pebble

July 7, 2017Categories: Software, Tutorial
Pebble is a templating engine. It looks particularly familiar to me because I have been using Django . You have access to blocks, include/import features, loops etc. This post is a simple exercise in loading some templates. Prerequisites I've been using Eclipse IDE, but you can use whatever you…

Display a Function's Errors in Oracle

June 30, 2017Categories: Software, Tutorial
TL;DR: Use the power of DBMS_OUTPUT.PUT_LINE , Luke! I've built a function along the lines of: When using the function, I got some 0 results and I wanted to know why. The solution I got was using DBMS_OUTPUT.PUT_LINE : Now, all you have to do is enable DBMS_OUTPUT in your environment and you…

Call an Oracle Function from Spring with CallableStatement

June 29, 2017Categories: Software, Tutorial
Following the previous post , I wondered if there's a more elegant way to call a function. It turns out there is and it's based on CallableStatement : The CallableStatementCreator sets up the statement and the CallableStatementCallback executes the statement and returns the value up to the…

Call an Oracle Function from Spring

June 29, 2017Categories: Software, Tutorial
The easiest way to call a function from Spring is using SELECT . For example, having a function HAS_PANEL_FLAG_OK with two parameters and returning an integer , the function call looks like: This will return all flags for the panels matching the condition. Java Call The query string can be…

Easy Volumio Plugin Development

June 28, 2017Categories: Software, Tutorial
The past few days I've been struggling with building a volume controller plugin for volumio. My initial routine would be something like: edit the source code on a PC zip the code and some node_modules bundled from another plugin load the plugin in volumio This presents several issues: Slow…
PreviousNext

All categories