Monday, March 16, 2015

HarmTrace, or: How I Learned about Cabal Hell and Hated it Ever Since

For a music visualization project I'm trying to get HarmTrace, a haskell library, working. It is what Chordify uses in their backend to detect BPM and Chord changes, and Chordify is great on that.

I did not expect, however, that it would be so hard to install a haskell package. Turns out that the "package manager", Cabal, is famous for breaking dependencies and giving developers hell. To this date I've spent 15 hours on it, and I believe it's very close, but it's been a long and winding journey.

Current progress:

Upstream Mentor (creator of HarmTrace and co-founder of Chordify!) successfully contacted.

Mentor suggestion: Install it in a linux machine, with ghc-7.6.3.

Installation progress:

Mac: using GHC 7.6.3, and custom .cabal file, build gets stuck at hmatrix-gsl-stats-0.2 bug. Someone ran into this as well. His fix didn't work on my machine.

Linux: He suggests using linux for this. Ubuntu was installed in a VirtualBox and I tried to install Haskell-Platform on it. First try with Debian distribution, it bugged out; second try, it ran out of memory after ~5 hours. Oops. Guess I'll try it on my Mint.

The author who ran into hmatrix-gsl-stats problem wrote a post about installing it on Linux. After getting Haskell-platform installed, I'll follow his post for the rest.

Oh, and fragment of a script:

To install from online:
cabal install HarmTrace --with-ghc=ghc-7.6.3 --constraint="HarmTrace-Base==1.1.0.2" --constraint="uu-parsinglib installed" --allow-newer=uu-parsinglib,cabal

To build from local:

cabal configure --with-ghc=ghc-7.6.3
cabal build --with-ghc=ghc-7.6.3
cabal install --with-ghc=ghc-7.6.3

Monday, January 26, 2015

The Great FireWall of China and Web Development

The new leader of China, Xi Jinping, had strengthened the Internet Censorship in China. Beginning this new year, all Google services became inaccessible from mainland. 

The impact is severe, for that it does not only affect the well-known Google Services - Gmail, Google Drive, Google Play, etc - but also developer-oriented services, such as Google App Engine. Furthermore, since many scripts and fonts are hosted on Google CDNs, the total banning of Google services has rendered tons of websites not related to Google ugly or non-functional. Many modern websites rely on Javascript to function correctly, not to mention web apps.

Before going back to China I was wondering if it would be necessary to develop websites that still works without Javascript. As far as I know, that's a compatibility requirement even rarer than "This has to work on IE6". During this winter in China I have experienced what it's like to use the Web this way, and it's not pretty. Sometimes I have to use view-source to extract the information I want. The modern web has already became heavily javascript-dependent, and from how it looks in the industry, there is no going back.

Maybe a wise thing to do is to keep in mind that there would be users accessing your website without the Javascript functioning. My experience in China is a pretty unique situation, but there are many other situations that might break your javascript on the user's computer. A broken website that still has the information the user is looking for with some ugly default fonts and misplaced CSS is better than nothing at all.

P.S. This post is not an excuse for my low productivity this winter.
P.P.S. Since so many important services became inaccessible, especially Gmail, I took the opportunity and installed Firewall-breaching softwares on my family members' computers. Another major victory for Chinese Democracy.

Wednesday, November 12, 2014

RPG Journal: Caving

I caved hard last weekend. It reminds me of the days I spent playing WoW during High school in Michigan, when I first came to America.

Gameplay Journal

The caving happened after two weeks of hard work on various projects. (Speaking of which, check them out - Time Trooper and my Portfolio Site Template!)

Every time I finish something substantial, I would add 1 to my "Kill count" for that week. Last week, I pulled multiple all-nighters (can't remember - memory is blurry) and broke my personal record.

The burnout came. Saturday I was still working hard meeting people and talking about various things, but Sunday, and Monday, and a part of Tuesday (that is two hours before this current moment), I dove into the Legend of Korra Season 2, and World of Warcraft, among other things. I watched half of Korra Season 2 in a Marathon, and went on another Marathon of Battleground Grinding for 8 hours or so, finally going to bed at 5 in the morning. Monday I jumped back to WoW after school Monday, went to bed late again (3 p.m.), and played a bit more Tuesday. During all this time I have ~8 papers overdue for 3 different classes.

Highlights and thoughts

- Burnout sucks.
- During my first year in America I spent tons of time on WoW due to culture-shock-induced-social-anxiety. This is similar to that in symptom, in that I ignored the overdue works and procrastinate on entertainment to the point of sacrificing sleep for it. They are also similar in that they are both stress-induced. The difference is that last time was the aftermath of a bigger stressor that's also harder to solve. This time the stressor is smaller and more temporary.
- I spent most of my WoW time farming honor points from PvP - to be exact, by doing BattleGrounds. The win/lose ratio for me was approximately 1/13. It was hell of a grind, yet it was strangely relaxing. Perhaps it's because the goal (to get enough honor points to purchase an heirloom) was the main motivation, and even though i lost every round, I'm still being steadily rewarded for playing.
- Gear and skill are both very important in PvP. This also means that players are being rewarded by both being good at the game and the amount of time they spent playing.
- Planning and cooperation are the most dominant factors in Battlegrounds. The bigger the battlegrounds are, the more significant this is.

Wednesday, October 29, 2014

RPG Journal: Boost to 90

After going back to WoW last time, I had a ~1 month AFK, because the free 1 month subscription from coming back ran out. It was a tough decision to pre-purchase the new expansion Warlords of Draenor and go back to WoW.

Game Summary

Warlords of Draenor sets the story after Garrosh's defeat by both Alliance and the Horde. He escaped the trial with helps from the Infinity Dragon Flight, Kairoz, and Wrathion. He time-travelled back to an alternative Draenor, and over there helped free the orcs from the fate of serving the Burning Legion. instead, the orcs formed a war machine, the "Iron Horde", and reopened the Dark Portal to attack present Azeroth.

The pre-release events are already happening in the game; The Iron Horde has arrived in the Blasted Land and both Horde and Alliance are sending their best troops there to hold back the Iron Invasion.

Gameplay Journal

I boosted my lvl14 Goblin Rogue. I've always wanted to play a rogue, and Goblin just seem to be a fun race.

The boosted lvl90 character starts at the event at Blasted land. During the quests there I acquire my rogue skill sets incrementally. 

Afterwards I was free to roam the earth however I want, so I checked out some areas in Mist of Pandaria, did a transmorg run in Black Temple with my old friend, ran through couple lvl90 raids, and did some questing in MoP to learn more about the lore.

Highlights and thoughts


- Great idea to introduce the skills slowly and point out their categorization as oppose to allowing the player everything from the beginning of the boost.
- While it doesn't make a difference on goblins or pandarens, new models of other races look good and feel good.
- Running through old contents is great fun. It serves as a break from the massive difficult intense 25 man raids. It also allows you to have a smaller, closer group and do stuff.
- I GOT TO MEET SHAO HAO OMGASLKJFHKALSJBVASIUVIWEWA anyway that was quite an epic introduction to the Pandaren lore and history. It is safe to say I did not see that coming, and it is one of the in-game moments where mechanics, role-playing and narrative combine so perfectly.

- Lorewalker Cho serves as a good NPC to walk you through the lores. See What i did there?
- New Talent system is great. Previously the talent system is very hard to change around, and serves more as a theorycrafting game. Once a patch comes out, there will be a period of time when everyone is trying out new talents. But once some optimized talents come out, there's no game, only research. In this new talent system, changing talents only require a simple item, and there's no more "optimal" talent system, since talents are more about specialization and uniqueness rather than "raising attack by another 3 percent". Now that talents are not interdependent on each other anymore, it's also easier to make these decisions solely depending on the playstyle rather than calculation.
- Scenarios are very enjoyable story-wise, although they still run into the problem of conflicting interest of players who want to experience the story/immersion v.s. players who just want to be the very best, the first that ever was.

RPG Journal: Going back to WoW

So, after 4 years of AFK, I went back to WoW!

Game Summary

Well, I'm sure everyone know what World of Warcraft is about.
I was playing it casually in high school. The expansion back then was Wrath of the Lich King. Much has changed since then, both story and mechanics. Cataclysm, and Mist of Pandaria, came after these.
Sadly I lost the original accounts and its characters (an lvl 80 Tauren Shaman).

Gameplay Journal

I tried out two new characters. A Pandaren monk and a Goblin Rogue. Both Horde because I swore my loyalty to the Horde in my past incarnations.

I leveled the monk to ~ level 40 and the rogue to ~ level 15.

For the pandaren monk, after the initial sequences of quests in the starting zone, I ventured into Ogrimmar, then Azshara, then Ashenvale, then Stonetalon Mountain, then Southern Barren, then Dustwallow Marsh, and then the Thousand Needles, where I stopped my journey.

For the rogue, I didn't go much beyond the initial quests. But!!! His adventure will continue in the next blogpost.

Highlights and thoughts

The Biggest change they put into cataclysm is the changes in the old regions, and that's what I want to experience the most.

In WotLK, I reached a point at level 60  when i just want to stay at that level and enjoy the end-game contents in WoW classic. The end game and its stories felt very separate at that point, because while WoW kept pushing in new expansions, they all happened in new collections of zones (Northrend, Outland). The regions from 1 - 60 only builds up to the end-game contents of level 60, so it's only natural for me to prefer to experience all the excitements there rather than going to Outland.

Cataclysm, however, changed the classic world and revamped all the stories and quests. The new storyline focused around the conflicts between the Horde and the Alliance, particularly around the leadership of Garrosh Hellscream.

Even the new contents from Mist of Pandaria, for example, the discovery of the Wandering Isles by the horde and the Alliance, fit beautifully into the new contents from Cataclysm. The Horde and the Alliance is still at war, and pandaren's starting zone introduced that conflict just at the right time.

Not to mention the large storyline that routed across Azshara, Ashenvale, and Stonetalon mountain. The events surrounding the bomb defined many aspects of Garrosh, the new horde under him, and the new world situation.

There are also more varieties of quests. These designs seem highly influenced by WotLK. I got to man siege engines, shoot down planes, ride on a cart to travel in the Starting Zone as oppose to having to walk endlessly. I haven't got into the game mechanics changes yet in this post, but overall it's been a much more exciting RP experience.

Thursday, October 23, 2014

RPG Journal: Everquest Landmark

So, I tried out Everquest Landmark!

Game Summary

Everquest Landmark = Minecraft, but more realistic graphics AND MECHANICS.

In this game, you gather resources, mining from the very earth you stand on, and use them to construct any structure you wish to make.

Gameplay Journal

I used my friend's account to enter the game. After fighting through all the control methods and rules, I headed out for an adventure. I decided to build my base at the top of this peak that is the highest point of the island i spawned on.

When running to that place, I stumbled on many buildings by other players. Unfortunately I did not see any other players. 

I also stumbled into a cave, much like the one in Minecraft, except a lack of monsters and life-threatening agents. The grappling hook shines here, for I can use it to move around inner walls of the cavern and mine easily. After messing around in there for much longer than I thought I would, I headed out for the peak.

I tried to build some decent structures, but the learning curve of building tools was higher than I thought. I gave up after successfully erecting a platform for my stillbirth headquarter.

Highlights and thoughts

- Their territory system is weird + monitization point. You can either build things in the wild, or pay some points to establish a private sandbox area. You either dig up bunch of copper to pay for that, or pay actual money.
- Maybe because of the level of skill required to build a good structure, the player contents are mostly ugly and not fitting to the world.
Essentially, while I was hoping to see this...

... instead I got this.



Some of them aren't bad - they actually are quite humorous. Still, I can see a problem when in this game you are living out epic stories, but turn your head and you see some broken architectures in the air.

The difficulty and building methods in Minecraft is a lot simpler, and theme of Minecraft is a lot lot open-ended. These are probably the reasons why it's more enjoyable to play minecraft which uses simple voxel building, rather than Landmark, which has a set of more powerful tools, but not as easy and fun to get in. The realism also limits the humor aspect.

Tuesday, October 14, 2014

The "wonderfulness" of Javascript types

> le me, opens js console
> parseInt("derp")
> NaN
> typeof parseInt("derp")
> "number"




One day I will understand the design philosophy behind all that weird javascript types, and I will transcend into something else, something more than a front end code monkey.

But that day is not today.