Light Bulbs

Tonight I went to the store to buy some replacement light bulbs only to be disappointed by a huge array of horrid fluorescent lights. The only incandescent bulbs were soft whites (ugh!), special forms for chandeliers, etc., and halogen lamps. I bought some clear halogens and they are quite bright (which is good for headlamps but not for interiors, IMO), but nevertheless they are nicer than fluorescents.

Anyways, I am going to conduct a little investigation on THE FUTURE OF INTERIOR LIGHTING.

I’ll start with incandescent light bulbs. I’m not going to bother to explain the technology because you probably already know it. I’m simply going for aesthetics here because I don’t really care about energy consumption. Incandescents are the best because they make the best light for indoor, night-time use. It’s orange, and it’s dim. This is perfect for indoor, night-time use because it’s orange, so it looks pretty, and it’s dim so our brains don’t think it’s day-time.

Next is halogen. These are like super-incandescent bulbs. They suck because they’re so freaking bright. The brightest ones are put in cars specifically to allow for idiots on the freeway to blind me with. What I do like about them is their color, which is closer to daylight than any other form of light-bulb. I don’t why, it just is.

Next we have LEDs, which are cool because we might be able to get Arch to run on them since they are diodes. There’s just one problem:

LED Light Bulb

They Look Fucking Stupid

Okay, they’re fine under a lamp shade, but not for vanities, and frosted bulbs are ugly.

 

Lastly we have fluorescent light bulbs. They suck.

glibc is Bloated

The GNU C Library is bloated, and here’s why: browsing through the source I could not find a single library, a single library function, that didn’t go to some other function, which goes to some other function which goes to some other function which goes to some other function which goes to some other….

I Forgot to Tell You Guys….

I no longer use Gnome. I use XFCE. I hate it almost as much as Gnome and KDE, but that’s beside the point.

Theory of Programs and Libraries

There are two critical catalysts for the development of software: unification and innovation. Innovation comes from competition, and unification comes from the elimination of competition. How can the two coexist? I’ve thought of this and have thought to find a solution.

Since my beginnings as a programmer, I’ve been taught a valuable lesson concerning software design. Programs should be split into two essential parts. The part that interacts with the user, and the part that interacts with the system. The part that interacts with the user is often called interface, while the part that interacts with the system is often called the core. I also learned it’s best to put the core into a library, so that other programmers may use it.

Many programs should utilize the specific functions it needs from a single single-purpose library. For example, there are two programs that use the same libraries for whatever they need. One program is used for viewing PDFs on screen, and the other is used for printing PDFs onto paper. The viewer needs a library for on-screen graphics while the printer needs a library for accessing printer hardware. Both need a library for reading the PDF and converting it to a usable format. The printer and viewer could use their own PDF library, but that would be inefficient. It’s much better for these programs to use a third-party library.

The question is, “Should libraries have competition?” and although it is tempting to say no, it is a necessary evil. So how can programs stay unified? A solution is cooperation. Back to our example, if the viewer and the printer were to team up and always utilize the same PDF library, they could always agree on the best PDF library without breaking unification. The PDF libraries would continue to compete amongst themselves to win the support of the printer and viewer developers. This requires strong communication, however, and that is something that can be difficult to achieve.

Why Don’t People Like RoboCop 2?

RoboCop 2 Theatrical Poster

RoboCop's Suit Seems More Blue in RoboCop 2

This past weekend I watched two wonderful movies. RoboCop and RoboCop 2. Now, I had watched both of these back when I was a kid, but have largely forgotten them. As I did some research on these movies, as I do with all movies I watch, I heard RoboCop 2 got bad reviews by critics and fans alike. That struck me a bit odd because as a kid I remember liking RoboCop 2 more. So I watched both of them.

RoboCop 2 is better. It’s the better because, perhaps due to Irvin Kershner’s style, we actually come to like these characters, know these characters, and sympathize with these characters. This is pretty much the only difference between these movies. The mood is the same, the tone is the same, the acting is the same, the writing-style is the same, the stories are different but both cheesy, and they both have the same satirical theme. I could only find two real differences. First is the focus. RoboCop focuses solely on RoboCop, while RoboCop 2 focuses on an array of characters. Second is the score, RoboCop has a darker score than RoboCop 2, but I actually like 2′s better because I find it fits nicely with the satiric tone.

To conclude, I can understand why RoboCop 2 wouldn’t be as well-received, but I don’t understand why some people call it shit. It’s not shit. It’s a very good movie by a very underrated director who should’ve been given way more credit than he received.

Programming Case Study: FORTRAN

So in order to further educate myself on the matter of programming languages, I’ve decided to once-in-a-while try out a language, take it for a test drive, and try to make something useful. I will not be teaching you the language, and I will not specify all the details, but I will try to inform you of the major strengths and weaknesses of the language. So the first language I’ve decided to try is the oldest language still in use: Fortran.

Maybe it’s just me, but Fortran is one of the coolest sounding things ever. It sounds futuristic, powerful, like the name of some kind of galactic empire.

Palpatine

John Backus, designer of Fortran

So, a quick trip to Wikipedia told me that Fortran is a general purpose, procedural, imperative programming language. I like the sound of procedural and imperative, two programming paradigms that seem to fit well with my brain. I scrolled down to look at some example code. The syntax looked exotic, but I was able to understand it thanks to comments and my own intellect. Now I was ready to learn the language.

First I had to find a tutorial, and like many programming languages, there’s many implementations and standards of Fortran. I’d decided to go with Fortran 90 because I couldn’t really find anything entry-level for later versions, and Fortran 77 appeared to be in a deprecated state (i.e. no new code is written with it).

Now it could very well be that my perception of a language is based entirely on the writings of the tutorial, but I tried to focus on code and not on my ability to understand the writer.

My very first Fortran program was the old Hello World program:

program Hello
    print *, 'Hello, world!'
end program Hello

Pretty straight foward. Again, the imperative paradigm I’m used to. So as I followed further examples, I discovered that Fortran has a pretty clean syntax, not what I expected, especially for an old language. There’s obvious bullshit initialization code at the top and bottom of every program, known as the program statement, but you’d probably have that on your programs anyways, even if it wasn’t required, in the form of a comment (I know the GNU people love putting copyright notices everywhere). Now let’s look at a small program I wrote that converts Fahrenheit to Celsius:

function FahrToCelsius(f)
    real FahrToCelsius
    real, intent(in) :: f

    FahrToCelsius = 5.0 * (f - 32) / 9.0
end function FahrToCelsius

program FahrenheitCelsius
    real FahrToCelsius
    real, parameter :: low = 0.0
    real, parameter :: high = 100.0
    real, parameter :: step = 10.0
    real f, c

    f = low
    do while (f /= high)
        write(*, fmt="(F8.3)", advance="no") f
        c = FahrToCelsius(f)
        write(*, fmt="(F8.3)") c

        f = f + step
    end do
end program FahrenheitCelsius

Fortran is both manifest and implied type, statically typed, and strongly typed. If a variable is not declared, Fortran will try to guess it’s type from it’s value, and this can be annoying because it’s not actually a dynamically typed language. Anyways, we define a function and call it in our main program. In the function, we declare our variables. real is a floating point, intent(in) means that f is an immutable input from the caller. At the main program we declare variables and then proceed with our executable code. A parameter is a constant. Fortran differentiates functions from subroutines (or procedures, here the terms may be used interchangeably). Functions return one value while subroutines return an arbitrary number of values. Fortran also has a lot of built-in functions for math. abs, sin, cos, tan, and more are included. Fortran can be incredibly fast for computation, even faster than C. This, along with built-in support for complex numbers, makes Fortran useful as a FORmula TRANslator.

However, this language is weird. It has a complicated type system. You have to declare variables, but you don’t have to, which confused me. So I invoked the -fimplicit-none flag on the compiler so it would force me to declare all my variables. Making subroutines and functions can be unnecessarily complex. To get arguments from a call, they must be declared within the code block along with the intent declaration. To get an immutable argument from the caller use (in), or (out) to make an outgoing argument. Wait, an outgoing argument? Yes, it’s a subroutine argument that is used for assignment. There’s also arguments that can be read from and written to. This was all very confusing for me.

Main Program:
    integer a, b, c
    a = 1
    b = 2
    call subroutine(a, b, c)

Subroutine:
    integer, intent(in) a
    integer, intent(inout) b
    integer, intent(out) c
    modify b and c

So, a can only be read, b is like a normal variable and c is undefined before being assigned. I call this “return values by assignment”. Rather than using a return statement (though there is a return statement, it is only used for exiting a subroutine), variables are returned to their callers by modifying variables that have been declared by their caller. On top of that, Fortran supports nesting functions and subroutines inside the main program and other subroutines and functions. This is standard, but usually not necessary for imperative languages.

Anyways, there are some other details about the language. Fortran has arrays and strings, and supports organizing code across files via modules. Modules are accessed in a way far more intuitive than C headers (Fortran compilers allow you to use the C Preprocessor if you wish). You can pick and choose the exact subroutines and functions you want to use for your code from a specific module or you can use the entire module. Let’s look at a summary of my take on Fortran.

Pros:

  • Straightforward, procedural design
  • Lots of built-in math operations
  • Fast execution
  • Built-in complex type
  • Intuitive I/O routines
  • Does it’s job as a language for calculations

Cons:

  • goto/archaic statements
  • Manifest and implicit typing can be very confusing
  • Functions and subroutines are unnecessarily complex
  • Two dialects (fixed-form and free-form) can make Googling difficult

The verdict here is Fortran accomplishes it’s goal of being a language for scientific purposes. Personally, I would not mind using this language, though I probably wouldn’t choose it for any purpose. It’s amazing how a language that is so old has been able to adapt to the changes in computing. I had a pretty fun time learning this language, despite some of its nuances. Anyways, if you’ve used Fortran, feel free to give me your opinions of the language.

Scheme is an Impossible Language

Let’s say we have this lovely little scheme code:

(define (square x) (* x x))
(define (sum-of-squares x y)
  (+ (square x) (square y)))
(define (sum-of-squares-of-two-largest x y z)
  (+ (square
       (cond ((and (> x y) (> x z)) x)
             ((and (> y x) (> y z)) y)
             (else z)))
     (square
       (cond (or (and (> x y) (< x z))
                 (and (> x z) (< x y)) x)
             (or (and (> y x) (< y z))
                 (and (> y z) (< y x)) y)
             (else z)))))
(display (sum-of-squares-of-two-largest 1 2 3))
(newline)

The problem is, this code doesn’t even work and I can’t figure it out for the Dickens. The problem with this code is that it’s impossible to debug. Usually, when I debug code, I print stuff to stdout, but due to scheme’s (or Lisp’s) silly method of evaluation, that’s impossible. Maybe I’m too stupid. So, I’ve decided to never ever again even attempt a non-imperative programming language. I’m just not smart enough y’know? But srsly, why would you ever need to find the sum of the squares of the two largest numbers from a set of three? But if I wanted to, I could easily do it with a regular old imperative language like Python.

def sumofsquares(L, n=2):
    if n > len(L):
        raise ValueError('n must be less than or equal to the number of items')
    L = [item ** 2 for item in L]
    L = [L.pop(L.index(max(L))) for x in range(n)]
    return sum(L)

print(sumofsquares([1, 2, 3]))

So it seems Scheme and Lisp both go the list of programming languages I hate, which includes Ruby, bash (the language part; I like the shell), and Java.

GNOME 3 Got Rid of Minimize and Maximize

Lol.

How Binaries Work

GNOME 3 Gets Too Close for Comfort

The first thing the GNOME 3 website tells me is

made of easy

O SquirrelFish! Not only does it make no sense gramatically, it’s also in lowercase! The next thing I see is: SIMPLY BEAUTIFUL. What? This is a computer program, not a woman! Then I see “We have provided several fast and convenient ways to access the activities view, including the activities keyboard key (often known as the Windows key) and the activities hot corner.” Why are we rebranding the Windows key? It’s the Windows key, Microsoft invented it so they’re entitled to call it what they want and we shan’t call it anything else. Hell, I never use it and it’s not on all keyboards so why are we utilizing it all of sudden? Lastly there’s my favorite line of the whole website, “You’ll love this feature if you’re a user who likes things to happen fast.” Right, because lots of pointless animations will really speed things up. By the way GNOME developers (a.k.a. cultists), every user likes things to happen fast. That’s why they pay for broadband.

What the website fails to tell me is how they actually made GNOME any better. From what I see, they just copied Snapple and made it more bloated. The only thing that looked interesting was “REDESIGNED SYSTEM SETTINGS” which, if we’re lucky, means no more GConf, but it probably means “We put even more ‘advanced settings’ in GConf.”

Okay kids, so I haven’t actually used the software, but I don’t care because their website is ugly. Last I checked this thing is due in March (but is alpha still … skipping QA for a DE, great idea!). That means I have less than 2 months to either

  • get a new computer
  • go MacGyver and use twm or something  minimal
  • send DDOS attacks to the GNOME developers (a.k.a. cultists)

I think I’ll go with the latter.

In all seriousness, if I can’t get GNOME 3 to work at all, I’ll start a fork.

I hate you, GNOME 3. Go die in a hole.