Thursday, July 29, 2010

wtf, msys!

in an msys shell (from running C:\msys\1.0\msys.bat):
$ python -c "import sys;print(sys.argv)" "C:/A"
['-c', 'C:/A']

$ python -c "import sys;print(sys.argv)" "C:/A C:/A"
['-c', 'C;C:\\msys\\1.0\\A C;a:\\']
Why would you do that! The solution is to use backslashes:
$ python -c "import sys;print(sys.argv)" "C:\A C:\A"
['-c', 'C:\\A C:\\A']
But again, wtf!!

Friday, April 16, 2010

Git Fail

$ git add file-that-is-1.4GB
fatal: Out of memory? mmap failed: Cannot allocate memory
Is that it? Git just can't handle files that are that big?

Yep. That's it. Here are other people who have found the same thing:

http://blahg.josefsipek.net/?p=219
http://ubuntuforums.org/archive/index.php/t-634946.html

I guess this is one more way in which SVN is better than Git. I still like Git, but it's by no means better than SVN in every way.

Why does "suppress" have 2 'p's?

Forgive me for thinking that "supress" was correct spelling. All the rules about English spelling I know say that that word should have only one 'p'. Look at the word "supremacy". That has only one 'p'. The etymology of "suppress" is sub + premere [wiktionary]. That doesn't even have 'p's at all, let alone two of them. You know what, I'm just going to keep spelling it "supress".

Friday, April 9, 2010

MSYS Make and Windows Paths

Why can I not find any documentation about how Windows absolute paths are interpreted in MSYS make?
C:\TEMP\tmp2.txt: C:\TEMP\tmp.txt
touch C:\\TEMP\\tmp2.txt
This works just fine in MSYS make. Cygwin make can't handle all those colons. Why doesn't MSYS document how it handles paths anywhere?

Tuesday, April 6, 2010

Remote Desktop Connections suck at event queuing

Microsoft Remote Desktop Connections are great when the network is working. When there's a brief lag in the connection, events are queued. Great. The problem is that keyboard events and mouse events are in DIFFERENT QUEUES!! The network just lagged for me, so I clicked in a location in a text editor and typed a word. When the lag passed, my events went through, but the word was typed at the old cursor location, and then the mouse click went through and jumped the cursor to the new place. Would it really have been that hard to buffer all input in the same queue?? Come on!

Monday, April 5, 2010

Why Git is like a Microsoft product

That's right, I just said Git is like it's written by Microsoft. Or rather designed by. It works, which is awesome, but its design features one serious drawback of which I find Microsoft products to be the most prominent source. The drawback is namespace pollution.

In Windows, you're not allowed to name a file "CON". Why? Because of namespace pollution. There are 25 reserved names that show up in the context of file names, but that aren't really file names because they're special.

This writes "hello" into a file called "conn":
echo hello >conn
This doesn't create a file at all. I have no idea what it does:
echo hello >con
The only difference is that "con" (case insensitive) is a special name. I'm calling this namespace pollution because there are a set of names (file names) and a set of names (reserved names) that are mixed together.

In Git it's a lot clearer what I mean by namespace pollution.
git checkout thing
What does this do? Can't tell. It might revert a file called "thing" to it's state at the last commit. It might switch the entire working directory to another branch called "thing". Which of these happens depends on whether there's a file called "thing" or a branch called "thing". If both exist, I'm sure one of them happens, but I don't know which without doing an experiment or reading through documentation. I'm not going to do that. Why can't there be different syntax for the two? Like
git switchtobranch thing
and
git revertfile thing
I'm going to say it. SVN's syntax is much more understandable.

Wednesday, March 24, 2010

&OK

Why is there never a mnemonic on OK buttons in Windows? If my focus is on a different button, there's no way for me to push OK without tabbing around. Cancel doesn't need one, since it's almost always the same as Escape. Usually, all buttons have mnemonics except for OK and Cancel, making OK the MOST INACCESSIBLE BUTTON ON THE WINDOW. Whose idea was that!

Monday, March 8, 2010

Ruby and Apple Fans Need to Settle Down

Mac Users Need to Settle Down

Recently, a Mac user and I had to decide on the order of the "OK" and "Cancel" buttons on a dialog in an Android application. The facts are that Windows puts the "OK" button on the left, and Mac puts the "OK" button on the right. The Mac user actually called the Windows way "bad design". I believe the rationale behind the Mac way is that the right side of a screen should correspond to forward and the left side should correspond to backward (makes me think of Mac's placement of the close window button.). In the discussion, we didn't really have time to argue about it a lot, and he was in a somewhat authority-like position over me, so it's probably good that I didn't pursue my side further at the time, but I'd like to do that now.

The text of a dialog box in all operating systems is either left-aligned or centered, and the two are indistinguishable for some lengths of text (since the dialog changes size to fit the text). The default position of your focus as you read the text starts at the left, averages in the center, and ends at the right. I'd argue that the center is really the main point of attention and so the button closest to the center is the first button the user sees and thinks about. Since buttons are right-aligned (at least in Windows), the closest button to the center is the button on the left, which should be the button the user wants to click. That's a good reason for Windows to put the "OK" button on the left instead of the right.

All that to say, Mac users seem to be a little too aggressive. They'll defend Mac to the death, which is just plain ridiculous. That much enthusiasm is really unhealthy for a topic like Windows vs Mac. Just look at the iPad. Any support for that at all is evidence of an unhealthy devotion to Mac products.

That being said, a counter example to my point is a very respectable Mac fan at the place where I work.

Ruby Developers Need to Settle Down

The same goes for Ruby developers (who seem to be the same people as Mac users. Hmmmmmm.). Ruby, just like Mac, is potentially beautiful, but completely non-standard. Ruby's syntax is not like any other languages' syntax. And I don't mean that it's hip and fresh; I mean that it's difficult to learn and nothing really that exciting. Here's an example of Ruby's syntax:
file_contents = open("filename"){|f| f.read}
I know what the line does: it opens a file, reads all of the text in it, and assigns the text into the variable file_contents. But how in the world does that curly-bracket lambda function fit into the semantics of the open() thing?? Obviously, I could find out with some research, but I thought I knew Ruby's semantics pretty well, and this totally stumped me. For comparison, here's Python's equivalent:
file_contents = open("filename").read()
Seems a lot simpler; particularly, you know that read() is a function of the object returned from the open() function. (It's possible that the Ruby code actually closes the file in some kind of with-/using-/try-finally-like semantics, which makes python's code a bit more complex to match the functionality exactly.) One more argument against the Ruby language itself, is that it was designed by one guy, designed for himself, and designed with no regard for anyone else's preferences (see Wikipedia).

But enough about Ruby, the point I'm trying to make here is that Ruby users need to settle down. The first search result for "C type casting parser" (as of the day of this post) is CAST -- Ruby's C parsing dog. Woof.. A couple things to note, one is how silly the title is, but that's fine. The second is that it's on a website called rubyforge.org. What's wrong with sourceforge.org? The third thing to notice is about 1 screen down the page in the section "The Parser".
Here's a quiz: what does "a * b;" do?

I bet you said "why you l4m3r n00b, that's a statement that multiplies a by b and throws away the answer -- now go take your meaningless snippetage to your computing 101 class and let me finish hurting this JavaTM programmer." Well, you'd be both mean and wrong. It was, of course, a trick question. I didn't say if any of a and b are types! If only a is a type, it's actually a declaration. And if b is a type, it's a syntax error.
Was the caricaturization really necessary? That bash on Java was completely unrelated. The real point the author is trying to make is actually a very good one, and was the reason I sought "C type casting parser" in the first place (has to do with parser state).

Ruby on Rails developers are usually good examples of over-excited Ruby fans. Ruby on Rails is a FANTASTIC framework for website development compared to PHP, but there exists a framework comparable to Ruby on Rails that uses Python instead of Ruby, Django. Python, as I will eagerly argue to the death (wait a minute...), is a better programming language than Ruby. Everyone I know that knows both Rails and Django likes Django way better, but Rails developers will hear none of it. Python is arguably a much easier language to learn than Ruby, and, from what I hear, Django is a better framework than Rails. Why does Ruby on Rails maintain its popularity? Well, besides momentum, I'm sure there's some unhealthy fanaticism as well.

That being said, I am embracing a lot of the semantics of the Ruby programming language in my programming language Jax. However, I'm not acknowledging any causality or direct inspiration from Ruby; it's just the way programming languages should work.

In Conclusion

Mac sucks!! Up with Linux (and windows)!!

Ruby sucks!! Up with Python (and java)!!

Monday, February 15, 2010

Monday, February 1, 2010

An 'x' is not a '+'

Idk who thought that "cxx" was a good way to refer to C++, but all I can say is that an 'x' is not a '+'. 'x' is used as a variable (like DirectX), and an 'x' looks kinda like a '+' rotated 45°. So either, cxx means c-anything-anytyhing, or it means that it's ok to roteta randow letters whenever yon want.
The C pre-processor (which is very similar to the C++ pre-processor) is also commonly referred to as CPP which might cause some confusion in certain circumstances (especially if you output the pre-processed files with .cpp as suffix), which might be one reason to use .cxx/.hxx.

-- http://www.phwinfo.com/forum/comp-lang-cplus/329968-what-difference-between-cpp-h-vs-cxx-hxx.html
Ok, the C Pre Processor is a general purpose text processor that the C language depends on. It is not at all dependent on the C programming language, so the name C Pre Processor is an objectively bad name.

Furthermore, why would you name something after the process that produced it? if you call the output of the C Pre Processor "cpp files", then you should probably call the original source files "vim files". Name things after what they are or where they're going, not how they got where they are. The ".o" file extension on object files is for "object" not for "output". The extension ".out" for executable files is a bad choice.

The reason for this rant is that cmake tells me it's compiling CXX objects. Why in the world would cmake use 'X's instead of '+'s? It's not like '+'s are special characters in status messages.

Thursday, January 21, 2010

What Great Software

More software in the world needs to be like this:

http://whenisgood.net/

As they themselves say:
No sign-up form. No password to choose. No fuss at all.
Other sites that do this:Huzzah!!

Tuesday, January 12, 2010

Putty intercepts Alt+Space

There're only a few windows I can't minimize with Alt+Space,N. One of them is googletalk because it doesn't use actual windows or something. GoogleTalks's got all sorts of non-standard behavior.

But Putty I expected better from. They allow Alt+Tab but not Alt+Space.

This reminds of when I discovered that GLUT eats Alt+F4. I had to put handles in for GLUT_KEY_F4 when (glutGetModifiers() & GLUT_ACTIVE_ALT) and then exit(0).

dumb.