Lazarus open project weirdness – solution!

I found a way to get Lazarus to open my project. If I open the project and nothing seems to happen…go back to open and open the .pas (in my case unit1.pas) file. It then opens the code and the form! WTH? Crazy!

Lazarus seems to have the potential to be incredibly useful to me. A former MS-Access programmer, who always wished he got the commercial Delphi product from Borland. MS-Access was very useful for my small projects. Combine Lazarus with SQLite3 and you have a great MS-Access replacement. I started to think my Lazarus projects were screwed up and I was almost ready to give up. This is a huge workaround. I think now I can continue to use it.

Back to my Julia Unicode gripe

Concerning this unicode string “日本語”

Julia tells me it has a length of 3. This initially led to my indexing problems. Because visually they’re 3 characters. So for example I would try and reference the above 2nd character as one greater than the previous byte. I probably would have figured out what was going on sooner had Julia given me the correct length. I feel the length statement is a bug, because it returns the wrong value for code points greater than 127.

Go on the other hand correctly tells me the above string, has a length of 9.

Lazarus open project weirdness

I think I talked about this before. I often have problems opening Lazarus projects, files or what ever you call it where you want to open a previously working program. Sometimes nothing will open. Sometimes someting else will open. Often I’ll drag a working zipped file and extract then maybe or just as likely it wont open. I’ll select an .lpi it accepts the choice but nothing seems to happen and File>Close All will be grayed…Close Page won’t be grayed implying something is opened. However clicking it does nothing and it remains ungrayed.

in addition there is a separate Project tab with Open and Close. If I previously clicked File>Close All then why isn’t Close Project grayed. And why is there another Lazarus file access menu 5 tabs right of the File tab?

Modified file dates sometimes get updated when I don’t save anything.

I just want to open my freeking project just like I saved it when it worked!

Python time difference and ffmpeg

I frequently want to cut scenes out of video clips. I use ffmpeg to do this. However it’s tedious to put my options in every time. The command I used over and over is…
“ffmpeg -i fileIn -ss startTime -t timeLength [-codec copy] fileOut”

This was tedious to type every time. So I wrote a Python program so I could just enter the args…
fileIn [c] startTime timeLength

This saved a lot of typing. Notice there is no fileOut, because I simply create an output file with the same name as the input file, only I add a sequence suffix to the input file. So fileOut is usually filein-01.mp4, the next run it’s filein-02.mp4 and so on. The optional “c” added “-codec copy”. Which creates the output file very fast. However it doesn’t always start exact. Sometimes there are several seconds after your specified startTime, missing before the fileOut starts playing. Not adding “c” for “-codec copy” can take much longer to run but provides a more exact start time.

Now this has saved me a lot of typing. However the timeLength can be tedious to calculate. So if I watch the vid on vlc and the piece I want starts at 3min 46sec and ends at 35min 13sec I need to mentally calculate that’s 31 min 27sec…or 31:27 for timeLength. Not easy for my old brain. So that’s where this project comes in. It’s a very easy problem for Python.

import datetime
# Since I only care about the time difference…use the same date!
start = datetime.datetime(2000, 1, 1, 0, 3, 46) # (yy, mm, dd, hh, mm, ss)
finish = datetime.datetime(2000, 1, 1, 0, 35, 13)
difference = finish – start

Now I considered, there’s a good possibility that ffmpeg has a ending time flag to use for this, rather than the ‘-t’ flag. But where’s the fun in that?

Go – Strings, bytes, runes and characters

We’ve come a long way since 8 bit ASCII and EBCDIC. It was an issue with Julia too. Every modern language has to deal with International characters. I guess I need to dive into it because thanks to the Internet and other languages a character is not necessarily one byte. Go Info here. Which also pointed to a post… here which is titled “The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)” which was written in 2003, so that sounds like a good place to start. However he does say “EBCDIC is not relevant to your life.”…that’s what he thinks! I guess I’ll find out what a rune is.

To continue after reading the 2nd article mentioned above. This tidbit is why my Julia program had no problems with ASCII, but did with EBCDIC. In UTF-8, every code point from 0-127 is stored in a single byte. Only code points 128 and above are stored using 2, 3, in fact, up to 6 bytes.

Having a Go…with Go

Golang…baby steps. Go sounds cool and Golang sounds wordy. Go is too common IMHO. However since Go comes from Google it probably helps in googling the language. Perhaps a stronger assumption you’re googling about the language.

Playing with Go. Reading/writing files. Learning enough to be dangerous.

Tumbleweed network activity lie

So in addition to Tumbleweeds odd way of graphing left to right at the beginning, then switching to right to left as all my default monitors do. It also sometimes shows download activity when I’m disconnected from the network. As shown below. In this case I also physically disconnected the Ethernet cable. If you fullscreen this you can see a red x on the network icon. Also at first glance it looks like a big download because it fills the graph. But that’s because the graph is adjusted to the highs. The actual download rate is shown as 242.0 B/s.