Wednesday, December 28, 2016

P-touch info mode diagnostic

So I found a service manual for the PT-1900 and it says that it has a "diagnostic mode." With the unit powered off, hold code and k, then press the power, release the power, then release code and K you get into the INFO diagnostic mode, and the display will say "INFO MODE."

Note that it won't go into info mode unless the buffer is empty.


The page from the manual says:


Starting the Inspection Mode
First, press the “ON/OFF” key while pressing the “Code” and “R” keys, and release the “ON/OFF” key, then “Code” and “R” keys so that the RAM is cleared, and the machine performs normally. Then, when the power is OFF, press the “ON/OFF” key while pressing the “Code” and “K” keys and release the “ON/OFF” key, then the “Code” and “K” keys so that the machine goes into the inspection mode.


Once you are in "INFO MODE" and you type the number keys you get:




1 = Info mode (show the country settings and test the display)
2 = Cassette diagnostic (if you push the cassette identification pins with your finger, it will update in real-time)
3 = key (test the keyboard)
4 = cut (test the cutter)
5 = print 1
6 = print 2
7 = motor (runs the motor until you turn it off, best to take out the cassette first or you will waste your p-touch tape)
8 = AD (test the Analog/Digital conversion)

r = motor
m = print head
f = feed and cut

so hit ENTER and it will go into the various modes, when you've cycled through all the options for a given mode, it will go to the next mode.


I find the AD kind of interesting, as it will display the Voltage and Temperature sensors in real time:

VOLT TEMP
BA 8A


for the m=PRINT HEAD, if you then type y, it will cycle through Di,STR,CLK,LAT, w will go to OFF, then e will go to END, then 1 (one) turns the unit off. I have no idea what this means...perhaps it is to test the signals on the print head connector as there are signals on the connector that are named DI, STR, CLK and LAT.



My cool discovery of the day.







Na = Nation and it is a US model, H = Head Rank (I don't know what that means exactly), and Vo = Voltage (o for good, x for not good)



Cassette pins status







I'm using a Panasonic PQLV1 telephone adapter that only puts out 9V, but it seems to work. Probably why the Vo reads X instead of O.



Officially, the PT-1900 requires 9.5V.

I was able to get into the info mode on a PT-1750 and a PT-2300. The PT-1750 had some different options, one being a CG that would display the character roms.

Mastermind game

Years ago, I had a coleco digits handheld game. It played the game of mastermind, where it chooses a 4 digit number and you try to guess it. You press a button and it will tell you how many digits are in the solution and if they are in the correct place.

I thought it'd be fun to try and make a mastermind game using microsoft excel.


So you choose a number, put it in A1, then set up a function like this:

=findmatchwrongpos(TEXT($A$1),TEXT(C1)

and your function would look something like this where we mark a "match" with an asterisk so it won't be counted again.

Function findmatchwrongpos(a, b As String) As Integer
  For i = 1 To Len(a)
    If Mid(a, i, 1) = Mid(b, i, 1) Then
      correctposcount = correctposcount + 1
      Mid(a, i, 1) = "*"
      Mid(b, i, 1) = "*"
    End If
  Next i
  For i = 1 To Len(a)
    c = Mid(a, i, 1)
    If c <> "*" Then
        For j = 1 To Len(b)
          If Mid(b, j, 1) = c Then
            Mid(b, j, 1) = "*"
            Mid(a, i, 1) = "*"
            wrongposcount = wrongposcount + 1
            Exit For
           End If
        Next j
    End If
  Next i
  
  findmatchwrongpos = wrongposcount
End Function



And for debugging purposes, why not have a function that returns a variant type so you can see what's going on:


=findmatchitem(TEXT($A$1),TEXT(C1),1)

passing an item number so you can get different return items:



Function findmatchitem(a, b As String, item As Integer) As Variant

  For i = 1 To Len(a)
    If Mid(a, i, 1) = Mid(b, i, 1) Then
      correctposcount = correctposcount + 1
      Mid(a, i, 1) = "*"
      Mid(b, i, 1) = "*"
    End If
  Next i
  correcta = a
  correctb = b
  For i = 1 To Len(a)
    c = Mid(a, i, 1)
    If c <> "*" Then
        For j = 1 To Len(b)
          If Mid(b, j, 1) = c Then
            Mid(b, j, 1) = "*"
            Mid(a, i, 1) = "*"
            wrongposcount = wrongposcount + 1
            Exit For
           End If
        Next j
    End If
  Next i
  
  If item = 1 Then
    findmatchitem = correctposcount
  ElseIf item = 2 Then
    findmatchitem = wrongposcount
  ElseIf item = 3 Then
    findmatchitem = "CORRECT CHECK: " + correcta + "," + correctb
  ElseIf item = 4 Then
    findmatchitem = "WRONG CHECK: " + a + "," + b
  End If
End Function



Maybe after this, I'll dig out a copy of Interplay's Learn to Program Basic and write mastermind in it.

Monday, December 26, 2016

Ear blasting youtube on headphones

I like to watch youtube on my knoppix box and to use headphones. The problem is that so many videos have wildly different audio levels. Some videos are extremely quiet, while others are really loud. So what happens is that you turn the volume way up for the quiet video, then BAM! another video starts playing at an ear shattering level.

I don't really want to experience the full dynamic range of loudness on my headphones.

Windows has loudness equalization built-in, why not linux? Just a simple limiter will do.

Something like this, but for your computer audio:

http://gizmodo.com/245624/tv-volume-regulator-keeps-those-loud-commercials-on-an-even-keel

Sunday, December 18, 2016

Formula for number of dominoes

So I was trying to wrap my head around the formula for the number of dominoes.

It's (n+1)(n+2)/2.

For double 12 dominoes, that's 91. But how to derive it?

Let's look at the simple case of n=2 dominoes.

Plugging n=2 into the formula, we get (3)(4)/2 or 6 dominoes.



but there's tiles that stick out over the top of the triangle. There's (n+1) half tiles. Or (n+1)/2 area, to sum up all the half tile area.



and presto we get our formula:

((n+1)(n+1)/2) + ((n+1)/2)

and simplifying

(n^2+2n+1)/2 + (n+1)/2

to get

(n^2 + 3n + 2)/2

or

(n+1)(n+2)/2.


http://www.domino-games.com/faq/How-Many-Tiles-And-Dots-Are-In-A-Dominoes-Set.html

Math and dominoes...

Wednesday, December 14, 2016

Trs-80 whiz kids


I was going through some stuff today and came across a copy of the TRS-80 whiz kids comic book.

Kids today don't have the experience of growing up with the TRS-80 whiz kids. "Hey, it's a free comic book!"

Stories like "The computers that said no to drugs!" and "The computers that saved Metropolis!"

http://www.trs-80.org/trs-80-computer-whiz-kids/

Monday, December 12, 2016

Apple II checkerboard

I remember years ago I wanted to see what would happen if I flipped the Apple II's hi-res pages as fast as I could.

So I did an HGR which would clear the first hi res screen, then an HGR2 to switch to the second hi res screen and filled the screen with white with a for loop. Something like HCOLOR=7:FOR I = 0 TO 191:HPLOT 0,I TO 279,I:NEXT.

Then I entered a little machine language program that would read $c053 and $c054 to flip the pages, then jump back to the top of the loop.

As I recall, it would make a neat checkerboard effect, alternating black and white down the screen. If you altered the timing of the loop, the pattern would change.

Of course, this would necessitate a reset to get out of this loop.

This is all from memory, as I haven't had a real apple II for ages.

Thursday, December 8, 2016

Little puzzles

Recently, I've been fascinated with LCDs and how to drive them from a microcontroller. They're not simple like LEDs, you have to give them an AC signal. If you drive them with a DC signal, it will destroy the LCD.

So I read a bunch of pages about driving LCDs searching google on "driving lcd microcontroller".

In the pdf at http://www.atmel.com/Images/doc2569.pdf it describes how you can make the necessary voltages to swing from -vlcd to +vlcd using waveforms that runs from 0 to +vlcd and are out of phase with one another.

This totally baffled me, how could you make the negative voltage differences with only positive voltage?

I was stumped before I realized that the negative voltage difference wasn't from COM to ground or SEG to ground but instead from COM to SEG.

When COM is +vlcd and SEG is 0, you get +vlcd across COM-SEG.

When COM is 0 and SEG is +vlcd you get -vlcd across COM-SEG.


This page was pretty helpful to see this:

http://www.arduinoos.com/2014/08/lcd-direct-driving/

Sunday, November 27, 2016

I think I figured out why I like the original Stellar 7

So I'm looking at these screenshots of Stellar 7 and its remakes/sequels and I think I can see why I like the original. The viewscreen is bigger and fills up more of the screen space. In all of the remakes, the viewport is about half the size due to all of the cockpit graphics.

It makes the low resolution screen seem even more low resolution.

They also run too fast, somehow the slow frame rate makes the graphics easier for the eye to track.

This would be a fun project, to remake Stellar 7 with nice hi-res graphics in Blitz Basic or something.

Another game that would be a great remake with modern technology is Rescue Raiders.


A couple of great webpages on Stellar 7 with all kinds of nice screenshots:

http://www.hardcoregaming101.net/stellar7/stellar7.htm

https://www.c64-wiki.com/index.php/Stellar_7

Saturday, November 26, 2016

Trying to find things that you've seen long ago

I watched this foreign French movie on Bravo years ago. I forgot the name of the movie and so I went looking for it on imdb. I wasn't able to figure it out initially but I never gave up and kept looking every time it popped into my head. Finally, I figured out what it was. It was called "Le the au harem d'Archimede" or "Tea in the harem". You know, the Theorem of Archimedes.

I remember these things long ago and can't remember what they were exactly.

Like this music video that I think aired on the show "Rock'n America" back in the 80s where this gal in this yellow jumpsuit was in some kind of power plant pulling levers up and down. I'm still trying to figure out what that one was. I vaguely remember it being called Love lines or something like that.

And this Othello game that I played years ago on some really fancy computer back in the mid 80s. I don't know what computer it was, but that was practically the only game for it and I remember that the computer was really expensive. It was some really obscure desktop computer with a monochrome display. I don't remember it having color. Someday I'll figure out what it was. I keep searching google images for Othello or Reversi but nothing looks familiar.

The obscure things that you remember and you want to put a name with them.

Wednesday, November 16, 2016

Inkjet printers drive me crazy

If you leave an inkjet printer idle for a couple of weeks, the cartridges tend to dry up. Then you get all of this streaky printing with missing lines.

I don't print all that much so this happens to me a lot. So at the precise moment I actually need my printer for something important, it doesn't print properly.

Most infuriating.

Thursday, November 10, 2016

Finnix for powerpc imac g4

A friend gave me an old imac g4 with an ailing hard drive. How to image it? I would normally use knoppix, my favorite linux. But the imac g4 is powerpc, and knoppix is x86.

What to do? Well, there's a nice distribution called Finnix which is very knoppix-like and works with powerpc.

It seems to be text only, but that isn't a problem for me, as the programs that I'm interested in are things like ddrescue, smartctl, and mount.cifs.

So far, it works great!

My knoppix flash drive install seems to get slower and slower


I like to run a knoppix system off of a flash drive, but it has tended to get slower and slower over time.

Perhaps I just don't have enough memory on this old notebook (it only has 2GB).

Maybe the iceweasel/firefox history files get too big. I like keeping my history though.

I see the flash drive flicker quite a bit at times and sometimes iceweasel will just take forever to load a page.

It does run though and will return to normal eventually.


edit: Maybe the flash drive is a little bit screwy. I had to fix some corruption in the persistent image with fsck.ext2. Also there was some corruption in the vfat partition where knoppix-data.img resides that fsck.vfat couldn't fix. It told me the fat table and the backup didn't match and presented me with options to take one or the other, but no matter which one I chose, it wouldn't make any modifications.


Sunday, October 30, 2016

1/9 1/99 1/999 and so on

I was playing with an alphasmart 3000 and the calculator applet and just punching numbers in.

So 1/9 = .11111111111111111
and 1/99 = .0101010101010101
and 1/999 = .001001001001001
and 1/9999 = .0001000100010001

etc.

This makes sense if you think about it a little bit.

Numbers are cool.

Monday, October 24, 2016

Old system doesn't like the new USB WD 1235 series

I put a new USB western digital WD 1235 (at least that's what the hardware detect calls it) on my old windows 2000 system and it hates it.

I got a WD 3TB and tried it, a WD 4TB as well, and it just doesn't like them at all. hey seem to be detected fine but disk management says "unreadable".

They both work great on linux. *sigh*

The older 4TB WD USB drives work without issue, I wonder why these ones don't.

I thought it might be the partition table, I zeroed the first part of the drive and it still thinks it's unreadable.

Saturday, October 22, 2016

The Never Used Kitchen

Apparently, this kitchen was built in 1956 and never used. A real time capsule.

Good thing it is pristine, unlike Tulsarama's Miss Belvedere.

http://betweennapsontheporch.net/never-used-ge-kitchen-a-time-capsule/

Thursday, October 13, 2016

Cool spynet video watch

My latest toy is a SpyNet video watch. It's a lot of fun. The camera does 320x240 videos and works best outdoors in sunlight. Under my normal indoor lighting the videos are pretty much black. They fixed this with the more recent version that has night vision. (Mine is the old version, with no night vision)

It even has a couple of games built-in, nothing that will hold your interest for very long. One is like Chromium BSU (if you have knoppix, you know this game) and the other is a "fighting" defense game where you block punches and kicks to win.

It's pretty bulky, holding your arm up and pressing the buttons was like using the ElectraComs.

The bulkiness around your wrist makes it hard to take off or put on your coat.

Since the camera is fixed at the top of the watch, you have to swing your arm around to "point" at what you want to capture, which is pretty awkward. It really limits you to capturing things from 12 to 3 o'clock. The snake attachment looks pretty interesting.




Sunday, October 2, 2016

USB flash drives and md5sum

I always thought it was interesting how USB flash drives would read differently if they had sectors that hadn't been written yet.

For instance, here's a flash drive that I was testing:

knoppix@Microknoppix:~$ time dd if=/dev/sdc | md5sum
1972744+0 records in
1972744+0 records out
1010044928 bytes (1.0 GB) copied, 75.2915 s, 13.4 MB/s
e7ef4e43591086d1f484ac8ae0167ad8 -

real 1m15.670s
user 0m5.747s
sys 0m6.820s
knoppix@Microknoppix:~$ time dd if=/dev/sdc | md5sum
1972744+0 records in
1972744+0 records out
4d1ec5b4d17d364db0dc7f1b361271e7 -
1010044928 bytes (1.0 GB) copied, 74.0257 s, 13.6 MB/s

real 1m20.292s
user 0m5.860s
sys 0m6.737s
knoppix@Microknoppix:~$

Somehow that just doesn't seem right, to give different results. I suppose I could initialize it by writing zeros to every sector before using it.

so let's make a zero file that fills up all the available space:

knoppix@Microknoppix:~$ ls /media/sdc
knoppix@Microknoppix:~$ time dd if=/dev/zero of=/media/sdc/ZEROFILE
dd: writing to ‘/media/sdc/ZEROFILE’: No space left on device
1972225+0 records in
1972224+0 records out
1009778688 bytes (1.0 GB) copied, 10.447 s, 96.7 MB/s

real 0m10.456s
user 0m1.550s
sys 0m7.897s
knoppix@Microknoppix:~$ sync
knoppix@Microknoppix:~$ umount /dev/sdc


and let's check if that fixes our different md5sums:


knoppix@Microknoppix:~$ time dd if=/dev/sdc | md5sum
1972744+0 records in
1972744+0 records out
1010044928 bytes (1.0 GB) copied2029b6aa4ebbd3c5da36631b1273ef41 -
, 60.7487 s, 16.6 MB/s

real 1m0.780s
user 0m5.677s
sys 0m7.080s
knoppix@Microknoppix:~$ time dd if=/dev/sdc | md5sum
1972744+0 records in
1972744+0 records out
2029b6aa4ebbd3c5da36631b1273ef41 -
1010044928 bytes (1.0 GB) copied, 65.335 s, 15.5 MB/s

real 1m8.571s
user 0m5.597s
sys 0m6.947s

and yes, now the md5sums match.

Friday, September 30, 2016

Setting VLC to tune channel 3 NTSC

I wanted knoppix 7.6 to tune channel 3 on my bt848 card on /dev/video0 but it wouldn't tune properly.

So I tried everything I could think of.

but I looked at the parameter list after clicking on advanced options and it needed a space before :v4l2-tuner-frequency=61250

61250 khz = 61.25 mhz for channel 3 which will tune my analog cable box DTA.

so this line doesn't work:

:v4l2-standard=NTSC:v4l2-tuner-frequency=61250 DOESN'T WORK

and this line does work:

:v4l2-standard=NTSC :v4l2-tuner-frequency=61250 WORKS

so you just have to manually add the space and it works.

Thursday, September 29, 2016

Ubuntu sound is problematic with my analog tv cards

I thought I'd try ubuntu 16.04 on a system that I'd been using with knoppix and I am getting extremely frustrated.

I launch tvtime or vlc and I just can't get the sound working at all from my brooktree 848 capture cards. I actually have two bt848 installed in this system.

I installed pavucontrol and I can see that there's some audio flickering on the meter but I just can't hear it.

With knoppix, everything just works with regards to the audio, and now I am so totally baffled.

I think I better do something else for awhile...I can see why people use windows.

There's video from /dev/video0 and /dev/video1 but just no sound.

Monday, September 26, 2016

Built-in editor for microcontroller kit

I'm having a great deal of fun trying to figure out the ins and outs of the Thames and Kosmos microcontroller kit.

I wrote my first program(s) using the built-in editor and I have to say that it's a little bit restrictive. For instance, you have to double click on an instruction (or drag it into the program pane) to add it to the program.

Once you've put it in, you can't edit it in any way except to delete it. No copy/paste, or changing a numeric constant.

So to enter an instruction like Delay = 250, first you have to set the constant to 250, then double click on the Delay instruction.

I did notice that all of the sample programs have the suffix .k and they are all text files. One should be able to edit a text file and load it into the editor. It seems that labels have no indentation, and regular instruction have a TAB at the beginning of the line.

The initial program upon first launching the editor software had the line Delay 250, but I could only enter the instruction Delay = 250, so that must have been loaded from a text file.

Saturday, September 24, 2016

Thames and Kosmos Microcontroller kit

My latest toy is a Thames and Kosmos Microcontroller kit. This is great fun. I think it's discontinued and I got this second hand. It only seems to be missing one of the transistors but I don't think that's a show stopper.

So far I've put it together and hooked up the first test. You have to assemble the pieces into the case, pressing the little clips into place, and placing the potentiometer, the microphone, the piezo and hooking up the power connections.

There's a lot of connections to be made in the diagram for the first test and I missed a couple. I actually missed a critical one and the test wouldn't run as it didn't have the pins connected pins on the microcontroller between 5v and start.

Then I got some of the LEDs installed backwards, and finally I realized how you can tell polarity: there's a small flat spot on the side of the LED. It's subtle but if you look closely it's there.

Once everything is hooked up properly, the LEDs will light in sequence, the first LED's brightness will be controlled by a light sensor, and the rate of the LED sequence is controlled by the same light sensor (bright makes it slow, dark makes it fast) and if you press on a clip switch, the piezo will beep and freeze the light sequence. Pretty cool.

Thankfully, there's a 9v barrel plug so I don't have to use batteries but it's left to you to find an appropriate power supply (after about a half hour I located something that would work in all of my electronic stuff).

Great fun, so far I'm having a blast.

Friday, September 23, 2016

I wish VLC would allow "fit to window" stretching

I hate black borders around video. I'd rather have the image stretched to fill the window. Instead, VLC and tvtime want to enforce aspect ratios. It'd be nice if there was an option to "relax" this aspect ratio enforcement.

I don't mind a little image distortion here and there, I've gotten used to the 4:3 to 16:9 stretching on my TV.

VLC command line for bringing up the analog TV card

I thought I'd figure out how to get VLC started and playing from my analog TV brooktree 848 card.

The command line that works for me is:

vlc v4l2:///dev/video0 --v4l2-standard NTSC --live-caching 0 &

I like the ampersand at the end to run it in the background and keep the terminal window active.


https://wiki.videolan.org/Documentation:Modules/v4l2/


http://askubuntu.com/questions/527482/is-it-really-possible-to-set-up-vlc-to-stream-tv-from-tv-tuner-card-encore-enlt


I had to do this because it was too complicated for family members (who will go nameless) to bring up the dialogs and to do it manually.

It's amazing how just the smallest complexity can stump people.

When we had to switch to Digital Television Converter Boxes, the additional complexity of having a DTV box that broadcasts on channel 3 would completely baffle an unnamed family member. And the DTV box that has its own volume control in addition to the TVs own volume control.

They liked it when there was no complexity: you turn it on and it works. They weren't keen on having two remotes either: one remote for the TV, and one for the DTV box.

I was really glad when we found a TV (I think it was a Funai) that when plugged in would come up on channel 3 ready to go, so we could hide the TV remote.

It's the same reason why people like automatic transmissions: they just put their foot on the gas and the car goes. They don't want the trouble of having to switch gears themselves and the learning curve that goes with that.

Friday, September 16, 2016

I've grown to really like subtitles

I have grown accustomed to watching movies with subtitles always turned on. I think it takes some of the cognitive load off from having to listen closely to the dialogue. In some movies the characters talk softly and you can't understand what they're saying half of the time.

I get upset when I get a dvd that doesn't have subtitles in English. It'd be neat to have the movies subtitled on movies shown on in-flight entertainment. Often they'll have sustitles in foreign languages but not English. I don't care if the movie is already in English, give me English subtitles too!

Thursday, September 15, 2016

Logitech revue is a nice doorstop

So I got this neat looking Logitech revue, and plugging it in and going through the initial setup, it just waits at the "Downloading update" screen forever.

It says to wait 10-15 minutes, but I waited for about 5 hours and I don't think it's going to do anything.

If I hit CTRL+ALT+DEL it reboots but it just gets hung up again at "Downloading update."


I guess that's the wave of the future, where products get orphaned and disowned by their creators after a couple of years.


So it's about as good as a doorstop. A really nice looking shiny gloss black doorstop.

I suppose that I could reuse the K700 keyboard as it's got the logitech unifying symbol on it.

edit:

I found another Logitech Revue and it apparently had already been set up previously and it had no problem running. All I really wanted to do was to see well how the web browser worked. It's a bit slow, but that's to be expected. I'd say it's about on par with the built-in browser in an LG smart TV. It'll play youtube in the browser but it takes a bit of time to get it playing.

I downloaded an mp4 video and the built-in media player would play it well.

A real shame to abandon such a cute little device.

Wednesday, September 14, 2016

Trying to get knoppix to play audio over the hdmi

So I got this core i3 system and I wanted to play audio over the hdmi.

Knoppix is awesome but I had a hard time figuring out how to set the default audio device.

alsamixer doesn't seem to have facilities for setting the default audio output.

aplay -l gives me this output:

knoppix@Microknoppix:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 1: ALC892 Digital [ALC892 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0


and then editing the file /usr/share/alsa/alsa.conf

defaults.pcm.card 0
defaults.pcm.device 3

I set the defaults.pcm.device to 3 so that it will play over HDMI 0

alsactl init

seems to read the alsa.conf file to get things working, and youtube plays over the hdmi with iceweasel.

----
edit:
I like to run knoppix on a flash drive with a persistent image and after changing the default.pcm.device to 3, I took the flash drive and booted it on another system. Then I got no sound on the other system which was totally baffling. Then I remembered that I had changed the default.pcm.device and resetting it back to 0, the sound came back. On that particular system, there is no device #3.

Sunday, September 11, 2016

Ridiculously different power plugs

One of the things that I absolutely hate are devices that have some non-standard power plug jack. I've got this chumby one that takes 5 volts but it has the weirdest little power plug. I wish manufacturers would just use regular plugs that you can easily get a replacement ac adapter for.

There are reasons for using a strange plug, like people plugging in 12V power supplies to a 5V input, but I always check before I would do that. A little labeling goes a long way.

At least you could give me the inner and outer diameters of the plug on the label, for instance.

I did find a plug that would sort of work, but it isn't the right outer diameter so it loses proper connection with the slightest bump.

Some of the worst offenders in this regard are older LCD monitors. Why, why, why use such funny power plugs on the 12V adapter bricks. Can't we just standardize things? I was really glad when they went away from using power bricks to just integrating the power supply on the monitor and using the regular 3 plug AC cord.

And don't get me started on external cd/dvd rom drives. They often use a keyed plug but if there's a different way to wire 4 or 5 pins, they will use all possible permutations. Some of the power bricks have labels that say what pins are what voltage, but the drives don't have such corresponding information. So if you mix up your AC adapters...

Wednesday, September 7, 2016

Future cars may be a lot slower

I was thinking that autonomous vehicles would be a lot safer if they drove slower through the city, minimizing the risk of accidents.

http://www.treehugger.com/cars/praise-slow-car.html

And there's a new movement for 20 is plenty. Every day I read about bicyclists and pedestrians being killed, just so that cars can get to their destinations a little faster. You shouldn't have to die for riding your bike around the city.


http://www.treehugger.com/urban-design/more-reasons-why-twenty-plenty-or-30-enough-metric-types.html

Tuesday, September 6, 2016

Primitive User Interfaces

I was having quite a bit of fun fiddling with the MX-909 and its microprocessor. The primitive user interface of entering commands and parameters with a keypad reminded me of something I was reading about recently, the Apollo Guidance computer.

The pilots would type a two digit verb and then type some parameters.

https://en.wikipedia.org/wiki/Apollo_Guidance_Computer

I like this replica of the DSKY.



What a far cry from a mouse and GUI, but it got the job done.

Can you imagine what it was like having errors show up on this computer during the mission? And all you've got is a bunch of lights and numbers to look at on the display.

http://www.doneyles.com/LM/Tales.html

and there's a javascript AGC simulator Moonjs at http://svtsim.com/moonjs/agc.html

Saturday, September 3, 2016

Triple monitor cards

I was looking at the frys ad today and saw that they have a GT710 that will support 3 monitors simultaneously.

I have systems and video cards that have 3 different outputs but only 2 crtcs which means that they only will output to 2 monitors simultaneously.

The Optiplex 760 has displayport, VGA, and I chucked a low profile ADD2-N card in there for a DVI output, but the integrated video will only support 2 of 3.

That third output just taunts me...

I've got another video card around here that has 3 heads, but it'll only do 2 outputs as well.

There ought to be a law that says if you've got 3 heads, that they all work...



From this review:
http://www.pcadvisor.co.uk/review/graphics-cards/evga-geforce-gt-710-review-3639185/

"The EVGA GT 710 gives you one each of VGA, HDMI and DVI-D outputs. The card can output on all three ports simultaneously for multi-monitor setups, although sadly there’s no DisplayPort available."

Friday, September 2, 2016

Adding a mode to xrandr

I was trying to use an HP w19b with my old dell inspiron laptop e1505 with a vga output. But for some reason knoppix can't seem to bring up a resolution greater than 1024x768.

So after some searching I found this page:

http://www.ubuntugeek.com/how-change-display-resolution-settings-using-xrandr.html

The top res for the HP w19b is 1440x900 so

cvt 1440 900

gives me:

# 1440x900 59.89 Hz (CVT 1.30MA) hsync: 55.93 kHz; pclk: 106.50 MHz
Modeline "1440x900_60.00" 106.50 1440 1528 1672 1904 900 903 909 934 -hsync +vsync

xrandr --newmode "1440x900_60.00" 106.50 1440 1528 1672 1904 900 903 909 934 -hsync +vsync
xrandr --addmode VGA-1 1440x900_60.00
xrandr --output VGA-1 --mode 1440x900_60.00


what's kind of cool is that once I add the mode, it will show up in the ARandR gui tool as well.

xrandr
Screen 0: minimum 320 x 200, current 1024 x 768, maximum 4096 x 4096
VGA-1 connected primary 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
1024x768 60.00*
800x600 60.32 56.25
848x480 60.00
640x480 59.94
TV-1 disconnected (normal left inverted right x axis y axis)
1440x900_60.00 (0x1aa) 106.500MHz
h: width 1440 start 1528 end 1672 total 1904 skew 0 clock 55.93KHz
v: height 900 start 903 end 909 total 934 clock 59.89Hz



Just for fun, I thought I'd make some "nonstandard modes" just to see if they'd work.

I tried cvt 1200 900 and that worked, and cvt 480 900 and that worked too. 480x900 makes pixels 3x wide as high for a 1440x900 monitor. Looks trippy.

cvt 480 900
# 480x900 59.62 Hz (CVT) hsync: 55.69 kHz; pclk: 34.75 MHz
Modeline "480x900_60.00" 34.75 480 504 552 624 900 903 913 934 -hsync +vsync
xrandr --newmode "480x900_60.00" 34.75 480 504 552 624 900 903 913 934 -hsync +vsync
xrandr --addmode VGA-1 480x900_60.00
xrandr --output VGA-1 -mode 480x900_600.00


and I have this Haier 24 inch tv that only reports that it goes up to 1680x1050 in VGA mode. After making a cvt 1920 1080 mode is the first time I've been able to put 1920x1080 on the vga with it.

Thursday, September 1, 2016

Playing with the Maxitronix MX-909 CPU

Investigating the Maxitronix MX-909 CPU.

The Maxitronix CPU is quite interesting. It looks like a "simplified" processor that runs an interpreted machine language.

It has 6 registers, A through F, each a single byte.

Line numbers are used for addresses.

There's a limit of 64 instructions (or lines) in a program.
So you get to enter instructions from line 00 to line 3F.

There's 32 keys in the keyboard, arranged in 2 groups of 16 keys (4 keys by 4 keys).


The opcodes are:

MOV move data
IN read data from input port - 4 bits
OUT write data to output port - 8 bits
CMP compare data
JMP jump to an address
JC/JNC jump carry/no carry
JZ/JNZ jump zero/non zero
SEC/CLC set/clear carry
ROR/ROL rotate
INC/DEC increment/decrement
ADD
SUB
OR
AND
XOR
NOT
TM1/TM2 TM1=delay by param*10ms TM2=delay by param*1sec
HEX makes a data table entry of a single byte
BON/BOFF BON sets up a buzzer at a specific frequency on output pin 8, BOFF turns it off, used with TM1/TM2 to make a specific duration
STP stop
NOP no op

I count 28 different instructions.


The addressing modes are pretty simple too:

for the move instruction:

MOV reg,#n8 (the n8 means an 8 bit number), reg is A-F
MOV reg,reg
MOV A,@reg read from memory (indirection by register)

Interestingly, you can move from memory to the A register with register indirection (read from memory), but you can't store to memory.


so a sample program would be

00 MOV c,#80
01 MOV a,c
02 INC a
03 JMP 02

For some reason, they call registers "mem" in the manual, which seems a bit confusing, as I would normally interpret mem to mean memory.

It does look very much like machine language programming, and essentially it is.

It's pretty clever.

The debugger leaves something to be desired.
Once you put the CPU into debug mode, you choose a register to watch (b-f) or 0 (will show you the zero and carry flags in the digits displayed).

So you get a display that shows you the current contents of A and another register of your choosing.

for example:

line A reg B-F reg
00 A 00 C 00

and pressing RUN gets:

01 A 00 C 80

and pressing RUN again gets:

02 A 80 C 80



You can single step through by pressing RUN, but here's the annoying thing: you can't change the register displayed. So once you've chosen to show register B, you get register B until you've exited the program.


STACKED INSTRUCTIONS:

There's some advanced stuff here too like what they call "stacked instructions" in the manual.

If you have multiple identical immediate MOVs in a row, only the first one will be executed.

So if you have

20 MOV C,#20
21 MOV C,#21
22 MOV C,#22
23 MOV C,#23

and you execute a JMP 21, only the first MOV C will be executed, and the following ones will not be executed. So JMP 21 will give you the value #21H in register C by the time the program counter hits 24.

The BON instruction can be "stacked" too.

10 BON #01H
11 BON #03H
12 BON #05H

has the same behavior. Here JMP 11 will execute BON #03H and will skip any sequential following BON instructions.

So what happens when the CPU hits an empty instruction? Execution stops and you get ILL on the screen.

Data entry of programs is fairly straightforward, but there are some interface annoyances. For instance, once you lock in a specific opcode, you have to enter the parameters fully before you're allowed to go back and change the opcode. So if you choose MOV _,#__ as your opcode, you have to provide the register and the immediate value before you can do anything else. You should be able to press left arrow and change it immediately but you're not allowed to do that.

Another is that you have to press the down arrow to "lock in" the instruction even after you've entered all the parameters. Failure to do so makes the instruction disappear when you type ESC to change the cpu mode from Program to Debug.

There's no saving or loading your creations so when the power is off, your program disappears. It's only intended for small programs anyway, so this isn't a huge drawback.

It'd be really neat to have a full dot matrix LCD with being able to PRINT things to the display, but the focus is on interfacing with external components in the kit, like the LEDs and the 7 segment display.


If you want to see a sample of the manual, here's a sample (and shows project #470 and #484).

http://www.elenco.com/admin_data/pdffiles/MX909.pdf

Man finds himself the only passenger on the plane

http://www.wsbtv.com/news/national/hot-topics/atlanta-man-boards-flight-discovers-i-am-the-only-person-on-this-plane/357705663#

http://www.usatoday.com/story/travel/flights/todayinthesky/2016/06/24/delta-flier-only-passenger-160-seat-md-90/86327662/

Sounds like an episode of the Twilight Zone. Or maybe the rapture happened and he got left behind.

Wednesday, August 31, 2016

Man who dedicated himself to doing everything right

"Brandon did everything the right way to such an extreme that within the Arkansas football program, fanatical devotion to the correct course of action became known as doing things "the Burls Way.""

"Almost Perfect ARKANSAS LINEMAN BRANDON BURLSWORTH DEDICATED HIMSELF TO DOING EVERYTHING FLAWLESSLY. WHEN SOMETHING FINALLY WENT WRONG, IT COST HIM A BRIGHT NFL FUTURE--AND HIS LIFE"

I thought this was an interesting and tragic story.


http://www.campusrush.com/brandon-burlsworth-movie-greater-arkansas-football-1987980608.html


http://www.si.com/vault/1999/06/28/8108380/almost-perfect-arkansas-lineman-brandon-burlsworth-dedicated-himself-to-doing-everything-flawlessly-when-something-finally-went-wrong-it-cost-him-a-bright-nfl-futureand-his-life

Tuesday, August 30, 2016

Running over pedestrians in China

I could not believe this when I read it.


Driven to Kill
Why drivers in China intentionally kill the pedestrians they hit.
By Geoffrey Sant

http://www.slate.com/articles/news_and_politics/foreigners/2015/09/why_drivers_in_china_intentionally_kill_the_pedestrians_they_hit_china_s.single.html

What's with all of the aggressive driving these days?

I'm really seeing a lot of aggressive driving these days. It seems like when the gas prices go down, everybody wants to get on the road. The traffic lately has been pretty heavy.

Yesterday, I saw the aftermath of a bad accident when I came off the freeway. Police cars everywhere blocking the intersection and ambulances taking people away.

I also witnessed an accident that same day where this car ran a red light and clipped another car that was going through. Thankfully, it wasn't a major crash, but it was totally avoidable.

Totally avoidable. It's not like this is a complicated equation: slow down and drive with safety in mind. So you gain a few seconds but you put everybody at risk.

Everybody's really sorry after they wipe somebody out. But it didn't have to happen in the first place.

I remember getting rear ended while waiting for a left turn arrow. Why? Because the lady was speeding and was out of control. She had just totaled my car and she has the gall to say "Oh it was already like that!" And thanks for the massive whiplash. So I have to pay the price for someone else's recklessness. Just because they "were in a hurry."

Sunday, August 28, 2016

Maxitronix 500-in-1

My new toy, a maxitronix 500-in-1. I was most interested in how the little cpu works, and how you program it with the keyboard and lcd.

The mpu has:

64 memory (I'm going to assume they mean bytes)
one (1) accumulator
five (5) registers
four (4) input ports
eight (8) output ports (data 8-bit)
26 instructions available.



http://www.elenco.com/search/searchdetails/500-in-1_electronic_project_lab=Mjg3

Wednesday, August 24, 2016

i810 video and 1680x1050 monitor

I've got this old dell system with i810 video and it works great with a dell 2007FP with its 1600x1200 video, but a dell e228wfp just doesn't want to go higher than 1280x1024 under windows 2000.

The native resolution of the e228wfp is 1680x1050.

Apparently, the video bios was written long before (circa 2002) there were any widescreen resolutions like 1680x1050.

I guess I could get it working if I run with linux, a very clever person figured out how to "patch the video bios".


http://www.melvilletheatre.com/articles/intel-widescreen/


I'm going to boot it up with knoppix and see if it can handle the full resolution.

edit: yes, knoppix works with the full 1680x1050 resolution.


This isn't the first time I've found an old video card driver that doesn't like high resolutions, a matrox g200 under win95 positively hates my full hd 1920x1080 monitor and won't boot up properly, instead going to something like 640x400x8 and squawking that it can't find a good resolution. If I boot up with the monitor switched to another system (with my KVM switch), it will boot up just fine. I think it just doesn't handle all of the resolutions that it gets from the EDID.

Saturday, August 20, 2016

Gimp keeps cropping my perspective rotations

I'll admit that I'm kind of gimp newbie. I want to crop an image, do some perspective transformations and then have the resulting image not cropped.

But gimp keeps cropping it. I've figured out a workaround though: just promote what is called a "floating selection" to a new layer.

Here's my original pic:



I crop it:



Now I do a Tools/Transform Tools/Perspective:



And after I get it to correct the perspective into straight lines:



And then I click on transform:



But you see that the floating selection is outside the original rectangle of the crop. So we right click and Image/Fit canvas to image:





and now the canvas has expanded:



but we're still not done. We need to promote the floating selection to a layer. Right click on the floating selection and choose To New Layer:





Now you want to right click and go to Image/Merge Visible Layers and choose expanded as necessary:





And now it's all back to a single image.

Before merging visible layers:



After merging visible layers:



Thursday, August 18, 2016

Using VLC to play analog tv card

One of the things that I like about knoppix is that it includes tvtime. If you've got a standard analog tv card (bt848 based) it should work out of the box.

Sure, analog TV is a dinosaur, but I can still get analog cable TV from the digital-analog converters from the cable company.

All you have to do is to tune channel 3 on the analog and use the remote for the converter box.


I recently figured out that VLC will also play the TV card quite well, just point it to /dev/video0 or /dev/video1 (or whichever /dev/video is the proper number) and it works quite well.

One of the problems is that VLC doesn't seem to have any support for changing the channels on the tuner. TVtime has this built-in.

(Not that you really need to change the channel, but I wanted to know how to do it).


"v4l2-ctl --help-tuner" gives you
Tuner/Modulator options:
-F, --get-freq query the frequency [VIDIOC_G_FREQUENCY]
-f, --set-freq=
set the frequency to MHz [VIDIOC_S_FREQUENCY]
-T, --get-tuner query the tuner settings [VIDIOC_G_TUNER]
-t, --set-tuner=
set the audio mode of the tuner [VIDIOC_S_TUNER]
Possible values: mono, stereo, lang2, lang1, bilingual
--tuner-index= Use idx as tuner idx for tuner/modulator commands
--list-freq-bands display all frequency bands for the tuner/modulator
[VIDIOC_ENUM_FREQ_BANDS]
--get-modulator query the modulator settings [VIDIOC_G_MODULATOR]


You can use "v4l2-ctl -d /dev/video0 -f 61.25" from the command line to set the frequency to change the channel to 3.
You can use "v4l2-ctl -d /dev/video0 -f 67.25" from the command line to set the frequency to change the channel to 4.

http://osdir.com/ml/video4linux-list/2009-06/msg00098.html


https://en.wikipedia.org/wiki/North_American_television_frequencies

Also make sure that you show the "additional options" in the play capture card dialog and set the caching to 0ms, otherwise your audio will be out of sync since it will wait for the caching delay before it shows the video.


Wednesday, August 17, 2016

P-Touch PT-330 won't print anything

I have a PT-330 that won't print anything. It sounds just like this problem asked over at Justanswers.


http://www.justanswer.com/printers/2ktvg-older-p-touch-label-maker-pt-330-when-print.html

"Customer Question
I have an older P-Touch label maker (PT-330). When I print, the label comes out but it is blank. I have tried several different size tapes to see if it is a tape problem, but they all are the same. Is it a goner? "

Everything seems to work, it just doesn't print anything on the tape.






I inspected it very carefully and the problem is that the roller isn't being pressed tightly against the printhead. The plastic in the mechanism has gotten brittle and a piece has cracked so it no longer works properly.

If you look carefully at the picture you can see the gap. There isn't supposed to be any gap when the lever is pushed all the way down.





It's interesting to look at the system board. Click on the pic for a full size view.




There's a Mitsubishi M37702S1AFP M37702 cpu in spot #5.



There's a ROM chip, a Samsung KM23C4100CG-12 in spot #4.



There's a RAM chip, an NEC D43257BGU-85LL in spot #2.



There's a Gate Array, an NEC D65612GF053 in spot #3.



There's an LCD driver NJU6450AF from JRC (new japan radio company njr.com) in spot #6.




I haven't figured out where spot #1 is. Perhaps it's the LCD on the other side of the board.


There's a motor to drive the gears and roller that pulls the tape through, a Mabuchi EG-530AD-9B 2400RPM 9V motor CCW.




In the upper left, there's a pad for a connector called XT1 P5. I wonder if that's for some kind of external connector, like a serial port possibly.

Maybe the XT1 is the marking for a crystal oscillator, the one marked 16000NMF?

The F is the Fujitsu logo, and it looks like a piezoelectric resonator, so it must be a Fujitsu resonator.





Judging from all of the 97s I see on the system board, I would estimate it to be built in 1997.


It'd sure be interesting to dump the rom from this board, wish I had an EPROM programmer.


Here's the other side of the system board, with all of the keyboard pads and the LCD.



And the back of the keyboard.




firefox downloads often don't let me change the name

So I click on a link and it gives me two options: open with some application or to save file.

The problem is, it wants to save it as some longwinded file name, when I'd rather have something else.

Like for instance, I've got a picture on facebook, I click on options, download then it gives me some filename like 234395827323.jpg when I'd like to change it to something more readable.

Instead, I have to wait until the download is complete, find the file, then rename it.

Isn't it much easier to give me the option to "Save file as..." in the first place?



Chromecast and resizing the Chromium window in realtime

I'm running Chromium under knoppix 7.7 and using the chromecast chrome extension to send a tab to the TV.

What's cool is that you can resize the browser window and it resizes the contents of what it's sending to the TV.

So if you want to zoom in on something, just resize the browser window so that it "frames" it better.

Tuesday, August 16, 2016

Dell 2007FP monitor startup

I thought the monitor startup on the dell 2007FP was kind of cool.

When you first plug it in, the dell logo shows up one letter at a time.

First the D, then the E, then the two Ls.




I like little touches like that. Reminds me of what cars do today where they sweep their gauges.


BattleTech Center

I remember years ago reading about the Battletech Centers, where you'd fight other people in simulated giant mech battle, and based on Amigas.

.Info magazine had a writeup in issue 35 in 1990.

https://archive.org/stream/info_Issue_35_1990-12.info_Publications_US/info_Issue_35_1990-12.info_Publications_US_djvu.txt


"The BattleTech Center

by Jeff Lowenthal


Join Jeff as he tries out the BattleTech Center's high-tech Amiga driven battle simulators. "


"It's unlikely to be limited by the hard-
ware, which includes 16 networked Amiga
500 boards, one for each cockpit, plus two
more computers per pod. The 50Os run most
of the game code and the secondary display
screens. Custom graphics cards, 68020
accelerator boards, and a variety of other
hardware, combined with a library of 19.000
3D graphic images, provide the power to
make this ihing real. The main display even
varies as a unit moves away, duplicating the
fogginess you see at long distance in real
life."

It looks pretty primitive by today's standards, but that was the kind of thing that I dreamed about back in the day.





This training video with Joan Severance is pretty funny.


Sony all in one LV series

I got this neat Sony VAIO LV series all-in-one circa 2008. I can get it to boot into knoppix 7.7 and it works pretty well. Interestingly, it uses a slightly different method to set the brightness of the screen.

xbacklight doesn't work telling me that "No outputs have backlight property."

xrandr --output LVDS-1 --brightness 0.85

allows me to set the brightness.


http://askubuntu.com/questions/62249/how-do-you-change-brightness-color-and-sharpness-from-command-line


This Sony is pretty cool, it has a useful feature where the monitor can function as a regular monitor, taking an HDMI input that will drive the screen. I can put the computer in standby with "sudo pm-suspend" and press the HDMI select button on the side to use it as just a monitor.

It's got awesome speakers, probably the best I've heard on a computer.

The 24" 16:10 monitor is pretty good with 1920x1200 resolution. The all-in-one is just a bit on the heavy side at 30+ lbs.

Form Factor
all-in-one
Weight
35.27 lbs


xrandr --verbose
Screen 0: minimum 320 x 200, current 1920 x 1200, maximum 8192 x 8192
LVDS-1 connected 1920x1200+0+0 (0x63) normal (normal left inverted right x axis y axis) 0mm x 0mm
Identifier: 0x61
Timestamp: 6678072
Subpixel: unknown
Gamma: 1.0:1.0:1.0
Brightness: 0.50
Clones:
CRTC: 0
CRTCs: 0 1
Transform: 1.000000 0.000000 0.000000
0.000000 1.000000 0.000000
0.000000 0.000000 1.000000
filter:
dithering depth: 6 bpc
supported: auto, 6 bpc, 8 bpc
dithering mode: off
supported: auto, off, static 2x2, dynamic 2x2
scaling mode: None
supported: None, Full, Center, Full aspect
color vibrance: 150
range: (0, 200)
vibrant hue: 90
range: (0, 180)
1920x1200 (0x63) 154.640MHz -HSync -VSync *current +preferred
h: width 1920 start 1946 end 1998 total 2106 skew 0 clock 73.43KHz
v: height 1200 start 1205 end 1216 total 1225 clock 59.94Hz
1920x1080 (0x64) 173.000MHz -HSync +VSync
h: width 1920 start 2048 end 2248 total 2576 skew 0 clock 67.16KHz
v: height 1080 start 1083 end 1088 total 1120 clock 59.96Hz
...

I wonder what all of this dithering stuff means...is it an 18-bit panel?

Sunday, August 14, 2016

iceweasel/firefox weird middle click behavior - loads page sometimes


I keep having this weird thing happen: sometimes I'll accidentally hit the middle button while scrolling, and suddenly an older page loads.

It doesn't happen all the time, or every time but it's one of those things that makes you wonder what the heck is happening.

I can get it to happen with a middle double click.

Sometimes if I click on the back button then do a middle click-drag to the right in a empty spot on the page, it will load a previous page.

I don't get it...it's super irritating to have your browser do things you don't expect. Where did that come from?


I'll see if changing some of the about:config settings will fix it.

middlemouse.contentLoadURL false
middlemouse.paste false


http://askubuntu.com/questions/4507/how-do-i-disable-middle-mouse-button-click-paste

Adding text to cell formats

I like my units to show in my spreadsheets, so for the miles per gallon column, I set the format to

0.0 "mpg"

and for the distance between fillups the format is

0 "miles"

Saturday, August 13, 2016

Calculating miles per gallon between fulls

I wanted to calculate the miles per gallon between full tanks, so I wrote a crap macro to do it. You use the macro by putting the macro in a Module and then calling the function with a formula


=calc_mpg_between_fulls(I45) passing it the cell where you're at (in this case column I, row 45) as a Range, so it knows where to access the cells in the sheet.

Basically it looks for the first row that has the string "to full" in column 7 (column G) and then calculates the mileage driven and gas used starting from that row.

Function calc_mpg_between_fulls(thiscell As Range) As Double  
orig_row = thiscell.Row
orig_col = thiscell.Column
'MsgBox Str$(orig_row) + " " + Str$(orig_col)
odometer_col = 1
gas_col = 2
full_col = 7
row_to = orig_row
While Cells(row_to, full_col) <> "to full": row_to = row_to - 1: Wend
row_from = row_to - 1
While Cells(row_from, full_col) <> "to full": row_from = row_from - 1: Wend
'MsgBox "  row_from" + Str$(row_from) + "  row_to:" + Str$(row_to)
milesdriven = Cells(row_to, odometer_col) - Cells(row_from, odometer_col)
For i = (row_from + 1) To row_to: gasused = gasused + Cells(i, gas_col): Next i
calc_mpg_between_fulls = milesdriven / gasused
'MsgBox " miles: " + Str$(milesdriven) + " gas used:" + Str$(gasused) + "   " + Str$(milesdriven / gasused)
End Function


The only thing is that it will only calculate the formula once due to the way Excel recalculates things. So if you want it to recalc, just fill copy the formula over the same cell again and it will recalculate it.

edit:

so I was thinking about recalculation, why not pass a dummy range as well so that it will recalculate if anything in that range is changed.

Function calc_mpg_between_fulls(thiscell As Range, dummyrange As Range) As Double 

and make the formula =calc_mpg_between_fulls(I45,A40:G45)

Gas tracking spreadsheet

I like to track my gas mileage so I made up a spreadsheet to do it. Sure, there's a website at gasbuddy or fuelly but where's the fun in that?




column A is odometer
column B is gallons (to the third digit after the decimal e.g. 11.384 gallons)
column C is gas price per gallon
column D is total price: formula column B * (C +0.009) since the price is actually plus 9/10 of a cent
=B2*(C2+0.009)
column E is date
column F is gas station name and location
column G is to full: either the words "to full" or blank to indicate not filling up to full
column H is miles traveled: formula column A - last row's column A
=A2-A1
column I is mileage: formula miles traveled (column H divided by column B)
=H2/B2

and for another row, just use fill copy to copy the formulas down the page


I've been tracking my gas mileage for over 10 years, saving each receipt, writing the odometer down and then entering it into the spreadsheet when I get a chance.

If I don't put the receipt into my wallet immediately after getting it, I tend to lose the receipts.

I fill it to full each time, otherwise the simple calculation gives kind of wild results.

Once you have a year's worth of data, then you can make interesting charts. I like to make charts of odometer vs date and putting in linear regression lines and showing the regression formula.





so according to the linear regression formula y=11.825x - 370507 I've driven on average 11.825 miles per day or 11.825 * 365 = 4316 miles per year.

Gas tracking spreadsheet

I like to track my gas mileage so I made up a spreadsheet to do it. Sure, there's a website at gasbuddy or fuelly but where's the fun in that?

column A is odometer
column B is gallons (to the third digit after the decimal e.g. 11.384 gallons)
column C is gas price per gallon
column D is total price: formula column B * (C +0.009) since the price is actually plus 9/10 of a cent
=B2*(C2+0.009)
column E is date
column F is gas station name and location
column G is to full: either the words "to full" or blank to indicate not filling up to full
column H is miles traveled: formula column A - last row's column A
=A2-A1
column I is mileage: formula miles traveled (column H divided by column B)
=H2/B2

and for another row, just use fill copy to copy the formulas down the page


I've been tracking my gas mileage for over 10 years, saving each receipt, writing the odometer down and then entering it into the spreadsheet when I get a chance.

If I don't put the receipt into my wallet immediately after getting it, I tend to lose the receipts.

I fill it to full each time, otherwise the simple calculation gives kind of wild results.

Once you have a year's worth of data, then you can make interesting charts. I like to make charts of odometer vs date and putting in linear regression lines and showing the regression formula.





so according to the linear regression formula y=11.825x - 370507 I've driven on average 11.825 miles per day or 11.825 * 365 = 4316 miles per year.

Friday, August 12, 2016

HP Omni All in one computer and knoppix 7.7

So I got this HP Omni all in one computer. I wanted it to boot from knoppix 7.7 installed to a flash drive and it wouldn't boot from the boot menu unless I chose the flash drive under the "Legacy boot" section, not the "UEFI boot section".

It's an all in one, so it's like a laptop with an integrated screen and speakers. If you're used to regular monitors, there's no buttons to adjust the brightness and contrast.

So it's xbacklight and xgamma to the rescue.


xbacklight -set 50

xgamma -gamma 0.7


xbacklight -inc 10

to make it a little brighter

xbacklight -dec 10

to make it a little darker

So far it seems to run pretty sweetly under knoppix 7.7. Even the built-in webcam works under /dev/video0 and can be viewed with VLC.


The only thing I don't like is that there isn't a built-in VGA/DVI/HDMI for an external monitor. What if the monitor goes bad?


eDP1 = embedded displayport

xrandr
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
eDP1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
1920x1080 59.99*+ 59.93
1680x1050 59.95 59.88
1600x1024 60.17
1400x1050 59.98
1280x1024 60.02
1440x900 59.89
1280x960 60.00
1360x768 59.80 59.96
1152x864 60.00
1024x768 60.00
800x600 60.32 56.25
640x480 59.94
DP1 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
VGA1 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)



xrandr can set the gamma as well, for example:

xrandr --output eDP1 --gamma 1.0:1.0:1.0


If you ask xrandr for verbose you get a lot of info:

xrandr --verbose
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
eDP1 connected 1920x1080+0+0 (0x4a) normal (normal left inverted right x axis y axis) 0mm x 0mm
Identifier: 0x42
Timestamp: 34664178
Subpixel: unknown
Gamma: 1.0:1.0:1.0
Brightness: 1.0
Clones:
CRTC: 0
CRTCs: 0 1
Transform: 1.000000 0.000000 0.000000
0.000000 1.000000 0.000000
0.000000 0.000000 1.000000
filter:
BACKLIGHT: 4
range: (0, 10)
Backlight: 4
range: (0, 10)
scaling mode: Full aspect
supported: None, Full, Center, Full aspect
Broadcast RGB: Automatic
supported: Automatic, Full, Limited 16:235
audio: auto
supported: force-dvi, off, auto, on
1920x1080 (0x4a) 143.600MHz -HSync -VSync *current +preferred
h: width 1920 start 2016 end 2080 total 2176 skew 0 clock 65.99KHz
v: height 1080 start 1088 end 1092 total 1100 clock 59.99Hz

...

hmmmm I wonder if I can adjust the scaling mode, looks interesting.


xrandr --output eDP1 --set "scaling mode" "Full"
xrandr --output eDP1 --set "scaling mode" "Center"
xrandr --output eDP1 --set "scaling mode" "Full aspect"

Cool! It works!

Thursday, August 11, 2016

wdtv live hdmi to a regular dvi monitor

Just for fun, I thought I'd hook up a wdtv live plus hd to a dvi monitor Dell 2007FP to see what'd happen.

DVI is basically HDMI (without sound) so it should work in theory. All you really need is an HDMI to DVI cable. (or is that DVI to HDMI cable)

I plug it in and turn it on and I get a funny looking screen that's got a pink shade, but if I go into settings and force a 720p 60hz mode everything looks proper. The Dell 2007FP can't do 1920x1080p since it tops out at 1600x1200 but 1280x720p looks pretty good.

Now to find some speakers to hook up to the wdtv.

Tuesday, July 26, 2016

Snapcircuits is good fun

I got one of these snapcircuits kits and they're quite fun to play with, hooking up things together and seeing what they do.

It's quite a clever system, "snapping" circuits together.

http://www.snapcircuits.net/

Monday, July 25, 2016

Saturday, July 23, 2016

Usborne computer books from 1980s

http://www.usborne.com/catalogue/feature-page/computer-and-coding-books.aspx

I really liked the Usborne books back in the 80s. Now they have them available as PDFs on their website. Cool.



http://www.raspberrypi-spy.co.uk/2016/02/usborne-releases-1980s-coding-books-as-free-pdfs/

http://www.theinquirer.net/inquirer/news/2446950/get-your-retro-on-with-15-free-seminal-1980s-usborne-coding-books

https://www.theguardian.com/technology/2015/oct/01/usborne-books-teach-children-code-lisa-watts

Portege r400 keep losing wireless from standby

The built-in wireless on my Portege r400 keeps disappearing after resuming from standby in Ubuntu 16.04.

It comes back after reboot just fine, but it's kind of annoying.

dmesg gives me:


[ 3405.001081] iwl3945 0000:02:00.0: Microcode SW error detected. Restarting 0x82000008.
[ 3405.001094] iwl3945 0000:02:00.0: Loaded firmware version: 15.32.2.9
[ 3405.001130] iwl3945 0000:02:00.0: Start IWL Error Log Dump:
[ 3405.001136] iwl3945 0000:02:00.0: Status: 0x000302E4, count: 1
[ 3405.001140] iwl3945 0000:02:00.0: Desc Time asrtPC blink2 ilink1 nmiPC Line
[ 3405.001369] iwl3945 0000:02:00.0: SYSASSERT (0x5) 4194070648 0x008B6 0x017B8 0x00320 0x00000 65

[ 3405.001388] iwl3945 0000:02:00.0: Read idx for DMA queue txq id (4), idx 9, is out of range [0-256] 41 41.
[ 3405.001395] iwl3945 0000:02:00.0: Read idx for DMA queue txq id (4), idx 10, is out of range [0-256] 41 41.
[ 3405.001403] iwl3945 0000:02:00.0: Error Reply type 0x00000000 cmd UNKNOWN (0x00) seq 0x0000 ser 0x00000000
[ 3405.004120] iwl3945 0000:02:00.0: Can't stop Rx DMA.
[ 3405.006131] ieee80211 phy0: Hardware restart was requested
[ 5300.018813] wlp2s0: deauthenticating

and another time

[ 3184.320135] iwl3945 0000:02:00.0: Queue 2 stuck for 2500 ms.
[ 3184.320150] iwl3945 0000:02:00.0: On demand firmware reload
[ 3184.325905] ieee80211 phy0: Hardware restart was requested
[ 3184.374096] iwl3945 0000:02:00.0: BSM uCode verification failed at addr 0x00003800+0 (of 900), is 0xa5a5a5a2, s/b 0xf802020
[ 3184.374105] iwl3945 0000:02:00.0: Unable to set up bootstrap uCode: -5
[ 3184.420924] iwl3945 0000:02:00.0: BSM uCode verification failed at addr 0x00003800+0 (of 900), is 0xa5a5a5a2, s/b 0xf802020
[ 3184.420930] iwl3945 0000:02:00.0: Unable to set up bootstrap uCode: -5
[ 3184.467646] iwl3945 0000:02:00.0: BSM uCode verification failed at addr 0x00003800+0 (of 900), is 0xa5a5a5a2, s/b 0xf802020
[ 3184.467652] iwl3945 0000:02:00.0: Unable to set up bootstrap uCode: -5
[ 3184.514382] iwl3945 0000:02:00.0: BSM uCode verification failed at addr 0x00003800+0 (of 900), is 0xa5a5a5a2, s/b 0xf802020
[ 3184.514387] iwl3945 0000:02:00.0: Unable to set up bootstrap uCode: -5
[ 3184.561111] iwl3945 0000:02:00.0: BSM uCode verification failed at addr 0x00003800+0 (of 900), is 0xa5a5a5a2, s/b 0xf802020
[ 3184.561117] iwl3945 0000:02:00.0: Unable to set up bootstrap uCode: -5
[ 3184.601146] iwl3945 0000:02:00.0: Unable to initialize device after 5 attempts.
[ 3184.601160] ------------[ cut here ]------------
[ 3184.601250] WARNING: CPU: 0 PID: 5129 at /build/linux-xK5wks/linux-4.4.0/net/mac80211/util.c:1818 ieee80211_reconfig+0x1d5/0xef0 [mac80211]()
[ 3184.601254] Hardware became unavailable during restart.
[ 3184.601257] Modules linked in: cpuid rfcomm drbg ansi_cprng ctr ccm bnep wacom_w8001 serport btusb btrtl btbcm btintel bluetooth snd_hda_codec_realtek arc4 snd_hda_codec_generic snd_hda_intel coretemp iwl3945 snd_hda_codec iwlegacy snd_hda_core mac80211 snd_hwdep kvm snd_pcm gpio_ich snd_seq_midi snd_seq_midi_event cfg80211 irqbypass pcmcia snd_rawmidi snd_seq yenta_socket snd_seq_device pcmcia_rsrc snd_timer pcmcia_core snd lpc_ich soundcore joydev input_leds toshiba_acpi sparse_keymap serio_raw wmi shpchp toshiba_bluetooth toshiba_haps tpm_infineon mac_hid parport_pc ppdev lp parport autofs4 hid_generic usbhid hid i915 e1000e psmouse i2c_algo_bit drm_kms_helper syscopyarea sysfillrect ptp pata_acpi sysimgblt fb_sys_fops drm pps_core video fjes
[ 3184.601368] CPU: 0 PID: 5129 Comm: kworker/0:2 Tainted: G W 4.4.0-31-generic #50-Ubuntu
[ 3184.601372] Hardware name: TOSHIBA PORTEGE R400/Portable PC, BIOS Version 1.50 03/14/2007
[ 3184.601418] Workqueue: events_freezable ieee80211_restart_work [mac80211]
[ 3184.601423] c1acd967 f27fb110 00000286 d37f3e40 c13a689f d37f3e80 f8b9fb58 d37f3e70
[ 3184.601434] c1070317 f8b9fd08 d37f3ea0 00001409 f8b9fb58 0000071a f8b61c95 f8b61c95
[ 3184.601444] fffffffb f4cf0a44 f4cf0420 d37f3e8c c107038e 00000009 d37f3e80 f8b9fd08
[ 3184.601454] Call Trace:
[ 3184.601467] [] dump_stack+0x58/0x79
[ 3184.601476] [] warn_slowpath_common+0x87/0xc0
[ 3184.601529] [] ? ieee80211_reconfig+0x1d5/0xef0 [mac80211]
[ 3184.601581] [] ? ieee80211_reconfig+0x1d5/0xef0 [mac80211]
[ 3184.601587] [] warn_slowpath_fmt+0x3e/0x60
[ 3184.601639] [] ieee80211_reconfig+0x1d5/0xef0 [mac80211]
[ 3184.601647] [] ? mutex_lock+0x10/0x30
[ 3184.601693] [] ? ieee80211_scan_cancel+0x91/0x1c0 [mac80211]
[ 3184.601737] [] ieee80211_restart_work+0x5f/0xa0 [mac80211]
[ 3184.601745] [] process_one_work+0x121/0x3f0
[ 3184.601750] [] worker_thread+0x37/0x490
[ 3184.601756] [] ? process_one_work+0x3f0/0x3f0
[ 3184.601762] [] kthread+0xa6/0xc0
[ 3184.601768] [] ret_from_kernel_thread+0x21/0x38
[ 3184.601773] [] ? kthread_create_on_node+0x170/0x170
[ 3184.601778] ---[ end trace 4a55b647ba02b52e ]---
[ 3184.602108] wlp2s0: deauthenticating