Help
RSS
API
Feed
Maltego
Contact
Domain > rephrase.net
×
Welcome!
Right click nodes and scroll the mouse to navigate the graph.
×
More information on this domain is in
AlienVault OTX
Is this malicious?
Yes
No
DNS Resolutions
Date
IP Address
2014-10-07
75.119.192.165
(
ClassC
)
2024-09-15
69.163.179.165
(
ClassC
)
Port 80
HTTP/1.1 301 Moved PermanentlyDate: Sun, 15 Sep 2024 23:19:25 GMTServer: ApacheLocation: https://rephrase.net/Content-Length: 229Content-Type: text/html; charsetiso-8859-1 !DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN>html>head>title>301 Moved Permanently/title>/head>body>h1>Moved Permanently/h1>p>The document has moved a hrefhttps://rephrase.net/>here/a>./p>/body>/html>
Port 443
HTTP/1.1 200 OKDate: Sun, 15 Sep 2024 23:19:25 GMTServer: ApacheUpgrade: h2Connection: UpgradeLast-Modified: Tue, 24 Jan 2012 05:08:12 GMTETag: fece-4b73f223ba700Accept-Ranges: bytesContent-Length: 65230Cache-Control: max-age600Expires: Sun, 15 Sep 2024 23:29:25 GMTVary: Accept-Encoding,User-AgentContent-Type: text/html !DOCTYPE html>html>head> title> rephrase.net/title> meta http-equivContent-Type contenttext/html; charsetutf-8 /> link relstylesheet href/days/1140.css/> link relstylesheet href/days/style.css/> script src/days/css3-mediaqueries.js>/script> meta nameauthor contentSam Angove /> link relalternate typeapplication/atom+xml titleAtom href/days/recent.atom /> /head>body idrephrase>div idheader classcontainer> div classrow> div idnavigation classtwelvecol last> ul classmenu> li classcurrent>a href/>home/a>/li> li> a href/days/ titleblog>days/a> /li> li>a href/box/ titleprojects>projects/a>/li> li>a href/momentary/ titleitems of momentary interest>links/a>/li> li>a href/what/ titlemiscellaneous information>about/a>/li> !--li idsearch>form action/search methodget>search input typetext nameq />/form>/li>--> /ul> /div> /div>/div>div idbody classcontainer> div classrow> div idshowing classtwelvecol last>Sams infrequently-updated cabinet of curiosities/div>/div>div classrow> div classthreecol> div classitem-meta> Tuesday, 23 June 2009 /div> /div> div classninecol item last> h2>Backbars and JavaScript Bitmaps/h2>p>Oh, thats right, I have a blog! Ive got a bunch of old projects to document, but first, a minor diversion of this past week./p>p>Eliazar Parra published a hrefhttp://elzr.com/posts/backbars-on-social-link-sites/>a fabulous user-script/a> to add backbars to social link sites like Digg and Reddit, where content is voted on and scored. The idea of a backbar is that each item is unobtrusively shaded with a background that corresponds with its score./p>p>The backbars effectively transform the page into a bar chart, and in some cases its a spectacular improvement. His a hrefhttp://elzr.com/images/blog/screenshots/backbars-so-badge-big.gif>Stack Overflow example/a> highlights the shortcomings of the original design, which disguises entire orders of magnitude by turning 39,9000 into 39.9k, which has the same visual weight as 3,996./p>p>Backbars make all the difference:/p>img src/miscellany/09/so-example.gif altStack Overflow design />p>Love it!/p>h3>Generating Images/h3>p>However, the original implementation has external dependencies, most vexing being coloured rectangles hosted on the authors site. As a result, you cant even change backbar colours./p>p>This led down the rabbit hole into dynamically generating the images from within the script. Most formats are frustratingly complex to implement (I am strong>not/strong> porting zlib to JavaScript), so it had to be simple bitmaps./p>p>Luckily, they dont only come uncompressed; there are several flavours of run-length compression, a simple scheme whereby you replace a series like code>redpixel + redpixel + redpixel.../code> with a single code>redpixel * 100/code>. In the case of these big blocks of colour, it takes 2 bytes to encode 255 pixels, quite a staggering improvement over the 1020 bytes of the uncompressed 24-bit version./p>p>The end result: a hrefhttp://rephrase.net/box/bitmap/>jsbmp/a>, a small library for generating bitmaps in JavaScript./p>p>Pretty useless, but there are a few intriguing possibilities. Sparklines, maybe?/p>h3>Not Invented Here/h3>p>And then of course I had to do something about jQuery, so I ended up reimplementing the script. Enter a hrefhttp://rephrase.net/box/user-js/>Admiral Backbar/a>. small>(Its a trap!)/small>/p> /div>/div>div classrow> div classthreecol> div classitem-meta> Sunday, 26 October 2008 /div> /div> div classninecol item last> h2>Notes on installing Roundup at Dreamhost/h2>p>Installing a hrefhttp://roundup.sourceforge.net/>Roundup/a> 1.4.6 at a hrefhttp://dreamhost.com/>Dreamhost/a> stretched from the 15-30 minutes specified in the a hrefhttp://roundup.sourceforge.net/doc-1.0/installation.html>installation docs/a> to something more like four hours. This is a collection of notes for next time./p>h3>Dramatis Personae/h3>p>strong>a hrefhttp://roundup.sourceforge.net/>Roundup/a>/strong> is the software. Its billed as a simple-to-use and -install issue-tracking system, but its so configurable that its probably better described as a lightweight tracker-oriented framework./p>p>The Roundup installatation includes the Roundup strong>module/strong> -- i.e., what you get when you code>import roundup/code> -- and a set of strong>administration scripts/strong>: code>roundup-admin/code>, code>roundup-server/code> etc./p>p>You can use the code>roundup-admin/code> script to create a strong>tracker/strong>. If Roundup is a framework, the tracker is the application. It includes a data schema, page templates, extensions, custom behaviours and so on./p>p>To access the tracker you will need to set up the strong>web interface/strong>./p>h3>1. Installation/h3>p>If you get a hrefhttp://pypi.python.org/pypi/roundup>the source distribution/a>, the instructions suggest that you install it. Dont./p>p>Which is to say, the docs assume that you are a server administrator attempting to add the Roundup module and associated scripts into your Python installation directory. If you run this:/p>pre>code>`python setup.py install --prefix test_directory`/code>/pre>p>The result is:/p>ul>li>code>test_directory/Lib/site-packages/roundup//code> -- Roundup module/li>li>code>test_directory/Scripts//code> -- platform-specific administration scripts/li>li>code>test_directory/share/roundup/templates//code> -- included templates/li>li>code>test_directory/share/roundup/cgi-bin//code> -- included web interface/li>li>code>test_directory/share/locale//code> -- translation files/li>/ul>p>i.e., files that slot neatly into a Python install. Because I have not a hrefhttp://wiki.dreamhost.com/Python#Building_a_custom_version_of_Python>installed a custom version/a> and obviously cant touch the server-wide installation, this structure is not ideal./p>h3>2. Be Careful About Changing The Directory Structure/h3>p>I want the Roundup module in my directory for Python libraries, code>/home/me/pylib/code>. I dont care about locales and the scripts are just thin wrappers around Python files in code>roundup/scripts/code>. /p>p>Its the templates that are the problem. The comment on the code>listTemplates/code> function in code>roundup/admin.py/code> reveals the 5-step process Roundup uses to find them:/p>blockquote>p>Look in the following places, where the later rules take precedence:/p>ol>li>code><roundup.admin.__file__>/../../share/roundup/templates/*/code>br /> this is where they will be if we installed an egg via easy_install/li>li>code><prefix>/share/roundup/templates/*/code>br /> this should be the standard place to find them when Roundup is installed/li>li>code><roundup.admin.__file__>/../templates/*/code>br /> this will be used if Roundups run in the distro (aka. source) directory/li>li>code><current working dir>/*/code>br /> this is for when someone unpacks a 3rd-party template/li>li>code><current working dir>/code>br /> this is for someone who cds to the 3rd-party template dir/li>/ol>/blockquote>p>Either throw the templates directory into code>/home/me/pylib/code> too or only ever run the code>roundup-admin/code> script from a template directory. Or, if you dont already have a directory for libraries, just run it from the source distribution./p>h3>3. Create a Tracker/h3>p>Run code>roundup-admin/code> if youve installed Roundup and the script is on your code>PATH/code>, otherwise code>python roundup_admin.py/code>./p>p>Type code>install/code> and follow the prompts:/p>pre>code>Enter tracker home: /home/me/tracker/Templates: classic, minimalSelect template classic: classicBack ends: anydbm, mysql, sqliteSelect backend anydbm: mysql/code>/pre>p>If the template or backend files cant be found, it wont be possible to select them, so exit and fix the problem./p>p>Youll have to come back to code>roundup-admin/code> later, but now its time to configure the tracker./p>h3>4. Configure Your Tracker/h3>p>Head to code>/home/me/tracker//code> and edit code>config.ini/code>. Search for NO DEFAULT to find the items that need to be set. The tracker wont run at all if theyre not. /p>p>In the Dreamhost context, consider a subdomain -- code>http://tracker.example.com//code> -- because it will make deployment much easier./p>p>Return to code>roundup-admin/code> and initialise the tracker to set up the default user accounts and roles./p>h3>5. Creating The Web Interface/h3>p>I spent several hours failing to track down mysterious bugs apparently caused by some combination of my tracker settings and the bundled CGI interface. Try using the WSGI interface instead:/p>pre>code>#!/usr/bin/env python2.4# Enable HTML tracebacksimport cgitbcgitb.enable()# obtain the WSGI request dispatcherfrom roundup.cgi.wsgi_handler import RequestDispatchertracker_home /home/me/tracker/app RequestDispatcher(tracker_home)from wsgiref.handlers import CGIHandlerCGIHandler().run(app)/code>/pre>p>Note that code>wsgiref/code> isnt included in Python 2.4. Dreamhost isnt providing 2.5 yet, so just download the package and put it somewhere handy./p>h3>6. Deploying With Passenger/h3>p>You can use a hrefhttp://www.modrails.com/>Phusion Passenger/a> to deply WSGI applications; the wiki a hrefhttp://wiki.dreamhost.com/Passenger_WSGI>has more details/a>. Just set it up in the panel and modify the web interface a little:/p>pre>code>#!/usr/bin/env python2.4import sys, cgitb# Enable HTML tracebackscgitb.enable()# Even if youve got your paths set up to find# your python libraries automatically, Passengers# interpreter wont.sys.path.append(/home/me/pylib)from roundup.cgi.wsgi_handler import RequestDispatcher# The WSGI app has to be called applicationapplication RequestDispatcher(/home/me/tracker/)# Thats it./code>/pre>p>Save it as code>passenger_wsgi.py/code> and youre good to go./p> /div>/div>div classrow> div classthreecol> div classitem-meta> Wednesday, 30 April 2008 /div> /div> div classninecol item last> h2>Mrs. Gamelys Words/h2>p>Mark Helprins a hrefhttp://www.amazon.com/Winters-Tale-Mark-Helprin/dp/0156031191/>Winters Tale/a> is a delight, even if its apparent themes are little more than an excuse for the wordplay window-dressing. I might not have found perfect justice, but a hall of light and mirrors built from language is quite enough for me./p>p>One thing that needled, not being the sort to read with dictionary in hand, was this:/p>blockquote>p>Though Mrs. Gamely was by all measures prescientific and illiterate, she did know words. Where she got them was anyones guess, but she certainly had them. Virginia speculated that the people on the north side of the lake, steeped in variations of English both tender and precise, had made with their language a tool with which to garden a perfect landscape. Those who are isolated in small settlements may not know of the complexities common to great cities, but their hearts are rich, and so words are generated and retained. Mrs. Gamelys vocabulary was enormous. She knew words no one had ever heard of, and she used words every day that had been mainly dead or sleeping for hundreds of years. Virginia checked them in the Oxford dictionary, and found that (almost without exception) Mrs. Gamelys usage was flawlessly accurate. For instance, she spoke of certain kinds of dogs as Leviners. She called the areas near Quebec march-lands. She referred to diclesiums, liripoops, rapparees, dagswains, bronstrops, caroteels, opuntias, and soughs. She might describe something as patibulary, fremescent, pharisaic, Roxburghe, or glockamoid, and words like mormal, jeropigia, endosmic, mage, palmerin, thos, vituline, Turonian, galingale, comprodor, nox, gaskin, secotine, ogdoad, and pintulary fled from her lips in Pierian saltarellos. Their dictionary looked like a sows ear, because Virginia spent inordinate proportions of her days racing through it, though when Mrs. Gamely was angry a staff of ten could not have kept pace with her, and half a dozen linguaphologists would have collapsed from hypercardia./p>/blockquote>p>— cite>Winters Tale/cite> (New York: Harvest, 2005), 225-226/p>p>For reference (thanks, cite>Oxford English Dictionary/cite>!):/p>dl>dt>Leviner/dt>dd>? (presumably not from levin, to emit flashes of lightning)/dd>dt>march-land/dt>dd>a border territory/dd>dt>diclesium/dt>dd>botanical term for a kind of dry, seed-retaining fruit/dd>dt>liripoop/dt>dd>part of a graduates hood in early academic costume; later (presumably by derivation) to have ones liripoop was to have learned a lesson or part/dd>dt>rapparee/dt>dd>a 17th-century Irish pikeman; later an Irish bandit/dd>dt>dagswain/dt>dd>a kind of rough bed-cover/dd>dt>bronstrops (singular)/dt>dd>a female procuress of sexual services/dd>dt>caroteel/dt>dd>an old commercial measure of quantity (a caroteel of cloves)/dd>dt>opuntia/dt>dd>originally a Greek herb; later an American cactus/dd>dt>sough/dt>dd>a whisper or murmur or breath; or, a drain or swampy place; or, a ploughshare/dd>dt>patibulary/dt>dd>of or relating to a gallows (patibulum: fork-shaped gibbet)/dd>dt>fremescent/dt>dd>growing noisy/dd>dt>pharisaic/dt>dd>of the Pharisees, hence legalistic, self-righteous, devoted to the letter and not the spirit/dd>dt>Roxburghe/dt>dd>a style of bookbinding/dd>dt>glockamoid/dt>dd>shaped like an arrow-head (note: not in OED)/dd>dt>mormal/dt>dd>a kind of scab or sore/dd>dt>jeropigia/dt>dd>from Portuguese geropiga, a mixture of grape juice, brandy and sugar used to adulterate wines/dd>dt>endosmic/dt>dd>relating to endosmosis, the flow of a fluid from an area of lesser concentration to one of greater/dd>dt>mage/dt>dd>a magician, or more generally a wise man/dd>dt>Palmerin/dt>dd>16th Century Spanish romantic hero, hence any knightly champion/dd>dt>thos/dt>dd>old Greek and Latin name for some kind of canine animal not definitively identified by subsequent historians/dd>dt>vituline/dt>dd>of or like a calf (vitulus: calf)/dd>dt>Turonian/dt>dd>part of the Cretaceous period/dd>dt>galingale/dt>dd>a gingery spice; better known as galangal/dd>dt>comprodor/dt>dd>possibly a misspelling of comprodor, a native steward or head servant, intermediary with the locals/dd>dt>Nox/dt>dd>personification of the night, from nox, night/dd>dt>gaskin/dt>dd>a kind of breeches; or, formation from gasket/dd>dt>secotine/dt>dd>possibly a misspelling of Seccotine, a brand of glue originating in the 19th century/dd>dt>ogdoad/dt>dd>the number eight, a set of eight; or specifically the Ogdoad, eight divine beings of ancient Egypt/dd>dt>pintulary/dt>dd>?/dd>dt>Pierian/dt>dd>relating to Pieria, home of the Muses; hence, poetic/dd>dt>saltarello/dt>dd>an animated Italian and Spanish dance/dd>/dl>p>Trawling the book for the rest of Helprins vocabulary I leave for someone else, but special mention is due to amphibological -- of amphibology/amphiboly, ambiguity of speech, especially deriving from grammatical construction -- for appearing in context in the title cite>Amphibological Whimsey Dances/cite>. Its a better name for wordplay than wordplay./p> /div>/div>div classrow> div classthreecol> div classitem-meta> Tuesday, 05 February 2008 /div> /div> div classninecol item last> h2>IntelliType XML/h2>p>Microsoft hardware is fabulous, but -- like everyone else ever to buy one -- I was disgruntled to find that the a hrefhttp://www.microsoft.com/hardware/mouseandkeyboard/ProductDetails.aspx?pid043>Natural Ergonomic Keyboard 4000/a>s centre-keyboard lever is set to control zoom, and only zoom, rather than something like vertical scroll. Worse, IntelliType wont let you change it, unlike almost every other special key on the board./p>p>Luckily, it turns out that its a limitation of the interface, not the software; you can get a lot more done with a little registry tweaking and two XML configuration files in the installation directory:/p>ul>li>code>C:\Program Files\Microsoft IntelliType Pro\commands.xml/code>/li>li>code>C:\Program Files\Microsoft IntelliType Pro\mscmdkey.xml/code>/li>/ul>p>There are two different kinds of customisation possible:/p>ol>li>Use the registry to map keys to commands specified in code>mscmdkey.xml/code>/li>li>Change the behaviour of those commands in specific contexts with code>commands.xml/code>/li>/ol>p>First, we want to look at code>mscmdkey.xml/code>./p>h3>code>mscmdkey.xml/code>/h3>p>code>mscmdkey.xml/code> lists commands sent out by the keyboard to IntelliType. It should probably be treated as read-only, but its informative; code>commands.xml/code> cant easily be edited without it. The commands look like this:/p>pre>code><Command name VOLUME_UP_COMMAND id700 isUIfalse defaulttrue > <ResourceIDs displayName3809 description4009 descriptionPlusAccel0 osdText4270/></Command>/code>/pre>p>The magic numbers are inscrutable (a code>displayName/code> of 3809, an code>osdText/code> of 4270?), but the code>name/code> and code>id/code> are simple enough./p>p>The code>name/code> is a human-readable label. code>VOLUME_UP_COMMAND/code> is the default action of the volume-up button. code>SAVE_COMMAND/code> corresponds to the Save button above F11. Some of the commands dont have buttons on all keyboards: the Natural 4000 has no next track button (code>MEDIA_NEXT_TRACK_COMMAND/code>), but the Natural MultiMedia does. Some of the commands em>never/em> have buttons: code>BATTERY_LOW_COMMAND/code> is an automatic feature of the battery-powered wireless models./p>p>Well need the code>id/code> when we get to code>commands.xml/code>. To change the Zoom lever we want:/p>ul>li>code><Command name ZOOM_IN_COMMAND id319 defaulttrue >/code>/li>li>code><Command name ZOOM_OUT_COMMAND id320 defaulttrue >/code>/li>/ul>p>319 and 320, respectively./p>p>Some commands have an code>MSReserved/code> sub-element. The code>appCommand/code> attribute corresponds to a a hrefhttp://msdn2.microsoft.com/en-us/library/ms646275(VS.85).aspx>code>WM_APPCOMMAND/code>/a> parameter (e.g., for code>NEW_COMMAND/code> its 29, the defined value of code>APPCOMMAND_NEW/code>)./p>p>Ive had no success trying to add my own commands under high, unused code>id/code>s./p>h3>Remapping keys/h3>p>The IntelliType software allows you to remap some, but not all, of the keyboards keys. When you do, the changes are saved to the registry at code>HKEY_CURRENT_USER\Software\Microsoft\IntelliType Pro\EventMapping/code>./p>p>The easiest way to find the key-code of a key you want to remap is to use IntelliType to assign it, then modify the values. The entry for my second favourites button looks like this:/p>pre>code>HKEY_CURRENT_USER\Software\Microsoft\Intellitype Pro\EventMapping\79ShellExecutecmd.exeFriendlyPythonArguments/K pythonCommanddword:00000320/code>/pre>p>The important one is code>Command/code>. code>dword:00000320/code> is 0x320 hex, or 800 in decimal. Search code>mscmdkey.xml/code> for a command with an code>id/code> of 800 and youll find code>SHELL_EXECUTE_COMMAND/code> -- that sounds a lot like what were doing. You can use any of the commands from code>mscmdkey.xml/code> here, though not all of them work./p>p>code>Friendly/code> is just a human-readable name (this entry displays in the favourites menu as start Python). code>ShellExecute/code> and code>Arguments/code> are specific to code>SHELL_EXECUTE_COMMAND/code>./p>p>IntelliType can only set the favorites buttons to applications and URLs, but I miss the next and previous track buttons from my Natural MultiMedia. Ive put them as faves 4 and 5:/p>pre>code>HKEY_CURRENT_USER\Software\Microsoft\Intellitype Pro\EventMapping\81Commanddword:000002c0HKEY_CURRENT_USER\Software\Microsoft\Intellitype Pro\EventMapping\82Commanddword:000002bf/code>/pre>p>code>0x2c0/code> is 704, code>MEDIA_PREVIOUS_TRACK_COMMAND/code>; code>0x2bf/code> is 703, code>MEDIA_NEXT_TRACK_COMMAND/code>./p>p>Some keys cant be remapped. The My Favorites key, for example, can be disabled with code>DISABLE_COMMAND/code> (400) but operates as normal with any other value./p>h3>Editing code>commands.xml/code>/h3>p>code>commands.xml/code> lets us redefine what those commands actually do in any given context. It makes sense: not all software is alike, so triggering (e.g.) a spell check will require something different in OpenOffice.Org Writer than in Microsoft Word. Many of the mappings are simpler than you might think: code>SAVE_COMMAND/code> (311), for example, is just a macro that performs the Ctrl + s keyboard shortcut!/p>p>code>commands.xml/code> looks something like this, trimmed for brevity:/p>pre>code><DPGCmd> <ENG> <Application UniqueNameStandardSupport> <C311 Type5 KeySeqctrl s /> <C401 Type5 KeySeqF7 /> </Application> </ENG> <ALL> <Application UniqueNameNotepad AppNameNotepad> <C311 Type1 wParam0x10001 /> <C401 Type0 /> <C309 Type5 KeySeqalt F4 /> </Application> </ALL></DPGCmd>/code>/pre>p>Were not interested in a lot of this. Each installed language has an element under the root code>DPGCmd/code> node defining the function of a command in that locale. a hrefhttp://msdn2.microsoft.com/en-us/library/ms903928.aspx>code>ENG/code> means English/a>. The special element code>ALL/code> applies to all languages; unless youre a hardcore polyglot then its all youll need./p>p>Commands are mapped on a per-application basis, but code>AppName/code> doesnt seem to actually do anything: change Notepad to Potato and the keys will work the same./p>p>code>UniqueName/code> is the important one, and refers to the window class name passed to the relevant a hrefhttp://msdn2.microsoft.com/en-us/library/ms633586(VS.85).aspx>Windows API/a> functions. If you want to do application-specific customisation, theres third-party software around (e.g. a hrefhttp://www.searchlores.org/tools.htm>The Customiser/a>) that can get a class name from any active window. If not, the special code>UniqueName/code> value code>StandardSupport/code> applies to all window classes./p>p>Be careful not to have conflicting rules. Commands defined under specific code>UniqueName/code>s will override commands defined under code>StandardSupport/code>, but they cant be defined under specific languages if theyre also in code>ALL/code>./p>h4>Commands/h4>p>Every code>Application/code> contains elements with names like code>C319/code>, where 319 is the code>id/code> of a command in code>mscmdkey.xml/code>. All of these command-elements have a type attribute:/p>ul>li>Types 1-4 take different kinds of undocumented magic numbers. Type 2 commands seem to be handled by Windows, rather than the active application, as they execute shell functions (open default browser, search window etc.), but thats all I can figure out./li>li>Type 7 commands take another type as a subtype. By default its only used for code>OFFICE_TASK_PANE_COMMAND/code>, so Im assuming its a hack just for that./li>/ul>p>The others are easier:/p>ul>li>Type 0 disables the key./li>li>p>Type 6 takes an code>Activator/code> which is passed to the window. Some of them are evidently application-specific -- code>IllustratorZoomin/code>, code>IE7Save/code> -- but others seem more general. An incomplete listing:/p>ul>li>code>ZoomIn/code>/li>li>code>ZoomOut/code>/li>li>code>ScrollUp/code>/li>li>code>ScrollDown/code>/li>/ul>/li>/ul>p>Type 5 is the fun one, which takes a simple keyboard macro in its code>KeySeq/code> attribute. As mentioned above, Save is implemented like this:/p>pre>code><C311 Type5 KeySeqctrl s />/code>/pre>p>i.e., its exactly the same as pressing Ctrl and s. Multiple chords can be separated with a code>|/code> pipe character, so if you want a Hello world! button:/p>pre>code><C203 Type5 KeySeqshift h | e | l | l | o | space | w | o | r | l | d | shift 1 />/code>/pre>p>Macros seem to be deliberately limited, possibly as a security feature. You cant code>alt tab/code> out, for example, or navigate menus with code>alt | f | downarrow | downarrow | enter/code>. You em>can/em> implement macros that reach into Save As or Open file-pickers, though, and presumably other kinds of dialog./p>h3>See Also/h3>p>I wouldnt even have considered looking for baroque XML configuration files if the internet hadnt said it was possible. a hrefhttp://huddledmasses.org/hacking-the-natural-4000-keyboard/>Joel Bennetts guide/a> has the most detail by far, plus a handy bit of XSL to remove the F-lock annoyance./p> /div>/div>div classrow> div classthreecol> div classitem-meta> Sunday, 28 October 2007 /div> /div> div classninecol item last> h2>Sight and Sound Top Tens/h2>p>In 1952, a hrefhttp://www.bfi.org.uk/sightandsound/>cite>Sight and Sound/cite>/a> magazine followed up a Belgian poll of directors favourite films with a similar referendum, this time for critics. The result was sixty-odd top-ten lists and an aggregate ten best films, with Vittorio De Sicas a hrefhttp://imdb.com/title/tt0040522/>cite>Bicycle Thieves/cite>/a> coming in at number one./p>p>The poll would be of relatively little interest if it had ended there, but it was repeated in 1962 -- and 1972, 1982, 1992, 2002... Collected, the lists show the evolution of the cinematic canon (or at least the critical zeitgeist, which may not be precisely the same thing) over the last half-century. For example: 1962 saw a hrefhttp://imdb.com/title/tt0033467/>cite>Citizen Kane/cite>/a> move to first position, where its stayed ever since, but in 1952 it shared thirteenth. Ten years later, it was even further in front./p>p>I suppose that watching items move up and down lists is only of interest to a certain kind of person, but that kind of person is me. Its annoyed me no end that so many of the websites collecting lists of greatest films only provide the cite>S&S/cite> aggregate top tens: those by individual critics offer much greater variety, as well as scope for a hrefhttp://www.theyshootpictures.com/gf1000.htm>more interesting statistical projects/a>./p>p>To that end, now that Ive dug up the original magazines, here they are in full (or close to it):/p>ul>li>a href/miscellany/07/ss/sightandsound52.txt>1952/a>/li>li>a href/miscellany/07/ss/sightandsound62.txt>1962/a>/li>li>a href/miscellany/07/ss/sightandsound72.txt>1972/a>/li>li>a href/miscellany/07/ss/sightandsound82.txt>1982/a>/li>li>a href/miscellany/07/ss/sightandsound92critics.txt>1992 critics/a> / a href/miscellany/07/ss/sightandsound92directors.txt>1992 directors/a>/li>/ul>p>The BFI has graciously put a hrefhttp://www.bfi.org.uk/sightandsound/topten/poll/>all of the 2002 results/a> online already./p>p>Not every list was published in the magazine, though from 1962 onwards the effort was made. I havent included the comments, many to the effect of you bastards, how can I pick just ten?/p>p>Theres a remarkable range of creative interpretations of the words top ten films. Some included twelve or fifteen. Some included single entries like The Apu Trilogy (really three films), Chaplins Mutual films (more than ten), and in one case Anthology of the works of W. C. Fields (more than thirty). Some picked small extracts -- like a single musical number -- over films entire. One picked a specific, unreleased cut, subsequently destroyed by re-editing. Some sent in lists of directors./p>h3>Note on accuracy/h3>p>Please forgive any missing diacritics: the OCR was hard on them, and Im willing to sacrifice a cedilla here and an acute there to save time. All other corrections are welcome./p> /div>/div>div classrow> div classthreecol> div classitem-meta> Monday, 10 September 2007 /div> /div> div classninecol item last> h2>Drupal Role/h2>p>a hrefhttp://drupal.org/>Drupal/a> 4.2.0 was the first CMS I ever installed, a hrefhttp://web.archive.org/web/20031001233040/http://iluo.net/>back in 2003/a>. A few weeks later it became the first CMS I botched an upgrade to, at which point I moved on to other pastures./p>p>That was that until last week, when a hrefhttp://home.netspeed.com.au/aistorm/>John/a> demanded help with a custom module for his mountaineering club site, to enable users to enter unique codes in their profile area and have their membership upgraded to a new role. I gather the point is to pass out the codes in meatspace when members join or pay their dues -- its a clever idea./p>p>A day or three later and the result was a hrefhttp://vs.rephrase.net/namor/php/drupal/rolecode/>this module/a>./p>p>Most of my experience developing plugins for other peoples PHP comes from WordPress, so it was interesting to use such a dramatically different API. WordPress requires explicit registration of hook functions, e.g./p>pre>code>add_action(edit_post, my_edit_post_action);/code>/pre>p>But Drupal uses magic function names. If you have a module called code>mymodule/code>, any function called code>mymodule_init/code> will be automatically hooked into a hrefhttp://api.drupal.org/api/function/hook_init/5>code>hook_init/code>/a>./p>p>Its an elegant solution, though I favour the Pythonic explicit is better than implicit philosophy too much to be comfortable with it./p>p>One of the best (and worst) things about the whole experience was the a hrefhttp://api.drupal.org/api/group/form/6>Forms API/a>. Instead of writing HTML, you just write some code like this:/p>pre>code>function mymodule_form() { $formname array( #type > textfield, #title > t(Name), #description > t(What are you called?) ); $formsubmit array( #type > submit, #value > t(Yield!), ); return $form;}/code>/pre>p>Hook the function in at the appropriate place, and Drupal renders it, themed prettily, with anti-CSRF nonces already handled. More magic functions, hooked in as code>mymodule_form_validate()/code> and code>mymodule_form_submit()/code>, can be used for validation and form submission actions respectively./p>p>As always, the downside of a leaky abstraction is that customizations not provided for in the API are much harder than they should be, but I expect that the vast majority of modules never have any problems./p>p>Drupal has lots of other niceties missing from WordPress too, like the a hrefhttp://api.drupal.org/api/function/watchdog>code>watchdog/code>/a> logging system and a hrefhttp://api.drupal.org/>documentation that doesnt suck/a>. I have issues with it as a user -- the learning curve for administration is comparatively steep -- but its flexible, powerful, and easy to extend. As a developer Im extremely impressed./p> /div>/div>div classrow> div classthreecol> div classitem-meta> Tuesday, 14 August 2007 /div> /div> div classninecol item last> h2>JavaScript Bayes/h2>p>I wanted to have some Bayesian fun in a user-script, so did a hrefhttp://vs.rephrase.net/namor/javascript/bayes/>a quick JavaScript port/a> of the fabulous a hrefhttp://divmod.org/trac/wiki/DivmodReverend>Divmod Reverend/a> Python module./p>p>Its somewhat limited, but dead easy to use:/p>pre>code>var guesser new Bayes();guesser.train(hannibal, I love to kill people and eat them.);guesser.train(austen, Come, let us have tea and scones in Mr. Bingleys gazebo.);guesser.guess(Jane, these scones are simply delightful!);// austen, 0.9999guesser.train(hannibal, I love to kill people and eat them with tea and scones.);guesser.guess(Give me those scones or Ill kill and eat you.);// hannibal, 0.9481433307479079, austen, 0.6203339133520634/code>/pre>p>Its missing some stuff, but does enough to be getting along with./p>p>As a test application, I went on and wrote up one of the examples given in the Reverend docs: a hrefhttp://rephrase.net/box/what-the-dickens/>a script to tell whether you write more like Charles Dickens or Jane Austen/a>. Its both pointless and inaccurate, but I suppose it qualifies. :)/p> /div>/div>div classrow> div classthreecol> div classitem-meta> Saturday, 23 June 2007 /div> /div> div classninecol item last> h2>Userscript: IMDb Decoder Ring/h2>p>It seems to be a Greasemonkey kind of month. IMDb ratings are a hrefhttp://blog.moertel.com/articles/2006/01/17/mining-gold-from-the-internet-movie-database-part-1>fuzzy in the middle/a>, so Tom Moertel made a a hrefhttp://community.moertel.com/ss/space/IMDB+Movie-Rating+Decoder+Ring>decoder ring/a> listing what the rating means in terms of the movies per-genre percentile ranking. a hrefhttp://imdb.com/title/tt0413267/>cite>Leprechaun 5/cite>/a>s 3.2 rating seems bad enough even with an even distribution; in reality, it has a worse rating than em>90%/em> of movies in the database./p>p>Anyhow, a hrefhttp://rephrase.net/box/user-js/scripts/imdb-percentile-ratings.user.js>this userscript/a> puts the data conveniently inline./p>p>Before:/p>img srchttp://rephrase.net/miscellany/07/imdb.decoder.before.png altShrek 3 at IMDb without the script />p>After:/p>img srchttp://rephrase.net/miscellany/07/imdb.decoder.after.png altShrek 3 at IMDb with the script enabled />h3>a hrefhttp://rephrase.net/box/user-js/scripts/imdb-percentile-ratings.user.js>Download/a>/h3> /div>/div>div classrow> div classthreecol> div classitem-meta> Monday, 18 June 2007 /div> /div> div classninecol item last> h2>Userscript: Reddit unread comments helper/h2>p>strong>Edit - 2008-05-27:/strong> Updated to work with the (horrid) Reddit redesign. I cant be bothered updating the screenshots too./p>p>Or: (ab)using a hrefhttp://greasespot.net/>Greasemonkey/a> and a hrefhttp://gears.google.com/>Google Gears/a> to add features that would be handled better server-side./p>p>a hrefhttp://vs.rephrase.net/namor/javascript/userscripts/redditunreadcommenthelper.user.js>The script/a> tracks comments youve seen at a hrefhttp://programming.reddit.com/>Reddit/a>, then exposes the data in several small ways that each make your life a little easier. Features:/p>ul>li>p>On the main Reddit list pages, replace the i>n/i> comments links with i>x/i> unread comments (i>n/i> total)./p>p>Before: /p>img srchttp://rephrase.net/miscellany/07/reddit.us.list.before.png altbefore the userscript is applied />p>After: /p>img srchttp://rephrase.net/miscellany/07/reddit.us.list.after.png altafter the userscript is applied />/li>li>p>On clicking through to a page where youve already read some of the comments, jump to the first unread comment./p>/li>li>p>Highlight unread comments with a bright but non-distracting left margin./p>/li>/ul>p>a hrefhttp://vs.rephrase.net/namor/javascript/userscripts/redditunreadcommenthelper.user.js>Download or install it/a>./p>h3>Notes/h3>p>My ulterior motive was testing the a hrefhttp://code.google.com/apis/gears/api_database.html>Gears DB/a> with Greasemonkey. More than once Ive wished it had a binding to SQLite, and with Gears it does: it just got a thousand times more useful. Itd be nicer yet if I could save to an arbitrary cross-domain database, but this is still a tremendous step up./p>p>This script uses a bit of a hack and writes itself directly into the window, rather than just manipulating the DOM from the usual plexiglass sandbox. Strictly speaking its not necessary, and only possible at all because I have no use for the code>GM_*/code> API functions, but a userscript with Gears does require at least some meddling of this kind. /p>p>Gears prompts the user to allow it to run on a specific domain, but the dialog doesnt appear if its initialized from within Greasemonkey; it has to be done from the unsafe window. Once its set up -- once the local database has been created and what have you -- Greasemonkey is fine, but that first step is critical./p>p>Still, thats basically the only hurdle, and its trivial to surmount. Gears is a dream: the API seems a little sparsely featured, but its so easy to build a platform around that the lack of convenience methods doesnt matter. I wrote a very simple DB wrapper of my own, and others are already building full ORMs. Theres no sight of JavaScript on Jacks just yet, but it cant be far off./p> /div>/div>div classrow> div classthreecol> div classitem-meta> Saturday, 16 June 2007 /div> /div> div classninecol item last> h2>E4X/h2>p>E4X, short for ECMASCript for XML, is an extension to ECMAScript (i.e. JavaScript, JScript, ActionScript...) with new syntax and built-in objects for more convenient handling of XML fragments. It seems to be used most frequently with ActionScript 3 (Flash), but is also available in recent Mozilla/Firefox releases./p>p>I whipped up this guide after a quick read-through of a hrefhttp://www.ecma-international.org/publications/standards/Ecma-357.htm>the specification/a> and a bit of playing around. Corrections are more than welcome./p>p>In order, it briefly outlines:/p>ul>li>The syntax for declaring literal XML values/li>li>code>XML/code> and code>XMLList/code> objects/li>li>Variable interpolation in XML literals/li>li>The new syntax for traversal of XML objects/li>li>Namespace considerations/li>li>The methods of XML objects/li>/ul>h3>First-class XML/h3>p>E4X XML objects can be created by passing a string to the code>XML/code> constructor function, but thats hardly exciting. Much more interesting is the new syntax for XML literals, similar to that in a hrefhttp://www.scala-lang.org/intro/xml.html>Scala/a>. Its em>exactly/em> what youd expect:/p>pre>code>var x <elm id1> <a>content</a></elm>;/code>/pre>p>Theres no more need to bother with painful string concatenation or backslashed line continuations./p>p>Even better, XML objects are first-class citizens. They have properties and methods; they can be deleted, concatenated and iterated over./p>pre>code>var y x + <elm id2 />;var name <xml />.name();/code>/pre>h3>code>XML/code> and code>XMLList/code>/h3>p>As well as code>XML/code>, E4X defines the code>XMLList/code>, an ordered collection of code>XML/code> objects similar to the W3C DOM code>NodeList/code>./p>p>The literal syntax is rather less intuitive:/p>pre>code>var xl <> <a /> <b /> <c /></>;/code>/pre>p>Much of E4Xs expressive power comes from the blurring of the line between code>XMLList/code> and code>XML/code> objects. Both have a type of code>xml/code>; code>instanceof xml/code> returns true for both./p>p>The advantage is that you rarely need to worry about which you have. A single-item code>XMLList/code> is treated identically to an code>XML/code> object, and even longer lists share many of the same methods. The code>text()/code> method of an code>XML/code> object returns its text content. On an code>XMLList/code> it returns the concatenated text content of all list members./p>p>If you do need to tell the difference, just check the code>.length()/code>: an code>XML/code> objects length is always code>1/code>./p>h3>Literal Interpolation/h3>p>When declaring a literal, expressions inside braces (curly brackets) are automatically evaluated. /p>pre>code>var name bob^%*;var tag person;var p <{tag} id3>{name.replace(/^a-z/ig, )}</{tag}>;// <person id3>bob</person>/code>/pre>p>Braced values are not, however, evaluated in code>CDATA/code> sections, such as the contents of attribute values:/p>pre>code>var att id;var val 3;var a <person {att}{val}>bob</person>;// <person id{val}>bob</person>var b <person {att}{val}>bob</person>;// <person id3>bob</person>/code>/pre>p>Interpolated attribute values are automatically quoted; any XML entities are automatically escaped./p>pre>code>val \<>;b <person {att}{val}>bob</person>// <person id"<>>bob</person>/code>/pre>p>Literal braces should be escaped as code>{/code> and code>&x#7D;/code> for code>{/code> and code>}/code> respectively./p>h3>Accessing XML Properties/h3>p>XML objects can be filtered and traversed using an object syntax similar to a hrefhttp://effbot.org/zone/element-index.htm>ElementTree/a> and a hrefhttp://www.crummy.com/software/BeautifulSoup/>BeautifulSoup/a>, with a bit of XPath thrown in./p>p>A nodes child elements can be accessed as properties:/p>pre>code>var x <people classexample> <person id1><name>sam</name></person> <person id2><name>elizabeth</name></person></people>;var names x.person.name;var name x.person0.name;names.toXMLString();// <name>sam</name> <name>elizabeth</name>name.toXMLString();// <name>sam</name>/code>/pre>p>code>x.name/code> is the same as code>x.child(name)/code>./p>h3>Attributes/h3>p>As with XPath, code>@/code> is used to access attributes./p>pre>code>var id x.person0.@id;/code>/pre>p>code>x.@name/code> is identical to code>x.attribute(name)/code>./p>h3>Descendants/h3>p>The code>../code> operator accesses all descendants, not just the immediate children./p>pre>code>var names x..name;var ids x..@id;/code>/pre>p>code>x..name/code> is equivalent to code>x.descendants(name)/code>./p>h3>The Wildcard/h3>p>The code>*/code> wildcard matches all names./p>pre>code>var persons x.*;var all x..*;var attrs x..@*;/code>/pre>p>The wildcard is magic in more than one context, but in this one its equivalent to code>QName(null, *)/code>./p>pre>code>var all x.descendants(QName(null, *));/code>/pre>h3>Filtering Predicates/h3>pre>code>var me x.person.(name sam);var either x.person.(@id 1 || @id 2);/code>/pre>p>Predicates can be nested and quite complex:/p>pre>code>var me x..*.(name sam && name.parent().(@id 1).name() person);/code>/pre>p>Theyre not quite as useful as they could be, however. Unlike XPath, E4X expressions cannot easily be used to search ancestor axes./p>p>The previous example illustrates a potential problem. It only works because the list of matches is reduced to one by code>(name sam)/code> before the code>parent()/code> method is invoked. /p>p>This expression, on the other hand, will raise an exception:/p>pre>code>x..*.(name.parent().@id 1);/code>/pre>p>The filter does em>not/em> examine the parent of every code>name/code> in turn; it looks for the single parent of the entire list of code>name/code>s together. It returns code>undefined/code> unless every member shares the same parent. /p>h3>Deletion/h3>p>The code>delete/code> keyword works on arbitrary E4X expressions:/p>pre>code>delete x.person.(@id 1); // thats me gone delete x..person // ... and everyone else/code>/pre>h3>Assignment/h3>p>You can also use the normal assignment operator:/p>pre>code>x..name0 batman;x.@pointless new attribute!;x.person + <person id3><name>alfred</name></person>/code>/pre>p>In some circumstances you can also assign to an expression that would return a list:/p>pre>code>x.* <goodbye_previous_content />;/code>/pre>p>But those nodes were all together, so replacing them at once is a natural operation. This, on the other hand, is illegal:/p>pre>code>x.person.@newattributes for all;/code>/pre>h3>Iteration/h3>p>There are several ways to iterate over code>XMLList/code> and code>XML/code> objects, though for code>XML/code> the exercise is meaningless:/p>pre>code>x0 x;// true/code>/pre>p>Nevertheless. First, iteration over list indices:/p>pre>code>var i, elm;for (i in x..*) { elm x..*i;}/code>/pre>p>The same can be accomplished with a code>for;;/code> loop and the code>length()/code> method./p>pre>code>for (i0; i<x.length(); ++i) { elm xi;}/code>/pre>p>Most useful of all, though, is the new code>for each .. in/code> syntax, allowing direct manipulation of matching nodes:/p>pre>code>var elm;for each (elm in x.person) { elm.@id + 1;}/code>/pre>h3>Namespaces/h3>p>E4X has robust namespace support, but (as anyone with XML experience must expect) they complicate an otherwise simple model./p>pre>code>var x <xml> <v1>value one</v1> <v2>value two</v2> </xml>;x.v1 value one;// true/code>/pre>p>With namespaces, you have to use a qualified name./p>pre>code>var x <xml xmlnshttp://example.com/> <v1>value one</v1> <v2>value two</v2> </xml>;x.v1 undefined;// truevar example Namespace(http://example.com/);x.example::v1 value one;// true/code>/pre>p>Note the use of the code>::/code> scoping operator. You can also suggest a namespace prefix and/or or construct the QName directly:/p>pre>code>var example Namespace(example, http://example.com/);var name QName(example, v1);var same QName(http://example.com/, v1);/code>/pre>p>If more liberal matching is required, the code>*/code> wildcard signifies any namespace./p>pre>code>x.*::v1 value one;// true/code>/pre>p>The wildcard anyname-namespace is different from the unnamed namespace, and can also be created by passing code>null/code> to the code>Namespace/code> constructor. The following are equivalent:/p>pre>code>x.*::v1x.child(QName(null, v1));/code>/pre>h4>The default namespace/h4>p>Using perhaps the most self-explanatory syntax ever devised, you can set the default XML namespace in the current scope. /p>pre>code>var example Namespace(http://example.com/);default xml namespace example;// ordefault xml namespace http://example.com/;var x <xml />;x.toXMLString();// <xml xmlnshttp://example.com//>/code>/pre>p>To reiterate: em>in the current scope/em>./p>h3>code>toString()/code> vs. code>toXMLString()/code>/h3>p>There is an important difference between the code>toString/code> and code>toXMLString/code> methods. /p>pre>code>var x <people> <person id1><name>sam</name></person> <person id2><name>elizabeth</name></person></people>;var names x.person.name;var name x.person0.name;names.toXMLString();// <name>sam</name> <name>elizabeth</name>name.toXMLString();// <name>sam</name>names.toString();// <name>sam</name> <name>elizabeth</name>name.toString();// sam/code>/pre>p>code>toString/code> returns different values depending on whether or not an object is considered complex. If there are no child elements (other types, such as XML comments, dont count), it returns the elements text content only. This is very useful in most cases but a painful gotcha in others./p>h3>Extending E4X/h3>p>ECMAScript lets you do wonderful things by extending a hrefhttp://erik.eae.net/archives/2005/06/06/22.13.54/>code>Object.prototype/code>/a>, code>String.prototype/code> etc. with new methods./p>p>Its much harder with E4X. The prototypes of code>XML/code> and code>XMLList/code> are read-only, so new methods cant be added directly. Most of their existing methods throw exceptions if they are applied to any other object. Procedural code will have to do./p>p>Future versions will have built-in support for custom types based on XML schemas./p>h3>Global function reference/h3>h4>code>isXMLName( value ) : bool/code>/h4>p>Is the value usable as an XML name?/p>h3>code>XML/code> Constructor Reference/h3>p>The code>XML/code> constructor has several properties managing global settings for XML processing and serialization./p>h4>code>XML.ignoreComments/code>/h4>p>Ignore XML comments. (Default: code>true/code>.)/p>h4>code>XML.ignoreProcessingInstructions/code>/h4>p>Ignore XML processing instructions. (Default: code>true/code>.)/p>h4>code>XML.ignoreWhitespace/code>/h4>p>Ignore whitespace. (Default: code>true/code>.)/p>h4>code>XML.prettyPrinting/code>/h4>p>Pretty-print XML output with code>toXMLString()/code> etc. (Default: code>true/code>.)/p>h4>code>XML.prettyIndent/code>/h4>p>Pretty indent level for child nodes. (Default: code>2/code>.)/p>hr />p>There are also three methods to more easily apply and restore settings for use, say, within a function./p>h4>code>XML.settings()/code>/h4>p>Get an Object containing the above settings./p>h4>code>XML.defaultSettings()/code>/h4>p>Get an object containing the default settings./p>h4>code>XML.setSettings(settings)/code>/h4>p>Set XML settings from, e.g., an object returned by code>XML.settings()/code>./p>h3>XML Object Reference/h3>h4>code>addNamespace(namespace)/code>/h4>p>Add a namespace declaration to the object./p>h4>code>appendChild(child)/code>/h4>p>Append a node to the objects list of children./p>h4>code>attribute(attributeName)/code>/h4>p>Returns an code>XMLList/code> of zero or one matching attributes./p>p>Same as code>element.@attributeName/code>./p>h4>code>attributes()/code>/h4>p>Returns an code>XMLList/code> of attributes./p>p>Same as `element.@*/p>h4>code>child(propertyName or index)/code>/h4>p>Same as code>element.propertyName/code> or code>elementindex/code>./p>h4>code>childIndex()/code>/h4>p>Returns the nodes position in the parents list of children, or code>-1/code> if there is no parent or its children are unordered./p>h4>code>children()/code>/h4>p>Returns an code>XMLList/code> of children./p>p>Same as code>element.*/code>./p>h4>code>comments()/code>/h4>p>Returns an code>XMLList/code> of child nodes that are comments./p>p>Same as code>element.(*.nodeKind() comment)/code>./p>h4>code>contains(value)/code>/h4>p>Same as code>element value/code>./p>h4>code>copy()/code>/h4>p>Return a deep copy of the object, detached from its parent./p>h4>code>descendants(name)/code>/h4>p>Return all descendants with the given name, or, if name is null or undefined, all descendants./p>p>Same as code>element..name/code>./p>h4>code>elements(name)/code>/h4>p>Returns all child elements with the given name, or, if name is null or undefined, all child elements./p>p>Same as code>element.(*.nodeKind() element)/code>./p>h4>code>hasOwnProperty(prop)/code>/h4>p>The same as on any other object./p>h4>code>hasComplexContent()/code>/h4>p>Returns true if the node has complex content (in effect, if it has child elements)./p>h4>code>hasSimpleContent()/code>/h4>p>The opposite of code>hasComplexContent/code>./p>h4>code>inScopeNamespaces()/code>/h4>p>Returns an code>Array/code> of in-scope code>Namespace/code> objects./p>h4>code>insertChildAfter(anchor, child)/code>/h4>h4>code>insertChildBefore(anchor, child)/code>/h4>p>Insert a child node before or after the specified anchor node. If the anchor is code>null/code>, insert before or after no nodes./p>p>If the anchor is not in this XML object, do nothing./p>h4>code>length()/code>/h4>p>Return the length of the object. For code>XML/code> objects always return code>1/code>./p>h4>code>localName()/code>/h4>p>Return the local part of the qualified name. (A nodes name not including its namespace.)/p>h4>code>name()/code>/h4>p>Return the qualified name. (Including namespace.)/p>pre>code>var x <xml xmlnshttp://example.com/>abc</xml>;x.name() http://example.com/::xml;x.localName() xml;x.namespace() http://example.com/;/code>/pre>h4>code>namespace(prefix)/code>/h4>p>Return the in-scope namespace specified by code>prefix/code>, or:/p>ul>li>If no namespace matches, return code>undefined/code>./li>li>If code>prefix/code> is not provided, return the default namespace./li>/ul>h4>code>namespaceDeclarations()/code>/h4>p>Return an code>Array/code> of code>Namespace/code> objects representing namespaces declared (as in assigned a prefix) on this XML object. /p>h4>code>nodeKind()/code>/h4>p>Returns the type of XML node, one of code>attribute/code>, code>element/code>, code>comment/code>, code>processing-instruction/code>, code>text/code>./p>h4>code>normalize()/code>/h4>p>Merge adjacent text nodes and remove empty text nodes on this all descendants./p>h4>code>parent()/code>/h4>p>Return the parent node. On an code>XMLList/code>, this method returns code>undefined/code> unless all members share the same parent./p>h4>code>processingInstructions( name )/code>/h4>p>Returns all child processing instructions with the given name, or, if name is null or undefined, all child processing instructions./p>p>Same as code>element.(*.nodeKind() processing-instruction)/code>. /p>h4>code>prependChild(value)/code>/h4>p>Insert code>value/code> at the beginning of the objects child nodes./p>h4>code>propertyIsEnumerable(prop)/code>/h4>p>Will the specified property be enumerated in a code>for .. in/code> loop? Same as for other objects./p>h4>code>removeNamespace(namespace)/code>/h4>p>If possible, remove the given namespace from the object and all descendants. code>removeNamespace/code> will em>not/em> remove a namespace if it is referenced in that object or any of its children./p>h4>code>replace(propertyName, value)/code>/h4>p>Replace value specified by code>propertyName/code>, where code>propertyName/code> is a name, numeric index or code>*/code> wildcard, with code>value/code>./p>h4>code>setChildren(value)/code>/h4>p>Replace the objects children with code>value/code>./p>h4>code>setLocalName(name)/code>/h4>p>Change the objects local name using a string or the code>localName/code> property of a code>QName/code> object./p>h4>code>setName(name)/code>/h4>p>Set the objects name and alter the in-scope namespaces to fit./p>h4>code>setNamespace(ns)/code>/h4>p>Replace the objects default namespace with code>ns/code>./p>h4>code>text()/code>/h4>p>Returns all child text nodes with the given name, or, if name is null or undefined, all child text nodes./p>p>Same as code>element.(*.nodeKind() text)/code>. /p>h4>code>toString()/code>/h4>p>Returns a string representation. Elements with simple content (i.e., no child elements) are returned as text; complex elements are returned as XML./p>h4>code>toXMLString()/code>/h4>p>An XML serialization of the object./p>h4>code>valueOf()/code>/h4>p>Return this object./p>h3>code>XMLList/code> Reference/h3>p>Most methods are the same. Descendant methods such as code>children()/code> and code>text()/code> are simply applied to all members of the list and the results combined. Others, like code>parent()/code>, dont work when it isnt logical that they do so -- consult your common sense./p>h3>Optional Features/h3>p>Implementations are allowed to include these optional features, or not. Currently Mozilla seems to be on the or not side of the fence, but theyre easy enough to implement in userspace if you need them./p>h4>code>domNode()/code>/h4>p>Return a W3C DOM node representation of the object./p>h4>code>domNodeList()/code>/h4>p>Return a W3C DOM NodeList representation./p>h4>code>xpath(exp)/code>/h4>p>Apply the XPath expression code>exp/code> and either return an code>XMLList/code> of results or throw a code>TypeError/code>./p> /div>/div>div classrow> div classthreecol> div classitem-meta> Tuesday, 08 May 2007 /div> /div> div classninecol item last> h2>Sunshine/h2>blockquote>p>And, while with silent lifting mind Ive trodbr />The high, untrespassed sanctity of space,br />Put out my hand and touched the face of God. /p>/blockquote>p>-- J.G. Magee, a hrefhttp://www.qunl.com/rees0008.html>cite>High Flight/cite>/a>/p>div classspoilers warning>Beware spoilers./div>p>Its a terrible shame that the second half of a hrefhttp://imdb.com/title/tt0119081/>cite>Event Horizon/cite>/a> belonged to one of the worst science fiction films of the 1990s, because the first half promised one of the best./p>p>Dr. Weir (Sam Neill) and his team head into space to investigate an experimental spacecraft, thought lost seven years before when a test of its faster-than-light engine went awry. Theres a whole universe of possible explanations for its reappearance, from aliens to temporal anomalies to quantum somethings-or-others, until Weir speaks those ludicrous, devastating words: the ship has returned from a dimension of pure evil. Its not just a wretched turn of phrase; its not just that the anticipated twist is the equivalent of a hrefhttp://imdb.com/title/tt0075005/>cite>Christine/cite>/a> in space or HAL666. Its a betrayal. /p>p>Science fiction is em>science/em> fiction, and scientific endeavour is founded on one basic principle: given time and study, given logic, curiosity and empirical investigation, we can figure it out. We can find out what makes it go. We can reverse-engineer the secrets of the universe./p>p>By contrast, Weir gloats:/p>blockquote>p>Did you really think you could destroy this ship? Shes defied space and time. Shes been to a place you couldnt possibly imagine./p>/blockquote>p>Another character describes the ships destination as somewhere beyond scientific reality, hell. These are not the words of a scientist; they are the words of a priest. cite>Event Horizon/cite> invokes the inexplicable supernatural and thereby becomes fantasy. Its moral is the moral of Babel or Icarus: who are we, mere mortals, to touch the sky?/p>p>a hrefhttp://imdb.com/title/tt0448134/>cite>Sunshine/cite>/a>, written by Alex Garland (a hrefhttp://imdb.com/title/tt0289043/>cite>28 Days Later/cite>/a>) and directed by Danny Boyle (a hrefhttp://imdb.com/title/tt0117951/>cite>Trainspotting/cite>/a>), is a significantly better film, though its science is almost as dubious and it echoes its predecessors painful tumble into creature-feature horror. A team of astronauts are sent aboard the ship i>Icarus II/i> to reignite our dying sun with a nuclear device, but events take a turn for the cite>Horizon/cite> when they discover the cite>Icarus I/cite>, thought lost seven years earlier when it failed in the same mission, intact but apparently abandoned./p>p>When the crew have their corresponding encounter with an entity beyond easy understanding, its with nothing so abstruse as extradimensional evil: they find the sun. Even for the audience it approaches the spiritual. Like a hrefhttp://imdb.com/title/tt0062622/>cite>2001: A Space Odyssey/cite>/a>, some of the most memorable moments are long, slow shots of objects in space; and though the discordant post-rock score couldnt be further from cite>2001/cite>s classical, the effect is the same. At once beautiful, frightening and inspiring, the images hint at the sublime. In cite>Sunshine/cite>, they are images of the sun, so massive, so bright, so fundamentally alien to human experience that an emotional response is inevitable. /p>p>For the characters the experience is palpably religious. They dream about it at night; Searle (Cliff Curtis) sits in the observation chamber and bathes in light until he burns. Pinbacker (Mark Strong) makes it explicit: he looks into the sun and finds God there. The Icarus myth had already been registered in the names of the ships, but he invokes it again in his attempt to sabotage the mission. He is the instrument of Gods will: in accordance with the divine plan, humanity must be allowed to die./p>p>Pinbacker is a murderous psychopath; the crew sensibly refuse to believe him. Humanity wins, and Gods plot (or Pinbackers interpretation of it) is foiled. That is not to say that the spiritual element of the film is diminished, but for the remaining characters it is a purely secular matter. Capa (Cillian Murphy) at one point comments that their computer simulations are inedaquate, because the high heat and the high gravity are enough to bend time and space. The phenomenon is graphically illustrated in the penultimate sequence, and though obviously unscientific -- Boyle has quipped the warning, Kids! Dont stick your arm in the sun! -- its a figurative expression of the same sense of wonder that most of us find in our interactions with the natural world. A flower is no less perfect as the culmination of millions upon millions of evolutionary generations than it is as the work of a divine craftsman. The sun is no less magnificent as the product of purely natural energies. Even the irreligious can appreciate sublimity./p>p>In cite>Event Horizon/cite>s defense, its not necessarily unscientific to claim something as unimaginable: human brains have limits. We evolved that way, coded to survive as hunter-gatherers. We were not coded to imagine the ten or eleven dimensions postulated by theories of quantum mechanics; its hard enough to accept that time is a fourth. (How do you visualize four dimensions on a three-dimensional plane?) Less esoteric but no less true, most of us couldnt easily distinguish between a hot oven at 200°C and one at 250°C. To a primitive brain it hardly matters: both are hot enough to burn. How then can we deal with the surface of the sun, closer to 5000°C, or the core, over em>12000000°C/em>? Death occurs too soon for nerve impulses to even reach the brain. Unimaginable is an appropriate label. /p>p>But imagination isnt the end-all, and even if it fails were still capable of comprehending the difference between two hundred and twelve million. One of the many glories of science is that unimaginable is not the same as indescribable. /p> /div>/div>/div>div idfooter classcontainer> /div>/html>
Subdomains
Date
Domain
IP
re.rephrase.net
2024-08-11
69.163.179.165
vs.rephrase.net
2024-09-15
69.163.179.165
View on OTX
|
View on ThreatMiner
Please enable JavaScript to view the
comments powered by Disqus.
Data with thanks to
AlienVault OTX
,
VirusTotal
,
Malwr
and
others
. [
Sitemap
]