Comment now »
Those of you who know me are probably aware that I’m a bit of a tea drinker. My usual routine at work includes a cup of black tea in the morning (usually Adagio’s Irish Breakfast blend), and another cup of either a black or green tea in the afternoon – whatever I feel like that day.
Yesterday, a coworker gave me a hit from her stash: Allegro’s Himalayan Green blend. I was quite impressed – a strong, refined aroma, and a fairly robust flavor for a green tea. Nothing as “robust” as a roasted green, but a bit stronger than many other green teas I’ve enjoyed. I have resteeped it this morning, and it seems to have produced a pretty passable second cup after an extra-long steeping.
Comment now »
Alt title: stereo vision is neat! There are obviously design flaws involved with having two eyes set apart being rigged to generate a single field of view – most notably when an object is close enough to my head that the scene is drastically different between the two lenses. And it does render strange visual artifacts, like being able to see my computer screen apparently *through* my hand, when it is held up in front of only one eye.
What really struck me, though, is that my brain is sufficiently well programmed that, while the strange things do render, and I consciously recognize them as strange, it doesn’t actually screw with my mind. Offhand, I’d expect that do generate more of a “holy crap wtf!” response in my brain, but it takes these things in perfect stride. No doubt because it happens many times daily, but still – humans are neat.
5 Comments »
Creating a gift want-list management app (mostly to learn how to use CakePHP). Naturally, this includes Lists of things a User wants. So, naturally, I called the DB table lists, implying a model named List. Seems fine, right?
When using the ‘cake bake all’ tool, I got a bunch of parse errors to the effect of ‘unexpected token T_LIST, expected T_STRING’ or something close. I forgot to copy/paste that error code before I fixed it ><; I’ll have to go reproduce that later so this will be a useful hit on Google later for the error message.
TL;DR: I tried to use names that were already used by either PHP itself or CakePHP
php -l to do a compile check on
app/models/list.php, I get the same eror:
php -l models/list.php
Parse error: syntax error, unexpected T_LIST, expecting T_STRING in models/list.php on line 2
Errors parsing models/list.php
Anyway, after changing the DB table to want_lists (and having to change all of the foreign key reference column names from list_id to want_list_id), I deleted all of the model, controller, view and test files, then reran the ‘cake bake all’ commands for each model it detected, the error seems to have disappeared. Testing still required, of course, both to confirm that this is where the error stemmed from, and that my fix did in fact fix it.
TL;DR: CakePHP doesn’t like models named List. Use a different name, like WantList.
UPDATE: I’ve recreated the error. I’ve done the bake for the User model already; here’s the dump from trying to bake the List model:
Welcome to CakePHP v1.3.6 Console
App : app
Use Database Config: (default/test)
Possible Models based on your current database:
Enter a number from the list above,
type in the name of another model, or 'q' to exit
[q] > 5
Baking model class for List...
Creating file /home/wanchan/abandonedfactory.net/gifter_test/app/models/list.php
List Model was baked.
SimpleTest is not installed. Do you want to bake unit test files anyway? (y/n)
You can download SimpleTest from http://simpletest.org
Baking test fixture for List...
Creating file /home/wanchan/abandonedfactory.net/gifter_test/app/tests/fixtures/list_fixture.php
Parse error: syntax error, unexpected T_LIST, expecting T_STRING in /home/wanchan/abandonedfactory.net/gifter_test/app/models/list.php on line 2
You’ll subsequently get similar errors when baking any other models that interact with Lists. Again, renaming the model to something else (I used WantList) seems to correct this, so I’m guessing CakePHP has an internal List class that this conflicts with.
I’d propose that the ‘cake bake’ command should be updated to at least warn the user about potential name conflicts. Or, alternatively, a separate ‘cake bake_check’ or something. Even just a simple published list of “names to avoid in PHP/CakePHP/whatever” would be pretty useful. Maybe I’ll start figuring out how to do all that after lunch…
Update 2: Looks to me like the conflict was probably with the PHP builtin function list(). Hmm… I wonder if it’s even possible to have a program generate a list of all names that it can’t use. I’m guessing that the best I’d be able to do is add/modify a bake command to check if any of the classes you’re ordering it to operate on are illegal. Not sure how to do that offhand… maybe have it write some temp code snippet files, then see if any of them generate parser errors like I just encountered?
Comment now »
I was perusing the Starcraft II web pages up on battle.net the other day, reading their descriptions of the various units. It’s pretty slick, and nicely informative. I found a couple of broken images on one page, so I used their support contact form to try to tell them.
…They replied to tell me that the preferred method for reporting WoW problems was to contact a GM in game.
Seriously, SCII is still pretty new, and I think it’s pretty popular. We may not have quite the number of players as WoW, but apparently we Starcrafters are literally not even worth acknowledging the existance of as users of battle.net.
I didn’t really care what happened to this bug report – I was just trying to be helpful – but this is a bit insulting. Mostly I think it rubs me the wrong way because I’m still pretty upset that I *have* to connect to battle.net to play SCII. If SCII *requires* a battle.net account, why wouldn’t your support peons not be obliged to know about it?
Ah, ranting~ it’s what an unread blog is here for.
Comment now »
Crap, I’m now far enough over the edge that I write emoticons. I just wrote “no change -.-” into my notes I keep at work.
Comment now »
So here I am, pondering learning FORTRAN just for the hell of it. I start with the GNU Fortran compiler page, of course, and sure enough, they have a page on their wiki with some info on learning Fortran (or learning the newer versions of it, depending on previous experience). At the bottom of the short list of links is some simple, practical advice: “Google on ‘fortran 95 tutorial’”. Here’s where it gets fun.
The first hit returned when asking Google about that phrase? That GNU Fortran wiki page which advises you to search Google. Maybe Google’s search engine gave the page extra points for telling people to visit Google?
Comment now »
I finished my first pass through the Starcraft II: Wings of Liberty campaign over the weekend. The acting (such as it is) in the cutscenes was quite good, and the plot itself excellent, in my opinion.
I was quite pleased at the difficulty. On “normal” I had minimal troubles in the first handful of missions, and with the exception of the last couple of missions, the only times I had to reload from saves was when I was trying to complete the optional objectives. It made for a pretty smooth playthrough. My only gripe, I guess, is that I’m going to need to start over in order to play out all of the missions, as the story has a couple of (minor) forks – I need to replay so that I can make the other decision at each fork.
I must say, however, that having a totally different set of units available to me in the campaign battles as compared to standard multiplayer matches was a bit confusing. I like my medics, and they behave so much better than in the original Starcraft. I miss them so during my skirmish battles :/ (the Vultures are neat, but I hardly used them anyway).
The ability to research upgrades in the lab and armory to permanently modify my army for future missions, and the way each campaign battle unlocked a particular unit on completion also sat very well with me. It felt like the usual natural progression of increasing tech level mission-by-mission, complete with the expected brief tutorial about the unit’s capabilities, except that I gained some control over the order in which I added each particular unit to my arsenal. So I could do things like expedite the addition of the glorious Siege Tanks, since I knew I’d be making extensive use of those.
The Laboratory research upgrades were considerably more engaging than I expected, mostly because you are made to choose between two different upgrades at each level. The problem? Pretty much all of the research options are zomg awesome. I’m happy with my choices, but suspect I’d do just as well with the alternatives.
The Mercenary units are amusing, and useful, but overall pretty “meh” in my opinion. Admittedly, that’s probably because I often forget to summon them, other than the Pirate Battlecruiser. I make pretty heavy use of battlecruisers whenever possible (at least in campaign missions). And his “I’m being attacked” dialogue amuses the heck out of me: “it’s a trap!”
I’m still not sure I care for Blizzard’s decision to split SCII into 3 full-on games, but this one, at the least, was worth my time and money. If they charge full price for the Protoss and Zerg campaigns, I’m gonna expect one hell of a performance, since this one has the multiplayer engine already.
Speaking of multiplayer, I have a smallish complaint. Why must “offline” skirmish battles (where I’m the *only* human player) be treated exactly the same as an online multiplayer? Pausing is limited, and I once paused a game and went to bed, only to find the game had ejected me for holding the pause too long. Who was I inconveniencing? Did it really bother the AI that I made it wait before finishing the match? For that matter, if I’m playing coop or head-to-head with friends, why shouldn’t we be able to table a long match for completion after we, say, come home from work? On the other hand, maybe the save/load function can fill that niche? I have no idea if a multiplayer game can be resumed with the same humans as before, or if AIs get automatically assigned to those slots. Or are mutiplayer matches even saveable? I don’t generally play with humans, because, as a rule, People Suck. I don’t see why I should expect the SCII community to be any different. I need to send a copy to Mark and make him play with me, I guess ^^;
Comment now »
In terms of skills learned pre-college that I actually use day-to-day, it occurs to me that “touch-typing” is probably a lot higher than one would think. It’s probably something like
(for me, anyway).
Obviously this is because I discovered a love for computers and programming them, but that didn’t take off until college. Thanks, Middle School, for adding “decent touch typist” in there next to “literate” at the base of my skillset.
Comment now »
Well, got Michi picked up a bit later than expected, so we decided to go straight home for some Abyssea XP with FI folks instead of hiking. Worked pretty well, I ran boxes on my RNG to go 64 -> 66, and Michi got her WHM up to 80 plus cap buffer.
Michi is planning to take Friday off, so we’re thinking to do a longer day of hiking along Rattlesnake Ridge then.
Comment now »
So Michi and I finally decided to get off our backsides, and get in some hiking while the weather was still good. On recommendation from some of her coworkers, we decided to try Tiger Mountain State Forest. I expect we’ll be hitting it a lot, as in low traffic it takes ~20 minutes to get to the trailhead from our apartment.
On Saturday we hit the trail a bit after 8am, and started straight up West Tiger No. 3 Trail. That ended up being a poor decision on my party – I underestimated how badly out of shape I am. After 30 minutes of moderately steep climbing, I was pretty badly beaten. On my request, we turned back, and spent another 45 minutes or enjoying the fairly flat Around the Lake Trail, which, strangely, skirts around Tradition Lake. It’s a pretty pleasant trail, with the majority being better described as a narrow gravel road than a forest trail.
This morning we slept in a bit longer, and didn’t hit the trail until more like 10am. This time we started with the Around the Lake Trail for a warmup, but forked off at Nook Trail just before returning to the trailhead. We too Nook south for a while in a much nicer climb up a bit of West Tiger Mountain, then used Talus Rock Trail to cut back over to West Tiger No. 3 for the descent back to the trailhead. We loaded back into the truck at about 11:30. We came home with weary legs, but happy for our morning’s exercise :D
Since our Sky shell has cancelled events this week, we’re going to try to hike something from that trailhead again tomorrow after Michi gets off work. Traffic’s gonna be inevitably much worse, but there’s only one way to find out how feasible it is to hit those trails after work ^.^b