I am very impressed by the #raspberrypi 3

After losing patience with my cubietruck, I decided to buy an RPi 3 (Raspberry Pi 3). I bought the “official” kit, which included a nice sleek black case, the RPi 3 itself, a power adapter and the noobs uSD (micro SD card) installer. On Amazon, people had reported problems with the uSD card. I did not have any problems, so I assume that they have ironed them all out. The kit cost £47 altogether. Try buying an Intel PC for anything like that price!

I noticed that the RPi 3 is dramatically faster than the RPi 2. The performance enhancements seems to go far beyond what a comparison of the raw specs of the machines might imply.

My comments on the hardware:

  • power adapter. Yes! Finally! We now no longer have to mess around with using a powered USB hub and attaching devices to it. That’s a messy solution. The RPi 2 could not even handle a pen drive plugged into its USB ports, making it considerably inconvenient. RPi 3 fixes that issue.
  • 4 USB ports. This enables me to use a laptop SATA drive as a root partition, using 2 USB ports (one for power, one for data), with spare ports for the keyboard and mouse, should I want to use it that way.
  • HDMI. OK, that was in the RPi 2, too. HDMI is better than DVi because I can get the audio coming out of my telly, rather than have to attach separate speakers.
  • Wifi on board. I would not say this is a “fantastic” feature, but it did allow me to ditch the requirement of an ethernet cable. So, again, one less item of clutter. Setting up Wifi was trivial, too. I just typed in my Wifi password, and I’m good to go.

It should also be noted that Raspberry Pi has considerable momentum and a large developer community behind it. This is important, because it means that things just work better, support is wider, and you have more community backup if you run into problems; which happens less often anyway because of the extra design work.

The thing about the RPi compared to potentially competing products is that the former is more “thought through”. Other products, which typically come from China, seems to be a bit “wobbly”. The cubietruck, for example, has a SATA drive, but the power draw means that you have to start hooking extra sources to the board. The latest kernel doesn’t support the NAND device, which is a considerable inconvenience. Booting is a bit of a mess, too. For some reason, I couldn’t get network working when I booted from SATA, even though it seemed to be OK from the uSD card. You run into a lot of these kinds of “chicken and egg” scenarios when you opt for less popular boards.

So I would definitely recommend the RPi over similar solutions. That’s not to say that you should never consider other vendors, Perhaps a Beagleboard, or whatever, which costs less, is more of an appropriate solution for your particular project. The point being is that they don’t occupy the same “solution space”.

I notice the noob card comes with Windows 10 IoT. It’s something I might have a play with. I would be interested in seeing if I could set up a media centre using it. If memory serves,  Windows 10 does not include a media player, though. If so, then Microsoft should probably rethink that one.

So basically, the RPi 3 gets 5 out of 5 stars from me. It is British engineering should be about! Well done to the team that designed it.

 

rpi.JPG

Advertisements
Posted in Uncategorized | Leave a comment

Magic Hat – CCT stays in

CCT was due to exit by rotation, but as it still passes the Greenblatt screen, it stays in.

Sorry for my terseness, but I am quite busy right now.

Stay safe out there.

Posted in Uncategorized | Leave a comment

Taking #AROS for a spin

AROS is a free open-sourced clone of the Amiga OS, primarily targeted at Intel chips. It is also available for the RPi (Raspberry Pi), but is hosted on Linux, and you need to pay for it. The RPi is an obvious target for AROS on account of its cheap and stable hardware. Other architectures are also supported.

I tried out AROS’ latest release from May 2017 for the x86: Icaros v2.2. It is a gorgeous-looking system with a much greater visual appeal than the original Amiga OS.

Sadly, development progress limps along due to the dearth of programmer interest. AROS was conceived around the same time as Linux. I would not be able to say whether AROS is more popular now than it was a decade ago. The project is still alive, though, and interest seems at least stable.

AROS is a great source of nostalgia to me. I bought an Amiga A600 in 1993 when I was doing my Masters. I created an application for it in 1995 called “etb”. It created an extended trial balance from a set of financial transactions. It is still available on Aminet. I updated the program in 2005, and I am thinking of updating it again for old time’s sake.

It is a C program of nearly 1000 lines. Considering the simplicity of what it does, 1000 lines is too much. I wrote a different financial application for Linux in 2700 lines of C++ code. Although larger, the program does considerably more. It handles share portfolios and downloads recent share prices from Yahoo Finance, for example. It can output files for John Weigley’s Ledger program and create portfolios that can be uploaded into Stockopedia, amoungst other things.

AROS has a version of Python from 2008, which could simplify the amount of code needed considerably. However, AROS also includes the GNU C++ compiler. Although it is severely lags behind the current version of GCC, a cursory test showed that it is likely to be a near-complete implementation of C++11. That’s great!

One problem that dogs AROS is the diffusiveness of the development tools. On the one hand, one could develop on Linux and cross-compile to AROS. Alternatively, one could work with AROS natively. I am inclined to go with the latter option, as it is easier to use, and tools are already in the distribution.

The big downside to this is that AROS doesn’t have a “bash” shell. So you cannot easily compile GNU programs. This also seems to be a generally similar problem with the programs on Aminet. Their binaries will not work on i386 architectures, and the build process is unlikely to work out-of-the-box. So a porting effort is still necessary.

AROS is definitely cool, and fast, but I don’t think that there are sufficient pieces in place for it to reach a critical mass. Not yet, anyway. AROS is prone to the occasional crash, but for me it is not a deal-breaker in terms of usability. I will probably do what most people will do with AROS though, which is to say play around with it, say “Wow, this is really cool,” but then go back to doing whatever it is I was doing before I started tinkering.

I have AROS set up in a VM on Windows. The internet works, but sound does not. I have also copied AROS onto a pen drive, so that it runs completely natively. Unfortunately, the internet does not work on my regular PC due to lack of drivers. This makes it unusable in that form, as I have no way of transferring files on or off the system. The instructions did suggest putting two partitions on the pen drive, with one of them being FAT. However, I could not get such a system to boot. It is possible that with more experimentation I could get such a system to work.

The pen drive works quite well on my ASUS VivoPC system. Internet works, but sound does not. The lack of sound is obviously going to limit AROS’ appeal as an OS. I think that sound can work, but it requires a specific sound card. For nearly everyone, then, there is no audio.

Virtualising AROS, or using a host OS is the most likely way to have AROS working at its best. However, I think that most people, like me, are going to think that whilst it is cool to see AROS working, it is difficult to see how it complements their native OS.

I do not want to disparage the AROS project, though. I think it is a great and cool project. I really want it to succeed. The developers of AROS deserve many kudos for their efforts. If they could crack the problem of creating a native version for the RPi that was easy and free to install, then I think that they will achieve a significant uptick in interest in the project. RPis’ can be bought for bobbins, and be used realistically as dedicated systems.

The main website for AROS is here: http://aros.sourceforge.net/ . I have written about configuring the system, and setting up an FTP client-server system here: http://www.markcarter.me.uk/aros.htm

Go check it out!

Posted in Uncategorized | Leave a comment

elvish shell

I decided to give the elvish shell a try today. Elvish is a shell written in golang, designed to be more expressive than bash.

Bash drops just short of being a programming language. For example, it doesn’t do floating point arithmetic, which is a nuisance. Elvish does, though.

I set myself a little task: write a program which reads from standard in, prints the number of lines read, then prints the input. It’s an interesting task because it must cache the input.

Here’s what I cam up with in elvish:

#!/usr/bin/env elvish
contents = [(cat )]
echo (count $contents)
for line $contents { echo $line }

Here’s the equivalent I write in awk:

{
 i += 1;
 line[i] = $0;
}

END{
 print i;
 for(idx=0; idx<i; idx++) print line[idx];
}

As you can see, elvish manages the same thing in less than half the number of lines.

Here’s my C++ version:

#include <iostream>
#include <string>
#include <vector>

int main()
{
 std::vector<std::string> lines;
 std::string line;
 int nlines = 0;
 while(std::getline(std::cin, line)) {
 nlines++;
 lines.push_back(line);
 }

std::cout << nlines << "\n";
 for(std::vector<std::string>::iterator it = lines.begin(); it != lines.end(); ++it)
 std::cout << *it << "\n";

return 0;
}

That’s 20 lines of code.

Here are the timings of running the scripts:

time awk -f count.awk <derive-2.txt >/dev/null
real 0m0.067s
user 0m0.004s
sys 0m0.002s

Although there are some odd timings:


time awk -f count.awk <derive-2.txt >/dev/null

real 0m0.006s
user 0m0.003s
sys 0m0.002s
$time elvish count <derive-2.txt >/dev/null

real 0m0.052s
user 0m0.025s
sys 0m0.011s
time ./a.out < derive-2.txt >/dev/null # c++ version

real 0m0.006s
user 0m0.004s
sys 0m0.001s


Awk seemed a little inconsistent in its performance. I’m not sure what’s going on there. It looks like Awk can be a real speed demon, and I’ve even seen it run a little faster than the C++ code. Those Awk guys certainly seem to know how to optimise stuff.

Elvish is certainly worth checking out. I’m not sure about its runtime speed, though.

Posted in Uncategorized | Leave a comment

A s-expr interpreter in #cplusplus

I have been working on my interpreter, and switched from parsing BASIC to parsing s-expr. The code is available on github. It’s crude, to be sure, and the inputs are fixed, but it does handle parse trees.

You can define variables, and it has a single arithmetic operator: addition. It’s really just a proof-of-concept. It’s quite a large amount of code, at just over 450 lines. I would really like to reduce the code base.

My goal is to come up with a kind of “pre-Scheme”, a language from which parsers can be created. I had planned to make the functionality extensible, but so far I have hard-coded the funtion definitions into blang_apply(). I am confident that the code could easily accommodate my proposed modifications.

The main class is “cell”, which holds a variant type. I actually used the C++ 2017 variant type at one point, but I couldn’t figure out how to set a value. I have abandoned that representation, as I grew frustrated with trying to make it work.

One thing I notice about C++ is that I often find that “some hammering is required”. Sum types (aka algebraic data types) fit naturally into Haskell syntax.  C++ seems to require a lot more effort.

This is an interesting philosophical question: should C++ by expanded by classes, or by syntax extensions? Classes certainly have one big advantage: you don’t need a new compiler. But they do have the disadvantage in that syntax can be easier to work with. After all, if product types are part of the language, then why not sum types?

Regardless of that, I now think my cell class is too unwieldy. Just as I planned to have a plug-in functions, I now think it is a good idea to have plug-in types.

One approach to types would be to use C++ class hierarchies to achieve polymorphism. I think that is the wrong approach, though. That would make it more difficult to extend dynamically. I prefer the idea of having “slots” for construction and destruction.

The current implementation keeps with the tradition of its previous incarnation as regards to deterministic garbage collection. No garbage collector is necessary.

Posted in Uncategorized | Leave a comment

Magic Hat – HVN stays in

The MHP (Magic Hat Portfolio) on Stockopedia (http://www.stockopedia.com/fantasy-funds/magic-hat-463/) is an experiment by me to see if a human can improve on a mechanical Greeblatt Magic Formula screen. I am trying to weed out “mistakes” that I feel the screening commits: unseasoned companies, scams, foreign companies (particularly Chinese), fishy accounting, and statistical quirks. Apart from that, I am agnostic as to the sector the company operates in, although I will try to avoid heavy concentration in any one sector. I will mostly apply “Strategic Ignorance”, by which I mean that I wont try to be clever in my stockpicking. My picking will be mostly mechanical. A summary of most of my Magic Hat articles can be found on the web page http://www.markcarter.me.uk/money/greenblatt.htm This will allow you to see, at a glance, what shares have been bought and sold in the past, as well as what shares have been rejected from consideration and why.

HVN is due to be ejected from the portfolio by rotation, but seeings as it still meets with the Magic Formula criteria, it stays in. It has a StockRank score of 98, also making it a keeper. The company has returned 27% since holding it a year ago, which is a very nice return.

The Magic Hat portfolio has come off the boil since May 2017; a phenomenon which I feared would happen.

Stay safe out there.

Posted in Uncategorized | Leave a comment

Arch Linux vs Slackware vs Others

Slackware was the first distro I installed, from a book, in the early 90’s, when I was studying for my PhD. In the latter half of the 90’s I had installed Redhat.

For everyday use, I use Windows, because things like my webcam and Yahoo Messenger Just Worked. If I was feeling a bit UNIXy, it was always possible to resort to cygwin.

I mostly pootled along that way until I discovered the Raspberry Pi, whereupon I decided to run a webserver from home on it. I fiddled around with the hardware, bought a cubieboard, and then a proper computer: an ASUS. The ASUS was pretty cheap. It came with Windows 8, but with no install disk, alas.

I tried Windows 8 for all about 30 minutes, and concluded that it was as bad as everyone said it was. That’s when I decided to zap the hard drive and install Arch onto it. I had some experience with Arch before, which gave me problems, for one reason or another.

I knew that my server would be dedicated to Linux, so I did not mind that I was erasing Windows 8.

This time, I had no problems with Arch, and I have been using it on my server for over a year. My conclusion: it’s the best Linux OS I have used. Despite being rolling release, it has been very stable for me, and much more stable than other systems.

On my main desktop, I have mostly been using Windows 7, with the occasional dual-boot to whatever I happen to want to experiment with. I have used a number of Linux systems in the past, including the *BSDs.

I usually dual-booted onto some flavour of Ubuntu; either the main distro, or Lubuntu. I tried out the most recent version of Ubuntu to see what all the fuss was about regarding the GNOME desktop.

To me, GNOME is unusable. It seems to require an unwarranted amount of movement, with no particularly good way of arranging windows. It you’re a developer, you need to have ready access to a large number of windows, and GNOME doesn’t seem to accommodate that kind of layout.

I was irked enough that I decided to try Slackware again.

My general comparison of Arch vs Slackware:

  • I love the breadth of packages available for Arch, and its dependency management. Slackware is clearly inferior in that respect … BUT … having said that, Slackware has two mitigating factors: 1) alienbob provides some pre-built binaries, and they’re for some really useful software like vlc, blender and libreoffice, and 2) failing that, sbopkg fills in many gaps. I discovered the tool ‘sqp’, which can build a queue containing all the dependencies. This is excellent, as it means I don’t have to fark around manually installing the dependencies. The dependency chain can be quite long for some of the more involved packages. Now I don’t have to worry about it. For software that is not in sbopkg, I can download the source and compile. This is not so bad, because software in this category tends to be at the periphery, where the dependency chain is not so big as to be onerous. Arch still wins, but I now feel that Slackware is able to make an adequate showing.
  • I am not a “ooh shiny” kind of guy, but I think that the newness of Arch software is a net plus. People’s mileage is going to vary on this. Some won’t like the size of the updates, and some won’t like the potential stability issues. Also, personally, I am keen to develop in C++17, so I am always itching to see what’s in the latest GNU compiler. Contrariwise, I think Slackware is great for testing your releases, as it is somewhat older, and you can check for compatibility issues. So it’s a win for Arch for me.
  • systemd … Slackware wins by not having it.

So, generally, I prefer Arch, although I think Slackware is an adequate second. I intend to dual-boot into my Slackware distro more often, and I would say that my opinion of Slackware has actually increased in the last week.

As to my opinion on other distros:

  • Ubuntu: I would actually recommend it for most people. It has some wonks to it, and I don’t like GNOME, but for most others it should be fine
  • Mint: pretty good, although I haven’t used it for a few years
  • Other minor distros like Crunchbang, Puppy, Elementary, etc. … yeah, they’re OK, pretty good, if they work for you, fine, but I always migrate away from them eventually
  • Debian: I have a lot of respect for Debian. apt-get is great. Stable is too old, and I wouldn’t recommend Stable for most people. Testing would be a much better bet, although I do notice that even in Testing, software can be somewhat stale. Sid, just no, I don’t want to “keep both pieces”. I’d say that if you wanted to install Debian, you’re actually probably better off installing Ubuntu.
  • Gentoo: no thanks. Seems like a hammer to crack a nut.
  • Fedora … ah yes, Fedora. this distro I have to rate as utterly unusable. By which I mean: eat flaming death, preferably with Poettering still trapped inside the building. Everyone would be much better advised to install Ubuntu instead. And before any Fedora fanboy pipes up in defense: please save your breath, I’m aware of the arguments, but I don’t buy them.

On desktops:

  • GNOME: Gno thank you. Consumes a lot of resources but delivers little functionality. The worst desktop environment imaginable.
  • KDE: OK, but not for me. Too resource-hungry for my liking, and a bit overly sugary, if you take my meaning
  • XFCE: I used to like it, but it now seems fairly resource-hungry and too finicky to set up
  • Fluxbox and LXDE: my two favourite window managers. Light-weight, stays out of my way, and yet has enough features to be useful. I discovered that you can do aerosnapping on Fluxbox, which makes it all you really need. Both are a little bit of a pain to set up to an acceptable configuration, but once done, they are great desktops
  • Fvwm2: I’m a fan of retro, and this certainly has that 90’s desktop feel to it. It’s a very light-weight manager, and apparently very customisable. The lack of a panel is a severe letdown, and the button bar and pager seem a bit clunky to me; which is why I prefere Fluxbox/LXDE better
  • Tiling window manager: fun for about 5 minutes of geeking out, then it’s back to a regular window manager as pragmatism reasserts itself

So there we have it. That’s my rant over. Remember, if you disagree, they’re only opinions. But they are the right ones. 😉

Posted in Uncategorized | Leave a comment