http …">

Jason Bosco

Full Stack Web Developer ; Generalist

Change Host-name on a Mac

I have the host-name on my MacBook set as Jason-MBP. But when I connect to the campus wireless network the hostname automatically changes to something else. This started causing problems when starting erlang shells with my original host-name. So I had to change it back to my original hostname to get the erl shell working. Found this after a bit of googling: 

sudo scutil --set HostName Jason-MBP.local

The Exposure-Usefulness Theory of Apps

Here’s my theory: “The usefulness of ANY app is directly proportional to the amount of exposure it receives, i.e., the number of people who try the app out, assuming the app is bug free.”

My observations so far seem to corroborate this theory. Why else would any company invest in marketing? Every company believes that if they could reach out to the right people, their app would be successful. In doing so, they try to reach as many people as they can to get to the right set of people. Exposure-Usefulness.

All of use have unique tastes and preferences. Wouldn’t there be atleast a handful of people on the face of the planet who would find a particular app useful to them? The very reason the app exists is that someone from that set of people thought it would be useful and decided to make build it. Exposure-Usefulness.

For several startups, two items on their marketing checklist I imagine would be: “Get to the front-page of HN” and “Get featured on TC”. Their idea is to get their app to a large audience. They of course don’t expect everyone in the audience to like it. But well, if they could atleast get a few people interested, that’s good enough for a start. Exposure-Usefulness.

To see if this Exposure-Usefulness theory actually stands good, here’s an experiment: What if, we had a platform in which app developers post links to their apps - apps of all platforms. And we have a review / commenting system. So you could call it a HN just for developers to unabashedly talk about their apps. And no the exisiting HN doesn’t seem to be the right place for this because, the sheer volume of news articles and the “don’t spam the system” comments seem to discourage people talking about their apps. HN is a news site and let it stay that way. Let it not be polluted by developers trying to get exposure for their apps. Instead, we need a HN just for developers to talk about their apps with no one telling them to stop spamming. 

With such a platform in place, and sufficient audience viewing the apps posted, would every app posted there be useful? I have reason to believe so. 

Find All Symbolic Links Within a Directory

For some reason I needed to see if there were any symbolic links within a directory and I used this command: 

ls -alR | grep "\->"

 

(-R for recurse)

Note to Self: Web Apps and Enterprises

Enterprises don’t use web apps that host data on external servers. Enterprises need control over their data. So a hosted version of a good web app with paid support would make good money. A hosted version of Dropbox? A hosted version of Google Docs?

Thoughts on Mac OS X Lion

The installation was a breeze. It was interesting to download an entire operating system as an “app” from the Mac App Store. The installation couldn’t have been any simpler. It asked only for the disk the OS needed to be installed on. And 40 minutes later, the computer boots into the new OS with all my exisitng apps and data! This is quite unlike the Windows experience with its umpteen number of options. At one point during the installation I was worried the new OS would wipe out my data, but my faith on Apple’s user oriented approach reassured me that they wouldn’t be so stupid as to wipe out user data without warning users. (I did have online backups and my code on remote repositories anyway.)

The login screen UI has changed.

The default wallpaper has changed to a picture of a Andromeda.

The scroll bars are tiny, and resemble the ones in iOS. Talking of scrolling, the most important change for me so far has been the two finger scrolling. In Snow Leoperd, if you swipe down with two fingers, the page scrolls down. But in Lion, this is reversed! To scroll down, you need swipe up! Though I now see how this is more logical than the old method, I’ve gotten so used to the old swipe action that it gets quite annoying. I now have to tell myself that it’s like scrolling on an iPad. OS X Lion is more closer to iOS. EDIT: There is an option to change it back the old way. They call the new way the “Natural way” in the Trackpad System Preferences. Also, the gestures for “show desktop” and mission center / expose are different now. 

They’ve changed “Turn on Airport” to “Turn on Wifi”. 

My user name now appears on the top right of the screen.

Apps can be made full screen. 

Expose transforms to a new feature called Mission Control. It looks better than expose and is more useful if you ask me. 

The new Launchapd feature is pretty awesome. It lines up all you apps just like in an iPad home screen. And you can swipe left and right to switch pages. Again a feature resembling iOS. 

The System Preferences window now has email settings. And the interface to add a new email account resembles iOS again. The Mail application also sports a new look. 

That was my experience in 15 minutes. 

More soon.

EDIT: 07/24/2011

Macports

Macports went haywire after the upgrade. As recommended on the macports site, I did a ‘selfupdate’ and an ‘update outdated’ and it started complaining about libiconv not being present. After a little reading up, it looks like the version of libiconv that I had only worked on Snow Leoperd. But when I tried to reinstall libiconv, it also tried to reinstall gawk which is a dependency and again it would fail looking for libiconv. I had to reinstall every package that I had installed via macports on Leopord. There is a guide at Mac Ports to help: https://trac.macports.org/wiki/Migration. Now erlang fails to install via ports. It gets stuck at “logger not found” error. I found this: https://trac.macports.org/ticket/30012. It looks like a macports bug on Lion. So for now, I’ve decided to install Erlang from source. Everything else works fine after the reinstall of macport packages. 

Appcelerator doesn’t work yet: http://developer.appcelerator.com/question/122584/error-launching-desktop-app…

dyld: Symbol not found: _iconv
  Referenced from: /usr/lib/libcups.2.dylib
  Expected in: /Users/jason/Library/Application Support/Titanium/modules/osx/php/1.1.0/libiconv.2.dylib
 in /usr/lib/libcups.2.dylib

Erlang doesn’t compile from source on Lion. It fails with the error: 

(cd ../main && make hipe.hrl)
sed -e "s;%VSN%;3.8;" ../../hipe/main/hipe.hrl.src > ../../hipe/main/hipe.hrl
erlc -W  +debug_info +inline -o../ebin hipe_rtl.erl
(no error logger present) error: "Error in process <0.1.0> with exit value: \{\{badfun,[<<5 bytes>>,<<47 bytes>>,<<9 bytes>>,<<3 bytes>>,<<2 bytes>>,<<5 bytes>>,<<12 bytes>>,<<2 bytes>>,<<8 bytes>>,<<8 bytes>>,<<5 bytes>>,<<7 bytes>>,<<5 bytes>>,<<11 bytes>>,<<2 bytes>>,<<11 bytes>>,<<15 bytes>>,<<4 bytes>>,<<50 bytes>>,<<5 bytes>>,<<1 byte>>,<<7 bytes>>,<<10 bytes>>,<<7 bytes>>,<<6 bytes>>,<<7 bytes>>,<<7 bytes>>,<<6 bytes>>,<<12 bytes>>]},[{erlang,apply,2}]}\n"

Apparently XCode4 is the culprit which is causing this.

EDIT: A commentor on HN suggested I read this: http://erlang.org/pipermail/erlang-questions/2011-July/060177.html. So I tried 

CFLAGS=-O0
./configure --enable-darwin-64bit

and then

make

but now it gets stuck with this:

ld: warning: ignoring file /Users/abcd/Downloads/otp_src_R14B03/erts/emulator/zlib/obj/i386-apple-darwin11.0.0/opt/libz.a, file was built for archive which is not the architecture being linked (x86_64) ld: warning: ignoring file /Users/abcd/Downloads/otp_src_R14B03/erts/emulator/pcre/obj/i386-apple-darwin11.0.0/opt/libepcre.a, file was built for archive which is not the architecture being linked (x86_64) Undefined symbols for architecture x86_64:...

EDIT: I had to run those commands on a fresh copy of the source and it worked fine this time. http://erlang.org/pipermail/erlang-questions/2011-July/060206.html. Apparently, “make clean” doesn’t clean up everything and so that’s why the commands wouldn’t work earlier. 

Update: Bootcamp does not work! This is pretty shocking. After several months I needed to boot up Windows (thanks to DRM encoded wmv class lectures) and to my shock, I couldn’t access the Bootcamp partition or was it just taking way too much time to boot into it. A quick search showed me that I had company. Oh well, good I didn’t have any important data on my Windows partition. 

Update: I now use Homebrew instead of Macports

Update: I ended up purchasing parallels and upgrading my RAM to 8GB

Update: The problem with dual monitors and full screen apps is plain annoying.