Wednesday, August 15, 2012

FalconView COM


   FalconView™ COM Overview

  • COM (Component Object Model) is a Microsoft specification which describes how to build components that can be dynamically shared.
  • COM components consist of executable code distributed as DLLs or EXEs
  • COM is language independent (C, C++, Visual Basic, JAVA, ADA…) But Microsoft tools such as VB Visual C++ or C# make it much easier.
With FalconView, you can use the interfaces either from a EXE running out of process or by creating a DLL running InProcess with FalconView. This first example is an EXE implementation.


Sunday, August 5, 2012

How to setup MineCraft Coder Pack (MCP)

Step 1. Download Java JDK (Need this for MCP) 

Step 2. Download MCP (Minecraft Coder Pack) 

http://www.mediafire.com/?hxui27dv5q4k8v4

(This step is only if you want to make mods,clients,etc. for minecraft)
Step 3. Download a Program to Edit with. (Eclipse)
 

Step 4. Download minecraft_server.jar (You need this for MCP) 

Step 5. Download/Installing Winrar 

Step 6. Setting Up MCP 
- Locate where all your downloaded files are.
- Make a folder on your desktop name "MCP" (Don't add quotations)
- Extract mcp70a.zip to folder you just created "MCP"
- Open folder "MCP" on desktop and open "jars" folder, now drag minecraft_server.jar into "jars" folder
- Now go to start and search "Run" then type in %appdata% then click ".minecraft" and copy "bin and "resources" (Make sure they have no mods installed)
- Now go back to "jars" folder and paste "bin" and "resources"
- Now go back to "MCP" and run "decompile.bat"
- If it says you need to update run "updatemcp.bat"
- Now you have successfully setup MPC
 


http://www.thetechgame.com/Archives/t=2004430/tutorial-how-to-setup-mcp-minecraft-coder-pack.html


david@david-ubuntu:~/Minecraft/MCP7.0a$ ./decompile.sh
== MCP 7.0 (data: 7.0a, client: 1.3.1, server: 1.3.1) ==
!! Please install either wine or astyle for source cleanup !!
# found ff, jad patches, ff patches, osx patches, srgs, name csvs, doc csvs, param csvs, renumber csv, astyle config
!! Updates available. Please run updatemcp to get them. !!
> Creating Retroguard config files
!! client already decompiled. Run cleanup before decompiling again !!
== Decompiling server using fernflower ==
> Creating SRGs
> Applying Retroguard
> Applying MCInjector
> Unpacking jar
> Copying classes
> Decompiling
> Copying sources
> Applying fernflower fixes
> Applying patches
> Cleaning comments
- Done in 67.34 seconds
== Reformating server ==
> Cleaning sources
!! reformating disabled due to no astyle or config !!
- Done in 1.16 seconds
== Updating server ==
> Adding javadoc
> Renaming sources
- Done in 0.83 seconds
== Recompiling server ==
> Cleaning bin
> Recompiling
- Done in 11.15 seconds
> Generating server md5s

Thursday, July 26, 2012

Android & Twitter - OAuth authentation

http://automateddeveloper.blogspot.com/2011/06/android-twitter-oauth-authentication.html

I’ve seen a lot of questions about connecting Android apps with Twitter using OAuth and thought I would write up a walk-through of how it can be done. The example will be done using Twitter4J which is a great library for connecting Java apps with Twitter and provides a simple interface to connect to the public Twitter Web Services.

First thing you will need to do is to register your new app (even though you haven’t made it yet!). Do this by heading to https://dev.twitter.com/apps/new (you will need an existing Twitter account sign up). You should complete the form with the relevant details for your app:


Spring Social Twitter Oauth

http://stackoverflow.com/questions/7968641/spring-social-twitter-oauth

Tuesday, July 24, 2012

Android VM and application

Dalvik performs a host of other optimizations, such as utilizing shared memory to allow objects being used by more than one application. This results in less memory consumption and fewer garbage collector cycles (again saving computing time and therefore battery). To achieve this, Android starts a special Dalvik VM instance on system boot, called Zygote, which preloads data into the shared memory that will likely be used by all applications (such as the core libraries). The Zygote VM then forks a new Dalvik instance from itself for each new application that’s about to start. Each child process (which is also a separate Linux process) can then access the shared data.



Sunday, July 22, 2012

Java Classloaders



The Java platform ships with a number of typical classloaders, which are used to do different jobs during the startup and normal operation of the platform:

Primordial (or bootstrap) classloaderThis is instantiated very early in the process of starting up the VM, and is usually implemented as native code. It’s often best to think of it as being a part of the VM itself. It’s typically used to get the basic system JARs—basically rt.jar—loaded and it does no verification.


Extension classloader—This is used to load installation-wide standard extensions. This often includes security extensions.

Application (or system) classloader—This is the most widely used classloader. It’s the one that will load the application classes and do the majority of the work in in most SE environments.


Custom classloader—In more complex environments, such as EE or the more sophisticated SE frameworks, there will often be a number of additional (a.k.a. custom) classloaders. Some teams even write classloaders that are specific to their individual applications. In addition to their core role, classloaders are also often used to load resources (files that aren’t classes, such as images or config files) from JAR files or other locations on the classpath.

Android inter-/intra-process communication


Android offers a unique collection of mechanisms for inter- (and intra-) application
communication. This chapter discusses the following:

Intents
Specify what you intend to do next: either to invoke a particular class within your
application, or to invoke whatever application the user has configured to process
a particular request on a particular type of data
Broadcast receivers
In conjunction with intent filters, allow you to define an application as able to
process a particular request on a particular type of data (i.e., the target of an intent)
AsyncTask
Allows you to specify long-running code that should not be on the “GUI thread”
or “main event thread” to avoid slowing the app to the point that it gets ANR
(“Application Not Responding”) errors
Handlers
Allow you to queue up messages from a background thread to be handled by an-
other thread such as the main activity thread, usually to cause information to up-
date the screen safely

Sunday, July 15, 2012

Shell tips



filename="all you need is love - the beatles.mp3"
ext=$(echo $filename | grep -o '\....$')
title=$(echo $filename | sed 's/ - .*//; s/\b\w/\u&/')
artist=$(echo $filename | sed "s/.* - \(.*\)$ext/\1/; s/\b\w/\u&/g")
echo $title - $artist$ext

All you need is love - The Beatles.mp3

Sunday, May 27, 2012

Another option for using jQuery



AKKA


http://typesafe.com/stack/download


http://typesafe.com/resources/getting-started/tutorials/getting-started.html

For AKKA/Java:
g8 typesafehub/akka-java-maven


For AKKA/Scala:
g8 typesafehub/akka-scala-sbt


For Play/Java:
g8 typesafehub/play-java


For Play/Scala:
g8 typesafehub/play-scala

Thursday, May 17, 2012

Android's component-oriented architecture


To make the reuse concept concrete, suppose you’re creating a drawing app that lets users choose a color from a palette, and suppose that another app has developed a suitable color chooser and permits this component to be reused. In this scenario, the drawing app can call upon that other app’s color chooser to have the user select a color rather than provide its own color chooser. The drawing app doesn’t contain the other app’s color chooser or even link to this other app. Instead, it starts up the other app’s
color chooser component when needed.

Android starts a process when any part of the app (such as the aforementioned color chooser) is needed, and instantiates the Java objects for that part. This is why Android’s apps don’t have a single entry point (no C-style main() function, for example). Instead, apps use components that are instantiated and run as needed.

Android's Dalvik






http://www.springsource.org/node/3505

Monday, April 23, 2012

Start/Stop ADB with Trace Turned On


platform-tools $ ADB_TRACE=all ./adb.exe kill-server

system/core/adb/adb.c::main():Handling commandline()
system/core/adb/adb_client.c::_adb_connect():_adb_connect: host:kill
system/core/adb/sysdeps_win32.c::socket_loopback_client():socket_loopback_client: port 5037 type tcp => fd 100
system/core/adb/transport.c::writex():writex: fd=100 len=4: 30303039 0009
system/core/adb/transport.c::writex():writex: fd=100 len=9: 686f73743a6b696c6c host:kill
system/core/adb/transport.c::readx():readx: fd=100 wanted=4
system/core/adb/transport.c::readx():readx: fd=100 wanted=4 got=4
4f4b4159 OKAY
system/core/adb/adb_client.c::_adb_connect():_adb_connect: return fd 100


platform-tools $ ADB_TRACE=all ./adb.exe kill-server
system/core/adb/adb.c::main():Handling commandline()
system/core/adb/adb_client.c::_adb_connect():_adb_connect: host:kill
system/core/adb/sysdeps_win32.c::socket_loopback_client():socket_loopback_client: port 5037 type tcp => fd 100
system/core/adb/transport.c::writex():writex: fd=100 len=4: 30303039 0009
system/core/adb/transport.c::writex():writex: fd=100 len=9: 686f73743a6b696c6c host:kill
system/core/adb/transport.c::readx():readx: fd=100 wanted=4
system/core/adb/sysdeps_win32.c::_socket_set_errno():_socket_set_errno: unhandled value 10054
system/core/adb/transport.c::readx():readx: fd=100 error 22: Invalid argument
system/core/adb/sysdeps_win32.c::adb_close():adb_close: 100(lo-client:5037)
* server not running *


platform-tools $ ADB_TRACE=all ./adb.exe start-server
system/core/adb/adb.c::main():Handling commandline()
system/core/adb/adb_client.c::_adb_connect():_adb_connect: host:version
system/core/adb/sysdeps_win32.c::socket_loopback_client():socket_loopback_client: could not connect to tcp:5037
system/core/adb/adb_client.c::adb_connect():adb_connect: service host:start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *

Saturday, April 14, 2012

Git - Single Developer Mode

> git config --global user.name "david"
> git config --global user.email "dmak168@gmail.com"
> git config --global color.diff auto
> git config --global color.status auto
> git config --global color.branch auto

(make a repository)
> mkdir ~/Project
> cd ~/Project
> git init
> git status
> echo "Hello There!" > readme.txt
> git status
> git add readme.txt (add a new file)
> git commit
> git status
> git log

> echo "modified again" >> readme.txt
> git add readme.txt (the second add put readme.txt into staging area)
> git reset (this is to reset staging area which result in doing nothing when commit)
> git add readme.txt
> git commit (this is to commit change to the repository)
(if you don't want to use "git add" for every change you made to a file
then you can just use "git commit -a" which will by pass the staging area)

Note 1:
1. Subversion works on repository and repository is represented as number starts at 1.
2. CVS works on File and each version of file is represented as 1.1, 1.2, 1.3 ...
3. Git works on commit, each commit gets a number (SHA1 hash) - which can guarantee the content of the repository. It promises that what we put in is what we get out by using the unique hash number.

Note 2:
> git reset (will not remove your changes but just reset the staging which means cannot commit)
> git reset --hard (will reset staging and also remove your changes and put it back to its last commit)

Note 3:
In Git our working copy is a local copy which is a full repository, and the commit is a local commit.


Wednesday, April 4, 2012

Application errors notification with Logback

http://maciejwalkowiak.pl/blog/2012/04/03/application-errors-notification-with-logback/

Logback in conjunction with SLF4J provides great API and fast and powerful implementation of logging framework. Reasons why to switch to Logback from log4j are not topic of this post and they are already described in details on logback website.

Thanks to SLF4J migration tool migration from log4j api to SLF4J is super fast. I’ve decided to switch all projects to Logback and after several months I have to say that I am really satisfied with that decision.

How to install Groovy on ubuntu 10.10

http://www.code-republic.com/?p=12

note: Ubuntu uses /etc/environment to setup your environment variables

Saturday, March 31, 2012

Top Things to do after installing Ubuntu

http://www.unixmen.com/top-things-to-do-after-installing-ubuntu-1104-natty-narwhal/

Ubuntu 12.04 LTS Precise Pangolin beta 1 is almost out. The final release it scheduled to be out in the 26th of April 2012. After you actually get done with the installation, there would likely exist a heap of things you still need to take care of. This post will share some interesting insight and ideas about what you can and should do after a successful installation.

How to install OpenJDK 7 in Ubuntu 12.04 ?
http://www.ubuntugeek.com/how-to-install-oracle-java-7-in-ubuntu-12-04.html

Thursday, March 29, 2012

VMWare ESXi tutorials

Intro 1. http://www.youtube.com/watch?v=WW8OlZ-s-Us

Intro 2. http://www.youtube.com/watch?v=GtoWAfrOWeU


Module 1. http://www.youtube.com/watch?v=HtNJD5cDpL8

Module 2. http://www.youtube.com/watch?v=rHUPWk64pmQ

Module 3. http://www.youtube.com/watch?v=uOhKVG9Sef0

Module 4. http://www.youtube.com/watch?v=5kxANMGm4jQ

http://www.youtube.com/watch?v=5kxANMGm4jQ&feature=results_main&playnext=1&list=PL89DE88402641452C


Module 5. http://www.youtube.com/watch?v=VepgExB_39E&feature=related

Ada string concatenation

I keep on getting CONSTRAINT_ERROR from the string concatenation code below:

for Line in 1 .. 5 loop
Fault_Data.Lru_Label := "Fault 0" & Integer'Image (Line);
...
end loop;

The link below shed light on how to do string concatenation in Ada:
http://stackoverflow.com/questions/4988438/ada-string-concatenation

The link below shows the differences between Java and Ada:
http://www.radford.edu/~nokie/classes/320/strings.html

IntelliJ Scala Plugin - nightly build

There is an alternative way to install the Scala plugin.Download the Scala plugin from the Nightly Builds page and unzip the archive to the directory /.IntelliJIdea/config/plugins. After that, run IntelliJ IDEA.

Wednesday, March 28, 2012

How to update AIR SDK for Flex Builder

Here's an overlay video for a previous version of AIR, but it should still be applicable.
http://www.youtube.com/watch?v=EpV9eUWzKMk


An Eclipse-like Ada IDE

The GNAT Programming Studio
http://libre.adacore.com/libre/tools/gps/

Installing And Configuring ESXI 4.1 Free edition

http://www.youtube.com/watch?v=8Uh1mBsVGYo&feature=related

The movie clip shows you how to:
1. Install VMWare ESXi Free on VMWare Workstation
2. Install vSphere Client to manage/configure ESXi

A good introduction to the VMWare vSphere Hypervisor (type 1 and 2)
http://www.youtube.com/watch?v=HtNJD5cDpL8&feature=related

http://www.youtube.com/watch?v=ZBl1Tf2A4lA&feature=related



How to install new virtual machine (VM) to ESXi



FAQ







Friday, March 23, 2012

Thursday, March 22, 2012

Managing diskk usage with quotas

http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch28_:_Managing_Disk_Usage_with_Quotas

# who
# wall The system is shutting down now!

# init 1
# cat /etc/fstab | grep -w usrquota
(if not exist then add it to make it looks like below:)
LABEL=/home       /home          ext3    defaults,usrquota  1 2

# mount -o remount /home
# exit

# touch /home/aquota.user
# chmod 600 /home/aquota.user
# aquotacheck -vagum
# edquota -u mp3user
Disk quotas for user mp3user (uid 503):   Filesystem  blocks       soft       hard     inodes     soft     hard
/dev/hda3 24 0 0 7 0 0


change the soft value to 5000 to limit user mp3user to a maximum of 5MB of data storage.

Saturday, March 17, 2012

Shiro - A Java security framework

http://shiro.apache.org/index.html

Apache Shiro is a powerful and easy-to-use Java security framework that performs authentication, authorization, cryptography, and session management. With Shiro’s easy-to-understand API, you can quickly and easily secure any application – from the smallest mobile applications to the largest web and enterprise applications.

Note: Looks at the example at samples/web, it makes use of HtmlUnit to perform unit test on HTML pages. HtmlUnit is a "GUI-Less browser for Java programs". It models HTML documents and provides an API that allows you to invoke pages, fill out forms, click links, etc... just like you do in your "normal" browser.

Sunday, March 11, 2012

How to setup PostgreSQL

https://help.ubuntu.com/community/PostgreSQL

Basic Server Setup
To start off, we need to change the PostgreSQL postgres user password; we will not be able to access the server otherwise. As the “postgres” Linux user, we will execute the psql command.

In a terminal, type:

Dapper

sudo -u postgres psql template1
Karmic, Lucid, Intrepid and Maverick

sudo -u postgres psql postgres
Set a password for the "postgres" database role using the command:

\password postgres
and give your password when prompted. The password text will be hidden from the console for security purposes.

Type Control+D to exit the posgreSQL prompt.


Create database
To create the first database, which we will call "mydb", simply type:


sudo -u postgres createdb mydb
Install Server Instrumentation for Postgresql 8.4
To install Server Instrumentation for Postgresql 8.4 you may use the command line and type:


sudo apt-get install postgresql-contrib
Run the adminpack.sql script, simply type:

sudo -u postgres psql < /usr/share/postgresql/8.4/contrib/adminpack.sql

Saturday, February 18, 2012

Top Tier Detergent Gasoline

http://www.toptiergas.com/

TOP TIER Detergent Gasoline is the premier standard for gasoline performance. Six of the world's top automakers, BMW, General Motors, Honda, Toyota, Volkswagen and Audi recognize that the current EPA minimum detergent requirements do not go far enough to ensure optimal engine performance.

Since the minimum additive performance standards were first established by EPA in 1995, most gasoline marketers have actually reduced the concentration level of detergent additive in their gasoline by up to 50%. As a result, the ability of a vehicle to maintain stringent Tier 2 emission standards have been hampered, leading to engine deposits which can have a big impact on in-use emissions and driver satisfaction.

These automakers have raised the bar. TOP TIER Detergent Gasoline help drivers avoid lower quality gasoline which can leave deposits on critical engine parts, which reduces engine performance. That's something both drivers and automakers want to avoid.

Friday, February 3, 2012

Moving from Scala to Java ... :(

http://www.infoq.com/news/2011/11/yammer-scala

An e-mail, sent from Yammer employee Coda Hale to Scala's commercial management at Typesafe, ended up being leaked via YCombinator and a gist at GitHub. The e-mail confirms that Yammer is moving its basic infrastructure stack from Scala back to Java, owing to issues with complexity and performance.

Yammer PR Shelley Risk confirmed to InfoQ that the e-mail represented the personal opinions of Coda Hale, rather than an official statement from Yammer itself; a follow up from the original author has been published at http://codahale.com/the-rest-of-the-story/. In it, Coda clarified that the message was a result of a request for feedback from Donald Fischer (CEO of Typesafe) following an earlier tweet indicating the move.

Update: Code has published Yammer's official position on the subject; which confirms the above points. It also points out that any language has flaws (not just Scala) and that the e-mail was an attempt at offering advice for how to improve Scala's performance and other concerns. Finally, it concluded that when rolling out any high performance project (for which Scala is their production environment) there are rough edges which need to be filed down; the e-mail was an attempt at helping Scala improve.

Monday, January 30, 2012

Apache TomEE

http://openejb.apache.org/apache-tomee.html

TomEE
The Web Profile version of TomEE contains
CDI - Apache OpenWebBeans
EJB - Apache OpenEJB
JPA - Apache OpenJPA
JSF - Apache MyFaces
JSP - Apache Tomcat
JSTL - Apache Tomcat
JTA - Apache Geronimo Transaction
Servlet - Apache Tomcat
Javamail - Apache Geronimo JavaMail
Bean Validation - Apache Bean Validation

TomEE+
The TomEE Plus distribution adds the following:
JAX-RS - Apache CXF
JAX-WS - Apache CXF
JMS - Apache ActiveMQ
Connector - Apache Geronimo Connector

Goal
Simple, Get more from Tomcat without giving anything up.

Nodejs vs Play for Front-End Apps

http://www.subbu.org/blog/2011/03/nodejs-vs-play-for-front-end-apps

We often see “hello world” style apps used for benchmarking servers. A “hello world” app can produce low-latency responses under several thousands of concurrent connections, but such tests do not help make choices for building real world apps. Here is a test I did at eBay recently comparing a front-end app built using two different stacks:



  • nodejs (version 0.4.3) as the HTTP server, using Express (with NODE_ENV=production) as the web framework with EJS templates and cluster for launching node instances (cluster launches 8 instances of nodejs for the machine I used for testing)



  • Play framework (version 1.1.1) as the web framework in production mode on Java 1.6.0_20.
The intent behind my choice of the Play framework is to pick up a stack that uses rails-style controller and view templates for front-end apps, but runs on the JVM. The Java-land is littered with a large number of complex legacy frameworks that don’t even get HTTP right, but I found Play easy to work with. I spent nearly equal amounts of time (under two hours) to build the same app on nodejs and Play.

Tuesday, January 10, 2012

Node.js + CouchDB

http://nodetuts.com/tutorials/30-couchdb-and-nano.html#video

> cat package.json
{
"name": "Node_tutorial",
"description": "My test node tutorial",
"version":"0.1.0",
"author": "David Chang",
"dependencies": {
"nano": "1.1.x"
}
}

> npm install
> cat couch.js
var nano = require('nano');
var server = nano('http://XXX:YYY@dmak168.iriscouch.com');

server.db.create('mydb2', function(err){
if (err) { throw err; }

console.log('created mydb');

var doc1 = { a:1, b:2, c: "abd", d: [1, 2, 3] };
var db = server.use('mydb2');
db.insert(doc1, "doc_two", function(err){
if (err) { throw err; }
console.log('inserted obj1');

db.get('doc_two', function(err, val) {
console.log('doc_two = ', val);
});
});
});

> node couch.js
created mydb
inserted obj1
doc_two = { _id: 'doc_two',
_rev: '1-f83339c44679257161b912dd6aad89dd',
a: 1,
b: 2,
c: 'abd',
d: [ 1, 2, 3 ] }

Thursday, January 5, 2012

Lucky number




Hooray for the lucky number I just got ... quadruple lucky 7


HTML5 on Google Chrome



This is a screenshot captured on Google Chrome(v9.0.597.107), it worked smoothly for 10+ minutes and then became unresponsive permanently ... :(

Monday, January 2, 2012

[Play!] keep the model stateless

Keep the model stateless

Play is designed to operate in a ‘share nothing’ architecture. The idea is to keep the application completely stateless. By doing this you will allow your application to run on as many server nodes as needed at the same time.

What are the common traps you should avoid to keep the model stateless? Do not store any object on the Java heap for multiple requests

When you want to keep data across multiple requests you have several choices:

  1. If data is small and simple enough, store it into the flash or the session scope. However these scopes are limited to about 4 KB each, and allow only String data.
  2. Save the data permanently into persistent storage (like a database). For example if you need to create an object with a “wizard” that spans multiple requests:
    • Initialize and persist the object into the database at the first request.
    • Save the newly-created object’s ID into the flash scope.
    • During successive requests, retrieve the object from the database using the object ID, update it, and save it again.
  3. Save the data temporarily into a transient storage (such as the Cache). For example if you need to create an object with a “wizard” that spans multiple requests:
    • Initialize the object and save it into the Cache at the first request.
    • Save the newly-created object’s key into the flash scope
    • During successive requests, retrieve the object from the cache (with the correct key), update it, and save it into the cache again.
    • At the end of the last request in the chain, save the object permanently (into the database for example)

The Cache is not a reliable storage but if you put an object in the cache you should be able to retrieve it. Depending on your requirements, the Cache can be a very good choice and a good replacement for the Java Servlet session.

http://www.playframework.org/documentation/1.2.4/model

Great presentations @ Parleys.com



AspectJ vs Javassist

AspectJ:

Advantages:
  • Very powerful, can do nearly anything you might need
  • Powerful pointcut expressions for defining where to inject an advice and when to activate it (including some run-time checks) – fully enables DRY, i.e. write once & inject many times
  • Both build-time and load-time code injection (weaving)
Disadvantages:
  • The modified code depends on the AspectJ runtime library
  • The pointcut expressions are very powerful but it might be difficult to get them right and there isn’t much support for “debugging” them though the AJDT plugin is partially able to visualize their effects
  • It will likely take some time to get started though the basic usage is pretty simple (using @Aspect, @Around, and a simple pointcut expression, as we will see in the example)

Javassist:

Advantages:
  • No run-time dependencies if build-time weaving used (load-time weaving requires the GluonJ agent library or gluonj.jar)
  • Simple Java syntax using GlutonJ’s annotation – though the custom syntax is also trivial to understand and easy to use
  • Easy, automatic weaving into the target classes with GlutonJ’s JAR tool, an Ant task or dynamically at the load-time
  • Support for both build-time and load-time weaving
Disadvantages:
  • An aspect can modify only a single class, you cannot inject the same piece of code to multiple classes/methods
  • Limited power – only provides for field/method addition and execution of a code instead of/around a target method, either upon any of its executions or only if the execution happens in a particular context, i.e. when called from a particular class/method



Sunday, January 1, 2012

CoffeeScript vs Google Dart



Learn Javascript



  • The best way to learn (and debug) Coffeescript

  • Dart is similar enough to JS but far less common. You will come across more JS than Dart.

  • To understand why CoffeeScript exists, and how Dart differs.

Use Coffeescript



  • CoffeeScript is out there in projects already, so there's community and experience.

  • CoffeeScript might come up at work sooner than Dart (esp. with Rails).

  • CoffeeScript is nice!

Check out Dart


If you understand Javascript, and use CoffeeScript, and have checked out Dart, you'll be in a good position to judge which hammer is best for the task. Most JS/CS knowledge should be transferrable to Dart, the other way around would be more difficult.




[But why the JavaScript generated by Dart is so HUGE ???] - Use Frog compiler instead of DartC to compile/generate smaller JavaScript.



While Dart is pretty neat and backed by Google, it has not be absorbed into the web-applications development community like coffeescript has (coffeescript is the suggested front-end development language of the Rails core team and the preferred front-end language of the ruby community). Coffeescript also has wider support tools and, in my personal opinion, more readability. However, if that does not have you convinced then you can take a look at this ‘Hello World’ program written in Coffeescript and compiled to Javascript then Dart compiled to Javascript (taken from this gist).


Long story short, Dart supposedly offers enhanced security in your front-end (hence all the added junk?) and is more catered to large-scale projects but I won’t be reaching for Dart in the near future. The language syntax is cool and liken to Java but all the useless generated code really makes it hard for me to understand what is going on under the hood. Why use 17K lines of code when 11 will do?


http://blog.brandonmathis.me/blog/2011/10/11/dart-or-coffee/

Google Dart vs Javascript

The fundamental problem with HTML5 is JavaScript, which is not an ideal language for enterprise application development.

Google recognises this issue. An internal email from Nov 2010 that outlines their strategy for ‘Dart’, says:

“Complex web apps–the kind that Google specializes in–are struggling against the platform and working with a language that cannot be tooled and has inherent performance problems”

In the past Google has used Java to JavaScript compilation (GWT) and annotated-JavaScript to JavaScript compilation (Closure) to overcome these problems. In my previous blogpost I speculated that Microsoft could use a similar approach, offering a C# / VB.NET to JavaScript compiler, allowing HTML5 developers to use the full power of Visual Studio. However, with Dart Google are looking to go one step further:

“The goal of the Dash effort is ultimately to replace JavaScript as the lingua franca of web development on the open web platform.”

That’s quite an ambituous goal!


http://www.scottlogic.co.uk/blog/colin/2011/09/dart-will-google-make-html5-applications-viable/

http://www.dartlang.org/



Best Paper Awards in Computer Science