Navigation

    Brain Sprinkles‎ > ‎

    Everything Else


    BPB-37 (Display BIOS Parameter Block, Version 37)

    posted 25 Apr 2013 06:46 by Dom De Vitto

    I wrote this in 1989-1990 and published it on 11th November 1992 (!), and found it again, still on the U-Mich Atari ST Archive.

    Here is the documentation file:

    BPB-37.TOS by Domenico De Vitto <ddv@uk.ac.bton.unix> (only till 1/7/1995)

     

    Well this the first bit o' program that I am going to fling into the

    big wide world, and I'm only doing it because I'm off ill and this is one

    (the one ?) bit of program that works 100% and cannot be improved

    (I think ...) that I have ever wrote.

      First it was written many years ago (1989-1990???), not based or idea

    copied from anything, it simply tells you all about the boot sector details

    of a drive and also gets the lower-screen-half from the TOS, in case you

    need to compare the details.

     

    As you all thought that was a copyright notice and naturally skipped it, I

    needn't be embarresed further in the document so anwards & upways...

     

    Running it ...

    It should have a 'TOS' extention because of its nature but I haven't seen

    any difference when it has a PRG or TTP extention so it can be changed.

     It is meant to be run from the desktop so don't moan about it clearing

    you shell screen, anyway I think it looks nice.

     

    Things it does...

    I was going to enter a huge piece of text on its workings but that is

    really boring for all the non-programmers, and they can read the source.

     

    This is what it does:

    If you're in medium-rez it changes down to low - perfectly legal this

     and it's clearer.

     

    Drops the title on the top line.

     

    Gets from the TOS the valid drive letters and displays them.

     

    Gets a key from the keyboard & converts it to uppercase (if a letter!).

     

    If the key is a valid drive letter (bit complex this check) it displays

     the drive you selected (now in uppercase).

     

    Reads in the bootsector from the right drive, even if the disc has just

     been swapped.

     

    If the read sector call returns non-zero - error - tell the user & skip

     the display of the boot sector info.

     

    Otherwaise..

    Displays all the info it can about the boot-sector :

    Boot branch - 'system disks' & the like use this to load the operating

      system, games (can) use it for loading quickly, as do virii.

      - if this is 0 you cannie have a boot-sector virus on the disk.(theory?)

    Volume serial - used by the system to tell if you swapped disks, every disk

     should have a random serial put here at format time for this purpose.

    Bytes per sector - $200 (512 decimal) on most disks - if its not the same

     at the ACTUAL sector size system may(??) go mad as a sponge.

    Sectors per cluster - 'cluster' being the smallest number of sectors one

     file can use on the disk, usually 2 (sectors).

    Reseerved sectors - always at least one as the boot sector counts as the

     first. Used by system-loaders & VERY BIG virii (gulp).

    File Allocation Tables (FATs) (number of) - FATs are used to keep track of

     all the places on the disk where your files are etc. 'Cause the're so

     important there are this many (usually 2) copies updated at the same time.

    Max root dir entries - the largest number of files that you can have in

     the root dir, usually 128 for floppies. Folders are files and can grow

     in size if more file entries (=name,date modified,size in bytes etc)

     are needed, but the root dir is a set size and therfore can only hold

     a limited number of file entries.

    Sectors - the total number of sectorson the media including

     reserved sectors, any hidden sectors, the FATs, the root dir and the

     'data area' where your files & folders are stored.

    Media descripter - this is meant to describe the media type on PCs

     ie hard disk, 3.5" floppy etc, etc. should really be $F8, but the TOS

     ignores it completely, so it is whatever your formatter sets it to be!

    Sectors per FAT - this is the size in sectors of EACH File Allocation

     Table.

    Sectors per track - The number of sectors per track usually 9 or 10.

     therefore TRACKS = (total sectors / sides on media) / sectors per track.

    Sides on media - for floppies 1 or 2 is valid, but hard disk controllers

     can pull a few tricks on the TOS and pretend there are more 'sides'

     - 64 is not unusual.

    Hidden sectors - this isn't very well documented anywhere, but I think

     these are like 'extra reserved sectors' - comments anyone ?

    Calculated dir sector - worked out as :

      reserved sectors + hidden sectors + (number of FATs * sectors per FAT)

     this should be the first root dir sector.

     I have recently used this info to write zeros to this sector and then ran

     a file system checker (FCHK.TOS) to clean up the mess and leave me with a

     completely clean hard disk partition !  (I wanted this as well!)

     

    Information from the TOS

    This info I added to BPB-37 'cause it gives :

    Total clusters - should be something like (you may need to +/- 1 ? to this)

     (total sectors - system sectors) / sectors per cluster

     where system sectors is

     calculated dir sector +

      ( number of root dir entries * 32 / bytes per sector )

    Free clusters - the number of free clusters.

    Sectors per cluster - a less trustable source of this value than direct

     from the boot sector, but what the TOS THINKS it is.

    Bytes per sector - likewise.

    'Therefore free space' - free space in bytes (using the TOS values) as

       free clusters * sectors per cluster * bytes per sector

     divided by 1024 to get Kb.

     

    Phew ! After you have read all the info it waits for a keypress (any).

     

    If it was originally in medium rez it changes back and resets the colours

    so the system as it was - all legal calls !!!

     

    Then...... it quits back to the calling desktop/shell etc.

     

    Phew ! - all the equations & algos by the way are from the top of my head

    so don't trust me, check them yourself.

     

    Notes.

    It gives you a lot of info, it fits in 2K (the original version was less

    than 1Kb). It was written in assembly using Genst 1.25 (Thanks ST-Format !)

    and the book 'The conise atari st 68000 programmer's reference guide'

    by Kathrine Peel (one really good book).

     

    Copyrights & the disclaimers

    I wrote this software but you use it at your own risk, so don't get me in

    court is it causes earthquakes in El-Salvador or something.

    You may copy, distribute, BUT NOT SELL IT, modest distribution costs may be

    charged - but remember it's FREE.

     

    If you do pass it on you should pass this doc file on with it so that it's

    ease of use is not lost down the generations.

     

    Please feel free to use the routines in the source code in your own

    programs but bear in mind that once the program all fitted in less than 2K

    I paid no attention to speed, effeciency or 'properness' of the code, but

    I think that it all works properly !

     

    This doc file is toooooo huge for the program now so just remember this:

    If you believe this software to be worth paying for, then pay me 10%

    of what it's worth - thats how much I'd get if I marketed it.

    Course you could simply send me any tips/advice/good jokes and then we

    can get on with the job of writing better software for the ST range.

     

    Any problems/enquiries etc with the program please E-mail me at :

       ddv@uk.ac.bton.unix

     

    Yours,

     

    Domenico De Vitto.

     

     

    And the source MC68000 assembler:

    program
     bsr setscreen
     bsr getdrive
     bsr readboot
     bsr interpret
     bsr extrainfo
     bsr pressanykeytoexit
     bsr resetscreen
     clr.w -(sp)
     trap #1


    setscreen
     move.w #4,-(sp)
     trap #14        * get screen mode in d0
     addq.l #2,sp
     cmp.w #1,d0
     bne dontchgmode
     move.w d0,screenmode    * if med-res save 1 in screenmode
     move.w #0,-(sp)
     move.l #-1,-(sp)
     move.l #-1,-(sp)
     move.w #5,-(sp)
     trap #14        * change to mode 0
     add.l #12,sp
     move.l #colregs,-(sp)
     move.w #6,-(sp)
     trap #14
     addq.l #6,sp
    dontchgmode
     bsr print
     dc.b 27,"E","BPB-37 by Domenico De Vitto",0
     rts

    getdrive
     move.w #10,-(sp)
     trap #13
     addq.l #2,sp
     move.l d0,drivemap
     bsr showdrives
     bsr getdrv
     rts
    showdrives
     bsr print
     dc.b 10,13,"Drives Available :",0
     even
     moveq #0,d7
    drvloop
     bsr checkdrive
     tst d0
     bne nextdrv
     moveq #65,d0
     add.b d7,d0
     bsr printchr
    nextdrv
     addq #1,d7
     btst #5,d7
     beq drvloop
     rts

    getdrv
     bsr print
     dc.b 10,13,"Enter Drive Letter :",0
     even
    gdrvloop
     bsr getkey
     bsr convertlu
     sub.b #65,d0
     bmi gdrvloop
     cmp #31,d0
     bpl gdrvloop
     exg d0,d7
     bsr checkdrive
     bne gdrvloop
     move.w d7,driveselect
     exg d0,d7
     add.b #65,d0
     bsr printchr
     rts

    readboot
     move.w driveselect,-(sp)
     move.w #0,-(sp)
     move.w #1,-(sp)
     move.l #buffer,-(sp)
     move.w #2,-(sp) * must be read 2 in order to catch disk changes.
     move.w #4,-(sp)
     trap #13
     add.l #14,sp
     rts

    interpret
     tst d0
     beq okdrive
     bsr print
     dc.b 10,13,"Error Reading Drive",0
     even
     rts
    okdrive
     bsr print
     dc.b 10,13,27,"p","         From the Boot sector :         ",27,"q"
     dc.b 10,13,"Branch to boot code :$",0
     even
     move.w buffer(pc),d0
     bsr hexword86
     bsr print
     dc.b 10,13,"Volume Serial # :$",0
     even
     move.w buffer+8(pc),d0
     bsr hexword86
     move.b buffer+10(pc),d0
     bsr hexprint
     bsr print
     dc.b 10,13,"Bytes per sector :$",0
     even
     move.l buffer+10(pc),d0
     ror.l #8,d0
     bsr hexword86
     bsr print
     dc.b 10,13,"Sectors per Cluster :$",0
     even
     move.w buffer+12(pc),d0
     ror.w #8,d0
     bsr hexprint
     bsr print
     dc.b 10,13,"Reserved Sectors (inc. boot) :$",0
     even
     move.w buffer+14(pc),d0
     bsr hexword86
     bsr print
     dc.b 10,13,"File Allocation Tables (FATs):$",0
     even
     move.b buffer+16(pc),d0
     bsr hexprint
     bsr print
     dc.b 10,13,"Max Root Directory entries :$",0
     even
     move.l buffer+16(pc),d0
     ror.l #8,d0
     bsr hexword86
     bsr print
     dc.b 10,13,"Sectors (inc reserved) :$",0
     even
     move.l buffer+18(pc),d0
     ror.l #8,d0
     bsr hexword86
     bsr print
     dc.b 10,13,"Media Descripter (not used by TOS) :$",0
     even
     move.b buffer+21(pc),d0
     bsr hexprint
     bsr print
     dc.b 10,13,"Sectors per FAT :$",0
     even
     move.w buffer+22(pc),d0
     bsr hexword86
     bsr print
     dc.b 10,13,"Sectors per Track :$",0
     even
     move.w buffer+24(pc),d0
     bsr hexword86
     bsr print
     dc.b 10,13,"Sides on media :$",0
     even
     move.w buffer+26(pc),d0
     bsr hexword86
     bsr print
     dc.b 10,13,"Hidden Sectors :$",0
     even
     move.w buffer+28(pc),d0
     bsr hexword86
     bsr print
     dc.b 10,13,"Calculated dir sector :$",0
     even


     moveq #0,d0
     move.b buffer+16(pc),d0
     move.w buffer+22(pc),d1
     ror.w #8,d1
     mulu d1,d0
     move.w buffer+14(pc),d1
     ror.w #8,d1
     add.l d1,d0
     rol.l #8,d0
     bsr hexprint
     rol.l #8,d0
     bsr hexprint        * print longword of start sect of dir
     rol.l #8,d0
     bsr hexprint
     rol.l #8,d0
     bsr hexprint
     rts

    extrainfo
     move.w driveselect(pc),d0
     addq.w #1,d0
     move.w d0,-(sp)
     pea driveextra(pc)
     move.w #54,-(sp)
     trap #1
     addq.l #8,sp
     bsr print
     dc.b 10,13,27,"p","   From the Operating System (TOS) :    ",27,"q"
     dc.b 10,13,"Total Clusters :$",0
     move.l driveextra+4(pc),d0
     bsr hexlongst
     bsr print
     dc.b 10,13,"Free Clusters :$",0
     move.l driveextra(pc),d0
     bsr hexlongst
     bsr print
     dc.b 10,13,"Sectors per Cluster :$",0
     move.l driveextra+12(pc),d0
     bsr hexlongst
     bsr print
     dc.b 10,13,"Bytes per Sector :$",0
     move.l driveextra+8(pc),d0
     bsr hexlongst
     bsr freespace
     rts

    freespace
     jsr print
     dc.b 10,13,"Therefore Free space = ",0
     even

     move.l driveextra(pc),d0     * no free clusters
     move.l driveextra+12(pc),d6    * sects per cluster
     mulu driveextra+10(pc),d6
     mulu d6,d0
     divu #$400,d0        * mulu and print free space
     move.w d0,digibyte
     jsr digits
     jsr print
     dc.b "K of ",0

     move.l driveextra+4(pc),d0     * total no of clusters
     move.l driveextra+12(pc),d6    * sects per cluster
     mulu driveextra+10(pc),d6
     mulu d6,d0
     divu #$400,d0
     move.w d0,digibyte
     jsr digits
     jsr print
     dc.b " total",0
     rts

    pressanykeytoexit
     bsr print
     dc.b 10,13,27,"p","         Press any key to exit          ",27,"q",0
     even
     bsr getkey
     rts

    resetscreen
     tst screenmode
     beq resetscreenexit
     move.w #1,-(sp)
     move.l #-1,-(sp)
     move.l #-1,-(sp)
     move.w #5,-(sp)
     trap #14
     add.l #12,sp
     move.l #colregs,-(sp)
     move.w #6,-(sp)
     trap #14
     addq.l #6,sp
    resetscreenexit
     rts


    ***************************************

    *** digital word print ,word in digibyte bsr digits
    digits
     moveq.l #0,d7
     move.w digibyte,d7
     divu #10000,d7
     bsr digiprint
     moveq.l #0,d7
     move.w digibyte,d7
     divu #1000,d7
     bsr digiprint
     moveq.l #0,d7
     move.w digibyte,d7
     divu #100,d7
     bsr digiprint
     moveq.l #0,d7
     move.w digibyte,d7
     divu #10,d7
     bsr digiprint
     move.w #$ffff,digiflag
     move.w digibyte,d7
     swap d7
     bsr digiprint
     clr.w digiflag
     rts
    digiprint
     swap d7
     move.w d7,digibyte
     swap d7
     tst.b d7
     beq digizero
     move.w #$ffff,digiflag
    digiret1
     add.w #"0",d7
    digiret2
     move.w d7,-(sp)
     move.w #2,-(sp)
     trap #1
     addq.l #4,sp
     rts
    digizero
     tst digiflag
     bne digiret1
     rts             * The end of VERY long digital print routine !
    digiflag
     dc.w 0
    digibyte
     dc.w 0
    getkey
     move.l #$20002,-(SP)
     trap   #13
     add.l #4,SP
     rts

    hexlongst
     move.l d0,-(sp)
     rol.l #8,d0
     bsr hexprint
     rol.l #8,d0
     bsr hexprint
     rol.l #8,d0
     bsr hexprint
     rol.l #8,d0
     bsr hexprint
     move.l (sp)+,d0
     rts
     

    hexprint
     move.l d0,-(sp)
     asr.l #4,d0
     bsr hpnext
     move.l (sp),d0
     bsr hpnext
     move.l (sp)+,d0
     rts
    hpnext
     andi.l #$f,d0
     cmpi.b #10,d0
     bmi hpnext2
     addq.b #7,d0
    hpnext2
     addi.b #48,d0
     move.w d0,-(sp)
     move.w #2,-(sp)
     trap #1
     addq.l #4,sp
     rts

    hexword86
     move.l d0,-(sp)
     bsr hexprint
     ror.l #8,d0
     bsr hexprint
     move.l (sp)+,d0
     rts


    print
     move.l (sp),-(sp)
     move.w #9,-(sp)
     trap #1
     addq.l #6,sp
     move.l (sp)+,a0
    ploop
     move.w (a0),d0
     tst.b d0
     beq pend
     asr.w #8,d0
     tst.b d0
     beq pend
      adda #2,a0
     bra ploop
    pend
     adda #2,a0
     move.l a0,-(sp)
     rts

    printchr
     move.l d0,-(sp)
     and.l #$ff,d0
     move.w d0,-(sp)
     move.w #2,-(sp)
     move.w #3,-(sp)
     trap #13
     add.l #6,sp
     move.l (sp)+,d0
     rts

    checkdrive
     move.l drivemap,d6
     btst d7,d6        * drv to check = d7
     beq checkdrivexit
     moveq #0,d0        * ret code in d0
     rts            * -1 = not there, 0=ok
    checkdrivexit
     moveq #-1,d0
     rts

    convertlu
     cmp.b #"a",d0        * if d0>=asc "a" subtract 32 from it
     bmi convertexit    * eg a => A , z => Z
     sub.b #32,d0
    convertexit
     rts

    driveextra
     ds.l 4

    drivemap
     dc.l 0
    driveselect
     dc.w 0
    colour0
     dc.w 16
    screenmode
     dc.w 0
    colregs
     dc.l $ffff3f00
     dc.l $f8f80000
     ds.l 6

    buffer



    (the end)

    Squid

    posted 19 Nov 2012 05:28 by Dom De Vitto


    I love this post by Scott Cassell, it's both scarey and wonderful.

    http://www.deeperblue.com/dancing-with-demons/


    Golf balls, marbles, sand and beer.

    posted 7 Nov 2012 04:25 by Dom De Vitto   [ updated 7 Nov 2012 04:35 ]

    Remember your Mayonnaise Jar ...
    A professor was teaching his philosophy class full of new students.  First he picked up a large empty mayonnaise jar and filled it to the top with golf balls.
    He asked the students "Is the jar full?", the students noddled and agreed it was.

    He then picked up a handful of marbles and poured them into the jar, shaking it until the marbles filled the gaps between the golf balls
    He asked again "Is the jar full?", the students looked at each other, then noddled and agreed it was.

    Next, he picked up a glass of sand and poured that into the jar.  The sand fell between the gaps and leveled off at the top of the jar.
    He asked again "Is the jar full NOW?", the students again looked at each other, thought, then noddled and agreed again.

    He then took out two cans of beer from under the table and poured these into the jar, with the sand soaking it all up.

     “Now, I want you to recognize that this jar represents your life. The golf balls are the important things: your family, children, health, friends, and favorite passions - things that if everything else was lost and only they remained, your life would still be full."

    “The marbles are the other big things that matter: your job, house, car."

    "The sand is everything else - the small stuff."

    "If you put the sand into the jar first, there is no room for the golf balls or the marbles.  The same goes for your life.  If you spend all your time and energy on the small stuff, you will never have room for the things that are important.  Pay attention to the things that are critical to your happiness.  Play with your children.  Take time to get health checkups.  Take your partner out to dinner.  There will always be time to clean the house and do some DIY.  Take care of the golf balls first, the things that really matter.  Set your priorities based on this - the rest is just sand.”

    One of the students raised their hand and inquired about the beer.  The professor smiled and said, “I’m glad you asked. It just goes to show you that no matter how full your life may seem, there’s always room for a couple of beers.”

    :-)

    Theamcodeaf

    posted 30 Oct 2012 16:50 by Dom De Vitto   [ updated 2 Nov 2012 02:38 ]

    Theamcodeaf is a protocol used to tersely communicate entity information with a high degree of resistance to interception.

    The name is derived from the two originating developers of the protocol, Al McCallum and Adam Ford, though others have contributed since it's original inception.

    The protocol syntax is defined as a location indicator followed by a number of optional descriptor/descriptor-intensity pairs and potentially a number of response codes from the receiver(s).

    The angle indicator is the code D followed by a decimal to indicate angle (IA) relative to transmitter.

    The formula to calculate IA is angle[degrees]/90+1, with immediately ahead being zero degrees (0/90+1=1).

    Descriptors/descriptor-intensity pairs take the form of a number of optional statement-clauses, formed by concatenating a item code and an intensity number (0 being extreme positive, 9 being extreme negative).

    Item codes include, top-down:
    H
    F
    T
    A
    L
    S
    (S is used as a general statement approximating the other items codes above).

    Theamcodeaf is a bidirectional protocol, with various response codes being used to form short message exchange blocks.

    New Car - KIA Rio

    posted 27 Aug 2012 05:43 by Dom De Vitto   [ updated 28 Aug 2012 14:18 ]

    After much number-crunching and comparison - in particular with the VW Golf bluemotion, I rcently bought a new KIA Rio '1+Air' 1.1 CRDI.

    Following over 4,000 miles of driving, I can conclude:
    • For mostly motorway ('freeway') driving @ 70 mph, I get 60-65 MPG.
    • For town driving (I love ISG - Idle Stop & Go), it's closer to 65 MPG.
    • If you're on a flat road, you can put it in 6th gear, and it will trundle along at 1,000-1,500 revs and registers 99.9 MPG ! (the most it can display)
    • If you race about, don't change up the gears, or change gears too frequently, it can get as low as 52 MPG.
    • My best MPG for the 1.5 miles from the local garage (full tank) to home (and this is mostly uphill) is 72.1 MPG - including 2 traffic lights.
    • I just filled the tank (40L) and got an average of  84  MPG over a  42 mile  trip !

    Basically, if you keep the top speed to 60-70, rather than 70, and just use the highest gear possible (keeping the revs below 2,000), you can really push up the MPG.  Idle Stop & Go is really good for saving fuel.  It works by turning off the engine when you put it in neutral, and then take your foot fully off the clutch.  It immediately starts the engine when you halfway depress the clutch again.  The engine startes so quickly, that it's running before the clutch is fully depressed, and always before you're even moved the gearstick - it's pretty awesome.  If you consider that the engine idles at 1,000 revs/minute, waiting for the normal 60 seconds is the same as driving around an extra half mile, so on a 5 mile (10 minute-ish) drive, that's a 10% saving.
    ISG does have it's qwerks though - if the battery isn't charged enough it doesn't engage (a little light shows it's disabled), and will actually restart the engine in ISG mode if the battery charge drops to low (e.g. the air con or lights drain the battery) - as you're in neutral, this isn't ever a problem.  It also (cleverly) restarts if you start to roll the car, presumebly so you've full power for the power steering etc.

    All in all, I've found it a really good car, it handles well, is 'quick' (though not blindingly so), looks good, and is what I'd have hoped for in a car.  I got 5 years of servicing (for £500), and combined with the 7 year / 100,000 mile warranty, ZERO rated car tax, and ZERO congestion charge band, I pretty much only have to fill it up once every 500+ miles (tank is 40 litres) and forget about it. 

    The only minor point is that they dealer only pumped the tyres up to 32 PSI, which is correct for the non-ECO tyres, but the ECO tyres are meant to be 38 PSI - when I did this my MPG jumped up by 5 MPG, so this really makes a difference.

    The only thing I would change would be the fact I got steel wheels, because the '1' model has these, and it also has the best combined MPG.  If I knew the MPG impact (positive or negative) of having their alloys, I would have almost certainly got their georgous sporty ones !

    If anyone from KIA is reading this, I'd gladly trial alloys and publish the results here !

    Moving, Buying, Selling Your House / Home....

    posted 21 Dec 2011 05:14 by Dom De Vitto   [ updated 13 Nov 2012 08:47 ]

    Ok, inspired by a friends FB post, so this is a little rough:

    Buying a house is not like anything else - nothing is confirmed until the ink is dry on the contract, and you've actually moved in.

    I really recommend getting "The Which? Guide to Doing Your Own Conveyancing" :

    http://www.amazon.co.uk/gp/offer-listing/085202813X/ref=dp_olp_used?ie=UTF8&condition=used

    You almost certainly DON'T want to do the conveyancing yourself - but you do:
    • Want to know exactly what everyone else needs to do for you
    • Want to know how long each of those steps would normally take.
    From experience, the "professionals" are often massively incompetent in every way - though they may seem fine at first.  I've heard of solicitors that put in the 'searches' to the wrong authority - delaying the contract signing by 5 weeks, and requiring a mortgage offer renewal, and re-assessment.
     
    It's up to YOU to make sure THEY don't make mistakes, which are always at YOUR expense (time+money).

    This goes for the people you're paying directly (solicitors, bank/lender) and the people paid by the people you're buying/selling from (estate agents, surveyors, their solicitors).  I've seen exchange of contracts not happen on a Friday because (it turns out) the sellers solicitor goes golfing at 11am on Friday - but his clerks were still telling estate agents "it may be signed today" at 3pm.

    I don't know anyone without a nightmare story, but I know the Which? Guide helped me massively with my last purchase, and every problem I've ever heard of would have been avoided using this book.  It does need a (minor, IMO) update to cover 'HIPs' etc.

    My "nightmare" was the vendor's friendly estate agent saying "I spoke to the sellers, and sorry, they can't possibly move out early.", so we agreed a date, and my family lived in a holiday home for two weeks (which was ace, but not the point).  When we spoke to the sellers face-to-face just before moving in, it turns out the ******* agent never bothered to ask them anything, and moving out early wouldn't have been any problem at all !  We could have even moved in over a few days, saving the cost to us of storage/removers!

    So the agent preferring to lie to me, rather than bothering to pick up the phone to ask their own customer a single question - which would have speed up the sale by two weeks and got the agent their commission two weeks earlier as well - this lie cost me around £1,500 !

    NEVER TRUST ANYONE INVOLVED IN BUYING A HOUSE!
    This includes any banks, solicitors, estate agents, surveyors, drain inspectors, sellers.  Basically these professions attract liars.  Don't get me wrong, there are some fantastic people out there (Leighton's Solicitors of Bournemouth are great and my sister was a credible 'Sales Negotiator', but error on the side of caution and pessimism.

    Talk to the seller (and your buyer) directly and frequently.
    An 'update' once a week isn't unreasonable, and more often if you're working through niggly details, like building/drain surveys (I've had a surveyor say "the seller wasn't in", but the seller said the whole family was on the drive loading up a van all morning).  Look at it this way, if you were buying anything else for hundreds of thousands of pounds - you'd expect the seller to be very keen, helpful and answer questions willingly.  Also it's a two-way street - are they having problems getting a mortgage/removals/whatever? Can you give them any suggestions as someone in the same "boat" ?  I've had a solicitor say "the searches are delayed as council has a 3 week backlog", but my buyers got theirs back in 5 days, from the same council.  A quick call to the council showed they were turning them around in 3 days, plus posting time, but my solicitor was too busy to submit the form - preferring to lie to me!

    Questions like "If the seller's purchase might not happen is this a problem for you? or is that more convenient for you?" are important.
    I've been in the position where my buyers would have happily paid £1,000 cash up the chain to the people we were buying from, as long as we could all complete before the end of the month (they were renting and £1,000 was the cost of the rental extension).  So often the chain can "work things out" as a group and everyone else is just trying to minimise their 9-5 work.

    Before you put in an offer, knock on the neighbours doors.
    They are going to be your neighbours soon, so are they friendly, or freaky? (or both!)
    Check what the street is like late on a weekday and weekend night, is it all house-parties and kids with hoodies street racing stolen Citron Saxos?
    I lived in a street where one person liked to double-park their lorry on the street every night, making it impossible to get larger vehicles past.  I'm sure someone affected could have complained, but doubt that would have changed much.


    The Worst Code I Ever Encountered

    posted 19 Dec 2011 07:51 by Dom De Vitto   [ updated 20 Dec 2011 04:02 ]

    This is the worst code I've ever encountered.  It's fantastic - I can only fault it as an exercise in confusion in that it doesn't name it's variables after operators - but they are named in a way that's misleading, nonsensical, and prone to typo-error - so it's still awesome.

    I should say that I've reformatted the code, because otherwise it makes my eyes bleed, and I'm lawsuit-adverse - just imagine the code with funky wrapping, inconsistent indenting and sneaky brace placement that infers the wrong code blocks, and you're at the right place in your mind.

    Off the top of my head, the tactical comment a) describes another function (or missed the '2'), b) makes no sense - in English at least, c) describes a looping/tree-walk process, when the code is entirely linear, d) makes no sense even applying the 'telephone test', e) uses terms 'step', 'parent', 'level' etc. that are either the same, or different, to each other, or common algorithmic terms, f) the term 'withoutany problem' means something, to someone, once.

    I just love the effort put in to do a tactical comment (though the coding standard mandated it!) but then the lack of grammatical sense, programmatic sense, or good spelling just undermines the whole thing.  I can read code, but theis author sets a trap for the naive by in providing documentation that entirely throws you off course and messes with your initial perception of what going to happen in the code.

    I really like that the last line (the 'punch-line') is entirely readible and makes complete sense, in isolation, leaving the reader dazed when they try to link it to the previous statements.  Brilliance.

    The very best thing about this code is that it came from the place with incredibly high standards of software engineering - in every respect, the place really did do things 'right', without exception.  However this code was inherited, and came from another company division - and here, obviously, be dragons....

    schedule_com2(step)
    int *step;
    /* *******************************************************************
       * Schedule_com schedules follows following algorithm to schedule  *
       * jobs :                                                          *
       * 1) At a particular level 1, say there are m steps ( m >= 1)     *
       *    -scheudle all he jobs in steps m-1 to the machines withoutany*
       *     problem.                                                    *
       *    -for the last step, schedule job if its parent has been done.*
       * 2) Once all the jobs have been done, move over to the next level*
       ******************************************************************* */
    {
      if (*step != *stepsAtLevel) { /* Just submit as many jobs as
                                     * possible */

        (void) scheduleJobInMask(step);
      }
      else if (*step == *stepsAtLevel) {
        (void) scheduleJobInMask(step);
      }
    }


    A collegue of mine (Keith Robichaud, a great S/W Eng, and not the original author of this code!) first brought the code of build_set/build_server.c to my attention around June 29th 1994.  Keith noticed that the second 'if' test was redundant, and asked me to rubber-stamp review his check-in back to the source-code control system - however I spotted that this function, a testament to amazingly bad coding, was entirely redundant, and was in fact only called from one place in the entire codebase.  Consequently, the only call to schedule_com2()' was replaced with 'scheduleJobInMask()' and all the this code above was deleted.

    We never confirmed the original author, and SCCS records were pruned at a major permanent fork some years before, but I have my suspicions.

    ....so though I went on to become a good and wise Software Engineer, this code lives now, only in my mind......[and here!]

    The Giant Claw (1957) - I love this film.

    posted 6 Nov 2011 05:44 by Dom De Vitto   [ updated 6 Nov 2011 05:45 ]

    From:  http://www.badmovies.org/movies/giantclaw/


    • Seen from space, the nations really are different colors.
    • The French Canadians are deathly afraid of Mexican food.
    • Battleships are quite large and often the target of hyperbole.
    • When is a pattern not a pattern? When it is a spiral.
    • The Pentagon is located across the street from the Capitol building.
    • Osmosis: os·mo·sis (oz-mo'sis, os-) n., 1. When a bird eats something.
    • Residents of Montana must be crack shots. It's the law.
    • Scientific instruments explode when they do not work.
    IMDB has the inside track: http://www.imdb.com/title/tt0050432/

    YouTube gets you most of the entire film but the French Canadian version, "La Garra Gigante", must be particularily awesome.

    www.justkrissi.com (JustKrissi)

    posted 4 Nov 2011 06:17 by Dom De Vitto   [ updated 4 Nov 2011 06:23 ]

    I've just done all my christmas girlie shopping for the ladies in my life at www.justkrissi.com - excellent choice, price and really good service.

    If you're out of ideas for Christmas presents, surf over there and have a look around - the produce list is growing all the time, and it doesn't take a minute to find something for that difficult person(s) in your life.  The site has just had a major upgrade, so if you find anything wrong, email justkrissi and you might get something more than just a thanks back !

    They also have a blog so not only do they sell you quality stuff, but they actually tell you how to make the most of their products - like how to get perfect nails, even for those who have always had problems.

    All in all 10/10 in all respects!

    Top Tips for Keeping Your Dog in Tip Top Condition

    posted 25 Sep 2011 08:12 by Dom De Vitto   [ updated 7 Oct 2011 15:06 ]

    Over the years I've had a few dogs, here are some of my top-tips that may be a use, especially if you have a Yorkshire Terrier.

    Food

    Dogs eat food, along with other things.  Always remember that your dog is basically a wolf - wolves eat other animals, including skin, fur, bones, and whatever else - 'yuk', yes, but natural, yes.  Dogs have slow digestive systems for exactly this reason, and one good feed a day (20 mins of eating) should suffice.  Never cook bones (especially chicken) as this makes them splinter and be dangerous to eat!
    We give our Yorkie raw chicken carcasses 4 times a week (he only eats about half a carcass eat time), and two days a week we blend up some vegetables (carrots, swede, parsnip, etc.) with the same amount of minced meat (beef, lamp, whatever) and he woofs this down.  One day a week we don't feed him - as dogs have a slow metabolism this isn't a problem (in the wild wolves may go days without a feed) and dogs are easily overfed, so this keeps there weight in check, especially as they get older and less active.  We get around 15-20 carcasses from a local butcher, bag them up individually and defrost them (still in the bag) before giving them to our dog.  Gob-smackingly, this only costs £10 (it's basically 'waist' from the butchers point of view), so we usually get a few 'recreational bones' too, for the dog to gnaw at and lick the raw marrowbone from the core.  http://julieannamos.hubpages.com/hub/Bones-To-Feed-Your-Dog has some more detail on why raw food is so much better, and cooked bones are dangerous.  Wikipedia's raw_feeding page, has more details including the problems of both processed (supermarket) food and raw feeding.

    Flaps and Free Roaming

    If you've an area that's safe for him to go in/out of, I'd recommend a dog flap or pet flap - out dog goes in/out whenever he wants, and he really appreciates the extra freedom.  If you think about it, if you couldn't go in and out when you wanted, you'd feel 'cooped up' pretty quickly, and dogs are pack animals that like to patrol the area around their 'den'.

    Treats

    I don't know why, but dogs LOVE cheese.  Unfortunately, like people, too much cheese tends to 'bung' them up.  The solution to this is cheese-in-a-tube - especially Primula Cheese (www.primula.co.uk).  It's low salt, easy to carry around, doesn't dry out (it's in a tube!) and ALL the profits go to charity!  It's a little harder to initially train a puppy with this kind of cheese/treat, as little solid treats (like small chedder cheese cubes) are easier to hand out and teach them to 'paw' at etc. but once they get the idea that doing the right thing gets them a treat, this kind of treat is brilliant.  Our dog won 'best trick' at a local dog show before he was even a year old, so it's highly effective.

    Pack Order

    Dogs are pack animals - it doesn't matter if it's a wolfhound or a chiuaua - get a few together and they will happily chase a toy or treat all day.  The important thing is to remember that you're the top dog in the pack - 'Alpha', and they don't do anything (in the wild or in your home) without the permission of the Alpha.  Not only is there an alpha, but everyone in the family has a pack order - and it's vital that your dog knows it's not the boss of any humans in the house - otherwise it will refuse to obey that human and may boss that human about - through growling and biting.

    Leads

    Leads are tricky - not the kind, but the restriction.  Some dogs need to know they are not in charge, but smaller dogs it just limits their ability to flee from an attacker.  For our yorkie, when he's on a lead he is more aggressive because his normal 'fight or flight' instinct is curtailed - his only option is fight.  Once off the lead, he knows he can 'escape' and he's much more friendly.

    1-10 of 14