Saturday, September 6, 2008
YMG 5K
My 9th-round opponent was a jerk: when I called a judge on a visibly bent card (which resulted in a match loss for an earlier opponent, and ultimately a warning for him) he was extremely rude/defensive until the ruling came back, at which point he actually shut up. He drew 3 Cryptics in game 2 which knocked me out of prize contention: a win in round 8 or 9 would have put me in 23rd at worst, I ended up in 43rd.
Still, top 20% (-ish). Nothing to sneeze at, and for the majority of the tournament I was kicking ass and taking names. Notably, my matchups were pretty mediocre throughout the tourny: played Kithkin twice (2-0), 1 Triple-tribe(0-0-1), 2 Five-color (1-1), 1 Kelpie (0-1), 1 Faeries(0-1), 2 Green decks (2-0). That's 3-5 bad matchups, or at least not favorable ones.
This tournament really reinforced a general observation about tournament magic: there are a relatively small number of douchebags playing the game and they tend to play slow, often painfully so. If they hadn't been so judge-understaffed (5, I think) I would have requested monitoring for slow play during at least the Triple-tribe game.
More general stuff:
*Faeries is really, really good. Like all kindsa good. Based on what I've seen of Shards, it will continue to dominate in Standard and possibly in Extended, as well. (ie, what I've seen of Shards is poopy)
*Shards appears to be aggressively multi-color, so I think there will be Karoo-ish lands (at common)
Tuesday, September 2, 2008
Emacs, TRAMP
TRAMP is an emacs extension that lets you edit remote files via ssh. This is nifty because it lets you have your own .emacs almost regardless of what you're editing.
Installation/use on Ubuntu is a snap:
sudo apt-get install tramp
add the following line to your .emacs (in your home directory)
(setq tramp-default-method "ssh")
C-x C-f /ssh:user@hostname:/path/to/file
(for whatever random reason, that syntax stopped working for me with no changes to the underlying system that I'm aware of after a week or so of using it. I got the error "ssh: ssh: Name or service not known" and revised the command to be as follows:
C-x C-f /user@hostname:/path/to/file
)
Tuesday, August 12, 2008
Honey Toast
Lorwyn-Shadowmoor Block Constructed has some number of decks. The number of decks doesn't really matter, however: the dominant archetype and the most powerful cards matter.
Faeries is probably the dominant archetype. If it's not, then it's probably mono-red. I don't care, actually. I'm not going to play either, although if I was forced to play one I'd play Faeries, simply because it has the best optimal draw essentially in the format. The problem with playing Faeries is that it's a completely known quantity: there just aren't many slots to adjust. Consequently, a skilled opponent can just play around it. With 2 god-draw games, that probably won't matter. But Faeries doesn't always get the god-draw.
Since I don't actually have the time, money or interest to test extensively, I decided to build a fun deck. A fun deck running as much of the power of the format as I could.
Initially, I played a deck with the goal of getting turn 2 Devoted Druid into turn 3 Overbeing of Myth. Without early disruption, I would win, period. The problem is that the format plays early disruption, so it actually makes sense to scale back and be more consistent. The one thing that testing that deck did tell me, though, was that Dream Fracture is good. Really good, in fact.
The way to make it even better is to have a deck consisting entirely of land and powerful cards. With such a deck, the card you draw off of it will almost certainly be better than the one your opponent just drew. A Quick 'n Toast basis seemed correct because of the average power level. The deck list follows:
2 Oona, Queen of the Fae
2 Primal Command
2 Hallowed Burial
4 Firespout
4 Shriekmaw
4 Cryptic Command
4 Dream Fracture
4 Broken Ambitions
4 Mulldrifter
26 land, configure to taste. my config:
4 Reflecting Pool
4 Vivid Grove
4 Vivid Creek
4 Flooded Grove
4 Island
4 Mystic Gate (2 of these are currently other filter lands in my deck due to a personal shortage of Gates)
1 Cascade Bluffs
1 Fire-lit Thicket
I don't know how it stacks up to the Chapin list, Justice Toast.
However, my thoughts:
I run more permission than any deck in the format except some builds of Merfolk, but Merfolk are not really fully on the radar AFAIK.
This means that when Faeries attempts a Mistbind Clique power-play, it's likely to result in their best creature hitting the graveyard, and I will either clash or draw a card, or choose a second cryptic mode.
I'm running fewer vivid lands than Justice, which seems correct: in my experience, I want at most 2 of my first 4 lands to be Vivid, and it'll happen to Justice almost every time. 3 of 4 is not implausible, which means no plays until turn 3. seems bad.
Archon of Justice is better in some sense than Oona, but unless Justice sticks a Runed Halo naming the Queen of the Fae, she will go the distance. If you untap with Oona, you win.
Basically, Honey and Justice take different approaches to solving a problem: Toast decks, despite their power, often just need to buy more time because of poor draws. I opted for a package that could take advantage of probably never missing a land drop, because Oona loves mana like I love bacon. Chapin included Mannequin to recur creatures, and it's very powerful. I don't think it is better than Dream Fracture, however.
getting Rails forms to be obedient.
The default Rails assumption is that you are doing things with ActiveRecord objects directly basically all the time. This is not a horrible assumption, but most of my Rails projects at LocaModa have not been "in charge", and so I've had to twist the expectations a little bit.
Most recently, I needed a form that was basically just a wrapper around a function that did direct inserts/deletes. Additionally, the form needed default values filled in. I'm a bad, bad man, and probably opened up a new level of hell for myself. But here's how I did it.
<% form_for :qux, :url => {:controller => das_controller, :action => das_action} do |f| %>
<%= f.text_field :foo, :value => @value %>
<%= f.submit "Suck it" %>
<% end %>
The Rails form_for docs are surprisingly opaque on this sort of thing, which I think is probably a mistake. Documenting possibilities, even the bad ones, is a very good thing, especially if the bad ones are accompanied with an explanation of why they should be avoided.
Tuesday, August 5, 2008
Heroku gem on Ubuntu Hardy
Getting it to actually work was surprisingly annoying: it error'd out very ungracefully whenever I entered a username/password, which turned out to be relatively easy to fix. command_line.rb (which lives in /var/lib/gems/1.8/gems/heroku-0.3.1/lib/heroku) needed to have a (require 'fileutils' ) inserted at the top.
With that problem solved, it complained about my ssh key (apparently vulnerabilities had been discovered), so I had to regen that. This shouldn't be a problem if you've generated your ssh very recently: mine was a few months old.
After that, it was basically just git annoyances. You need to (git add .) before a (git commit), which is best done as (git commit -a -m "your message"), which adds everything in the pwd (and recursively beneath) and then commits with a message, in this case "your message". Stealing blatantly from my older brother, I decided to make that faster to type and aliased (git commit -a -m) as gcm in my .bashrc. (alias gcm='git commit -a -m')
Monday, July 28, 2008
Rubygame
libsdl-ruby1.8 (probably not necessary, but might be useful if I needed an extension)
libsdl1.2-dev
libsdl-gfx1.2-dev
libsdl-image1.2-dev
libsdl-mixer1.2-dev
libsdl-ttf1.2-dev (this wasn't available for Hardy, so I did a package search and installed the package from Dapper)
Thursday, July 24, 2008
OGRE, ogre.rb
The current stable OGRE gem is 0.2 (and is named ogre.rb), and it wants ogre-1.4.4, which you can get reasonably easily by following the OGRE source installation directions and string-substituting appropriately. 0.3 is unstable and I was unable to install it on 64-bit Hardy.
I also needed to install osi-1.0.0, which is available on sourceforge. http://downloads.sourceforge.net/wgois/ois-1.0.tar.gz?modtime=1182593947&big_mirror=0 The installation procedure for that is directly analogous to the installation steps in the ogre install docs.
Additionally, I needed to muck around in the gem directory itself in order to be able to run any sample code. Specifically, plugins.cfg and resources.cfg needed to be moved into the gem root and resources.cfg needed /samples prepended to the path. The plugin folder needed to be /usr/local/lib/OGRE, although I think that I only needed to edit that because I had previously edited it on some wild goose chase.
With that, I was almost able to run the samples, but it resulted in a black screen that just wouldn't die. (Q, esc, C-c, CAD all failed) Turns out that I needed to adjust the settings: RTT Preferred Mode of PBuffer did the trick. (samples needed sudo to execute successfully) Exiting the rendering was accomplished via Q and arrow keys plus my touchpad allowed to to pan and zoom.
I'm not convinced that OGRE is intrinsically the way to go, but it certainly is getting the most attention from the Ruby community (the ruby irrlicht bindings are over a year old, and almost certainly out of date by now), and it seems like it would have a pretty strong symbiotic relationship with pyOGRE. Also, Google likes it enough that they gave it Summer of Code(rs). Rubygame seems like it might be too low-level, and Shoes doesn't seem capable enough at the moment.
As an interesting aside, Perl is apparently the best language for OpenGL development, running fully as fast as C. This raises a fairly compelling argument to have a compiler for a scripting language with a higher-level interface to OpenGL to target Perl for OpenGL apps. I may look into that project, as it seems potentially sexy as all hell.
The advantages that Python can currently cite for graphics dev over Ruby are largely documentation advantages, although Blender is also potentially a moderately big deal. Pygame is also probably somewhat more mature than Rubygame. That said, the incentives for using Python as a SDL API apply at least as strongly (and probably more so) to Ruby, so it still seems like a good route to go down if you want to do rendering/game dev using a high-level language.
If I end up using it seriously, I'll try to correct the heinous lack of docs.
Wednesday, July 23, 2008
Routing hell
{:controller => foo_controller, :action => foo}
syntax.
url_for is heinously broken if your application is running on a subdomain, as are the more concise text routes.
That's actually not strictly accurate: there are application routing schemes for which url_for will not be broken. if all of your urls look like
some_site.com/subdomain/thing
you'll be fine.
if you have some_site.com/subdomain/thing/foo
the urls generated by url_for will have /thing prepended, which is 7 kinds of not good.
If it was /subdomain/thing, you'd be fine. Probably.
The additional advantage of avoiding routing hell by using the {} options is that it will tend to keep your config/routes.rb very minimalist.
Tuesday, July 22, 2008
ActionGmailer
install the tlsmail gem.
in environment.rb:
require 'rubygems'
require 'tlsmail'
Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE)
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => "smtp.googlemail.com" ,
:port => 587,
:domain => "imap.googlemail.com" ,
:authentication => :plain,
:user_name => "you@gmail.com" ,
:password => "
}
Wednesday, July 16, 2008
Net:HTTP gotchas
Net::HTTP.start does, and seems basically strictly superior, although having both is probably nice for some niche.
The argument to Net::HTTP.start (or new) shouldn't have a preceding http://
If it does, you'll get this error.
SocketError: getaddrinfo: Name or service not known
from /usr/lib/ruby/1.8/net/http.rb:560:in `initialize'
from /usr/lib/ruby/1.8/net/http.rb:560:in `open'
from /usr/lib/ruby/1.8/net/http.rb:560:in `connect'
from /usr/lib/ruby/1.8/timeout.rb:48:in `timeout'
from /usr/lib/ruby/1.8/timeout.rb:76:in `timeout'
from /usr/lib/ruby/1.8/net/http.rb:560:in `connect'
from /usr/lib/ruby/1.8/net/http.rb:553:in `do_start'
from /usr/lib/ruby/1.8/net/http.rb:548:in `start'
from /usr/lib/ruby/1.8/net/http.rb:440:in `start'
from (irb):45
And then you'll go on a wild-goose chase around the internet, look at sample code for Net::HTTP in chapter 3 of the poignant guide and realize why it was breaking. And then write a blog post about it.
Thursday, July 10, 2008
Getting Started With Rails
For now, the best bet seems to be to read through most of the second edition of Agile Web Dev. so that you understand some Rails theory and practices. (basically, parts I and III) Then, follow along with one or more Rails 2.0 tutorials: I used Akita's to make the transition from 1.x to 2.x after about 6 months of inactivity. (http://www.akitaonrails.com/2007/12/12/rolling-with-rails-2-0-the-first-full-tutorial) Your mileage may vary, so feel free to consult other tutorials.
After that, the docs/api at rubyonrails.org are probably going to be your best friend, particularly in conjunction with Agile Web Dev.
Tips for newbies:
You really, really want to be using Ubuntu to develop Rails apps. The initial setup can occasionally be a bit of a headache but a quick expedition to google with any errors you're having will almost certainly result in the solution. The Ubuntu community is amazingly good and there are some pieces of software that will hit there significantly before they will on OS X, the other candidate for serious Rails dev. Using Windows for Rails dev seems to be filled with naught but pain.
A lot of people in the Rails community are yammering about how great Postgres is. It's probably not for you, unless you've used it before. MySQL is much more batteries-included and will probably be more than adequate for any app you're writing early. Database issues are just things you shouldn't have to worry about yet.
Heroku is a pretty good early hosting solution, unless you already have a Rails-compatible host. I don't like using them as a development platform, but that's largely personal taste and a toleration for sysadmin-y things.
Learn Ruby. No, not Ruby for Rails. Learn Ruby. Other than drive/intelligence the single biggest commonality I've observed among great Rails developers is that they know how to use Ruby well. Thinking as a functional programmer is tremendously helpful, so at least look at functional languages (I recommend Scheme) and practice programming Ruby with a functional style. Higher Order Perl is a pretty useful exercise book, even though it's not explicitly intended for Ruby. It will make your code better. Or at least suck less.
Wednesday, July 9, 2008
Java (arguably an exception to the 'mostly')
The sell here is very clearly targeting people who are coming from C, or a level of developer hell similar to C++, probably the beast itself.
Point-by-point:
*Java's start-up time is massive compared to that of Perl, Python, Ruby or Scheme. It is, at best, as speedy to get installed and write 'Hello, World!' as C, but that's assuming a lot. (that the developer is not using an OS with a C compiler already installed and fails to consult wikipedia)
*Java code is bloated. It may well be 4x as concise as C++, but it is massive compared to any of the above non-C languages and for some cases appears to be more verbose than C. The Java 'Hello, World!' is at least as long in terms of lines and has many more things for the novice to understand. While this is not strictly verbosity, it has the same mind-cluttering effect.
*Garbage collection is not exactly teh uniquely Java tech, and I have a difficult time believing that a language that verbose and structured is useful for learning good programming practices. I learned good programming practices by writing bad code. (long Perl scripts with no subroutines) I don't think that doing something correctly from the start gives you a proper understanding of why a particular method is correct: you need to screw up in order to know why the wrong way is wrong.
The alternative is to just accept the argument-from-authority, which is fundamentally opposed to the hacker ethos.
*Development time in Java is probably faster than it is in C++. It appears to be radically slower than Ruby dev time, at least for web apps.
*Platform dependencies: this is literally just a library issue. Library strength is a somewhat dubious selling point, because it just takes time and effort to catch up. At some point, Ruby (largely) caught and passed Perl and Python in terms of library strength.
*Write once, run anywhere: this is probably actually moderately nice for some cases, and is much less informationally selective than basically all of the previous arguments.
*Ease of distribution: no real opinion on this, probably true, probably a good thing.
The best argument for using Java is almost certainly that it is currently an industry standard. This is a pretty dubious means of selection because it requires you to believe in the durability of the status quo and individual programmers have proven somewhat disruptive of that.
Imagine telling a PHP programmer 4 years ago that they would lose web dominance. Or telling a COBOL or FORTRAN programmer in their hey-day that their languages would become moderately obscure punch-lines.
This argument is not fundamentally new, but it probably saved me from hemorrhoids or an aneurism.
Thursday, June 26, 2008
FP + Rails
Similarly, passing instance-level variables in models to class-level functions in the same model is very hard to do (as far as I could tell, impossible) without using the controller to function as a mediator that passes arguments.
This is really just an isolated aspect of a larger argument: OO sucks. Its suckage in this particular case is largely masked because Rails is very well designed for most tasks, but the suckage becomes quite apparent when you start breaking out of the standard Rails box.
Don't get me wrong: the Rails box is very nice. It is, however, still a box. It's possible that a concerted effort behind Arc could make something that is Rails-y by default while retaining the inherent flexibility of something written in a Lisp, but I'm not sure that it would be as useful as Rails is for web-dev. It seems like the hypothetical 'Arc on an Ark' platform would end up getting tweaked locally too much to actually be a meaningful standard, and I believe that to be a large part of the value of Rails: the silver lining on the box cloud.
In any event, I would argue that FP is the most useful of the various programming methodologies for a broad spectrum of use, probably in no small part because it encourages you to follow the (probably paraphrased/apocryphal) advice of Abraham Lincoln: "If you have four hours to cut down a tree, spend the first two sharpening your axe".
Wednesday, June 25, 2008
Mystical Thinkings
(Coldsnap)
Adarkar Valkyrie: is absurdly good if online with Twilight Shepherd, but is probably just not efficient enough.
Braid of Fire: very weird, and seems like it should be fueling a combo deck.
Fury of the Horde: too situational, but it's retardedly good when it's good.
Herald of Leshrac: absurd in EDH if you can protect it and yourself.
Hibernation's End: too expensive, but it seems like it might have potential in older formats that can support it better and give it more targets.
Panglacial Wurm: Seems really good in EDH.
Phyrexian Etchings: it's a bad Greed.
Phyrexian Soulgorger: 8/8. for 3. that's a lot of 8/8, even with a drawback.
Sek'Kuar, Deathkeeper: EDH General.
Zur, the Enchanter: EDH General.
(TSP)
Avatar of Woe: absurd in EDH.
Bitter Ordeal: nuts if you have War Marshal + a sac outlet, probably amazing in EDH.
Gaea's Blessing: something of a known quantity, but fantastic.
Hypergenesis: weird, but absurd with a good hand.
Intet, the Dreamer: great EDH general.
Ith, High Arcanist: seems like an interesting EDH general. In particular, he may have an interesting interaction with first strike.
Numot, the Devastator: EDH general.
Orcish Librarian: he's retardedly good deck manipulation, particularly if you can do something with the RFG'd cards.
Oros, the Avenger: EDH general.
Rites of Flourishing: insanely powerful, but helps your opponent first.
Scion of the Ur-Dragon: retardedly good EDH general.
Shrouded Lore: might be interesting in older formats.
Teneb, the Harvester: EDH general.
Witch's Mist: seems good in EDH, as it's potentially very political.
Rails + PostgreSQL
Getting postgres installed on Ubuntu Hardy was just a matter of apt-get'ing, getting the postgres gem installed required me to grab libpq-dev (evidently a replacement for postgresql-dev, and I have no idea why that's a Q instead of a G) first.
In order to get Rails capable of talking to postgres, I had to modify pg_hba.conf: the actual (ie, non-commented) content of mine is two lines that look like this:
local all all md5
followed by this:
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
the effect of the first line that begins with 'local' is to allow username/password logins from users other than the default postgres user.
Without that, attempting to login from another user account (for instance, the primary one on my laptop) resulted in this error:
rails FATAL: Ident authentication failed for user "postgres"
While I could have just started using the postgres user account for work, that's just assy.
Not sure how much of a hassle this was compared to the setup on OS X (as far as I can tell, rails dev happens almost entirely on either OS X or Ubuntu), but it was pretty reasonable and with slight documentation improvements would have been trivial.
Resulting convictions:
*PostgreSQL is less newbie-friendly than MySQL, but is a substantially better tool. (going back to my CRREL days, has support for GIS. more recently, was just more pleasant to work with. the backslash commands are useful as all get-out)
*Rails continues to be the best tool in its class, probably in the field period.
*Hardy is probably the best moderately mainstream OS out there, although it is occasionally a hassle.