Feeds:
Posts
Comments

Archive for the ‘Software Development’ Category

Sure. As told on the Zappa webpage:

Zappa makes it super easy to build and deploy server-less, event-driven Python applications (including, but not limited to, WSGI web apps) on AWS Lambda + API Gateway. Think of it as “serverless” web hosting for your Python apps. That means infinite scaling, zero downtime, zero maintenance – and at a fraction of the cost of your current deployments!

That’s less revolutionary than Frank Zappa, of course. But it might come in handy, once I find the time to do some real Python development… Then again, you will probably beat me to it!

Advertisements

Read Full Post »

We’re six years later, and I still haven’t gotten around to any kind of “Tinkering With The Raspberry Pi“. That does not mean that I still have to write down the production numbers from our solar panels by hand, however. The Asus eeePC, running Xubuntu and a bit of software a former colleague of mine and I hacked together, takes care of that. In doing so, it constructs a number of text files: one for each day, listing the current production in Wh every ten minutes, and one for each year, detailing the total production for each day. The backup of these files is made every day by a tool called ‘grive2‘ (but I’ll write about that later).

The setup works fine, almost all the time. But somehow the SMA Sunny Boy gets confused and creates ‘yearly’ files for years other than the current calendar year. Those files are utterly useless and clutter the hard disk as well as the backup, so I decided to get rid of them automatically. To prepare for the first days of a new year, the script should also be able to leave the file for the previous year in place – there may be two valid ‘yearly’ files in January, should I fail to archive the old year on New Year’s eve or on Jan. 1st.

To exercise my *nix shell skills, I decided to do that in ‘bash‘ rather than extend the current Python tools.

As is my habit, I decided to start with a demo script that does what I want on dummy data. For demo purposes the JDoodle website is a great resource, at least for ‘bash’ scripting (I did not try any of the 67 other languages available on the site). This allowed me to work on the code on my Mac-with-big-screen, and take the necessary screenshots for this post.

Here is the code I came up with:

Click on the image to get it in the form of a PDF file,
ready for copy/paste operations.

Nothing spectacular, as shown by the output. Now all I have to do is turn this into a little non-demo script and add it my crontab on the eeePC… Come and see in six years or so ;-)

PS. I’m just dabbling in bash scripting, so if there are better solutions for my problem, don’t hesitate to explain them to me, please.

Read Full Post »

The SD Times website writes up the state of affairs on Free and/or Open Source Software: Open source at 20: The ubiquity of shared code. Even after 20 (or more) years, the situation isn’t always clear, certainly not for new developers. So this article is a good start if you’re new to software development.

In the year 2000 I compiled on the Free Software page in this site. I’m pleased to see that the texts and sites on the page are still relevant. Only two sites disappeared (linuxppc.org and opensourceit.com); the rest is still thriving and relevant! Well, except for the link to Reddit – still a remarkable site, but no longer just for FOSS fans.

A landmark paper about Free and Open Source Software

Read Full Post »

The BoingBoing website pointed me to the Programmer’s Oath. Good initiative, and I do agree with every one of the items.

As usual, of course, my mind started analysing the text, and soon concluded that 8 of the 10 tenets are not specific to programming, but could be applied to any profession! And tenets 2 and 6 don’t need big changes to make them more generally applicable. So what user Widdershin came up with is the base for moral behaviour that all humans could/should fulfill.

Well, being cynical at times just like anyone, I should perhaps exclude politicians…

Read Full Post »

I noticed some interest in my earlier posts about ntlmHTTP, and that surprised me a bit. I wrote about the subject in 2011, and that is a long time ago, in IT terms!

So to clarify things: the ntlmHTTP project is no longer required: Adobe added NTML (aka. “Windows Integrated Authentication”) support to the CFHTTP tag in ColdFusion version 11. I did rework my code from 2011, and indeed: CFHTTP did suffice to call the Microsoft Exchange web services successfully with the credentials of a special technical account.

Although I did not test it I’m pretty sure NTLM is still there in later CF versions ;-)

Read Full Post »

Considering the number of mobile apps dedicated to the subject I know I’m not alone in wanting to know the fuel consumption of my vehicles. Like my father, I have been doing that as long as I have driven motor vehicles on two and four wheels. Since 2013 or so I am using AndiCar (on Android): it has the features I want, and it’s a piece of FOSS (Free and Open Source Software). Keeping an eye on your fuel consumption is always a good idea, since a rise in numbers can be the first indicator of a problem with your vehicle.

When we bought a bi-fuel car, however, things got complicated. In November 2017, as far as I could tell, there were no apps that had full support for “hybrid” or bi-fuel vehicles. I had no choice but to start experimenting a bit, and I settled on testing an app called Fuelio as a possible alternative for AndiCar. I won’t do a complete comparative review of these two: let me just explain that AndiCar is faster for data entry (at least in my situation: I enter the data in the evening or in the weekend, when I’m at home, not in the gas station), and Fuelio is the better looking app.

Some of the statistics available in the apps I mentioned (AndiCar on the left, Fuelio on the right). The numbers do not correspond because the periods are different, not because of errors ;-)

So I mailed Miklós, the author of AndiCar, explaining my situation. I probably wasn’t the first one to mention the “multi-fuel problem” to him. Nevertheless I’m quite impressed with the fact that six weeks later he already published a new version of AndiCar that allows detailed data entry for hybrid vehicles like mine. To top it off, he also mailed me to tell me about the new version!

One of the advantages of AndiCar is that it allows you to define your own fuel types. I actually use three types of fuel, since we have two types of CNG in Belgium: low caloric content (L) and high caloric content (H) gas. AndiCar is perfectly capable of handling that.

As a happy person I simply had to respond to Miklós – here’s the code of my mail:

Good work, man! You impressed me with the speed with which you implemented the support for alternative fuel vehicles. I’m not just giving you last version “a look”: I have copied all the fill-ups of my new car into AndiCar, of course.

For the moment I will continue to compare AndiCar with Fuelio, if only to get a feeling for what might constitute a good solution for the “fuel consumption/efficiency calculation” issue, as you call it. The Fuelio solution is not good enough: it just uses the distance between the two latest fillings for that type of fuel. But that results in silly numbers when driving most kilometers with one type of fuel, interspersed with an occasional fill-up of the alternative fuel (and that’ what I try to do: run mostly on CNG because it’s cleaner, just switching to petrol when no CNG is available).

What is probably needed, is a system whereby it is possible to indicate for each fill-up whether it can be used for a consumption calculation based on the previous fill-up of the same fuel type. Or perhaps an extra odometer field ? Or …? I realise that my situation is different from that of people with electric hybrid cars: my g-tron runs on CNG as long as there is enough of it in the tank, and switches to petrol with an explicit warning the moment that switch happens. In e-hybrids the rules are completely different, and I have no ideas about how AndiCar (or any other app) could support such calculations – I suppose those cars can do it themselves ;-)

Oh well. I’m already quite happy with the work you’ve done, so thanks again!

PS. I ran into one issue when entering my fill-ups in AndiCar: trying to “convert” an existing entry to the new fuel type and UOM crashed the app (I tried it several times). But of course, deleting the existing entry and reentering the data in a new entry solved the issue, so no real harm done.

If only all software makers would be so friendly and so quick to react to their users!

Read Full Post »

At work I’m busy moving all the ColdFusion applications from Windows 2003 servers with CF8 to new virtualised servers with Windows 2012 running CF11. Configuring Windows and IIS are also much more complicated than ten or more years ago, but we have that under control now. Most of the ColdFusion (and Java) code transfers without a problem, and I spend more of my time deleting scripts and components that are no longer used than modifying code.

Until this week, when I stumbled over a script that shows an inventory of the active Scheduled Tasks on the server, together with the link to their respective output (which we write to a network drive)… To do that, the code gets the data from the file, and then we put all the data in a handcrafted Query object. The names of the tasks and the links displayed fine, but there was something wrong with the start and end times: “1899-12-30” is not a time!

It took me hours to figure out what was wrong, because I was focusing on the date and time formatting functions used to format the data before adding them the query. Why the formatting, you ask? Well, we wanted to sort the data on columns containing start and end times, and in previous versions of CF our solution was to prepare the strings before adding them to the Query – seemed like a good way to make sure that ‘11:00:00 AM‘ and ‘11:00:00 PM‘ turned up in the right place of a sorted column.

So what was wrong with our code? Let me quote the “Query of Queries user guide”:

If you create a query object with the QueryNew function and populate a column with date constants, ColdFusion stores the dates as a string inside the query object until a Query of Queries is applied to the query object. When ColdFusion applies a Query of Queries to the query object, it converts the string representations into date objects.

Our code added strings formatted as “hh:mm” to the Query object, but once we filtered or sorted that Query using QoQ those columns were transformed into datetime objects. ColdFusion 11 then adds that time to the default date used, i.e. “1899-12-30“.

Clearly, that was not the case in earlier versions of ColdFusion – at least not in CF8. There are multiple solutions to solve this problem, once you know what’s going on – so now our overview displays everything as intended.

Read Full Post »

Older Posts »