Showing posts with label Open Source. Show all posts
Showing posts with label Open Source. Show all posts

26 February 2022

Porting RLE8

I am going back in time (again) and playing with some of my old source code: In the days of MS-DOS, 16 bit operating systems and 640 kB of RAM, I created a whole bunch of MS-DOS utilities and tools, mostly written in Turbo Pascal. In the last 20 years I have only ported a few of them. From time to time I miss one of these old tools - but never miss it enough to invest the time to write it from scratch. Last year I came across p2c, a Pascal to C translator by Dave Gillespie. Oh such joy - and I used it to port my old tools. One tool I used - which I had not created myself - was RLE8 by Shaun Case, Public Domain 1991.

art Moderne (licensed CC BY-NC-ND by Nadine)RLE8
RLE stands for run-length encoding compression. It is a form of data compression in which repeated values are represented by a count and a single instance of the value. It is a very simple form of compression and in the nineties it sometimes reduced disk and memory space significantly. It was used in early versions of Windows BMP for bitmap compression named BI_RLE8: An RGB format that used run-length encoding (RLE) compression for bitmaps with 8 bits per pixel. The compression used a 2-byte format consisting of a count byte followed by a byte containing a colour index. There were versions for 4 and 8 bit image data, RLE4 and RLE8 respectively. "RLE compression was used in the stone-age" as one forum comment reads and today there not much interest in it. The only reference I found was for benchmarking highly optimised code.

Finding the Original Source
Finding the original source code was difficult. It is in the nature of the modern WWW that new pages appear and old ones disappear. Fortunately the RLE8.EXE printed the name of its author and its license: Shaun Case 1991 Public Domain. After some googling I found an article about it, which later turned out to be the contents of the Readme someone had reposted almost ten years later on GameDev. Eventually I found the Retro Computing Archive with its collection of CD-ROMs containing shareware and Public Domain software from the late 80's and 90's. RLE8_SC. Win! (The Retro Computing Archive is great, many of its ZIP files are unpacked and therefore crawled by Google which helped me find it.)

Porting from Turbo C
The code compiled without issues, but included a header I did not have, dir.h, a header from Borland's Turbo C. I guess this is the biggest issue when porting old code - calls to non-standard library functions. I missed fnsplit, a function which split file specifications into component parts. While I could have created the function myself - an excellent opportunity to practice my C - I searched more and luckily someone had created it already. Thank you Robert B. Stout. Robert granted license to use his source files to create royalty-free programs, which RLE8 is. After adding some more of Robert's code, and removing code which was not needed, RLE8 compiled and linked, even with my pedantic settings of gcc -std=c99 -pedantic -pedantic-errors -Wall -Wextra. I loved it. Witness the power of C, a 50 years old programming language, still moving forward.

Download original and modified sources together with binaries for DOS and Windows x86.

29 November 2017

Interview Rea

Palestinians Collect Belongings from Gaza RuinsThe last Coderetreat was one of the rare Coderetreats that I was participating instead of organizing. I used the opportunity to pair with strangers and Rea was one of my partners. We came to talk about the sponsor of the Coderetreat and if she would work for a company offering products in the defence sector. So I asked her to answer my usual questions. These were her answers:

Rea, why did you choose to become a software developer?
I consider myself a beginner in the field of software development. I chose to switch to software development because in this world where computers play an increasingly important role I don't want to be a bystander, but be able to help shape it. I believe that in the near future software development should be as basic a skill as writing and arithmetic.

You said that you would not work for a company in the defence industry. Why is that so?
Call it defence industry or call it arms industry - its goal is to build something that harms or kills other people. Calling it defence industry rather than attack industry is just a euphemism. In the end it doesn't matter who started it. No defence industry is meant do be just passive-defensive. It always includes active attack as well. I don't want to have a part in this. I don't see why some humans should be worth living, while others can be harmed, maimed, crippled or killed at the whim of somebody in an office somewhere far from the actual action. Even thinking that there is a state funded - and therefore tax payer funded - industry that has the goal to kill makes me sick.

What other topics are you concerned about and what do you do about them?
I am concerned about many topics: Microbial resistance, climate change, loss of privacy, growing fear that manifests itself in hatred against others. I am not a politician and don't want to be one. What I do is to think hard about what I, as a single human being, can do, and then take little steps, one at a time. Even if they are not the most comfortable steps. Doing something, as little as it may be, is more valuable than to despair and do nothing at all. "Many a mickle makes a muckle" - I am convinced that each and every little step counts.

To be more specific, I do my little share against climate change, try to reduce waste and emissions, and have a small footprint. Although I have given up being a strict vegetarian (which I was for about 20 years), I eat meat less than once a month. I don't own a car and try to avoid using one as often as possible. I don't think it is necessary to travel extensively, although I really would love to see the world. I just think the harm it does is worse than the benefits I get. I buy locally and seasonally whenever possible. For me, this has precedence over organic food.

I have recently read that the volume of insect biomass has declined by almost 80% in the last 40 years in areas where it was measured, and other areas are likely to have seen a similar decline. This frightens me. Especially as the reasons can only be speculated about, and there is nothing I can do.

I speak up against racism, homophobia, sexism, etc. when I encounter it. I embrace diversity and try to raise awareness in others. I try not to judge what I don't know. Often, its not a matter of 'good' versus 'bad', but just of 'different'.

As for loss of privacy, again, I try to raise awareness. When people tell me they don't mind being under surveillance, I tell them this: You have nothing to hide when you go to the bathroom. But I bet you would rather not have me watch you there. I don't own a smart phone and still resist the urge to buy one. I try to reduce being tracked while surfing the Internet. I don't want a smart TV or any other smart device in my apartment. I still have an email address with Google, this is something I want to change soon. I do quite well without most of social media. And I wonder again and again how much longer I can keep up this retro lifestyle.

Methicillin-Resistant Staphylococcus aureus BacteriaWhat do you consider the biggest challenges for humanity at the moment?
I think bacteria resistance to antibiotics is one of the biggest dangers we are facing. This, combined with today's mobility, is all you need for a ghastly Hollywood movie scenario. I hope reality won't be as bad.

What could we do to engage in topics like meat mass production or pollution? For example, did you take part in public protests, donate money to NGOs or sign petitions?
As to what we can do - see my answer above. Signing petitions with Avaaz is something I did for a while. I realised that doing this makes me lazy in other ways. Signing gives me this feeling of accomplishment, but there is more I can do, in my own vicinity. The best way to fight meat mass production is not to consume this meat. For some people this is a bigger departion from their habits than for others, granted. But if you skip meat once a week, this is better than nothing. Or skip every other day. Or have meat once a week only. Just reduce your consumption. I think the difference in production cost between vegetables and meat should be reflected in the price. Not only the monetary price, but also the price as concerns the ecological footprint.

I have a split relationship with NGOs. I used to support Greenpeace, for example, but don't do that any more. One of the reasons is that I strongly disagree with their campaign against GMOs. Let's not get too deep into this here. But I do support NGOs as such, I think it is important that there are organisations that are independent of governments and other big influencers.

Do you think it is possible to work on "the right things"?
This is not my own idea, and I don't remember where I heard it first, but it had a great effect on me: Thinking about how much good I can do with my own work and how much good can be done with the money I earn, I have to realise that my money can do more than I can. While I would prefer to do both - work a job that matters and give money to others to do good stuff, I am not currently in the position to do so. I find it hard enough to avoid doing things I am not comfortable doing, working for industries I would rather not support. But what I can do is live a frugal life and give away the money I don't need to help others do better things. Again, not because I don't want to get my hands dirty or anything, but because other people or organisations are better suited to doing this stuff.

I wish I could do both: work on the things I believe to be the right ones, and support others to do the same at the same time. But then again, what I believe to be the right things might turn out to be completely wrong. I think it is important to keep an open mind on what the right things are, and change directions in the face of new evidence.

If it happened, please tell the story of your decisions regarding your work because of your values and social responsibility.
I don't remember any such decisions in my short life as a developer. I imagine that they would include security or privacy issues, or issues of inclusion/exclusion of certain groups. Before becoming a developer, I worked at a staffing firm for a very short time. After about a month I figured out how they treated their staff and quit immediately. I did not want to be associated in any way with such business practices. In hindsight I regret not having done more for the staff.

How do you think about selecting industry, customer and project based on your values?
An important choice for me was to work with a company that embraces Open Source Software instead of working for a closed source company. However, the software we produce is not Open Source, which I deeply regret. Choosing the customers I work with directly is unfortunately out of reach at the moment. This is something I aspire to.

Do you have problems with any industries? Why? What about Porn industry or weapon manufacturing?
I don't think porn is bad per se, as long as it is consenting adults working in it. (Of course, more could be said about the gender issues in most porn, but this is not the place and time for that.) As for the industries I don't want to work for: I don't have a list ready. But it is very obvious for me that the weapons and defence industry definitely have place high on that list. I would put animal factories and suppliers on that list too. As a teen I had to work as a farm hand for a few weeks, and was assigned to a small scale chicken farm. Every morning I had to walk through the big hall with all the chicks and collect the ones that had choked over night. Not a good memory.

Cow PortraitObviously, companies that use child labour are out of question as well. I also see combustion engines as a problem for climate change - although there are bigger problems, and worse polluters. Many car companies are looking into ways of making individual transport more sustainable making it a less clear-cut question. On the other hand, I would not want to work for companies in the petrochemical sector. Banks and insurance companies probably get a space on that list as well. And the pseudo-pharma industry that produces and sells pseudo-medicine. I mean those who sell sugar beads or other quackery and convince people they are as good as - or even better than - proper medicine. Any company, basically, that is concerned more with benefits for the few, instead of adding value for the many. Which is, unfortunately, quite common practice.

Did you ever reject a customer based on your values?
As I mentioned in an earlier question, I quit a job I actually needed because of fraudulent behaviour on their side.

On the other hand, what would be projects that you would love to work on?
I would love to work for social and educational projects. I see education as the most important tool to build a better world. Education on all levels, and for all social groups, everywhere. I am convinced that education is the only way to solve the problems we have today. (This is one of the reasons why I don't want to give up my small teaching gig.)

Some branches of research are important too. No future development without research. Not related to any specific project or customer, I find the use, propagation, and development of Open Source Software to be of great importance. Apart from the often mentioned four freedoms, I see it as a means to more equality. I have used and propagated Open Source for a long time, and want to start contributing to it as my next goal.

Thank you Rea for taking the time to answer my questions. (I saw the time of your last email was 1:18 am.)
Thank you, Peter, for the opportunity to think about these topics in a structured way! If anyone has any suggestions, please let me know.

6 August 2012

My Open Source Involvement

My current employer is refreshingly serious about software licenses. For example if an open source library is GPL licensed, it just cannot be used in a product or service offering. End of story. All other companies, I have ever worked for, just did not care. I like being serious about software. But it is not just about using the software, in fact it is about being contaminated with someone else's intellectual property, whatever this might be. To comply with my employer's bureaucracy I have to report my open source involvement and get written permission from my manager. Ok, so let's collect all my active open source projects and list them here as well. Some advertising never hurts.

Open Source Water Bottles
  • It began with PMD (BSD License), a source code analyser for Java, which I used a lot. In 2004 I started submitting patches and later I created my own set of custom rules as Maven module. Unfortunately the new PMD 5.0 is not backward compatible, so I have some pending work to do here. (Source Code)

  • In 2008 I created a system tray notifier to monitor build servers under BSD license. I use it myself and have to create maintenance releases from time to time. (Ah delicious dog food ;-)

  • javaclass-rb is a Java class file parser in Ruby. I created it in 2009 and I there is a small release once a year. Although it is not finished, it is particularly useful to analyse custom Java code. I hope that I will have some time in the future to describe it in detail.

  • Since last year I am organizing Hackergarten Vienna. Hackergarten is a craftsman's workshop, a classroom, a laboratory, a social circle, a writing group, a playground and an artist's studio. We meet once a month and work on Open Source. During this time I have submitted patches with working code to Commons Exec, Castor, Commons Email and JMeter (all under Apache License).

  • My latest project is BaDaDam, an experimental BDD framework for Java. It allows you to write stories in plain text, implement them in Java classes and just run them using JUnit. Some people from Hackergarten have helped me with contributions.

  • Occasionally I submit pieces of code to Rosetta Code, a programming chrestomathy site.

13 September 2011

Getting Started with Hackergarten

Hackergarten is a computer programming contributor group. Read more about Hackergarten here. To join the group either find an existing Hackergarten near you, or start your own. This is a step by step list of what I did when I started Hackergarten Vienna.

The Simple Way to Start a Hackergarten
  1. Contact a few people that might be interested.
  2. Find some Open Source committers and the smallest tickets/ideas to implement from their projects. Usually committers are short on personal time anyway and will love to find someone who is willing to help.
  3. Ask them to create a list of possible things to do in advance and publish it. Maybe have a theme for a night.
  4. Determine the preconditions (what is needed to code...) and publish them, so people are able to instal before.
  5. Find a place with wireless network. Most likely this is the office of a small company, e.g. Canoo or Sphinx. You might also find some pub with a separate room/wireless for no charge.
  6. Negotiate a proper date and time. At least for the first time. Then having a fixed time, e.g. first Tuesday each month is probably the best.
  7. Meet.
  8. Discuss the agenda for max. 15 minutes, do not discuss too long.
  9. Have food and drink ready so people do not have to leave for it.
Read the Hackergarten FAQ for further details and what to avoid.

What to Do
There have been all kinds of contributions made during a Hackergarten. Here are some general ideas what to do during a Hackergarten:
  • Fixing an outstanding ticket (bug) in project X, submitting a patch.
  • Writing Javadocs/doc pages for project Y.
  • Building a plugin for project Z.
  • Making screen casts showing how you can integrate W with Q.
  • Writing a new feature for project P.
  • Create a kata cast.
Also everything applies from Ways to Contribute to Open Source without Being a Programming Genius or a Rock Star.