IET Enterprise Linux Seminar at the Hong Kong Polytechnic University

When I gave a Linux seminar about six months ago, I had the foresight to bring a camcorder so I could capture the event for those who wanted to attend but couldn’t especially as it was on a Saturday morning. Well I’ve finally gotten around to pulling the video, doing a bit of editing and getting it uploaded to YouTube. As they say (and I hope you agree) better late than never!

The seminar was an IET event held at the Hong Kong Polytechnic University’s Hung Hom campus back in May 2011. It was sponsored by the Computing Department who provided excellent facilities (as you can see from the video) and wonderful refreshments (which you can’t see in the video because they were eaten long before the seminar started). Many thanks to both the IET and the University for making the seminar possible!

So, without further ado, here is the video itself which is also available directly on YouTube. I hope you find it useful and enjoyable and if you have any comments, corrections or suggestions for next time, I would be most happy to hear from you!

Posted in Uncategorized | Leave a comment

This is so true but is it a good or bad thing? What I actually meant to write…

Okay, this is what I meant to write about when I accidentally wrote and posted this :)

First let’s start with an image from the awesome XKCD:

You can find the original post here and I encourage you to actually visit the site. I haven’t hot linked the image because I don’t want to eat into the author’s bandwidth but obviously I take no credit for the image itself.

The Internet has changed the way we think, work and play. With an Internet connection you can quickly get up to speed on almost any topic assuming you have a basic education. Want to know about how a nuclear power plant works? No problem, we have got you covered. What about aeroplane design or advanced software development systems? We have a page for that…

With all this information available at the press of a button, are we eroding the value of a university education? Are we teaching children the wrong skill set for 21st century life? Rather than teaching students how to do X or Y, should we instead be teaching them how to search the Internet and cross-reference information to gain a higher chance of the information being correct?

Of course we can’t teach everything this way and skills require practice – you can’t just read about how to use a language for instance. But are we really that far off from what The Matrix demonstrated over a decade ago? The concept of downloading new skills and knowledge into your brain is not as fantastic as we think.

Literally, if you come up with a new topic right now and punch it in to Google, chances are high that you’ll find a lot of content on it already. You can quickly assimilate it, cross reference it and in many cases find worked examples and explanations. You can dip in and out and effectively tailor your education experience to precisely the information you need.

Admittedly the risk here is that whilst you understand the specifics that interest you, you might not understand the broader concepts and key ideas that you need to execute them but again another search will quite likely help relieve that problem quite nicely.

Now I am not saying a university education or apprenticeship can be replaced by a quick Internet search. There are some things that just cannot be learned that way. But how many of those skills that were important ten years ago are still of key importance today? How many have already been replaced?

My son is just over two years old. He can operate an iPod touch without difficulty. He likes to take pictures and videos and then go through the gallery and look at them. He replays the ones he likes and skips the ones he doesn’t. At two he is already operating a hi-tech device.

With immediate access to information and with people being connected to the Internet wherever they are, does anyone else think we might soon push this a little too far for comfort? Far enough perhaps that we cannot get out of the mess we’ve just caused?

 

Posted in Uncategorized | 1 Comment

This is so true – but is it a good or a bad thing? (Wikipedia powers the minds of the world)

First let’s start with an image from the awesome XKCD:

You can find the original post here and I encourage you to actually visit the site. I haven’t hot linked the image because I don’t want to eat into the author’s bandwidth but obviously I take no credit for the image itself.

This cartoon made me laugh which is always nice but it does have a very serious undertone. I can’t speak for anyone else but when I have a topic I want to know more about or I want to do a bit more digging on something I heard about in a lecture, Wikipedia is my first port of call. Seeing as when I google for most topics, Wikipedia tends to pop up first, I strongly doubt I’m the only one who does this.

I’d actually planned to write something completely different but somehow I ended up writing this. It’s really about values and how we see money rather than Wikipedia specifically, so do bear that in mind when you read through this :) .

Update: Here is the post I meant to write! :)

Like many awesome web resources, Wikipedia is free. Unlikely most of them, Wikipedia does not show adverts. The reason they give is because they want to maintain impartiality. Personally I wouldn’t mind adverts on the page, but then as a community edited resource, I’m sure there’d be all sorts of tampering to affect what ads are shown and so forth so I have to agree with their decision.

Now, I know there are entire sites dedicated to reasons why Wikipedia is evil, why it shouldn’t be donated to and a host of other issues. However I want to leave that to one side for a moment. For the sake of argument, let us pretend that Wikipedia and the team that runs it are all perfect beings and everything is exactly the way people dream it to be. Trust me, this simplification makes it much easier to make my point ;)

Wikipedia costs a tonne of cash to run and few people (relatively speaking of course) donate to the project. Whatever you think of the various controversies that have cropped up over the years, the pages and content are still there, and people continue to use it. It’s a massive site that requires an expensive infrastructure. Even though the content is mostly maintained by volunteers, servers, bandwidth, power, air conditioning etc are expensive and with the best will in the world, these things are not free.

This ties in to another topic on how people perceive money and their behaviour when spending it, but for now I’m curious as to why people would not donate to Wikipedia. For example, how much time and effort does Wikipedia save the average person? How quickly can we now learn new things or double check our understanding? Is it perfect? No, but is that the point?

So why then don’t people donate? I completely accept that some people are not in a position to do so, and I have no problem with that – but why do people who can easily afford such a contribution not doing so?

Then I started to think about a subscription model. What if Wikipedia wasn’t free? What if you had to pay say $15US a month for a subscription and then you could get at all of the content? Would you pay $15 to access such a resource? I would and I bet a lot of others would. But because it’s free, suddenly donating $10 seems like a big deal. Why is that? Why do people believe at least subconsciously that things have less value because someone chooses to give them away?

Why do we only value things when they have a direct cost?  What does that say for our key values as individuals? I’m not sure of the answer to that question but I am sure that it is nothing good…

Posted in Humanity | 1 Comment

NetFPGA kernel driver now has the init_mutex patch!

A while back I posted about a problem I’d experienced compiling the NetFPGA kernel driver. In newer kernels the function init_mutex had been removed and so the driver couldn’t be compiled. I figured out a work around which I originally posted here

This fix is now included in the latest software release. Actually, it’s been sorted for a while now, but I’ve only just gotten round to posting about it :) . This is great news as although I created a working patch for it, I wasn’t entirely sure whether I’d inadvertently broken something else at the same time. It’s always nice to know that you got something right :)

Kudos the NetFPGA guys, it is really an awesome project!

Posted in Uncategorized | Leave a comment

Hello World on the Atlys Spartan-6 (using the clock signal)

Well after battling around for a while I was finally able to get this short but still exciting example working. Now, I will post more about this later but basically it is quite likely that the code you are reading is horrible and the worst possible practice imaginable. In fact it is quite likely.

I’m teaching myself how to work with FPGAs and design hardware based solutions. I’m starting effectively from scratch. If you don’t know what a constraints file is, why you need one or that if you don’t comment out the unused definitions it will blow up in your face, these posts might be useful to you. I am planning to post what I’ve come up with so that it’s at the point where you can actually deploy it to your board and see it actually doing something other than the demo it came with.

For now though, here’s the code I wrote to get LED’s to flash based on switch and button position. I’ll post a video later so you can see what it is actually supposed to do.

 

----------------------------------------------------
-- Company: The Hong Kong Polytechnic University
-- Engineer: Peter Membrey
--
-- Create Date:    11:09:32 12/05/2011
-- Design Name:
-- Module Name:    HelloWorld with clock - Behavioral
-- Project Name:
-- Target Devices: Digilent Atlys Spartan-6
-- Tool versions:
-- Description:
--
-- Dependencies:
--
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
-------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;
-- Uncomment the following library declaration if instantiating
-- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity HelloWorld is
    Port ( clk  : in  STD_LOGIC;
           sw0  : in  STD_LOGIC;
           bt0  : in  STD_LOGIC;
           sw1  : in  STD_LOGIC;
           led0 : out  STD_LOGIC;
           led1 : out  STD_LOGIC);
end HelloWorld;
architecture Behavioral of HelloWorld is
  signal p0,p1,p2,p3,p4,p5 : STD_LOGIC;
  -- p0 goes high if sw0 is on
  -- p2 goes high if sw1 is on
  -- p1 XOR of p0 if but0 is on else p0
  -- p3 XOR of p2 if but0 is on else p2
  -- p4 didn't use it for some reason
  -- p5 1Hz clock signal
begin
 process (sw0,sw1,bt0,clk)
	variable cnt : integer := 0;
	variable cntOn : boolean;
   begin
   if rising_edge(clk) then
      if(cnt =50000000) then
         cnt:= 0;
         if(cntOn= true) then
            p5 <= '1';
            cntOn:= false;
         else
            p5 <= '0';
            cntOn:= true;
         end if;
      else
         cnt:= cnt +1;
      end if;
   end if;
   if(sw0='1') then
	  p0 <= '1';
	else
     p0 <= '0';
	end if;
	if(sw1='1') then
	  p2 <= '1';
	else
	  p2 <= '0';
	end if;
	if(bt0='1') then
	  p1 <= not p0;
	  p3 <= not p2;
	else
	  p1 <= p0;
	  p3 <= p2;
	end if;
	if(p1='1' and p5='1') then
	  led0 <= '1';
	else
	  led0 <= '0';
	end if;
	if(p3='1' and p5='1') then
	  led1 <= '1';
	else
	  led1 <= '0';
	end if;
 end Process;
end Behavioral;
Posted in FPGA, Hardware, VHDL | Leave a comment

New posts coming soon!

Well, it’s been nearly a month since I last posted anything and so for those people that do wander by on a regular basis, I wanted to assure you that I am still alive and well. This last month has been extremely busy and I have been dealing with some health concerns that have taken up an inordinate amount of my time.

Things are starting to settle down a bit now and I’m starting to clear my backlog. I am still committed to learning Esperanto and Chinese. I will still be posting updated tutorials and I will be working on some more interesting projects over the coming weeks.

I will also keep the blog up to date as well :)

Posted in Uncategorized | Leave a comment

RIP Steve Jobs

Steve Jobs has either directly or indirectly touched so many lives that his passing will be greatly felt. He was and remains an inspiration to many. His key note speeches were simply incredible and left a whole generation of people trying to work out just exactly how he did it.

I didn’t know the man personally, but he has touched my life. From the computers I work with every day, to affecting how I present and communicate my ideas. He will be sorely missed.

Steve Jobs, the friend I never knew; rest in peace.

Posted in Uncategorized | Leave a comment

Ethics: Why the Wiccan Rede is not just for Wiccans

I attended the first of six lectures on ethics this evening. For those wondering if the module is compulsory, the answer is yes. However the content was interesting, focussed and relevant – and quite honestly not what I was expecting. One of the downsides to not bothering with a bachelors degree is you miss out on the differences between what you learn in a school and what you learn at a university. Anyway, that aside, one of the tasks to complete is to pick a motto or mantra for the group. I suggested a one liner from the Wiccan Rede. First though, here is the full excerpt:

Abide the Wiccan Rede ye must
In perfect love and perfect trust
Eight words the Wiccan Rede fullfil
An’ harm ye none, do as ye will

As it is written in “Middle” English, it can be a challenge at the best of times, but if English isn’t your native language it can really confuse things as the sentence structure is pretty much backwards and not many people (i.e. none that I know of) use the word ye. For those that would prefer a sane version try my rendition (which sadly doesn’t rhyme):

You should follow this guidance
With best intentions and goodness
In summary this guidance means:
You can do whatever you want as long as nothing is harmed

Okay, I admit this is not my best work but it does getting the meaning across. The concept is quite straight forward and I think neatly sums up ethical thought and action. In short we should:

  1. Act in the best interest of all
  2. Truly and honestly act with best intentions
  3. Do no harm

In the original rede (rede is ye olde English for guidance) the word none is used. Sometimes people write this as None but I have seen it written both ways numerous times. The idea here is that it doesn’t just mean people or animals. It means everything as a whole.  Wiccans see the world (and universe) as an inter connected system – to harm anyone or anything is in effect harming yourself.

I won’t go too deep into Wiccan philosophy but I do think the last line of the rede would make a great mantra:

An’ harm ye none do as ye will  

It’s simple, short and sounds pretty cool. It also manages to capture in just eight words what many people have failed to capture in over a thousand.

Posted in Ethics | 3 Comments

Watching movies with subtitles is great for the movie… but not for language aquisition

Well I just watched “The Sorcerer and the white snake” which is a Cantonese movie based on the legend of the White Snake. It doesn’t exactly follow the legend and diverges in many key places. The special effects weren’t terrible but some bits were a bit on the cheesy side. That said, I really enjoyed the movie. There was one key thing of interest though…

I don’t remember the movie being in Cantonese. Once you get used to reading sub titles for the content, your brain will stop bothering to real process the sounds you’re hearing. Of course at a fundemental level you know they’re not speaking English – but it doesn’t really seem to matter as you have no trouble following the story. Not surprising really because your brain is working over time on the sub titles. That extra effort has to come from somewhere and I guess it does – from your ears.

I don’t think that watching foreign movies is a great way to boost your exposure if you’re going to sit and watch the sub titles. With them off, the brain has nothing to focus on and must attempt to derive meaning from the speech. Otherwise, whilst you might enjoy the film, I really doubt you’ll take much away from it language wise.

Of course, this shouldn’t stop you watching these movies. Many Chinese films are very cultural and deal with lots of ideas that are deep in Chinese custom and culture. If you just go for that experience alone then it is really worth it – just don’t kid yourself into thinking that you’re getting true exposure to the language if the movie has sub titles :)

Posted in Cantonese, Languages | 1 Comment

Emersion techniques might back fire slightly…

Although I don’t use it a lot, I had changed my Facebook settings to show everything in Esperanto. That was pretty cool to start with and I could recognize quite a lot of the words such as ŝati.

The problem was I really don’t use Facebook that much and have very little idea of what goes where or what does what. For example, I can fix a computer running Windows XP in Chinese. I have no idea what any of the text says and I can’t read the menus. However I’ve fixed the damn thing so often that I know what is where and what everything does. I even have a pretty good idea of what the error messages are…

But my lack of familiarity with Facebook meant that I couldn’t do this. For one off menus, especially those with pretty logos were fairly easy to decipher. On the other hand when you start getting popups with big red exclamation marks, a warning in Esperanto and two options also in Esperanto that you don’t understand, it gets a bit scary…

So today I changed my default setting back to English. At least I can read that and I can see what I’m agreeing to and what the warnings are.

Experience has taught me that immersion works well but you have to be careful with it. If you go to a completely foreign country for example, you need to take a crutch with you. If you don’t even have a phrase book, you’re going to be fairly screwed if the country you go to has little English.

This has back fired on me in Hong Kong too. The level of English use here allows me to use English. Seriously, unless you really want to learn Cantonese you can get by living here easily without Cantonese. The vast majority of bank staff speak English, the police speak English, the language used for legal matters is also English. Hell, even a large number of taxi drivers will have no problem getting you where you want to go…

The result? You get lazy. You don’t have to use it so you don’t. Humans have a very interesting ability – they can ignore any inconvenient truth with the greatest ease. Smoking causes cancer? Ignored.  Eating 50 doughnuts a day makes you fat(ter)? Ignored. If you don’t believe me just look at all the crap that is peddled to people offering quick fixes, free money an magic pills. The worst bit is people buy them!

In various parts of China, if you don’t speak Mandarin, you are not going to get anywhere. Thinking you might use English in a taxi? Forget it. Want to visit a bank or a local shop? If you don’t know Mandarin, expect to do a lot of pointing – an awful lot of pointing…

When you can’t fall back on English, you have to use the alternative because otherwise you’re going to be spending a lot of time sitting in the dark…

Anyway, the Facebook experiment didn’t pan out for me for the simple reason that I had no freaking idea what I was clicking on and that scares the crap out of me… I still think it’s a good idea in principle though… :)

Posted in Esperanto, Languages | 1 Comment