Tao of the MachineProgramming, Python, my projects, card games, books, music, Zoids, bettas, manga, cool stuff, and whatever comes to mind. |
Front page Last 10 archives 2003-06-21 2003-06-28 2003-07-05 2003-07-12 2003-07-19 2003-07-26 2003-08-02 2003-08-09 2003-08-16 2003-08-23 Category archives bettas books CCGs Charm esoterica Firedrop games general ideas internet Kaa linkstuffs Lisp manga music Mygale Nederland nostalgia programming Python SGI switch Wax Zoids :: Search All posts ...by category ...by date ![]() :: About me :: Oasis Digital :: Resume :: GeoURL :: RSS :: Atom ![]() ![]() |
Eye-boggling(via my referrer log ;-) A bunch of weird optical illusions here. Check out this one: The squares with A and B are obviously different colors... until you inspect the image in PhotoShop or whatever, and discover that they have the same RGB values. Really weird. My eyes still refuse to believe it. Update (2003.10.15): Apparently this is the original page. Image made by Edward H. Adelson. Massive code breakage at 11 o'clockIt came as an unpleasant surprise that the transition from Python 2.2 to 2.3 breaks a lot of production code. More so than the previous one from 2.1 to 2.2 (which hardly broke anything, IIRC). There were two major issues: 1. Different behavior of the t = Text(text) But in 2.3, all of a sudden it doesn't take an argument anymore, and I'd have to do this to get the same behavior: t = Text() t.data = text To be fair, this is not the correct way to create it (according to Martin von Löwis); it should be created using 2. Booleans. I didn't expect any problems with these; however... our system contains some code that takes the string representation of various objects, and creates SQLXML or SQL statements. Some of those objects used to be 0 or 1 (repr values "0" and "1"), but in 2.3 they have become booleans (repr values "True" and "False"). This has the unfortunate side effect of turning SQL statements like select foo from bar where closed=1 into select foo from bar where closed=True which doesn't work in SQL Server. It does similar things to the SQLXML. The eventual code changes were easy, but it's quite disturbing to see 50 tests break. :-) Update (2003.09.12). On a more positive note, my other projects (that don't rely on the string representation of boolean values) worked right out of the box, and were noticeably faster. A little Wax teaserThe following mini-application shows a notebook with two pages. One shows PyCrust (Patrick O'Brien's Python shell), the other PyCrust with filling (a tree-based object/namespace inspector). (Note: this is all in the development version of Wax, currently at 0.1.26.) from wax import * class MainFrame(Frame): def Body(self): nb = NoteBook(self) self.AddComponent(nb) nb.AddPage(PyCrust(nb), "PyCrust") nb.AddPage(PyCrustFilling(nb), "PyCrustFilling") self.Pack() app = Application(MainFrame, title="PyCrust demo") app.Run() PyCrust and PyCrustFilling are (under different names) staples in wxPython, and now in Wax as well. Being able to stick a (high-quality) shell in your programs is a very useful feature. Some more code. I added a TextEntryDialog today. This is the source: from dialog import Dialog from textbox import TextBox from label import Label class TextEntryDialog(Dialog): def __init__(self, parent, title="Enter some text", prompt="Enter some text"): self.prompt = prompt Dialog.__init__(self, parent, title) def Body(self): label = Label(self, self.prompt) self.AddComponent(label, stretch=1, border=7) self.text = TextBox(self, size=(100,25), process_enter=1) self.text.OnChar = self.OnTextBoxChar self.AddComponent(self.text, stretch=1, border=5) def OnTextBoxChar(self, event=None): # pressing Enter in the TextBox is the same as clicking OK if event.GetKeyCode() == 13: self.OnClickOKButton(event) else: event.Skip() def GetValue(self): return self.text.GetValue() Some thoughts:
Recognizing Magic cardsTo assess the (market) value of the Magic card, you need to know its expansion set or edition. Recognizing this is not always easy. Modern sets all have their own unique expansion symbol, but for older cards it's not always that simple. So here's a quick guide. N.B. These rules are a concise version of what can be found at CrystalKeep. 1. Does the card have an expansion symbol? If so, then you're all set... unless it's Arabian Nights, Antiquities, Legends or The Dark. For other sets, just look up the symbol if you don't know it. 2. For Arabian Nights, Antiquities, Legends and The Dark: look at the border of the card. Is it black? Then the card is really from those sets. If it's white, though, it's a reprint from Chronicles. 3. OK, so we have a card that has no expansion symbol. Now look if there's a copyright notice at the bottom. Not with the artist's name ("© Anson Maddocks" or whatever), but something with a year in it, like "© 1995 Wizards of the Coast, Inc. All rights reserved." 4. The oldest cards lack both the expansion symbol and the copyright notice. The edition can be determined by these rules:
In the meantime, I've added more cards to the list. Check them out if you're interested in acquiring some uncommons and rares for cheap. Python beginner's mistakesIt's time for you to take another hit from the Python pipe. My new article, Python beginner's mistakes, is now online. Again, it's late and I might have written silly things, so expect some revisions. I'm also open to suggestions. What beginner's mistakes did other people make?
Posted by Hans
"happiness is only a snake away"
Nowak on 2003-09-01 01:28:39
{link}
Categories: Python Cheap goodiesI'm selling some stuff. Right now there are only Magic cards, but books etc. will follow. See the trade section. -- Generated by Firedrop2. |