Mit dem _ Gem kann man Programme schreiben, die nur aus Unterstrichen bestehen. Das ganze ist valider Rubycode.
require "_"
____ _ _____ ____ __ ____ ____ __ ___ ____ __ __ _ ______
_____ ___ _ _ ___ _____ ______ ____ _ _ ____ _ _ ____ _
____ __ __ ___ _ ______ ___ ____ __ ______ ____ _ ____ ____
__ _ ____ _ _ ___ _____ _____ _ ______ ____ _ ______ _____
=> "Hello, world!"
WTF. Der Code des Gems ist ganze 23 Zeilen lang und ich hab mit meinen mageren Ruby-Kenntnissen eine Weile gebraucht, um zu verstehen, was da passiert. Hier eine kleine Analyse:
Schicker Regex-Tester zum live ausprobieren von Rubys regulĂ€ren AusdrĂŒcken. Auch nicht ĂŒbel ist RegExr, benötigt allerdings Flash und benutzt Action Scripts Regex-Engine.
* full mode: no full ruby spec support, no runtime code generation, no LLVM. (âvery light application and/or if the environment does not support runtime code generationâ (hint-hint))
Also wirds in ferner Zukunft möglich sein, iPhone-Programme in Ruby zu schreiben. WohĂ©. FĂŒr simple Apps vielleicht sogar schnell genug...
Wish you could write your Ruby in XML? Has the fact that Ruby is not "enterprise" got you down? Do you feel like your Ruby code could be made to be more "scalable"? Well look no further my friend. Youâve found the enterprise gem. Once you install this gem, you too can make Rails scale, Ruby faster, your code more attractive, and have more XML in your life.
Klasse Vortrag ĂŒber gelernten Optimismus und warum optimistische Menschen erfolgreicher sind.
Kleine Funktion zum schönen ausgeben von Arrays.
# [1, 2, 3] => "1, 2 and 3"
# [1, 2] => "1 and 2"
# [1] => "1"
def humanize_array a
[a[0..-3], [a[-2], a[-1]].compact.join(" and ")].flatten.join(", ")
end
Kleine Notiz fĂŒr mich, da ich das immer vergesse und es auch nicht auf Ultraviolets Website steht:
actionscript, active4d, active4d_html, active4d_ini, active4d_library, ada, antlr, apache, applescript, asp, asp_vb.net, bibtex, blog_html, blog_markdown, blog_text, blog_textile, build, bulletin_board, c++, c, cake, camlp4, cm, coldfusion, context_free, cs, css, css_experimental, csv, d, diff, dokuwiki, dot, doxygen, dylan, eiffel, erlang, f-script, fortran, fxscript, greasemonkey, gri, groovy, gtd, gtdalt, haml, haskell, html-asp, html, html_django, html_for_asp.net, html_mason, html_rails, html_tcl, icalendar, inform, ini, installer_distribution_script, io, java, javaproperties, javascript, javascript+prototype, javascript+prototype_bracketed, jquery_javascript, json, languagedefinition, latex, latex_beamer, latex_log, latex_memoir, lexflex, lighttpd, lilypond, lisp, literate_haskell, logo, logtalk, lua, m, macports_portfile, mail, makefile, man, markdown, mediawiki, mel, mips, mod_perl, modula-3, moinmoin, mootools, movable_type, multimarkdown, objective-c++, objective-c, ocaml, ocamllex, ocamlyacc, opengl, pascal, perl, php, plain_text, pmwiki, postscript, processing, prolog, property_list, python, python_django, qmake_project, qt_c++, quake3_config, r, r_console, ragel, rd_r_documentation, regexp, regular_expressions_oniguruma, regular_expressions_python, release_notes, remind, restructuredtext, rez, ruby, ruby_experimental, ruby_on_rails, s5, scheme, scilab, setext, shell-unix-generic, slate, smarty, sql, sql_rails, ssh-config, standard_ml, strings_file, subversion_commit_message, sweave, swig, tcl, template_toolkit, tex, tex_math, textile, tsv, twiki, txt2tags, vectorscript, xhtml_1.0, xml, xml_strict, xsl, yaml, yui_javascript
Das sind die verfĂŒgbaren Syntaxen in Ultraviolet. Erzeugt hiermit:
require 'rubygems'
require 'uv'
File.open('/Users/rob/Desktop/syntaxes.txt', 'w') {|f| f.write(Uv.syntaxes.join(', '))}
Ultraviolet ist eine klasse Library zum highlighten von Syntax. Benutz ich zusammen mit tm_syntax_highlighting fĂŒr die schicken Codeboxen hier im Blag. tm_syntax_highlighting wiederum liest die Farbdefinitionen von TextMate aus, wodurch der Code hier genauso chique aussieht wie in meinem Lieblingseditor. Har!
Beginning today, the Merb team will be working with the Rails core team on a joint project. [...] Effectively, Merb 2 is Rails 3.
Whoa.
Why!?
As you have probably gathered from the above, there arenât any clear points that the Merb and Rails team disagree on anymore. [...] Given this philosophical convergence, it just didnât seem like there was much to gain by continuing to duplicate effort and spend time and energy fighting each other.
Mit gutem Fix fĂŒr das Safari/IE-XML-Header-Problem.