Show Posts
Pages: [1] 2 3 ... 26
1  Community / Bar Sport / Re: Students caught out.... on: June 30, 2014, 06:01:32 pm
That is a classic case of kids going to Uni because Mum wants them to get a degree in something, anything, just so long as they are not around the house all day!!!

2  Community / Bar Sport / Re: Linux instructions on: June 12, 2014, 02:56:32 am
for a kernel it's

Code:
make bzlilo modules modules_install

You should be doing "make deb-pkg".

maybe in new versions, but this is potato, still using lilo rather than grub

I get that you can change a running kernel but I've never tried
3  Community / Bar Sport / Re: Linux instructions on: June 12, 2014, 01:04:33 am
It's not specific to man pages, I don't think.  I've read several walk-throughs that were intended to be consumed by beginners, and had lots of step by step instructions before turning into something like:  "Then edit your network configuration files as necessary."

Part of it is the experience gap between the user reading the guide, and the programmer / enthusiast writing it.  It's hard to know or remember what things are going to go over the heads of an inexperienced audience.  Then there's the complexity of a modern Linux system, where you could be doing any of a hundred different things.  Documenting them all, exhaustively, without reading like a Choose-Your-Adventure novel would be a considerable undertaking.  There's also laziness, as the author runs out of motivation after writing five pages of elementary text.

This where distros like Ubuntu come into play.
If you've wrestled with Debian or (god forbid) any redhat distro, installing and running Ubuntu feels like you're back in ME land.

My first Linux system was a DX4-100, which is still running Potato and DR-DOS, configuring things like X was a bit of a trial, the network stuff was easy, right up until I tried using samba to get the 'doze machines into the fray.
Netatalk, for the older Mac's I have was pretty simple, but I never did get the bridge on the Mac side of things to work, which meant the Linux and 'doze machines couldn't print directly to the LaserWriter.

I'm really not sure why a "beginner" would run vi or emacs, right from the get go I always used MC's internal editor.
That being said my mate who got me into Linux threw me in the deep end straight away by getting me started on compiling a custom kernel.

With ANY Linux package compiling starts with

Code:
./configure

from there you get to see if all the tools are there and working, you follow it up with

Code:
make

for a kernel it's

Code:
make bzlilo modules modules_install

Things are a bit different with grub, but it's a similar process
Compiling quake(n) or mjpegtools or what ever is a similar process.

But it's not something a beginner is going to NEED to do, not unless you have a video capture card or get into SDR or something.

It is actually quite hard to really "break" a Linux system badly enough you will need to re-install.
As for man-pages being hard to read, I don't get it.
Most man pages and the newer doc system have groovy little examples right at the end.

Under a Debian based distro, either vanilla Debian or Ubuntu, go to your package management weapon of choice, install the Linux How To's, there is some great reading in there.

These days configuring X, CUPS and a network is a hell of a lot easier than it ever has been.
4  Community / Bar Sport / Re: Linux instructions on: June 11, 2014, 06:58:00 am
If you look in /usr/doc/how_to, there are more than a few pages that have

"....the the the..."

this should tells us the author typed them just before dawn, after WAY too much coffee
5  Community / Bar Sport / Re: The beginners dilemma on: May 26, 2014, 08:49:22 pm
On the OT,

Since I was a child I have seen most people reach a certain age where looking words up in a close to hand dictionary becomes near-impossible. It's an attitude. Once you finish school, you become a completed adult. From there, looking things up is like admitting that you are not. And yes, I got told the "finished high school, know everything that matters" spiel many times back in the days.

Now we have the internet. Someone can be online asking for help and given links to fully prepared sites chock full of perfectly good and often illustrated explanations that they don't have to get off their... seats... to access, they still demonstrate a failure to even begin to absorb as much as a few terms.

"Here's a plate of food" gets "I can't use a fork, knife or spoon. Feed me.".

I'm happy to say that I have been able to help people not at all like that. If they get stuck and you give them a little help, they figure it out and get going. 

It's the others that get me.

But as I note, this is nothing new. It's just that with easy net access we have idiots where we did not before.



Google and wikipedia are dangerous things...
6  Community / Bar Sport / Re: The beginners dilemma on: May 26, 2014, 07:11:21 pm
On my bicycle I use chain wax, great stuff!

My "friend" needed to borrow my bike to fetch a puncture kit for his, so he took mine.

Came back, says "Your chain was squeaking, I lubed it with WD-40"

I was not happy
7  Community / Bar Sport / Re: The beginners dilemma on: May 24, 2014, 09:17:32 pm
When I worked in a gun shoppe, we used to get guys that went shooting "once in a blue moon", they'd come in with their pride and joy that had been sitting in the cupboard for months, the pre-storage treatment was WD-40/RP-7/CRC <something>.

The poor rifle would be gummed up tight as a<insert tight thing>

That wasn't too bad, you could normally free up the action with a good soak in turps or diesel.

The real worry was Greek or Italian blokes who had LIBERALLY applied olive oil!

Once the volatile bits of olive oil have evaporated what you're left with looks and behaves like epoxy!!

I had to boil a semi-auto .22 every day for nearly 2 weeks before I could get the thing apart!
8  Community / Bar Sport / Re: Your latest purchase on: May 16, 2014, 09:56:40 pm
So that's where your handle comes from!
9  Community / Bar Sport / Re: Your latest purchase on: May 16, 2014, 07:34:43 pm
yep, calculating reverse offsets for relative branches will be tricky

but at least "stack collision with heap" will be harder to make happen

Although the idea of negative address space is hard to get your head around
10  Community / Bar Sport / Re: Your latest purchase on: May 16, 2014, 06:51:59 pm
You got me wondering if it'll execute code in reverse

11  Community / Bar Sport / Re: Your latest purchase on: May 15, 2014, 07:29:39 pm
Just got my shiny new XMOS Start Kit sample!!!


    xCORE-Analog 8-core device with integrated debugger
    micro-USB connection to host debugger
    PCIe connector for sliceCARD add-on boards
    0.1" header compatible with Raspberry PI
    Two 4-zone cap sense sliders
    3x3 LED matrix
    2 additional LEDs
    Push-button switch
    4 ADC inputs
    256KB SPI Flash
    0.1" header for connecting additional startKITs




Not sure what I'll do with it yet!

As an aside...

I keep reading vitriolic comments, especially on Hack a Day about how bad the Arduino environment is, so far I think it's pretty good.
The XMOS composer software is nowhere as intuitive as Arduino, me thinks it'll be a steep learning curve!
12  Using Arduino / Sensors / Re: Auto gain control AGC amplifier for 40 kHz ultrasonic transducer on: May 15, 2014, 07:06:08 pm
I did it like this



If you don't just trigger on the strongest echo, ie when the 7414 Schmidt trigger goes "off" but capture with an ADC you can tell a lot by the "quality" or slope of the echo.

Don't bother with the Ver 2 circuit, most of the filtering you need is already done by the ultra sonic Rx trancducer itself, it's just a whole lot of hassle to make work and in the end unnecessary.

13  Using Arduino / Sensors / Re: HC-SR04 ultrasonic distance sensor at an angle on: May 15, 2014, 06:56:33 pm
the main lobe on both the Tx and Rx is about 60 degrees around the centre of the "business end"
If you mount the HC-SR04 vertically you will get better results at an angle.
14  Community / Exhibition / Gallery / Re: Conway's Game Of Life with TVout 128 x 96 pixels on: May 13, 2014, 06:06:58 pm
"becomes stable after 1800 generations without wrap around" I should have said!
On the Arduino R-pentomino takes around 3-4 minutes to become stable.

My Apple II code started out in Applesoft floating basic, going to integer Apple Basic sped things up, but took too long, so I wrote a hand assembled machine code version that ran pretty damn fast
15  Community / Exhibition / Gallery / Re: Conway's Game Of Life with TVout 128 x 96 pixels on: May 01, 2014, 05:07:00 am
I made a small change, starts off with R Pentomino rather than a random pond.
R Pentomino spawns 5 gliders in the first 30 odd generations, becomes "stable" after 1800 generations.

My first Apple II Life program took nearly a day to do 1800 generations!

Code:
// Conway's Game Of Life 128x96 using TVout
// P.Beard
// March 2013

#include <TVout.h>

#define matWidth 4
#define matHeight 96

TVout TV;
unsigned long * myScreen;

void setup() {
  TV.begin(PAL, matWidth * 32, matHeight);
  myScreen = (unsigned long *) TV.screen;
  randomSeed(analogRead(0));
  randomiseMatrix();
}

void loop() {
  generateMatrix();
  digitalWrite(13, !digitalRead(13));
}

unsigned long swapBytes(unsigned long x) {
  return ((x & 0x000000ffUL) << 24) | ((x & 0x0000ff00UL) << 8) | ((x & 0x00ff0000UL) >> 8) | ((x & 0xff000000UL) >> 24);
}

void randomiseMatrix() {
//start with R pentomino
  byte col = random(matWidth);
  byte row = random(matHeight);
  myScreen[(row+0) * matWidth + col] |= B0000011;
  myScreen[(row+1) * matWidth + col] |= B0000110;
  myScreen[(row+2) * matWidth + col] |= B0000010;
 
//  //Set up initial cells in matrix
//  for (int r = 0; r < matHeight; r++) {
//    for (int c = 0; c < matWidth; c++) {
//      myScreen[r * matWidth + c] = random(0xffff) << 16 | random(0xffff);
//    }
//  }
}

void injectGlider() {

  byte col = random(matWidth);
  byte row = random(matHeight);
  myScreen[(row+0) * matWidth + col] |= B0000111;
  myScreen[(row+1) * matWidth + col] |= B0000001;
  myScreen[(row+2) * matWidth + col] |= B0000010;
}


void generateMatrix() {
 
  //Variables holding data on neighbouring cells
  unsigned long NeighbourN[matWidth], NeighbourNW[matWidth], NeighbourNE[matWidth], CurrCells[matWidth], NeighbourW[matWidth];
  unsigned long NeighbourE[matWidth], NeighbourS[matWidth], NeighbourSW[matWidth], NeighbourSE[matWidth], firstRow[matWidth];

  unsigned long tot1, tot2, tot4, carry, NewCells;

  int changes = 0; // counts the changes in the matrix
  static int prevChanges = 256; // counts the changes in the matrix on prev generation
  static int staleCount = 0; // counts the consecutive occurrances of the same number of changes in the matrix

  //set up N, NW, NE, W & E neighbour data
  //also take a copy of the first row data for use later when calculating last row
  for (byte b = 0; b < matWidth; b++) {
    NeighbourN[b] = swapBytes(myScreen[(matHeight-1) * matWidth + b]);
    firstRow[b] = CurrCells[b] = swapBytes(myScreen[b]);
  }

  carry = NeighbourN[matWidth-1];
  for (char b = 0; b < matWidth; b++) {
    NewCells = NeighbourN[b];
    NeighbourNW[b] = NewCells >> 1 | carry << 31;
    carry = NewCells;
  }
 
  carry = NeighbourN[0];   
  for (char b = matWidth-1; b >= 0; b--) {
    NewCells = NeighbourN[b];
    NeighbourNE[b] = NewCells << 1 | carry >> 31;
    carry = NewCells;
  }

  carry = CurrCells[matWidth-1];
  for (char b = 0; b < matWidth; b++) {
    NewCells = CurrCells[b];
    NeighbourW[b] = NewCells >> 1 | carry << 31;
    carry = NewCells;
  }
 
  carry = CurrCells[0];   
  for (char b = matWidth-1; b >= 0; b--) {
    NewCells = CurrCells[b];
    NeighbourE[b] = NewCells << 1 | carry >> 31;
    carry = NewCells;
  }
 
  //Process each row of the matrix
  for (byte row = 0; row < matHeight; row++) {

    //Pick up new S, SW & SE neighbours
    if (row < matHeight - 1) {
      for (byte b = 0; b < matWidth; b++) {
        NeighbourS[b] = swapBytes(myScreen[(row+1) * matWidth + b]);
      }
    }
    else {
      for (byte b = 0; b < matWidth; b++) {
        NeighbourS[b] = firstRow[b];
      }
    }
 
    carry = NeighbourS[matWidth-1];
    for (char b = 0; b < matWidth; b++) {
      NewCells = NeighbourS[b];
      NeighbourSW[b] = NewCells >> 1 | carry << 31;
      carry = NewCells;
    }
     
    carry = NeighbourS[0];   
    for (char b = matWidth-1; b >= 0; b--) {
      NewCells = NeighbourS[b];
      NeighbourSE[b] = NewCells << 1 | carry >> 31;
      carry = NewCells;
    }
 
    for (char b = 0; b < matWidth; b++) {
     
       //Count the live neighbours (in parallel) for the current row of cells
      //However, if total goes over 3, we don't care (see below), so counting stops at 4
      tot1 = NeighbourN[b];
      tot2 = tot1 & NeighbourNW[b]; tot1 = tot1 ^ NeighbourNW[b];
      carry = tot1 & NeighbourNE[b]; tot1 = tot1 ^ NeighbourNE[b]; tot4 = tot2 & carry; tot2 = tot2 ^ carry;
      carry = tot1 & NeighbourW[b]; tot1 = tot1 ^ NeighbourW[b]; tot4 = tot2 & carry | tot4; tot2 = tot2 ^ carry;
      carry = tot1 & NeighbourE[b]; tot1 = tot1 ^ NeighbourE[b]; tot4 = tot2 & carry | tot4; tot2 = tot2 ^ carry;
      carry = tot1 & NeighbourS[b]; tot1 = tot1 ^ NeighbourS[b]; tot4 = tot2 & carry | tot4; tot2 = tot2 ^ carry;
      carry = tot1 & NeighbourSW[b]; tot1 = tot1 ^ NeighbourSW[b]; tot4 = tot2 & carry | tot4; tot2 = tot2 ^ carry;
      carry = tot1 & NeighbourSE[b]; tot1 = tot1 ^ NeighbourSE[b]; tot4 = tot2 & carry | tot4; tot2 = tot2 ^ carry;

      //Calculate the updated cells:
      // <2 or >3 neighbours, cell dies
      // =2 neighbours, cell continues to live
      // =3 neighbours, new cell born
      NewCells = (CurrCells[b] | tot1) & tot2 & ~ tot4;
     
      //Have any cells changed?
      if (NewCells != CurrCells[b]) {
        myScreen[row * matWidth + b] = swapBytes(NewCells);
        //Count the change for "stale" test
        changes++;
      }
     
      //Current cells (before update), E , W, SE, SW and S neighbours become
      //new N, NW, NE, E, W neighbours and current cells for next loop
      NeighbourN[b] = CurrCells[b];
      NeighbourNW[b] = NeighbourW[b];
      NeighbourNE[b] = NeighbourE[b];
      NeighbourE[b] = NeighbourSE[b];
      NeighbourW[b] = NeighbourSW[b];
      CurrCells[b] = NeighbourS[b];
    } //next col
  } //next row
   
  if (changes != prevChanges) staleCount = 0; else staleCount++; //Detect "stale" matrix
  if (staleCount > 32) injectGlider(); //Inject a glider

  prevChanges = changes;
}
Pages: [1] 2 3 ... 26