Today I wanted to wrap the text in my NetBeans editor. I found this article which pointed me to Tools -> Options -> Editor -> All Langauges -> Line Wrap: Anywhere. Everything is easy when you know how!
Monthly Archives: May 2014
HTTP Header Field Definitions
Reading about HTTP Header Field Definitions.
UnsupportedClassVersionError in Closure
Today while Getting Started with the Closure Compiler Application I ran into the following trouble:
jj5@mercy:~/Desktop/compiler-latest$ java -jar compiler.jar --help
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/google/javascript/jscomp/CommandLineRunner : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: com.google.javascript.jscomp.CommandLineRunner. Program will exit.
To fix the problem I installed jdk-7:
root@mercy:/home/jj5# apt-get install openjdk-7-dbg openjdk-7-demo openjdk-7-doc openjdk-7-jdk openjdk-7-jre
PHP WebDriver
Selenium API for PHP: PHP WebDriver.
PHPUnit Manual
I should really read the PHPUnit Manual…
PHP Gettext
TODO: learn how to integrate Gettext in my PHP apps.
PHP spl_autoload_register
Today I used spl_autoload_register again.
This time to load default concrete classes. For example in my framework I have a class called SlibUser:
class SlibUser extends SlibRecord {
public static function Load( $id ) {
$args = array( 'id' => $id );
$data = db()->get_row( 'select * from /*prefix*/user where id = :id', $args );
if ( $data ) { return new User( $data ); }
return null;
}
}
As you can see SlibUser creates a new User. That User can be provisioned by a user of my framework, but if they don’t specify a particular User definition I give them a default implementation with spl_autoload_register, e.g.:
<?php
function load_slib_mock( $class = false ) {
//var_dump( $class );
static $classes;
static $files;
if ( ! $files ) { $files = array(); }
if ( ! $classes ) {
$classes = array(
// URL
'Uri',
'UriPath',
'UriPathBuilder',
'UriQuery',
'UriQueryBuilder',
'UriQueryNode',
// framework:
'Auth',
'Column',
'FrontController',
'Option',
'OptionGroup',
'ResourceManager',
'Schema',
'Settings',
'Table',
'Variable',
// database:
'Database',
'DatabaseUpgrader',
// ORM:
'Browser',
'GeoipLocation',
'HttpAccept',
'HttpAcceptEncoding',
'HttpAcceptLanguage',
'HttpMethod',
'HttpUserAgent',
'Partition',
'Request',
'Role',
'Session',
'SessionSettings',
'User',
'UserPartition',
'UserSettings'
);
}
if ( ! in_array( $class, $classes ) ) { return false; }
$path = "/var/tmp/slib-$class.php";
if ( ! file_exists( $path ) ) {
$content = "<?php class $class extends Slib$class {}";
$file = fopen( $path, 'w' );
if ( ! $file ) { throw new IOException( "Cannot write '$file'." ); }
fwrite( $file, $content );
fclose( $file );
}
require_once( $path );
return true;
}
// autoload handler:
spl_autoload_register( 'load_slib_mock', true, true );
Videos I watched recently
- AngularJS — Superheroic JavaScript MVW Framework
- Miško Hevery and Brad Green – Keynote – NG-Conf 2014
- AngularJS Fundamentals In 60-ish Minutes
- Introduction to Angular.js in 50 Examples (part 1)
- Larry Page: Where’s Google going next?
- How BIG Is Google?
- Edward Snowden: Here’s how we take back the Internet
- Dan Wahlin – AngularJS in 20ish Minutes – NG-Conf 2014
- Igor Minar – Angular === Community (Keynote) – NG-Conf 2014
- Programming is terrible—Lessons learned from a life wasted. EMF2012
- “The World in 2030” by Dr. Michio Kaku
- Angular Team Panel
- Google I/O 2009 – The Myth of the Genius Programmer
- Noam Chomsky: The Singularity is Science Fiction!
- Sharon DiOrio – Filters Beyond OrderBy and LimitTo – NG-Conf 2014
- Lukas Rubbelke & Matias Niemela – Awesome Interfaces with AngularJS Animations – NG-Conf 2014
- Vojta Jina – Dependency Injection – NG-Conf
- Burke Holland – Angular Directives that Scale – NG-Conf 2014
- Julie Ralph End to End Angular Testing with Protractor
- Writing a Massive Angular App at Google NG Conf
- Dave Smith – Deep Dive into Custom Directives – NG-Conf 2014
- Tom Valletta and Gabe Dayley – Angular Weapon Defense – NG-Conf 2014
- Ben Teese – Rich Data Models & Angular – NG-Conf 2014
- Karl Seamon – Angular Performance – NG-Conf
- John Papa – Progressive Saving – NG-Conf
- Silvano Luciani – PhotoHunt – NG-Conf 2014
- Christian Lilley – Going Postal with Angular in Promises – NG-Conf
- Jason Aden – Using ngModelController to Make Sexy Custom Components – NG-Conf 2014
- Anant Narayanan – Building Realtime Apps With Firebase and Angular – NG-Conf 2014
- Daniel Zen – Using AngularJS to create iPhone & Android applications with PhoneGap – NG-Conf 2014
- Ari Lerner – Robotics powering interfaces with AngularJS to the Arduino – NG-Conf 2014
- Sean Hess – How to use Typescript on your Angular Application and Be Happy – NC-Conf 2014
- Brian Ford – Zones – NG-Conf 2014
- Richard Stallman: We’re heading for a total disaster
- Jeff Cross – Rapid Prototyping with Angular & Deployd – NGConf
- Thomas Burleson Angular and RequireJS
Sublime Text
Thinking about evaluating Sublime Text.
The Most Powerful Objects in the Universe
Today I watched this video: The Most Powerful Objects in the Universe. Awesome stuff.