Category Archives: Computers and Internet

Posts on computer science and the web, rants about OS:es, Window Managers, Platforms for almost publishing content on the web, and the like.

I expect that expectation to be wrong…

Checksum validation failed, expected <html> but is aa163ea9976e95abbdfd985fd6fd239297c14ff3 from sonatype-nexus-snapshots for https://oss.sonatype.org/content/repositories/snapshots/com/google/guava/guava-parent/23.0-android-SNAPSHOT/maven-metadata.xml

Yeah, Maven, if you expect “<html>” as a checksum… I bet something very special is going on…

Macass

Macass. What you feel like when your computer mysteriously allows a music player app that should remain unnamed (although the name suggests a frequent need to do laundry) total control over your OS and the only thing you can control is the mouse pointer. The journey ends with a cold boot, a panic boot, and all your Chrome tabs lost and gone forever. However, in rare cases, when Lady Luck doesn’t shine you on, she’ll allow your Office programs to recover unsaved changes… but that’s a coin-toss-land-on-the-side chance…

7 Mac Startup Options Every OS X User Should Know

There are a number of startup options that are available on recent Macs to aid in both troubleshooting and system management. Here’s a look at seven essential Mac startup options that every OS X user should know.

via 7 Mac Startup Options Every OS X User Should Know

Several of these have resolved serious issues for me. I’ve even put in calendar events to do PRAM-resets, Safe Boots and Disk Checks (booting in Recovery Mode) regularly.

How about that temporal programming?

Did you read my article on temporal programming?

Cool, huh?

Did you manage to make temporal programming in Java work?

No?

You need a quantum computer, of course, and Java 15…

Don’t believe me?

Good!

After all, yesterdays was April 1st!*

😛

* Ok. Come to think of it, with time zones and all… I am guessing the post was technically published on mars 31st in, e.g. the Americas… :÷|

Temporal Programming

Have you ever wanted to know information beforehand?

With temporal programming, you can!

For instance, when reading an input stream, you want to show a progress bar for how far along you’ve come. But, in order to know what percentage of the stream has been processed, you need to know how many bytes it contains.

Some streams are based on files so you can use the file to figure out the size. The same goes for some streams from web servers. But then there are other streams where the size isn’t known beforehand.

Temporal programming was invented for them.

Here’s an example:

temporal long streamBytes;
final ProgressBar progressBar =
  new ProgressBar("Reading stream",
  streamBytes);
long totalBytes = 0;

try (final InputStream is = ...) {
  byte[] buffer = new byte[1024];
  int read;

  while ((read = is.read(buffer)) > 0) {
    totalBytes += read;   

    // do something with bytes
    // ...

    // increase progressbar
    progressBar.step(read);
  }

  // set the max of the progressBar
  streamBytes = totalBytes;
}

All the magic is in the temporal keyword… much like the native keyword, it makes “stuff” happen behind the curtain…

At first, the value of the temporal variable streamBytes isn’t known, and in normal cases, this would create a compile error. However, the value of streamBytes is set at the end of the program, and can then be used in the beginning much as if the variable had been set from the start.

Pretty cool!

Of course, this example with a progress bar and a stream is much less exciting than an example with a stock ticker, for instance…

There’s money to make there!


Header image: By fdecomiteTunnels of Time, CC BY 2.0, Link