tag:blogger.com,1999:blog-56795512891696540282024-03-05T06:50:31.537-08:00Open Source BlogUnknownnoreply@blogger.comBlogger34125tag:blogger.com,1999:blog-5679551289169654028.post-24503965891425582332014-06-27T18:46:00.000-07:002014-06-27T19:57:36.274-07:00What's a better way of encoding data if you don't want to use JSON, or XML . <div>
<br clear="none" data-mce-style="margin-bottom: 0in; line-height: 100%;" style="line-height: 100%; margin-bottom: 0in;" />
<h3>
<b>What is Protocol Buffers? </b></h3>
</div>
<div>
Short answer: It's a way to serialize unstructured data. </div>
<div>
<h3>
</h3>
</div>
<div>
<h3>
<b>Benefits:</b></h3>
</div>
<div>
- Smaller</div>
<div>
- 20-100 x faster</div>
<div>
- Easier </div>
<div>
- 3-10 x smaller then xml</div>
<div>
- Generates code for you</div>
<div>
- You don't have to handwrite your own parsing code</div>
<div>
<br clear="none" /></div>
<div>
You
define (.proto file) the structure of your data then there is code
generated to read and write to data streams. Protocol buffer was developed at Google to help with their index server. Some developers even use protobuf
for storing data persistently for example BigTable. Some developers even
use it for RPC (<b> Remote Procedure Call</b> ) systems. See overview for more on this:<br />
<br />
<a href="https://developers.google.com/protocol-buffers/docs/overview">https://developers.google.com/protocol-buffers/docs/overview</a><br />
<br /></div>
<div>
<br clear="none" /></div>
<div>
Here is an example of a <b>.proto</b> file:</div>
<div>
<br clear="none" /></div>
<div>
package tutorial;</div>
<div>
</div>
<div>
</div>
<div>
option java_package = "com.learning.protobuf"</div>
<div>
option java_outer_classname = "SomeOuterClassIMadeUp"</div>
<div>
</div>
<div>
message <b>MyTopSecretMsg</b> {</div>
<div>
required String info = 1 ;</div>
<div>
. . .</div>
<div>
}</div>
<div>
<br clear="none" /></div>
<div>
<b>Note:</b> The '<b>required</b>' keyword could be replaced by '<b>optional</b>'.</div>
<div>
See protobuf language guide for more details on how to define your <b>.proto</b> files:</div>
<div>
<br clear="none" /></div>
<div>
<a data-mce-href="https://developers.google.com/protocol-buffers/docs/proto" href="https://developers.google.com/protocol-buffers/docs/proto" shape="rect" target="_blank">https://developers.google.com/protocol-buffers/docs/proto</a></div>
<div>
<br clear="none" /></div>
<div>
When you define your<b> .proto</b> file then you can compile it.</div>
<div>
<h3>
</h3>
</div>
<h3 data-mce-style="margin-bottom: 0in; line-height: 100%;" style="line-height: 100%; margin-bottom: 0in;">
<b>What is it used for?</b></h3>
<div data-mce-style="margin-bottom: 0in; line-height: 100%;" style="line-height: 100%; margin-bottom: 0in;">
Used as a communication protocol etc. </div>
<div data-mce-style="margin-bottom: 0in; line-height: 100%;" style="line-height: 100%; margin-bottom: 0in;">
<br /></div>
<h3 data-mce-style="margin-bottom: 0in; line-height: 100%;" style="line-height: 100%; margin-bottom: 0in;">
<b>How do I install it?</b></h3>
<div data-mce-style="margin-bottom: 0in; line-height: 100%;" style="line-height: 100%; margin-bottom: 0in;">
<b></b>Download it from Google @ <a href="http://code.google.com/p/protobuf/downloads/list">http://code.google.com/p/protobuf/downloads/list</a></div>
<div data-mce-style="margin-bottom: 0in; line-height: 100%;" style="line-height: 100%; margin-bottom: 0in;">
</div>
<div data-mce-style="margin-bottom: 0in; line-height: 100%;" style="line-height: 100%; margin-bottom: 0in;">
<span style="background-color: #ffd966;"> </span></div>
<div data-mce-style="margin-bottom: 0in; line-height: 100%;" style="line-height: 100%; margin-bottom: 0in;">
<span style="background-color: #ffd966;"> $ tar -zxvf protoc**.tar.gz ; </span></div>
<div data-mce-style="margin-bottom: 0in; line-height: 100%;" style="line-height: 100%; margin-bottom: 0in;">
<span style="background-color: #ffd966;"> $ configure; </span></div>
<div data-mce-style="margin-bottom: 0in; line-height: 100%;" style="line-height: 100%; margin-bottom: 0in;">
<span style="background-color: #ffd966;"> $ make ; </span></div>
<div data-mce-style="margin-bottom: 0in; line-height: 100%;" style="line-height: 100%; margin-bottom: 0in;">
<span style="background-color: #ffd966;"> $ make install ; </span></div>
<div data-mce-style="margin-bottom: 0in; line-height: 100%;" style="line-height: 100%; margin-bottom: 0in;">
<span style="background-color: #ffd966;"> </span></div>
<div data-mce-style="margin-bottom: 0in; line-height: 100%;" style="line-height: 100%; margin-bottom: 0in;">
<br data-mce-bogus="1" /></div>
<div data-mce-style="margin-bottom: 0in; line-height: 100%;" style="line-height: 100%; margin-bottom: 0in;">
<br data-mce-bogus="1" /></div>
<h3 data-mce-style="margin-bottom: 0in; line-height: 100%;" style="line-height: 100%; margin-bottom: 0in;">
How do I compile the <b>.proto</b> file ?</h3>
<div data-mce-style="margin-bottom: 0in; line-height: 100%;" style="line-height: 100%; margin-bottom: 0in;">
<br data-mce-bogus="1" /></div>
<pre>protoc -I=$PWD --java_out=$PLACE_TO_PUT_THE_GENERATED_CODE addressbook.proto</pre>
<div data-mce-style="margin-bottom: 0in; line-height: 100%;" style="line-height: 100%; margin-bottom: 0in;">
<br data-mce-bogus="1" /></div>
<div data-mce-style="margin-bottom: 0in; line-height: 100%;" style="line-height: 100%; margin-bottom: 0in;">
NOTE: $PWD means this present working directory</div>
<div data-mce-style="margin-bottom: 0in; line-height: 100%;" style="line-height: 100%; margin-bottom: 0in;">
<br data-mce-bogus="1" /></div>
<div data-mce-style="margin-bottom: 0in; line-height: 100%;" style="line-height: 100%; margin-bottom: 0in;">
<br data-mce-bogus="1" /></div>
<div data-mce-style="margin-bottom: 0in; line-height: 100%;" style="line-height: 100%; margin-bottom: 0in;">
<br data-mce-bogus="1" /></div>
<div data-mce-style="margin-bottom: 0in; line-height: 100%;" style="line-height: 100%; margin-bottom: 0in;">
<br /></div>
<div data-mce-style="margin-bottom: 0in; line-height: 100%;" style="line-height: 100%; margin-bottom: 0in;">
<br clear="none" /></div>
<div>
<br clear="none" /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5679551289169654028.post-51719620426540262222014-03-17T12:39:00.003-07:002014-08-06T21:23:50.960-07:00Release 0.7<br />
<br />
This week I am working on hawtio.<br />
<br />
<a href="https://github.com/hawtio/hawtio">https://github.com/hawtio/hawtio</a><br />
<br />
I am currently working on implementing a feature that function similar to how google drag and drop works.<br />
The user will be able to drag a file from their desktop and drop it on the page to upload files to a JMS messaging system called Apache ActiveMQ.<br />
<br />
<h4>
Plans for my next release:</h4>
<br />
To implementing a drag and drop feature which will leverage open standards <a href="http://www.w3.org/TR/FileAPI/">FileAPI</a> to uploading files to an Apache ActiveMQ JMS Queue.<br />
<br />
I've completed the UI portion and I will release another update soon.<br />
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5679551289169654028.post-10715099763350146882014-02-10T21:07:00.001-08:002014-02-10T21:19:21.444-08:00Open Source Clustering: Introduction to Apache Zookeeper <br />
<pre> _______ _______ _______ _______ __ __ _______
| _ || || _ || || | | || |
| |_| || _ || |_| || || |_| || ___|
| || |_| || || || || |___
| || ___|| || _|| || ___|
| _ || | | _ || |_ | _ || |___
|__| |__||___| |__| |__||_______||__| |__||_______|
________ ______ ______ __ ___ _______ _______ _______ _______ _______
(" "\ / " \ / " \ |/"| / ")/" "| /" "| | __ "\ /" "| /" \
\___/ :)// ____ \ // ____ \ (: |/ /(: ______)(: ______) (. |__) :)(: ______)|: |
/ ___// / ) :)/ / ) :)| __/ \/ | \/ | |: ____/ \/ | |_____/ )
// \__(: (____/ //(: (____/ // (// _ \ // ___)_ // ___)_ (| / // ___)_ // /
(: / "\\ / \ / |: | \ \(: "|(: "| /|__/ \ (: "||: __ \
\_______)\"_____/ \"_____/ (__| \__)\_______) \_______)(_______) \_______)|__| \___)
<pre> <span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">
</span><ul><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"> </span></ul>
</pre>
</pre>
<h2>
<span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">Introduction:</span></h2>
<span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">Apache Zookeeper was made for distributed systems and came from the open source community. The defacto standard when developing clusters in production. In a big data environment that uses Apache Hadoop you will definitely find Apache Zookeeper. </span><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">Zookeeper can be embedded in Java and C. When you want to architect a distributed applications or multiple servers across an LAN or WAN network then Zookeeper is a good choose. Clients connect to Zookeeper server via TCP protocol. Once you get a connection you can do things like: send requests, get requests, get watch events, and send heartbeats. </span><br />
<span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"></span><br />
<span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">If the connection drops then the client will connect to the next server. If you only run one zookeeper instance then your using singleton which can't do replication and if it crashs your stuck. One good feature of Zookeeper is that it sets the order by time stamping updates so if you make a series of sequential requests you can expect it to arrive and get processed in that order.</span><br />
<span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"><br /></span>
<br />
<span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">Note: The term "znodes" refers to a data node.
Uses a shared hierarchical name space which contains znodes.</span><br />
<br />
<br />
<u><b>ZNode Types:</b></u><br />
<br />
<ol>
<li><i>Persistent Nodes</i>: is there until its deleted</li>
<li><i>Ephemeral Nodes:</i> is there as long as the session is active. Can't have children</li>
<li><i>Sequence Nodes: </i> (Unique naming) applies both persistent and ephemeral nodes </li>
</ol>
<br />
<u><b>Znode Operation Types:</b></u><br />
<ul>
<li><i>Write</i>: Create, Delete, setData, setACL</li>
<li><i>Read</i>: Exists, getChildren, getData, getACL, sync</li>
</ul>
<u><b>ZNode Watchs:</b></u><br />
<ol>
<li>NodeChildrenChanged</li>
<li>NodeCreated</li>
<li>NodeDataChanged </li>
<li>NodeDeleted</li>
</ol>
When you want to trigger something to happen when a znode changes then we set watches which are time triggers. Watches are ordered. <br />
<br />
<b>Tips to developers: </b><br />
<br />
Since Zookeeper uses inmemory and it writes logs sequentially then you should set it up in its own server (box) because then it doesn't have to fight for resources. It is also recommended that you set the java heap to a reasonable size. Its also recommended that the amount you set on the heap isn't larger then the amount of memory available. To set it to 1gb to 2gb type:<br />
<br />
JAVA_OPTS="-Xms1g -Xmx2g"<br />
<br />
<br />
<u><b>Clustering: </b></u><br />
<br />
For Zookeeper to remain active in a cluster you need atleast 3 znodes (alive). <br />
<br />
Good rule of thumb is to use odd number of servers. Remember this formula:<br />
<br />
n-1 / 2<br />
<br />
<br />
<u><b><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">Benefits:</span></b></u><br />
<ul>
<li><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">Coordination Service</span></li>
<li><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">Synchronization</span></li>
<li><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">Configuration Management</span></li>
<li><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">Grouping</span></li>
<li><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">Naming</span></li>
<li><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">High availability</span></li>
<li><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">Favors consistency over everything else</span></li>
<li><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">Order is preserved </span></li>
</ul>
<br />
<span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">Znodes are like files and directories. You can think of the shared hierarchical namespace like a linux file system. Top level always starts at root but that root directory can have directories and files. Znodes can also have data associated with it such as coordination data (status, configuration, location, etc.) . Between a byte to kilobytes approximately in size.</span><br />
<br />
<u><b><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">Common misconception:</span></b></u><br />
<span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"><br /></span>
<span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">You should not use Zookeeper as a data store it was not meant for that.</span><br />
<span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"> </span><br />
<u><b><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">What's an Emsemble?</span></b></u><br />
<br />
<span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">These are multiple Zookeeper replicated over multiple hosts. </span><br />
<br />
<u><b><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">Performance:</span></b></u><br />
<br />
<span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">Apache Zookeeper stores its data inmemory so you can expect high throughput and low latency. Apache Zookeeper is faster on reads then on writes at a ratio of 10:1 . The reason why reads are faster is because read requests are processed locally at the Zookeeper server which the client is currently connected to. Write are forwarded to the leader and goes through majority consensus before the response is generated.</span><br />
<br />
<span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">Remember: If the connection drops then the client will connect to the next server. </span><br />
<span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"><br /><u><b>Consistency Guarantee:</b></u></span><br />
<ol>
<li><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"><i>Sequential</i> <i>Consistency</i>: Ordered</span></li>
<li><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"><i>Atomicity</i>: All or nothing</span></li>
<li><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"><i>Single System Image</i>: all clients see the same thing</span></li>
<li><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"><i>Reliability</i>: data is persisted once applied</span></li>
<li><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"><i>Timeliness</i>: up to date</span></li>
</ol>
<span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"></span><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"></span><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"><br /></span>
<u><b>Problems solved by Apache Zookeeper:</b></u><br />
<ul>
<li><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">Outages (if your doing replication your safe)</span></li>
<li><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">Coordination challenges</span></li>
<li><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">Operation Complexity. Have humans manually updating stuff on every server... Imagine 100,000 servers.. </span></li>
<li><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">Data changing</span></li>
</ul>
<br />
<u><b><span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">What happens when I set up replication and the leader dies?</span></b></u><br />
<br />
<span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">Zookeeper may be down for a second but if you configured it right then it goes through a voting algorithm to elect a new leader. </span><br />
<span style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"></span><br />
<u><b>Other usages of Apache Zookeeper out in the wild:</b></u><br />
<ul>
<li>Distributed Locking: (safe) You can implement barriers and latches</li>
<li>Discover Service: You can use DNS but Apache Zookeeper is much easier </li>
<li>Configuration: I think that dynamic configuration is a bit risky</li>
<li>Apache Hadoop: Uses it for service management </li>
</ul>
<br />
<br />
Drop some feedback in the comments below!<br />
:><br />
<br />
<br />
Thanks,<br />
Zak <br />
<a href="https://twitter.com/Prospect1010">Twitter: @Prospect1010</a><br />
Linked: <a href="http://www.linkedin.com/in/zakeriahassan">http://www.linkedin.com/in/zakeriahassan</a><br />
Github:<a href="https://github.com/zmhassan"> https://github.com/zmhassan</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5679551289169654028.post-60121863144261321902014-02-08T20:28:00.000-08:002014-02-10T19:54:22.830-08:00Apache Karaf - Open source OSGi Container - Part 1<br />
<h2>
Introduction to Apache Karaf - Open Source OSGi Container </h2>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDDQ2EaACypPdoApfDKWs73Exk5kyIo6bTuzf6PpTv6OsaMeE07Dae6rX2qRTQdUAaHaGEni5f0jQWLAc68qYcacGQ93DfJT2pM_e1GZvqw5JrhkzoJAsIglXbnkWvXqNUU0Z3XCUqkzw/s1600/Karaf.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDDQ2EaACypPdoApfDKWs73Exk5kyIo6bTuzf6PpTv6OsaMeE07Dae6rX2qRTQdUAaHaGEni5f0jQWLAc68qYcacGQ93DfJT2pM_e1GZvqw5JrhkzoJAsIglXbnkWvXqNUU0Z3XCUqkzw/s1600/Karaf.png" height="234" width="640" /></a></div>
<br />
<h3>
<u><b>Introduction:</b></u> </h3>
OSGi is not as complicated as it sounds. If you've used eclipse then chances are that you used an OSGi application without even knowing it. OSGi lets you break up your application into bundles that can be reused across applications and lets you manage cross dependency. Eclipse uses Equinox as its OSGi framework. OSGi is also a part of SOA although many people think SOA is all about web services. Without restarting developers can set the state of a bundle to:<br />
<ul>
<li><a href="http://www.osgi.org/javadoc/r4v43/core/org/osgi/framework/Bundle.html#UNINSTALLED"><code>UNINSTALLED</code></a>
</li>
<li><a href="http://www.osgi.org/javadoc/r4v43/core/org/osgi/framework/Bundle.html#INSTALLED"><code>INSTALLED</code></a>
</li>
<li><a href="http://www.osgi.org/javadoc/r4v43/core/org/osgi/framework/Bundle.html#RESOLVED"><code>RESOLVED</code></a>
</li>
<li><a href="http://www.osgi.org/javadoc/r4v43/core/org/osgi/framework/Bundle.html#STARTING"><code>STARTING</code></a>
</li>
<li><a href="http://www.osgi.org/javadoc/r4v43/core/org/osgi/framework/Bundle.html#STOPPING"><code>STOPPING</code></a>
</li>
<li><a href="http://www.osgi.org/javadoc/r4v43/core/org/osgi/framework/Bundle.html#ACTIVE"><code>ACTIVE</code></a>
</li>
</ul>
It lets you run multiple versions of the bundle in the same container. It lets you manage the life cycle of an application.<br />
<br />
<h3>
<u><b>What is Apache Karaf? </b></u></h3>
<ul>
<li>OSGi-based runtime </li>
<li>Light weight container but can scale</li>
<li>Multiples applications can be deployed on</li>
<li>Uses Apache Felix OSGi Framework by default or you can set it to use Eclipse Equinox OSGi framework </li>
</ul>
<h3>
<u><b>Features:</b></u></h3>
<ul>
<li>Hot deployment</li>
<li>Complete Console</li>
<li>Dynamic Configuration</li>
<li>Advanced Logging System</li>
<li>Provisioning</li>
<li>Management</li>
<li>Remote Access</li>
</ul>
<br />
<b>Warning</b>: If you install a bundle then exit Apache Karaf will remember.<br />
<br />
<h3>
<u><b>Why use OSGi?</b></u></h3>
<ul>
<li>Easy reuse between applications</li>
<li>Solves dependency management problem in J2EE Web applications (WAR/EAR) when multiple applications that use the same third party jars with different version may cause a mess.</li>
<li>It encourages and enforces modular design, provides a version, enables dynamic module updates.</li>
</ul>
<br />
<br />
<ul>
</ul>
<br />
<ul>
</ul>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5679551289169654028.post-33424189446818557882014-02-07T07:32:00.001-08:002014-04-29T15:42:54.568-07:00Remedy to Java.out.Memory when browsing ActiveMQ JMS Queue that exceed 200,000 messages<b>Remedy to Java.out.Memory when browsing ActiveMQ JMS Queue that exceed 200,000 messages</b><br />
<br />
<br />
<br />
<h3>
Diagnosis:</h3>
<br />
After attempting to debug this issue I quickly found out that there was too much data getting sent to the client (browser). I looked at alternatives like changing the design and then I looked at reusing existing capabilities of the web console. I found out that the web console had an RSS feed that we could leverage if we can get a section (start position and end position) to paginate through the JMS messages in queue. It will be sequential so it may get slow as you go deeper.<br />
<br />
<br />
<a href="http://localhost:8161/admin/queueBrowse/TEST?view=rss&feedType=atom_1.0&start=0&end=2">http://localhost:8161/admin/queueBrowse/TEST?view=rss&feedType=atom_1.0&start=0&end=2</a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPPKl8DzjktJrIIC010Otpl90MS-1QDwtaW37DZNsUKd3P7ex7VdhMiO0mpVZF8122e-qdLXf7M5UW1amMsX6BA_nrNP2jR5qjgU91VvXAA3x7lE9SQtVqWozdDXqTKGuUOct7cFoF-Us/s1600/Screenshot+from+2014-02-07+10%253A15%253A46.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPPKl8DzjktJrIIC010Otpl90MS-1QDwtaW37DZNsUKd3P7ex7VdhMiO0mpVZF8122e-qdLXf7M5UW1amMsX6BA_nrNP2jR5qjgU91VvXAA3x7lE9SQtVqWozdDXqTKGuUOct7cFoF-Us/s1600/Screenshot+from+2014-02-07+10%253A15%253A46.png" height="420" width="640" /></a></div>
<br />
<br />
<br />
<br />
<h3>
Problem:</h3>
<div>
Our data can grow and if we want to paginate through it or if we have other applications that would like to reuse some of the consoles functionality they may experience problems such as:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsh1G2WfRW9k1JAsWolhJ8utM116RPm_Fqn1HTXztPz4jihL_TkerCea95cT8LgiKVlKLTbhQdFFder80HtJp2U_rwRguBM9eg4WMuDNFOPAqOtnbimVWBMODjGwbYUCJjmrNlXRhtucE/s1600/Screenshot+from+2014-02-07+10:08:28.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsh1G2WfRW9k1JAsWolhJ8utM116RPm_Fqn1HTXztPz4jihL_TkerCea95cT8LgiKVlKLTbhQdFFder80HtJp2U_rwRguBM9eg4WMuDNFOPAqOtnbimVWBMODjGwbYUCJjmrNlXRhtucE/s1600/Screenshot+from+2014-02-07+10:08:28.png" height="544" width="640" /></a></div>
<br />
<br />
<br />
There where other problems that the community resolved but the main problem was that we where sending too much data to the UI. I have experience working with search engines and we had issues like this when our database grow too large. As a result I teamed up with Arthur Naseef to get this quickly and efficiently resolved.<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2Yyanbkm087hyphenhyphenXC4YRxEDvMhIvi9VEyjHiTBWnfefSzvVyBugOLb9jCxDZwCZx_0ELqLXIXXhM2kJ5jqQqXl-tx6fOy1fHU3ErNC8PqOrPNqXdPZ5f2DKNzLcG_VmfJKunwuKpvkxDg8/s1600/Screenshot+from+2014-02-07+10:10:04.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2Yyanbkm087hyphenhyphenXC4YRxEDvMhIvi9VEyjHiTBWnfefSzvVyBugOLb9jCxDZwCZx_0ELqLXIXXhM2kJ5jqQqXl-tx6fOy1fHU3ErNC8PqOrPNqXdPZ5f2DKNzLcG_VmfJKunwuKpvkxDg8/s1600/Screenshot+from+2014-02-07+10:10:04.png" height="368" width="640" /></a></div>
<br />
<br />
<br />
<br />
<br />
<b><u>Solution:</u></b><br />
Note: Since the deeper we go into the queue the longer it takes. I've added a progress bar to help our users know something is happening:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUanYrn8qc8CjFcXR5t6SCVa0O_ZB9GFcNY8wY9zacDjc7iqzhrqfK4QqeIgcieqEzQXPVub7QAk2Bx2O-7Ub0vKcjc8ETve6PMcYLAQc-P25GvVY4aZcQiDZ7By2chebkMvBuEW93grQ/s1600/Screenshot+from+2014-02-07+10%253A03%253A52.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUanYrn8qc8CjFcXR5t6SCVa0O_ZB9GFcNY8wY9zacDjc7iqzhrqfK4QqeIgcieqEzQXPVub7QAk2Bx2O-7Ub0vKcjc8ETve6PMcYLAQc-P25GvVY4aZcQiDZ7By2chebkMvBuEW93grQ/s1600/Screenshot+from+2014-02-07+10%253A03%253A52.png" height="304" width="640" /></a></div>
<br />
<br />
This is how the results look when we get back the messages.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuubMbPfEfg-mmBRpRdP-l6xGnwepUGcmdTx6Ub00c4j_H_cH1XfqV-HjIMyHbJElFft0RYfQsWetnG1pCLmedwwARvgmEp04VpcoCVPfe5Hs8Plj4Hz2aGieUuHIDLH8km42k8183oqI/s1600/Screenshot+from+2014-02-07+10:04:07.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuubMbPfEfg-mmBRpRdP-l6xGnwepUGcmdTx6Ub00c4j_H_cH1XfqV-HjIMyHbJElFft0RYfQsWetnG1pCLmedwwARvgmEp04VpcoCVPfe5Hs8Plj4Hz2aGieUuHIDLH8km42k8183oqI/s1600/Screenshot+from+2014-02-07+10:04:07.png" height="390" width="640" /></a></div>
<br />
<br />
<br />
<br />
<br />
Conclusion:<br />
<br />
I think this will open the doors to new possibilities for our web console. We have a great community driving these efforts. You can expect to see more innovation coming soon.<br />
<br />
If you are interested in test driving this new functionality then you can clone my repository:<br />
<br />
<a href="https://github.com/zmhassan/activemq.git">https://github.com/zmhassan/activemq.git</a><br />
<br />
<b>Note:</b> This new UI will live in "<b>pretty-UI</b>" branch.<br />
<br />
<br />
This design may appear in later releases but I'm currently in discussion with the community whether this is the direction we want to go.<br />
<br />
<br />
I will put in a pull request tonight with just the basic pagination and I'm going to only include the code that is required to patch this issue only. The extra UI design will have to wait.<br />
<br />
Jira Issue:<br />
<a href="https://issues.apache.org/jira/browse/AMQ-5024">https://issues.apache.org/jira/browse/AMQ-5024</a><br />
<br />
Pull Request:<br />
<a class="external-link" href="https://github.com/apache/activemq/pull/16" rel="nofollow" style="background-color: #e0f0ff; color: #3b73af; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; text-decoration: none;">https://github.com/apache/activemq/pull/16</a><br />
<br />
<br />
Thanks,<br />
Zak<br />
@Prospect1010<br />
Software Developer | Research Assistant,<br />
Center of Open Technology - Research Department, <br />
Seneca College, Toronto, Ontario</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5679551289169654028.post-57004757306737147592014-02-01T20:21:00.002-08:002014-02-15T16:44:38.207-08:00Experiment: ActiveMQ 4 Node.JS<br />
<br />
<br />
<br />
<br />
<h3>
<ol>
<li>What is ActiveMQ?</li>
<li>Can we integrate ActiveMQ with Node.JS ?</li>
<li>Implementation:</li>
</ol>
</h3>
<br />
<br />
<br />
<h3>
Introduction?</h3>
<br />
<br />
<h4>
Java Messaging Services.</h4>
<ul>
<li>Used for sending messages from application to application</li>
<li>Used for enterprise messaging which is referred to as MOM ( Message Oriented Middleware )</li>
<li>Messages contain business data and are routed through networks using protocols. There are many vendors that have their own implementations which follow this standard. Such as IBM WebSphere MQ, ActiveMQ, etc.</li>
<li>ActiveMQ is open source and a powerful messaging system used across the enterprise.</li>
</ul>
<div>
<br /></div>
<br />
<h3>
Can We Integrate ActiveMQ With Node.JS ?</h3>
<br />
<ul>
<li>It is possible to integrate it but you would have to write some code to do that.</li>
<li>Luckily I just thought about starting this project after watching this TED talk by Tim Berners-Lee on openness of the web and access to data. </li>
<li>I will be following and implementing open standards also the code will be open source.</li>
<li>ActiveMQ has support for the following protocols: ['TCP','UDP','WS','MQTT','STOMP', ....]</li>
</ul>
<div>
<br /></div>
<div>
<br /></div>
<br />
<h3>
Implementation:</h3>
<br />
I will be working on this project at <a href="https://github.com/zmhassan/activemq-node.js">https://github.com/zmhassan/activemq-node.js</a> and if anyone is interested feel free to join in on the fun programming.<br />
<br />
As you can see I got build errors. I'm using a continuous integration system to test quality of the code and do it continuously. I believe in writing clean code.<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlVdeWCdsUKLShSZLVAwaNanko61D7ZCAGxDm3cKo87L6BI7e-mBOEJyzOYSDmxKmxzBiC-8hleLZBzPJRQpkM2OMeefQ2WHUbsQ8BJOz4H0SieFQbDpm0sDJ0ykN02-vdXp0imgoOBwQ/s1600/Screenshot+from+2014-02-01+22:57:27.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlVdeWCdsUKLShSZLVAwaNanko61D7ZCAGxDm3cKo87L6BI7e-mBOEJyzOYSDmxKmxzBiC-8hleLZBzPJRQpkM2OMeefQ2WHUbsQ8BJOz4H0SieFQbDpm0sDJ0ykN02-vdXp0imgoOBwQ/s1600/Screenshot+from+2014-02-01+22:57:27.png" height="380" width="640" /></a></div>
<br />
<br />
<br />
I made a proposal to the Apache ActiveMQ community to replace the existing web console with a light-weight Node.JS web console.<br />
<br />
This will allow the following to be possible:<br />
<ul>
<li>Web sockets</li>
<li>Push notification</li>
<li>Async </li>
<li>Responsive</li>
<li>Lightweight </li>
</ul>
Note: This will run standalone and communicate to ActiveMQ via the following protocols: stomp, tcp, mqtt, etc.<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9Zmp-7AIz4LBOZOeUBFatC8qnsTkcrxJzMsWYgWpkmxJiYTeV8HAu0hort263myiaHQ7gG7xwjlWOMLTXDc_9RmxZC7adAVfIUwTKHl3y42A6-RmW66Dt4vgEfY9rmt3AvwFCLy7U0pk/s1600/IMG_20140203_001805.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9Zmp-7AIz4LBOZOeUBFatC8qnsTkcrxJzMsWYgWpkmxJiYTeV8HAu0hort263myiaHQ7gG7xwjlWOMLTXDc_9RmxZC7adAVfIUwTKHl3y42A6-RmW66Dt4vgEfY9rmt3AvwFCLy7U0pk/s1600/IMG_20140203_001805.jpg" height="480" width="640" /></a></div>
<br />
<br />
Here is a link to the email thread on discussions between me and the Apache ActiveMQ community:<br />
<br />
<a href="http://activemq.2283324.n4.nabble.com/Node-JS-Client-Library-for-Accessing-Apache-ActiveMQ-td4677269.html#a4677293">http://activemq.2283324.n4.nabble.com/Node-JS-Client-Library-for-Accessing-Apache-ActiveMQ-td4677269.html#a4677293</a><br />
<br />
<br />
<br />
Thanks,<br />
Zak<br />
@Prospect1010<br />
Software Developer | Research Assistant , Seneca College<br />
Toronto, ON<br />
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5679551289169654028.post-58902780292019031202014-01-27T11:54:00.005-08:002014-01-27T11:57:10.144-08:00Release 0.5<h3>
</h3>
<h3>
Introduction:</h3>
<br />
During my first release of OSD700 I learned the following:<br />
<ul>
<li>Jasmine.js Testing Framework</li>
<li>Grunt</li>
<li>Travis Continuous Integration</li>
</ul>
<div>
<br />
<br /></div>
<div>
In particular the bug I was exposed to involved fixing jshint validation errors caught by Grunt-CLI.<br />
<br />
<br />
Discovering bugs in Filer on Fedora 18 Chrome and found that the tests failed on Chrome however passed on Firefox.</div>
<div>
<br />
Chrome Failed Tests:</div>
<div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7uZ1fL3TQwnorJ77Cmc-mQWIwYROv5sDNAexoKMAH3_h6yulRE4Q5hzQObu-LRZWmhXffhdHn26N1E8NgcYhCPd7c1X1n5Cd54SSgPRYpHpN3mYpyv-WO7spiCeiQ6ZBLe6H4DNMP6js/s1600/Screenshot+from+2014-01-27+10:22:22.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7uZ1fL3TQwnorJ77Cmc-mQWIwYROv5sDNAexoKMAH3_h6yulRE4Q5hzQObu-LRZWmhXffhdHn26N1E8NgcYhCPd7c1X1n5Cd54SSgPRYpHpN3mYpyv-WO7spiCeiQ6ZBLe6H4DNMP6js/s1600/Screenshot+from+2014-01-27+10:22:22.png" height="400" width="640" /></a></div>
<br />
Firefox passed test:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOF_5A7YVvUz4bQzdoKGr5C6SI_rbAtIWIjE_-a-Vk5A7FWAcObIvIMK2q0JZ-ikqv74YXZ4zL_qPjujPhJQcAOkH_rRizEN-b5-UPkEPLR9xIjNQOQ_Zfn68T7wQkUnUtndMomAB4n-g/s1600/Screenshot+from+2014-01-27+11:10:40.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOF_5A7YVvUz4bQzdoKGr5C6SI_rbAtIWIjE_-a-Vk5A7FWAcObIvIMK2q0JZ-ikqv74YXZ4zL_qPjujPhJQcAOkH_rRizEN-b5-UPkEPLR9xIjNQOQ_Zfn68T7wQkUnUtndMomAB4n-g/s1600/Screenshot+from+2014-01-27+11:10:40.png" height="400" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h3>
What is Jasmine.JS?</h3>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Jasmine.js is a testing framework that applies the behavior-driven development principles. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
How do I write a Jasmine.JS Test?</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPaGnHvpK5UXjG3aqv68dTciyIUCGmNO4q2ov1UVYwJNrWeS_GNNqZNH6W0P9kwVdT4mSUgrUsL611p8ZLPI8DWdnLSrmViWxulz5qMHT-jQNdx-Mq4rHhilZHF7HVzwogOj4nS4hu0ss/s1600/Screenshot+from+2014-01-27+14:44:29.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="screen shot of code from: https://github.com/js-platform/filer/blob/develop/tests/spec/filer.spec.js" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPaGnHvpK5UXjG3aqv68dTciyIUCGmNO4q2ov1UVYwJNrWeS_GNNqZNH6W0P9kwVdT4mSUgrUsL611p8ZLPI8DWdnLSrmViWxulz5qMHT-jQNdx-Mq4rHhilZHF7HVzwogOj4nS4hu0ss/s1600/Screenshot+from+2014-01-27+14:44:29.png" height="200" title="screen shot of code from: https://github.com/js-platform/filer/blob/develop/tests/spec/filer.spec.js" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Screenshot of code from:<a href="https://github.com/js-platform/filer/blob/develop/tests/spec/filer.spec.js"> https://github.com/js-platform/filer/blob/develop/tests/spec/filer.spec.js</a></td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Note: The 'describe' function has nested 'it' functions. Each it function is an individual test.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<h3>
Pull Requests:</h3>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://github.com/js-platform/filer/pull/99">https://github.com/js-platform/filer/pull/99</a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<h3>
Conclusion</h3>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
I will be presenting during next class and have an interactive demo so we can code together. So everyone will know how to write jasmine test by end of class.<br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5679551289169654028.post-56150105161874891862014-01-10T21:56:00.002-08:002014-01-12T12:28:43.341-08:00Press Release: WhoTeachsWhat - Using JBoss AS 7 Application Server Hosted on OpenShift<br />
<br />
<h2>
Building JBoss AS7 Web Application On OpenShift ! </h2>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghSJUm8UpCr1h-bEdtmqxejFIxFdvtCjurp61cjvxTzdBszDR-_LG18L5DKAWenWAJYHGVa3IagROjBmZDV50wV4Jh5K3EDfwI7-mYmEvAE1NN0Kx8YFIj0Fh_tt7UWOVhqwsYIdaMnpc/s1600/WhoTeachsWhatPic2.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghSJUm8UpCr1h-bEdtmqxejFIxFdvtCjurp61cjvxTzdBszDR-_LG18L5DKAWenWAJYHGVa3IagROjBmZDV50wV4Jh5K3EDfwI7-mYmEvAE1NN0Kx8YFIj0Fh_tt7UWOVhqwsYIdaMnpc/s1600/WhoTeachsWhatPic2.png" height="348" width="640" /></a></div>
<br />
<br />
<h3>
Table Of Contents</h3>
<ul>
<li>Introduction</li>
<li>Gathering Requirements</li>
<li>Replacing Legacy System with JBoss AS 7</li>
<li>Project Design</li>
<li>Open Source Cloud Workflow</li>
<li>Our Team</li>
</ul>
<h3>
</h3>
<h3>
Introduction:</h3>
Seneca College CPA programming students don't just learn computer programming, we are able to build enterprise ready end to end systems. Part of the requirement for us to graduate is to finish a two part course (PRJ566 - Software Design /PRJ666 - Develop a system for a client to use). In the beginning of the course we were put into teams of 3 students and we had 2 choices.<br />
<ol>
<li><span style="background-color: #fff2cc;">Go out and find a client and build a system end to end. √ </span></li>
<li>Choose a fictional project or something the professor asks for. </li>
</ol>
We choose <b>option number 1</b> while others say it's too risky.<br />
<br />
Note: Although we are building a system for the client, we will be owning the intellectual property. The client can use WhoTeachsWhat web application to solve their business problem. Personally I don't really care much about intellectual property, in fact I'd prefer to commit code to open source.<br />
<h3>
Gathering Requirements: </h3>
Our client is the Chair of Seneca College and has a legacy system that uses an old Microsoft Access system. The Chair would like to plan faculty scheduling and would like a system to be able to find out more details about faculty before deciding on what course to assign the faculty member. This system will also be used by Seneca Coordinators to automate some work they need done. Our client would also like to administer this application and assign privileges to users. Report generation will be a feature of this system.<br />
<br />
<h3>
Replacing Legacy System with JBOSS AS 7 :</h3>
We will be replacing the legacy system with a JBoss AS 7 Web Application. I believe in building systems using open source technology that follows open standards.<br />
<br />
<br />
<span dir="ltr"><span style="color: black; font-family: Calibri,Arial,Helvetica,sans-serif; font-size: small;"><span style="font-size: 12pt;"><span style="font-size: x-small;"><span style="font-size: 10pt;">
“Empowerment of individuals is a key part of what makes open source
work, since in the end, innovations tend to come from small groups, not
from large, structured efforts.”</span></span><span style="font-size: x-small;"><span style="font-size: 10pt;"><br />
– Tim O’Reilly</span></span></span></span></span><br />
<br />
<br />
We are hosting our application using the latest open cloud technology Red Hat's OpenShift Public PaaS.<br />
<br />
It is located at this URL however it is still being developed so you won't have access yet to preview. Maybe next sprint we will showcase more of the UI.<br />
<br />
<br />
<a href="http://whoteachswhat-bzcareersearch.rhcloud.com/">http://whoteachswhat-bzcareersearch.rhcloud.com/</a><br />
<br />
<br />
<h3>
Project Design Considerations</h3>
<br />
We wanted to create a web application that would automate report generation and make managing faculty/courses simple. We want to solve our clients business problem and also provide a rich compelling UI. Here are some questions that are going to be addressed by this system:<br />
<br />
1) What courses has a professor taught?<br />
2) Are they eligible to teach this course?<br />
3) What is the faculty members status? (available, on vacation, part-time, full-time, on research) <br />
4) More.....<br />
<br />
This project is still in development and we will update you on the progress. But here is a preview of one of the reporting tool. <br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghz_0skGQgZxRiN1bqYrorrsvSMebRSr9E_l3DCbomp7mboy0pzeb1BL4nhh26bmc3B1j8pM-9yhIGAGB6B1Zup750jNR-LgifUtwniLBOrtkjOWlY9npllxbs2fbYqtipvFM0Obpu6NA/s1600/WhoTeachWhatPic1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghz_0skGQgZxRiN1bqYrorrsvSMebRSr9E_l3DCbomp7mboy0pzeb1BL4nhh26bmc3B1j8pM-9yhIGAGB6B1Zup750jNR-LgifUtwniLBOrtkjOWlY9npllxbs2fbYqtipvFM0Obpu6NA/s1600/WhoTeachWhatPic1.png" height="348" width="640" /></a></div>
<br />
<br />
<h3>
Open Source Cloud Workflow?</h3>
<br />
When we develop we prefer to work in a Linux environment and I setup the project on OpenShift Cloud PaaS.<br />
<br />
Here is a link with more details about OpenShift.<br />
https://www.openshift.com/<br />
<br />
<h3>
Our Team</h3>
<ol>
<li>Zakeria Hassan</li>
<li>SH Lee</li>
<li>Anil <span class="gI">Santokhi </span> </li>
</ol>
<br />
<br />
<span dir="ltr"><span style="color: black; font-family: Calibri,Arial,Helvetica,sans-serif; font-size: small;"><span style="font-size: 12pt;">Zak Hassan<br />
<span style="font-size: x-small;"><span style="font-size: 10pt;">Software Developer | Research Assistant , CDOT – Seneca College</span></span><span style="font-size: x-small;"><span style="font-size: 10pt;"><br />
</span></span><span style="font-size: x-small;"><span style="font-size: 10pt;">Twitter: <a href="https://twitter.com/Prospect1010">@Prospect1010</a></span></span></span></span></span><br />
<span dir="ltr"><span style="color: black; font-family: Calibri,Arial,Helvetica,sans-serif; font-size: small;"><span style="font-size: 12pt;"><span style="font-size: x-small;"><span style="font-size: 10pt;">Github: <a href="https://github.com/zmhassan">https://github.com/zmhassan</a></span></span></span></span></span><br />
<span dir="ltr"><span style="color: black; font-family: Calibri,Arial,Helvetica,sans-serif; font-size: small;"><span style="font-size: 12pt;"><span style="font-size: x-small;"><span style="font-size: 10pt;">LinkedIn: </span></span></span></span></span><a href="http://ca.linkedin.com/in/zakeriahassan/" name="webProfileURL" title="View public profile">ca.linkedin.com/in/zakeriahassan/</a><br />
<span dir="ltr"><span style="color: black; font-family: Calibri,Arial,Helvetica,sans-serif; font-size: small;"><span style="font-size: 12pt;"><span style="font-size: x-small;"><span style="font-size: 10pt;"> </span></span><span style="font-size: x-small;"><span style="font-size: 10pt;"><br />
</span></span><span style="font-size: x-small;"><span style="font-size: 10pt;"><br /></span></span></span></span></span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5679551289169654028.post-3060299325276009882013-12-12T09:52:00.000-08:002013-12-23T19:41:09.077-08:00The Future Of Healthcare Technology and Open Source<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMvADFxIN4BJ34l32MRVWYDw4z2ofwSDCeYevmlmWOTym_17esvRuhYiOT-zShKoF8vvXTzlr_gdFrHH1CCfHCb1SrdgsBc3gcH5__owlBx85HHtTUDT9QyP7mX9bwcvXTsIiWgUAF1NE/s1600/MyOscar.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="478" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMvADFxIN4BJ34l32MRVWYDw4z2ofwSDCeYevmlmWOTym_17esvRuhYiOT-zShKoF8vvXTzlr_gdFrHH1CCfHCb1SrdgsBc3gcH5__owlBx85HHtTUDT9QyP7mX9bwcvXTsIiWgUAF1NE/s640/MyOscar.png" width="640" /></a></div>
<br />
<br />
1. Introduction<br />
2. What is MyOscar?<br />
3. Should patients have access to their medical data?<br />
4. Critical care patient monitoring and can technology help?<br />
5. About our efforts at Seneca CDOT : NexJExpress Team<br />
6. Proposed change to MyOscar<br />
<h3>
Introduction</h3>
Most of us probably have some relative that may be in and out of hospital or some may have a critically ill relative. Wouldn't it be nice to have some way of monitoring how they are doing? Wouldn't it be great to see all this information on your smart phone? Wouldn't it be great to have not only the information freely available to patients but also that the software is free and open source? I will explain the cutting edge technology/research we are conducting.<br />
<h3>
What is MyOscar?</h3>
MyOscar is a personal health record system which was created to give patients the freedom to see their medical records. Not only are patients able to see this information but also share this information with family and loved ones. The software is open source. To read more about it visit:<br />
<br />
<a href="http://myoscar.org/myoscar/about-myoscar">http://myoscar.org/myoscar/about-myoscar</a><br />
<h3>
Should Patients Have Access To Their Personal Medical Data And Why?</h3>
You may have an elderly parent or grandparent that you may want to monitor if their condition becomes critical while at work or traveling. Or you may have a critically ill loved one that you may be taking care of. We think by having this technology, it would make it possible to help improve peoples lives and relieve worries.<br />
<h3>
Critical Care Patient Monitoring And Can Technology Help?</h3>
We believe that yes, it could be possible to help a patients for example a critical care patient which would need around the clock monitoring. Perhaps with technology like this patients could leave the hospital and allow their caregivers to monitor them through an application (smart phone).<br />
<h3>
About My Teams Efforts At Seneca CDOT (Center of Development Of Open Source Technology)</h3>
We are researchers, students and professors that believe that it may be possible to improve the healthcare industry through cutting edge technology. We believe that this technology we create should be open source. We have created mobile applications that read wireless via Bluetooth to retrieve accurate medical data. Currently we are working on syncing this data with MyOscar EMR to further improve accessibility of patient data.<br />
<br />
I am working on an android application to detect heart rate and my goal is to create an application that will help in early diagnosis of irregular heart rate diseases. During my research I found out that its important to track heart rate because it will help in preventing many diseases. Atrial fibrillation or AF for short is a abnormal rhythm of heart rate and may cause strokes to be more severe. Also if the heart rate is too fast or too slow it may cause difficulty of pumping blood through your body. To read more about AF please visit the following link for a more through explanation.<br />
<br />
<a href="http://emedicine.medscape.com/article/151066-overview">http://emedicine.medscape.com/article/151066-overview</a><br />
<br />
<h3>
Conclusion</h3>
As a programmer I've always defined success as making software that positively impacts peoples lives. Through this project I feel I'm that much closer. Leave any comments if you want to give me feedback.<br />
<br />
<br />
Thanks,<br />
Zakeria Hassan<br />
Software Developer | Seneca CDOT<br />
Follow me on Twitter: <a href="https://twitter.com/Prospect1010">@Prospect1010</a><br />
Linkedin: <a href="http://ca.linkedin.com/in/zakeriahassan/">http://ca.linkedin.com/in/zakeriahassan/</a><br />
<br />
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5679551289169654028.post-78333308935609521732013-12-06T09:20:00.000-08:002013-12-06T09:23:57.044-08:00HTML5 Support in Android and IOS? <br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLJyUNA_wdgfNlx-P3hGvNNm5sHE17jNKszt3cW8vYaVBJoxGrTv3-7RXjDi0wBaXVxOfCYiYetBB-h3bzXDR-pPRZedbSj6ZmE_craHcmQHr0fgfoYapoYMyJEzg0dXbW494QyPZJfS0/s1600/1383708950_HTML5-02.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLJyUNA_wdgfNlx-P3hGvNNm5sHE17jNKszt3cW8vYaVBJoxGrTv3-7RXjDi0wBaXVxOfCYiYetBB-h3bzXDR-pPRZedbSj6ZmE_craHcmQHr0fgfoYapoYMyJEzg0dXbW494QyPZJfS0/s1600/1383708950_HTML5-02.png" /></a></div>
<br />
<br />
<ol>
<li>Introduction</li>
<li>Why Do We Care? </li>
<li>Android KitKat (4.4) - Latest version of android</li>
<li>Fennec (Firefox for android)</li>
<li>Android NDK</li>
<li>Conclusion</li>
</ol>
<br />
<br />
<br />
<br />
<h3>
Introduction</h3>
<br />
Android is an open source mobile platform and has more then half of the market share for smart phones. Developing on android requires knowledge of Java but it is not a steep learning curve. Web developers may be interested in its new support for WebView based off of source code used in Chrome. There is a slight difference between android webviews and chrome browser and I will explain these details in the following blog post.<br />
<br />
<h3>
Android KitKat (4.4) - Latest version of android</h3>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgm-_GCrWB_JV5ZuPARFOAYvTMfOu2HiOUKkNigLqzkXWMh6hKP2vRfVR9pKGlktqQ-9ek0OGCUdH0VCSwHjH7uWPVBZMfXa_0ivtJfNZ6QqecqB0_TaO3ZUHZiocZMHupF9kiin5VmwSs/s1600/Android-Kitkat.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="248" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgm-_GCrWB_JV5ZuPARFOAYvTMfOu2HiOUKkNigLqzkXWMh6hKP2vRfVR9pKGlktqQ-9ek0OGCUdH0VCSwHjH7uWPVBZMfXa_0ivtJfNZ6QqecqB0_TaO3ZUHZiocZMHupF9kiin5VmwSs/s640/Android-Kitkat.png" width="640" /></a></div>
<h3>
</h3>
Android KitKat is the latest version of the Android platform as of this writing (Dec. 5, 2013). The main feature that will interest developers is the new chrome like WebView. Android Applications use webviews based on <a href="http://www.chromium.org/">Chromium Code</a> which includes common Javascript V8 and Blink rendering found in version 30 of Google Chrome on Android version 4.4. <br />
<br />
<u><b>Pro's vs. Con's</b></u><br />
<br />
Cons:<br />
<a href="https://developers.google.com/chrome/mobile/docs/webview/overview#does_the_new_webview_have_feature_parity_with_chrome_for_android">Not the same as chrome because it doesn't support:</a><br />
1) WebRTC<br />
2) WebGL 3D Canvas<br />
3) WebAudio<br />
4) Fullscreen API<br />
5) Form Validation<br />
6) Chrome Apps Platform<br />
<br />
<br />
<br />
Pro:<br />
Supports HTML5 better JavaScript run time, lets you do remote debugging using chrome developer tools.<br />
<h3>
Why do we care?</h3>
Support for HTML5 helps make using the web richer and will make developing apps easier. If WebRTC is fully supported then perhaps you could video chat with someone using our browser or android phone instead of downloading and installing third party files.<br />
<br />
<h3>
Fennec (Firefox on Android)</h3>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7QPJKmuRjZYoFuT3SYYy2MUH67yizu0APrFipwDGPmssr-l7hyFpntjTIr8TTNPiaodrxVYPeZ3Ou4jCZkeCyAh95NNfR_o5rdr9wc2B7ScyDWduzSKdQXKH9iwXkBz5sT0V86aXasco/s1600/Fennec-Android.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="264" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7QPJKmuRjZYoFuT3SYYy2MUH67yizu0APrFipwDGPmssr-l7hyFpntjTIr8TTNPiaodrxVYPeZ3Ou4jCZkeCyAh95NNfR_o5rdr9wc2B7ScyDWduzSKdQXKH9iwXkBz5sT0V86aXasco/s640/Fennec-Android.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">screenshot from https://play.google.com/store/apps/details?id=org.mozilla.firefox</td></tr>
</tbody></table>
<h3>
</h3>
<br />
I'm investigating if it is possible to ship a browser in an android application. In my search I came across Fennec which is the Firefox implementation of Android. Firefox is written in C++ and Fennec uses the same source code but also adds another layer of native Android code. Fennec is designed for smart phones, touch screen devices and UI utilizes a different XUL then what is found in Firefox for PC. Since it's used on smart phones then they are limited in CPU, memory, etc. <a href="https://wiki.mozilla.org/Mobile/Fennec/Debugging">Fennec uses parallel processing to run on android</a>.<br />
<br />
<br />
Like most technology Fennec has dependencies and the dependencies are:<br />
<br />
<ol>
<li>Must download NDK for Android </li>
<li>Set the mozconfig environment variables for Fennec.</li>
<li>Must download mozilla-central git repository (<a href="https://github.com/mozilla/mozilla-central">https://github.com/mozilla/mozilla-central</a>)</li>
</ol>
<br />
<b>How does NDK for android work?</b><br />
<br />
<b>Prerequisite: </b><br />
Must understand JNI to work with the NDK source code.<br />
<br />
In a nutshell, NDK lets you create shared libraries that basically lets you embed a C/C++ application in your Android App. Works on Android 1.5 Platform or later however I think Fennec can only run on 1.6 and greater. Although its better practice to develop applications in native code, you can write an application in C++ and have a wrapper.<br />
<br />
<br />
<h3>
Can Firefox Run on IOS?</h3>
<a href="https://wiki.mozilla.org/Mobile/Platforms">On Mozilla's website it says that Fennec doesn't run on IOS</a> but after speaking with a developer at Mozilla I found out that someone has created a way to build Firefox on IOS.<br />
<br />
Source code is located here:<br />
<a href="http://hg.mozilla.org/users/tanya.meshkova_gmail.com/ios-patches/">http://hg.mozilla.org/users/tanya.meshkova_gmail.com/ios-patches/</a><br />
<br />
Here is a screen shot of how it looks:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDYrkRWCvHmQMMviq4qL7lcYlz6vettuFH9hIWXifbMwlqNnhDBLaY7Ips5GYzkkajkGusXZfhYbBP7zknyPNH8A4dZP9xvnC0udxaumW2U32P2_NzTpSmZZ-MkHYKo8nqG9dBzgWW_48/s1600/r8Qti.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDYrkRWCvHmQMMviq4qL7lcYlz6vettuFH9hIWXifbMwlqNnhDBLaY7Ips5GYzkkajkGusXZfhYbBP7zknyPNH8A4dZP9xvnC0udxaumW2U32P2_NzTpSmZZ-MkHYKo8nqG9dBzgWW_48/s640/r8Qti.jpg" width="478" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">link to original page: https://imgur.com/r8Qti</td></tr>
</tbody></table>
<br />
<br />
<br />
<h3>
Conclusion:</h3>
<br />
Perhaps by using Android NDK which is used by Firefox to embed C/C++ source files in your Android application, we could perhaps embed Firefox in an applications. Or even <br />
better perhaps we could totally replace the need of using WebViews and use a XUL window to display the page you would like to view.<br />
<br />
<br />
<br />
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5679551289169654028.post-32638817575825069572013-11-18T10:46:00.000-08:002013-11-18T10:46:49.511-08:00Server Vital Sign: Scripts To Respawn MongoDB or Nginx When It Crashes<br />
<br />
<h2>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhV7n4hPB02SHnOC2M8FUz_p8-BUABrdAw2Iktfg4thNhU8eirsiWeVWKV35ImMuiQQa272gu88pgy_Gvm1nRv5dvzBUsAAWK1OCiJxuZsdFlqowYwjuCv9qp8O3m_rzWsFsANiqfeTfIo/s1600/1384676376_Blue.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhV7n4hPB02SHnOC2M8FUz_p8-BUABrdAw2Iktfg4thNhU8eirsiWeVWKV35ImMuiQQa272gu88pgy_Gvm1nRv5dvzBUsAAWK1OCiJxuZsdFlqowYwjuCv9qp8O3m_rzWsFsANiqfeTfIo/s1600/1384676376_Blue.png" /></a>Server Vital Signs </h2>
<h2>
</h2>
<h2>
Recovering from Failing MongoDB and Nginx</h2>
<br />
Like many developers working with mongoDB, I've had some issues with mongoDB when memory on my server is too low. If you get too much traffic nginx might fail also. I've come up with a solution that helped me have a stable server and I think sharing this solution would be great. I hope that this will be something we can extend as an open source project. I am hosting my project at the following url if anyone is interested:<br />
<br />
<a href="https://code.google.com/p/server-vital-sign/">https://code.google.com/p/server-vital-sign/</a><br />
<br />
<br />
<br />
Here is a link to my project. I plan on extending this in the future.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQlP7Pil_TKQK6eNnFRYYTq2KkC4inWNa76QaeMjdB_QHWV_6I7PKy2aPISYheGKboemIQslwkK4_a7TLLz5DRoLh9jn32MBmOS4LOaM__R6RksVVbjHV3XeKj33-QTBy9_HtFsRKpWHo/s1600/MongoNginxAlive.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="412" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQlP7Pil_TKQK6eNnFRYYTq2KkC4inWNa76QaeMjdB_QHWV_6I7PKy2aPISYheGKboemIQslwkK4_a7TLLz5DRoLh9jn32MBmOS4LOaM__R6RksVVbjHV3XeKj33-QTBy9_HtFsRKpWHo/s640/MongoNginxAlive.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
You can access this code at the following url:<br />
<a href="https://code.google.com/p/server-vital-sign/source/browse/MongoNginxAlive.pl">https://code.google.com/p/server-vital-sign/source/browse/MongoNginxAlive.pl</a><br />
<br />
<h2>
Monitoring Memory and Hard Drive Space</h2>
<br />
If your interested in code for monitoring hard drive space and memory remaining. I have also provide the following script:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhW1gWcVJHjXoTb1RTIeaPT_0YiYkmLnmTnRHcxmC1mc436rH1bPn0LN3pcopZdMCnbR2SDTxxTWZGryZE8WmXqd_oUsRuX5o2fHATvWwZThF8iaA0jCYsW5Xrb5-w4ZUmPID6qikiWKIc/s1600/MemoryHardDrive.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="444" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhW1gWcVJHjXoTb1RTIeaPT_0YiYkmLnmTnRHcxmC1mc436rH1bPn0LN3pcopZdMCnbR2SDTxxTWZGryZE8WmXqd_oUsRuX5o2fHATvWwZThF8iaA0jCYsW5Xrb5-w4ZUmPID6qikiWKIc/s640/MemoryHardDrive.png" width="640" /></a></div>
<br />
<br />
You can access this code at the following url:<br />
<a href="https://code.google.com/p/server-vital-sign/source/browse/MemoryHardDrive.pl">https://code.google.com/p/server-vital-sign/source/browse/MemoryHardDrive.pl</a><br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5679551289169654028.post-47205406457400673442013-11-15T21:36:00.001-08:002013-11-15T21:36:21.915-08:00Release 0.3<br />
<br />
<br />
I've learned more about nunjucks and localization. I also got to work on some UI.<br />
<br />
<ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=903611">Bug903611</a><u></u></li>
<li><u><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=923206" style="color: #663366; text-decoration: none;">Bug923206</a></u></li>
</ul>
<table cellpadding="4" cellspacing="0" class="bz_buglist sortable" style="background-color: #f6f4ec; color: #404040; font-family: 'Open Sans', 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: small; width: 100%px;"><tbody class="sorttable_body">
<tr class="bz_bugitem
bz_normal bz_-- bz_ASSIGNED bz_row_even " id="b923206" style="background-color: white; color: black;"><td class="bz_product_column" style="white-space: nowrap;"><br /></td><td class="bz_component_column" style="white-space: nowrap;"><br /></td><td class="bz_assigned_to_column" style="white-space: nowrap;"><br /></td><td class="bz_bug_status_column" sorttable_customkey="300" style="white-space: nowrap;"><br /></td><td class="bz_resolution_column" sorttable_customkey="100" style="white-space: nowrap;"><br /></td><td class="bz_short_desc_column"><br /></td></tr>
</tbody></table>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5679551289169654028.post-79821629616413006072013-11-07T12:24:00.004-08:002013-11-07T22:48:05.018-08:00StorageIO.js - Utilizing Backbone.js MV* to build rich client-side application for HTML5 Storage.<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiN2rsA7eg3L_FiOslzqAWncco5qETHBYZ9VlIExh9g3JTAK6nqqZ4d_3KNJFgdR9YbmN9NCVQGck9DG2ZhcJXw7w9DPAe49PgBO0Gtl3dKNY_rP73QiWM8x1PvKI8xkKZ5uHebQXQFpac/s1600/backbonejs.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="269" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiN2rsA7eg3L_FiOslzqAWncco5qETHBYZ9VlIExh9g3JTAK6nqqZ4d_3KNJFgdR9YbmN9NCVQGck9DG2ZhcJXw7w9DPAe49PgBO0Gtl3dKNY_rP73QiWM8x1PvKI8xkKZ5uHebQXQFpac/s320/backbonejs.png" width="320" /></a></div>
<br />
<br />
<h2>
Table of contents:</h2>
<br />
<ol>
<li>Idea</li>
<li>What is Backbone.js?</li>
<li>Who uses it?</li>
<li>Why would I use it?</li>
<li>How do I set it up?</li>
<li>Dependencies?</li>
<li>Conclusion</li>
</ol>
<h3>
Idea:</h3>
Good architecture/design on the client-side is sometimes an afterthought for some developers but in reality it is crucial and I’ve discovered a solution that will help me build a better StorageIO HTML5 Storage API. I know I need to store data but what about the overall structure of the applications? After another day of porting Adobe’s Brackets IDE to work in Firefox I experienced trouble integrating indexedDB with the Brackets IDE because it was originally created for working with physical file. We wanted to get Bracket IDE to work with data stored in IndexedDB.<br />
<br />
We where lucky to have code that mimics a file-system that uses IndexedDB but if we could make it RESTful then maybe we could mimic an actual server. Usually we interact with servers by sending files through http/https using GET or POST and waiting for the server to respond but in our case we are doing everything in the client-side . The solution to many problems I'm facing in both projects is using "backbone.js". I will explain what backbone is and why it is useful. <br />
<br />
<h3>
What is Backbone.js ?</h3>
<span style="background-color: #fff2cc;"><b>The short answer:</b> Backbone.js is a framework that works almost like Model View Controller but is different because it uses Model View Collections. It helps you build rich client side applications.</span><br />
<br />
<h4>
Backbone</h4>
Helps you structure your code in Model View Collection but has a unique twist to it.<br />
<ul><ul>
<li>Model: The data layer in your application</li>
<li>View: The UI layer in your application</li>
<li>Collection: Lets you save your data to a url</li>
</ul>
</ul>
Backbone has a little twist compaired to traditional MVC frameworks. It links the event processing and modification of models in the view.<br />
<br />
<h4>
Features </h4>
<ul>
<li>Light weight</li>
<li>Adds structure to your client-side code</li>
<li>more maintainable code in the long term</li>
<li>helps you build rich data-driven client-side applications</li>
<li>has helpful methods for querying and updating data </li>
</ul>
<h3>
Who uses it?</h3>
Many companies are using it including Walmart, SoundCloud, LinkedIn and many more.<br />
<br />
For the full list visit:<br />
<a href="http://backbonejs.org/#examples">http://backbonejs.org/#examples</a><br />
<h3>
Why would I use it?</h3>
<ul>
<li>Code Reusability</li>
<li>Code Maintains</li>
<li>Rich library</li>
</ul>
<h3>
Dependencies:</h3>
Backbone.js depends on Underscore.js and jQuery. <br />
<br />
<h3>
Prototype/ Mockup (Using backbone.js, underscore.js, require.js and indfs.js)</h3>
<br />
<br />
<pre class="brush:js">
"use strict";
/* @Author: Zakeria Hassan <zak.hassan1010@gmail.com>
* @Date: Nov. 6, 2013
* @Usage: Generally StorageIO uses IndexedDB http://www.w3.org/TR/IndexedDB/.
* If IndexedDB isn't isn't supported then it use as an alternative
* WebSQL http://www.w3.org/TR/webdatabase/.
*
* The MIT License (MIT)
* Copyright (c) 2013 Zakeria Hassan
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* Dependencies:
* require.js - http://requirejs.org/docs/release/2.1.9/comments/require.js
* jquery.js - http://jquery.com
* backbone.js - http://backbonejs.org/
* underscore.js - http://underscorejs.org/
*
*/
/*
* @parm global : 'this' object
* @parm runner : 'callback' function
*/
(function (global, runner) {
if (typeof exports === 'object' && typeof require === 'function') {
module.exports = runner(require("underscore"), require("backbone"), require("idbfs"));
} else if (typeof define === "function" && define.amd) {
define(["underscore", "backbone", "idbfs"], function (_, Backbone, IDBFS) {
return runner(_ || global._, Backbone || global.Backbone, IDBFS || global.IDBFS);
});
} else {
// RequireJS isn't being used. Make sure underscore and backbone are loaded in script tags
runner(_, Backbone, IDBFS);
}
})(this, function (_, Backbone, IDBFS) {
var global = window;
// Use Backbone and RequireJS to improve code
var StorageIO = function (_dbname) {
// USE IDBFS SOMEWHERE HERE.
//Setting backbone models
//1) Directory
//2) File
var Directory = Backbone.Model.extend({
initialize: function () {
// Triggered when you create a directory
}
});
var File = Backbone.Model.extend({
initialize: function () {
// Triggered when you create a File
}
});
return (global.indexedDB || global.mozIndexedDB || global.webkitIndexedDB || global.msIndexedDB) ? {
indexedDB: global.indexedDB || global.mozIndexedDB || global.webkitIndexedDB || global.msIndexedDB,
IDBTransaction: global.IDBTransaction || global.webkitIDBTransaction || global.msIDBTransaction,
IDBKeyRange: global.IDBKeyRange || global.webkitIDBKeyRange || global.msIDBKeyRange,
req: null,
result: null,
_fs: IDBFS,
dbName: _dbname || "test",
error: function (event) {
// Should do some error handling
// TODO: This code is not complete.. Will finish soon
console.log("request failed!");
},
success: function (event) {
this.result = this.req.result;
},
read: function () {
//TODO:This code is not complete.. Will finish soon
},
rm: function () {
//TODO:This code is not complete.. Will finish soon
},
/**
* @param {Object} has three keys and looks like this: { "key" : string,
* "value" : string,
* "isUnique" : bool }
* Establishs a database connection and if this is a a new database
* It creates the columns that will be used. It sets up the functions
* that are executed if the req's fail or succeed
*/
open: function (columns) {
this.req = this.indexedDB.open(this.dbname);
this.req.onerror = this.error;
this.req.success = this.success;
// Comment: the "onupgradeneeded" is triggered when a new database is created and
// TODO: Must be able to write key value pairs to the indexedDB.
// TODO: This code is not complete.. Will finish soon
this.req.onupgradeneeded = function (event) {
try {
var st = event.currentTarget.result.createObjectStore(this.dbname, {
keypath: 'id',
autoIncrement: true
});
if (!columns) throw new Error("Error code: 999 - Missing column variable in open function");
// Setting columns up
for (var i = 0; i < obj.length; i++) {
st.createIndex(columns[i]["key"], columns[i]["value"], {
unique: columns[i]["isUnique"]
});
}
} catch (e) {
// TODO: Must handle exception
} finally {
// TODO: clean up
}
}
return this;
},
/**
* @param {Object} has three keys and looks like this: { "key":string, value":string, "isUnique":bool}
*/
write: function (obj) {
},
close: function () {}
} : {
read: function () {
/*
* As a fallback solution to acheive cross browser compatibility
* I've included a Web SQL Backed solution.
* TODO:This code is not complete.. Will finish soon
*/
},
write: function () {},
rm: function () {}
};
};
_.StorageIO = StorageIO;
});
</pre>
Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-5679551289169654028.post-76597020728392379112013-11-06T14:35:00.003-08:002013-11-06T16:53:31.639-08:00Introducing StorageIO.JS - Cross Browser API for HTML5 Client Side Storage<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgw-bwXCSoUCkyi6laYRTE8sUbfAoDIvy2pkv5usVS7F2Vc-51_dcinmpvpmcQxoRL75hrLQUXKOlSeu2RrbsAsKdbHUpXApxGPpU7KMl9Uua-tdihe9_nIgPxqqjBUZIuTyyt9-MwNwPw/s1600/storageio.js.png" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgw-bwXCSoUCkyi6laYRTE8sUbfAoDIvy2pkv5usVS7F2Vc-51_dcinmpvpmcQxoRL75hrLQUXKOlSeu2RrbsAsKdbHUpXApxGPpU7KMl9Uua-tdihe9_nIgPxqqjBUZIuTyyt9-MwNwPw/s640/storageio.js.png" /></a><br />
<br />
<a href="http://zmhassan.github.io/StorageIO.js/">http://zmhassan.github.io/StorageIO.js/</a><br />
<h3>
Idea: </h3>
This was a result of thinking about our last lecture in OSD600. We want a cross browser way of storing and retrieving data in HTML5 Storage technologies like IndexedDB or Web SQL. Since we know that using IndexedDB is the preferred method of storing data in HTML5 in the client browser and secure features of same-origin policy, we will use Web SQL as a fallback solution to browser that doesn't support IndexedDB.<br />
<br />
<h3>
Proposal: </h3>
I think we could create a library that first detects if your browser supports indexedDB. If it does then it will provide you with an object that helps you quickly process your data. I would like to also consider using Web Workers in the asynchronous IndexedDB API to provide performance that will enable quick data access and allow for syncing data to the server in parallel.<br />
<br />
<h3>
Design:</h3>
IndexedDB gives us more feature rich experience, so we check for that first and return an object that will do everything from: Create, Update, Delete, Drop, etc. I'm still working on this, StorageIO.js may not have all the functionality I want but I will add it very soon. I want this code to be multithreaded so I will be implementing Web Workers. I will use native XHR ajax to achieve posting to the server for syncing data.<br />
<br />
<br />
<h3>
Where does the code live:</h3>
It lives in Git. Feel free to git clone and send your pull request. The web as we know it would not be what it is today without the collaboration of individuals that contributed code to open source community.<br />
<br />
<a href="http://zmhassan.github.io/StorageIO.js/">http://zmhassan.github.io/StorageIO.js/</a><br />
<h3>
Prototype/ Mockup:</h3>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<pre class="brush:jscript">
/* @Author: Zakeria Hassan <zak.hassan1010@gmail.com>
* @Date: Nov. 6, 2013
* @License: MIT
* @Purpose:
* Generally StorageIO uses IndexedDB http://www.w3.org/TR/IndexedDB/.
* If IndexedDB isn't isn't supported then it use as an alternative
* WebSQL http://www.w3.org/TR/webdatabase/.
*
* The MIT License (MIT)
* Copyright (c) 2013 Zakeria Hassan
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
"use strict";
(function (global) {
var StorageIO = function (_dbname) {
if (global.indexedDB || global.mozIndexedDB || global.webkitIndexedDB || global.msIndexedDB) {
return {
indexedDB: global.indexedDB || global.mozIndexedDB || global.webkitIndexedDB || global.msIndexedDB,
IDBTransaction: global.IDBTransaction || global.webkitIDBTransaction || global.msIDBTransaction,
IDBKeyRange: global.IDBKeyRange || global.webkitIDBKeyRange || global.msIDBKeyRange,
req: null,
result: null,
dbName: _dbname || "test",
error: function (event) {
// Should do some error handling
// TODO: This code is not complete.. Will finish soon
console.log("request failed!");
},
success: function (event) {
this.result = this.req.result;
},
read: function () {
//TODO:This code is not complete.. Will finish soon
},
rm: function () {
//TODO:This code is not complete.. Will finish soon
},
open: function () {
this.req = this.indexedDB.open(this.dbname);
this.req.onerror = this.error;
this.req.success = this.success;
return this;
},
/**
* @param {Object} has three keys and looks like this: { "key":string, value":string, "isUnique":bool}
*/
write: function (obj) {
//TODO: Must be able to write key value pairs to the indexedDB.
//TODO: This code is not complete.. Will finish soon
this.req.onupgradeneeded = function (event) {
var st = event.currentTarget.result.createObjectStore(this.dbname, {
keypath: 'id',
autoIncrement: true
});
//Creating Columns
for (var i = 0; i < obj.length; i++) {
st.createIndex(obj[i]["key"], obj[i]["value"], {
unique: obj[i]["isUnique"]
});
}
}
},
close: function () {};
};
} else {
/*
* As a fallback solution to acheive cross browser compatibility
* I've included a Web SQL Backed solution.
* TODO:This code is not complete.. Will finish soon
*/
return {
read: function () {},
write: function () {},
rm: function () {}
}
}
};
global.StorageIO = StorageIO;
})(this);
</zak></pre>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5679551289169654028.post-84926346240065982702013-11-05T14:03:00.001-08:002013-11-05T19:58:50.592-08:00Porting Brackets to work in firefox (Part 2)<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7JZ0U1QYfZ_PxW4IAp0Mp2TQy2SmKI4ZddcqLxNbBVR-bo8HSr7l8H37sq1WHkRzWwl1MUq3GAHw6EG6WnbTCoU1kVqWf0S5OsmW4wDeui8d7hJfhYA83VPPH85Kd4QfkNZ_u2akRS84/s1600/1383708950_HTML5-02.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7JZ0U1QYfZ_PxW4IAp0Mp2TQy2SmKI4ZddcqLxNbBVR-bo8HSr7l8H37sq1WHkRzWwl1MUq3GAHw6EG6WnbTCoU1kVqWf0S5OsmW4wDeui8d7hJfhYA83VPPH85Kd4QfkNZ_u2akRS84/s320/1383708950_HTML5-02.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><br /></td></tr>
</tbody></table>
<h2>
Table of contents:</h2>
<h2>
</h2>
<ol>
<li>Introduction </li>
<li>Browser Rendering Engine</li>
<li>HTML5 Storage</li>
<li>Why should I care? </li>
<li>What is IndexedDB?</li>
<li>What is Web SQL?</li>
<li>Conclusion </li>
</ol>
<br />
<br />
<br />
<h3>
<b>Introduction:</b></h3>
As users many things are abstracted from us, such as browser rendering engines and its effect on websites we use everyday. I will be going through an overview of new technologies in HTML5.<br />
<br />
<h3>
Rendering Engines:</h3>
Rendering Engine also known as web browser engine or layout engine is used by web browsers to present formatted content to users in a visual form from HTML, CSS, XML and Images files. It also processes client side scripts, cookies, sends http requests (GET, POST, PUT, DELETE, and HEAD). Depending on which rendering engine used browser vendors try to follow specifications to enable a user to view a single html page on multiple browsers, atleast thats how its supposed to be. You will find that not all browser support the latest specifications such as HTML5, CSS3 and many more cutting edge technologies.<br />
<br />
<u><b>Popular Rendering Engines:</b></u><br />
<br />
<br />
<b>Webkit:</b><br />
<ul><ul>
<li>Used by Apple's Safari, Google Chrome</li>
</ul>
</ul>
<b>Gecko:</b><br />
<ul><ul>
<li>Used by Mozilla's Firefox</li>
</ul>
</ul>
<b>Trident:</b><br />
<ul><ul>
<li>Used by Microsoft Internet Explorer</li>
</ul>
</ul>
<b>Blink:</b><br />
<ul><ul>
<li>Used by Opera (15+), Google Chrome (28+)</li>
</ul>
</ul>
<br />
<h4>
HTML5 Storage:</h4>
When developers think about storing data they typically think of storing data only on the server via Ajax or REST. That's cool but what if you want to run the application offline?<br />
<h4>
Advantages</h4>
<ul><ul>
<li>Many companies find storage cumbersome as data continues to grow so large on the server side and if its possible to save some data on the client it could save space on the server and bandwidth. </li>
<li>If an application is waiting to upload data and there is network latency it may cause an application to linger. </li>
<li>Useful for offline applications that would like to cache data.</li>
<li>Great to speed up performance of your data driven application </li>
</ul>
</ul>
<h4>
Disadvantage</h4>
<ul><ul>
<li>Data may be vulnerable if someone gets physical access to your computer. </li>
<li>Multiple clients that doesn't sync data with the server may have difficulty accessing the updated data from one client to the other. Simple solution sync your data.</li>
</ul>
</ul>
Luckily HTML5 has many technologies that can help mitigate this but not all these technologies are support in all browsers. See image below:<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6NgcmuECRv-Cw9LziaWjIbRsAqpKRdp2Fc_Be14q1XqPWSB7ewCFX5Uq3pRIEuoe7OEY1E7v3hjHNNBbY_aCDkQk2_x8lm8dmA-Okz7QIRV8dRUmUpGqIrPL2IF-o2ew-mu5J9fwmdAc/s1600/BrowserSupport.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="273" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6NgcmuECRv-Cw9LziaWjIbRsAqpKRdp2Fc_Be14q1XqPWSB7ewCFX5Uq3pRIEuoe7OEY1E7v3hjHNNBbY_aCDkQk2_x8lm8dmA-Okz7QIRV8dRUmUpGqIrPL2IF-o2ew-mu5J9fwmdAc/s640/BrowserSupport.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">screenshot from <a href="http://www.html5rocks.com/en/features/storage">http://www.html5rocks.com/en/features/storage</a></td></tr>
</tbody></table>
<br />
<h4>
Why should I care?</h4>
As software developers we should have an idea of how the web works because we
may be in a situation where we are asked to port an application that is
supported from one browser to a browser that is not supported. What I
mean by 'not supported' is for example in the case of Adobe's Brackets
which works fine on WebKit browsers doesn't work on non-webkit
browsers.<br />
<h4>
What IndexedDB?</h4>
IndexedDB is object oriented and does not use SQL but rather uses its own syntax. It is an indexed table system. It is used to index (save) or query (retrieve) objects (data stored/retrieved with a key) on the client's browser. It does have some secure features such as same-origin policy where you are not allowed to access data from multiple domains. It stores data in a key value pair.<br />
<ul>
<li>Asyncronous API </li>
<ul>
<li>It works like Ajax letting you pass data and pass a callback function
to return an event to let you know if it was successful or not. You can use the 'onsuccess' or 'onerror' property to attach event listeners to execute something if it succeeds or fails. You can use WebWorker with this to improve performance. </li>
</ul>
<li>Syncronous API</li>
<ul>
<li>Currently no browser supports this.</li>
</ul>
</ul>
<b>Note:</b><br />
<ul>
<li> IndexedDB isn't good for full-text search, internationalized sorting, and synchronization.</li>
<li>Web Worker is a way to achieve concurrency in JavaScript.</li>
</ul>
<br />
<h4>
What is WebSQL?</h4>
<br />
This is a relation table system and has been deprecated by W3C. It isn't a part of the HTML5 Specification but is still a useful technology to use because it supported in browsers that IndexedDB doesn't support.<br />
<h4>
</h4>
<h3>
Conclusion</h3>
<br />
HTML5 is interesting and as more browser vendors provide HTML5 Specification support, users and developers will have a better experience on the web. At least that is what I hope.<br />
<br />
Here are some cool demo's of IndexedDB in action:<br />
<a href="https://developer.mozilla.org/ms/demos/tag/tech:indexeddb">https://developer.mozilla.org/ms/demos/tag/tech:indexeddb</a><br />
<br />
<br />
<br />
<br />
Thanks,<br />
Zak Hassan<br />
@Prospect1010<br />
<br />
<br />
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5679551289169654028.post-10885799017801564932013-10-31T18:05:00.001-07:002013-10-31T18:06:20.424-07:00Porting Brackets IDE to work in Firefox (Part 1)During class my professor introduced our class to Adobe's open source IDE brackets. We learned that brackets can be run in the browser but currently is supported only in Webkit browers (Chrome, etc). If it works in Chrome we can get it to work in Firefox but will require updating the CSS, Javascript in the application. <br />
<br />
<h4>
What is Brackets?</h4>
Brackets is an open source IDE built in HTML5, CSS and Javascript. It is downloadable at the following site:<br />
<br />
http://brackets.io/<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjojgTUku_iqP1FUSfGcb9Qk4Afpy1ojOlFkouye2Ugv65lC1l_EUJsGnlFKAx38AKnJZA0pqjJQRqHpSCV1Dc166wnzSaDyVkAGbGOesyze_mbiRnSCk7VtW30p5yLbQWHW9zrmt44usU/s1600/Screen+Shot+2013-10-31+at+4.07.43+PM.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjojgTUku_iqP1FUSfGcb9Qk4Afpy1ojOlFkouye2Ugv65lC1l_EUJsGnlFKAx38AKnJZA0pqjJQRqHpSCV1Dc166wnzSaDyVkAGbGOesyze_mbiRnSCk7VtW30p5yLbQWHW9zrmt44usU/s640/Screen+Shot+2013-10-31+at+4.07.43+PM.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">screen shot of http://brackets.io/</td></tr>
</tbody></table>
<br />
When you fork brackets it will not display the sidebar properly in Firefox. I've fixed this bug in my repository.<br />
<h4>
This is how it looks in Firefox now: </h4>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT3oS953uPqzlQzvyWoqYiHwmROPkexAYeXShHymBbQl0Rqy5q2n2q6ABDFJWO10fmHIqX0IDQ_HYxoVLxZOQ7dLvy9Yd58FLcJYeSLvI_EnOX7jGtQFGBpp40mwzIfbH4AksqrYdle7E/s1600/firefox-nightly-brackets-sidebar-fix.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT3oS953uPqzlQzvyWoqYiHwmROPkexAYeXShHymBbQl0Rqy5q2n2q6ABDFJWO10fmHIqX0IDQ_HYxoVLxZOQ7dLvy9Yd58FLcJYeSLvI_EnOX7jGtQFGBpp40mwzIfbH4AksqrYdle7E/s640/firefox-nightly-brackets-sidebar-fix.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><b>Note:</b> There may be more bugs but I will continue testing this out
and experimenting with it. You will see all my updates on my
repository.</td></tr>
</tbody></table>
You get access to this code at the following git repository:<br />
<a href="https://github.com/zmhassan/brackets">https://github.com/zmhassan/brackets</a><br />
<br />
<h4>
Are there license restrictions on this code?</h4>
It uses the MIT license which does not restrict you that much on what you want to do. To see more details about the license. See the following link:<br />
<a href="http://bzcareermongodb.blogspot.ca/2013/09/mit-license_12.html">http://bzcareermongodb.blogspot.ca/2013/09/mit-license_12.html</a><br />
<h3>
</h3>
<h3>
How do I get brackets and get setup? </h3>
<h4>
To setup brackets without my updates:</h4>
<span style="background-color: #fff2cc;"><code><span style="color: black;">$ git clone </span><a href="https://github.com/adobe/brackets.git" target="_blank"><span style="color: black;">https</span><span style="color: #666600;">:</span><span style="color: #880000;">//github.com/adobe/<wbr></wbr>brackets.git</span></a><span style="color: black;"><br />$ cd brackets<br />$ git checkout </span><span style="color: #000088;">in</span><span style="color: #666600;">-</span><span style="color: black;">browser<br />$ git submodule update </span><span style="color: #666600;">--</span><span style="color: black;">init<br />$ cd src</span><span style="color: #666600;">/</span><span style="color: black;">nativeServer<br />$ npm install</span></code></span><br />
<span style="background-color: #fff2cc;"><code><span style="color: black;">$ cd </span><span style="color: #666600;">..</span><span style="color: black;"><br />$ python </span><span style="color: #666600;">-</span><span style="color: black;">m </span><span style="color: #660066;">SimpleHTTPServer</span><span style="color: black;"> </span><span style="color: #666600;">&</span><span style="color: black;"><br />$ node nativeServer</span><span style="color: #666600;">/</span><span style="color: black;">index</span><span style="color: #666600;">.</span><span style="color: black;">js</span></code></span><br />
<span style="background-color: #fff2cc;"><code><span style="color: black;">open http</span><span style="color: #666600;">:</span><span style="color: #880000;">//localhost:8000</span><span style="color: black;"><br /></span></code></span><br />
<h4>
You will not have my updates unless you clone my forked repository:</h4>
<span style="background-color: #fff2cc;"><code><span style="color: black;">$ git clone </span><a href="https://github.com/adobe/brackets.git" target="_blank"><span style="color: black;">https</span><span style="color: #666600;">:</span><span style="color: #880000;">//github.com/zmhassan/<wbr></wbr>brackets.git</span></a><span style="color: black;"><br />$ cd brackets<br />$ git checkout </span><span style="color: #000088;">in</span><span style="color: #666600;">-</span><span style="color: black;">browser<br />$ git submodule update </span><span style="color: #666600;">--</span><span style="color: black;">init<br />$ cd src</span><span style="color: #666600;">/</span><span style="color: black;">nativeServer<br />$ npm install</span></code></span><br />
<span style="background-color: #fff2cc;"><code><span style="color: black;">$ cd </span><span style="color: #666600;">..</span><span style="color: black;"><br />$ python </span><span style="color: #666600;">-</span><span style="color: black;">m </span><span style="color: #660066;">SimpleHTTPServer</span><span style="color: black;"> </span><span style="color: #666600;">&</span><span style="color: black;"><br />$ node nativeServer</span><span style="color: #666600;">/</span><span style="color: black;">index</span><span style="color: #666600;">.</span><span style="color: black;">js</span></code></span><br />
<span style="background-color: #fff2cc;"><code><span style="color: black;">open http</span><span style="color: #666600;">:</span><span style="color: #880000;">//localhost:8000</span><span style="color: black;"><br /></span></code></span><br />
<span style="background-color: #fff2cc;"><code><span style="color: #880000;"><br /></span></code></span>
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5679551289169654028.post-15223505969697966132013-10-30T18:06:00.000-07:002013-10-30T18:06:05.481-07:00Release 0.2As I continue to tackle more bugs I've now been exposed more to the github.com/mozilla/webmaker.org repository which I found was an excellent learning opportunity. I found out that there is still more for me to learn.<br />
<br /><h4>
I've learned the following:</h4>
<ul>
<li>Localization</li>
<li>nunjucks</li>
<li>font-awesome for UI components (http://fortawesome.github.io/Font-Awesome/)</li>
<li>twitter & google plus web services for sharing data</li>
<li>reusing code that exist rather then reinventing the wheel</li>
</ul>
<h4>
Contributions:</h4>
<ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=901600">https://bugzilla.mozilla.org/show_bug.cgi?id=901600</a></li>
<ul>
<li> Status: Review ?</li>
<li><a href="https://bugzilla.mozilla.org/attachment.cgi?id=818010" title="View the content of the attachment"><b>https://github.com/mozilla/webmaker.org/pull/435</b></a></li>
</ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=914333">https://bugzilla.mozilla.org/show_bug.cgi?id=914333</a></li>
<ul>
<li> Status: Review ?</li>
<li><a href="https://bugzilla.mozilla.org/attachment.cgi?id=824186" title="View the content of the attachment"><b>https://github.com/mozilla/webmaker.org/pull/476</b></a></li>
</ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=928090">https://bugzilla.mozilla.org/show_bug.cgi?id=928090 </a></li>
<ul>
<li>Status: Review ?</li>
<li><a href="https://bugzilla.mozilla.org/attachment.cgi?id=824997" title="View the content of the attachment">
<b>https://github.com/mozilla/webmaker.org/pull/477</b></a></li>
</ul>
</ul>
<b> </b>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5679551289169654028.post-86006907750001649212013-10-30T17:54:00.001-07:002013-10-30T17:54:08.079-07:00Release 0.1<br />
During my exploration through the fun exciting world of open source technology. I've learned a lot and encountered obstacles. My biggest obstacle was getting setup but with lots of persistence and not being afraid to ask for help I've over come these obstacles. Luckily I found that when I was in trouble I could easily ping someone on IRC to ask questions. I've noticed that the open source community is in the forefront in terms of creating new technology and I am lucky to get a chance to be apart of this community. <br />
<br />
Here are some of the technologies I've been exposed to just because of this project. <br />
<h4>
Technologies I've learned more about for Release 0.1</h4>
<ul>
<li>ElasticSearch</li>
<li>MakeAPI</li>
<li>Lucene</li>
<li>Moongoose </li>
</ul>
My contributions for Release 0.1:<br />
<ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=910403">https://bugzilla.mozilla.org/show_bug.cgi?id=910403</a></li>
<ul>
<li><a href="https://github.com/mozilla/MakeAPI/pull/153">https://github.com/mozilla/MakeAPI/pull/153 </a></li>
<li>Status: Review ?</li>
</ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=900025">https://bugzilla.mozilla.org/show_bug.cgi?id=900025</a> </li>
<ul>
<li><a href="https://github.com/mozilla/webmaker.org/pull/428">https://github.com/mozilla/webmaker.org/pull/428 </a></li>
<li>Status: Review ?</li>
</ul>
</ul>
<br />
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5679551289169654028.post-24049619309073176552013-10-17T11:03:00.002-07:002013-10-17T11:03:29.653-07:00How to use gettext() function in nunjucks for localization in Webmaker.org<span style="font-family: Arial; font-size: 13px;"><u><b>Using Localization & Nunjucks to update UI.</b></u></span><br />
<span style="font-family: Arial; font-size: 13px;"></span><br />
<span style="font-family: Arial; font-size: 13px;">To do localization we have to first find the messages.json file. Its located in the local/ directory. Once you open that you will find all the localization folders that exist. In my case I found english, french, russian and thai. </span><br />
<span style="font-family: Arial; font-size: 13px;"><br /></span>
<span style="font-family: Arial; font-size: 13px;">You can run the following command to find these files. </span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU4YDMti2NRcqD6bgYTCcM8FoyEpT_RUZNpDRky0VMfUs0N2VFP6YXF2OPqGdpIRCieVm9yCXVn4HCIONzE9ew2jxj3CwpY_L94B_Z0Xg0DtI1MbcFEc1EP6_sFEFB8GCjPsKjAIz4LZs/s1600/Localization.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="401" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU4YDMti2NRcqD6bgYTCcM8FoyEpT_RUZNpDRky0VMfUs0N2VFP6YXF2OPqGdpIRCieVm9yCXVn4HCIONzE9ew2jxj3CwpY_L94B_Z0Xg0DtI1MbcFEc1EP6_sFEFB8GCjPsKjAIz4LZs/s640/Localization.png" width="640" /></a></div>
<span style="font-family: Arial; font-size: 13px;"><br /></span>
<span style="font-family: Arial; font-size: 13px;">Once you open the messages.json file you can add a key value pair. The key is what you will use to pass into the gettext function to get the value in messages.json which is displayed via nunjucks.</span><br />
<span style="font-family: Arial; font-size: 13px;"><br /></span>
<span style="font-family: Arial; font-size: 13px;">In this example I had to add an error message to display no javascript enabled to fix a bug. I wanted to share what I've learned.</span><br />
<span style="font-family: Arial; font-size: 13px;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ-fvqu3LTrYQmuE75a8qSnfWLfHp2FztlndtxprL5kB49Qm5yB4A6-saw0iLkLwOfMMtBTkG3bM9n1a6nCfL_HHq_ZBet7jCZATYZLSR5zdDiU5VxXZhlSwv0O1YLWAItx1nyT8SWIUo/s1600/gettext_example.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ-fvqu3LTrYQmuE75a8qSnfWLfHp2FztlndtxprL5kB49Qm5yB4A6-saw0iLkLwOfMMtBTkG3bM9n1a6nCfL_HHq_ZBet7jCZATYZLSR5zdDiU5VxXZhlSwv0O1YLWAItx1nyT8SWIUo/s640/gettext_example.png" width="640" /></a></div>
<span style="font-family: Arial; font-size: 13px;"><br /></span>
<span style="font-family: Arial; font-size: 13px;"><b><u>Code Explained:</u></b></span><br />
<span style="font-family: Arial; font-size: 13px;"><br /></span>
<span style="font-family: Arial; font-size: 13px;">In the code you will see uses of {{ gettext("nojs") | safe }} which is used to go into the messages.json file and search for that key and display the localized text in it's place. The double brackets {{ }} are used to print the contents of a variable. </span><br />
<span style="font-family: Arial; font-size: 13px;"><b><br /></b></span>
<span style="font-family: Arial; font-size: 13px;"><b>Note:</b> If your string does not contain html then you don't need the "| safe " which was added here. You will see an example of this in the title tag where I put: {{ gettext("noJsTitle") }}.</span><br />
<span style="font-family: Arial; font-size: 13px;"><br /></span>
<span style="font-family: Arial; font-size: 13px;">Now your ready to work with localization in webmaker.org code.</span><br />
<span style="font-family: Arial; font-size: 13px;"><br /></span>
<span style="font-family: Arial; font-size: 13px;"><b>Warning: </b>Make sure to keep the messages.json file in alphabetical order once you've made your changes.</span><br />
<span style="font-family: Arial; font-size: 13px;"><br /></span>
<span style="font-family: Arial; font-size: 13px;"><br /></span>
<span style="font-family: Arial; font-size: 13px;"><br /></span>Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-5679551289169654028.post-34567025831583186212013-10-01T20:48:00.001-07:002013-10-01T20:48:03.360-07:00Apache Lucene - The Powerful Text Search Library<h2>
Apache Lucene - The Powerful Text Search Library</h2>
<br />
<h3>
<b><u>Features:</u></b></h3>
<br />
<ul>
<li>Full text search library</li>
<li>Lets you add metadata to an index</li>
<li>Returns ranked results for a given query sorted by the field you specify.</li>
</ul>
<div>
<h4>
<br /><b><u>Why Use Lucene?</u></b></h4>
</div>
<div>
<br /></div>
<div>
It's smarter then just searching text. For example, I mean imagine opening up your old history textbook from high-school and search each page one by one to find text. If that is tiresome then why would you make your computer waste time and have a slow runtime. Imagine now looking at the back of the book for an index with page numbers to a particular topic your looking for. With that notion Lucene doesn't just search text, it searches index's. </div>
<div>
<h4>
<br /><br /><b><u>What Do Index's Contain?</u></b></h4>
</div>
<div>
<br /></div>
<div>
Index's contain one or more document's and each document is a piece of metadata that describes data. If you were to index a table of a database consider each row as a single document. All the document's are then stored in an index. Document's don't just store data but rather store metadata like for example the name of a book, publisher, date of release, and more. Apache Lucene uses inverted index's to quickly search through millions of documents.</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<h4>
<b><u>How Do You Add A Document Or Search A Document In An Index?</u></b></h4>
</div>
<div>
<br /></div>
<div>
To perform a search you need to first add the document by adding it to the IndexWriter. Once it's added you can use an IndexSearcher to find your document.</div>
<div>
<br /></div>
<div>
<h4>
<b><u>Is Lucene Query Syntax Different?</u></b></h4>
</div>
<div>
<br /></div>
<div>
Yes. Its syntax kind of reminds me of JSON exact no curly braces:</div>
<div>
<br /></div>
<div>
field: value</div>
<div>
<br /></div>
<div>
<b>Note:</b> Field can be any name of a a field found in a document for exame title, publisher, date_published and more. Value is the value stored for this particular key value pair.</div>
<div>
<br /></div>
<div>
If the value has multiple words or white space then you should use quotes:</div>
<div>
<br /></div>
<div>
field: "value value"</div>
<div>
<br /></div>
<div>
You can also use AND, OR, NOT, boolean, wildcard, ranges, and more features to filter your search.</div>
<div>
<br /></div>
<div>
Now you have a good foundation on Apache Lucene.</div>
<div>
<br /></div>
<div>
</div>
<div>
<br /></div>
<div>
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5679551289169654028.post-11286803060382991072013-09-30T12:06:00.000-07:002013-09-30T14:53:44.383-07:00ElasticSearch: Deep diving into Mozilla's MakeAPI - Part 2<br />
Since working on the MakeAPI requires some understanding of ElasticSearch, I've decided to share what I've learned about it. <br />
<br />
Elastic Search uses the industry standard Lucene for its search. I will explain more about Lucene in a later blog post.<br />
<br />
How it works?<br />
It buffers a lot of data so it can do more operations at once.<br />
<br />
By default it refreshes every second so if you update a record it will display in a second which is excellent.<br />
<br />
With its intelligent search technology you can find synonyms to words used in search.<br />
<br />
Example of synonym:<br />
<br />
'argue' => ['bicker', 'quarrel','squabble', .... ]<br />
<br />
You can get suggestions to search terms or correct misspellings. This is similar to how google corrects your mistakes in there search:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgL0JRau42s9DMuXGejphwR9tqakzWakxvnirIfXQjR2OB_P6f4YsuwX0MO-2-K-JlDGcUuqAE7toyh4KgNVOxiZp6Gy8qvyqfLN_GkxmhKLV_tkkPNvpqGKBYVPn024KIFAr_j5kxGk18/s1600/Google-Correction.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="96" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgL0JRau42s9DMuXGejphwR9tqakzWakxvnirIfXQjR2OB_P6f4YsuwX0MO-2-K-JlDGcUuqAE7toyh4KgNVOxiZp6Gy8qvyqfLN_GkxmhKLV_tkkPNvpqGKBYVPn024KIFAr_j5kxGk18/s400/Google-Correction.png" width="400" /></a></div>
<br />
<br />
Mappings:<br />
ElasticSearch maps your data and has sane defaults but you can over ride it. For the MakeAPI its mappings the columns of data to the following:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVDM1LaySQPEdQB9YZmH6AMxD85vAMtc0O6oEgkp5fG7Lov20bW-UdsVl6Ne-UKRN4WeRlDhRT78BQW6hebRduHgbjmilZVoi4rDxPYDTNCcXZDxjrPA6Skk1P1thx4-1bHpiIk0aWeLU/s1600/MakeMappings.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVDM1LaySQPEdQB9YZmH6AMxD85vAMtc0O6oEgkp5fG7Lov20bW-UdsVl6Ne-UKRN4WeRlDhRT78BQW6hebRduHgbjmilZVoi4rDxPYDTNCcXZDxjrPA6Skk1P1thx4-1bHpiIk0aWeLU/s640/MakeMappings.png" width="412" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">To reproduce this just type in your teminal: curl -XGET http://localhost:9200/makes/make/</td></tr>
</tbody></table>
Security:<br />
ElasticSearch doesn't have any authentication so our MakeAPI uses hawk to authenticate users.<br />
<br />
What is the difference between a query and a filter?<br />
<br />
Query: A query is a simple Lucene search across index's which return a search.<br />
<br />
Filter: The results of a query that has been executed is stored in memory with a very efficient data structor called a bitset. Then when we perform a search that goes with the filter we compare all the documents with the filter bitset and it enables us to find the correct match.<br />
<br />
<br />
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5679551289169654028.post-54069517746414349602013-09-26T12:41:00.004-07:002013-09-26T15:15:26.364-07:00How do I generate a make with makeAPI?To generate a make with the makeAPI you must either use popcorn or thimble. In my case I used thimble because it was easy to create the "make".<br />
<br />
How do I create a make from Thimble?<br />
- Just edit some stuff and click publish.<br />
<br />
Once your done you should see a link to your make. You can either remix it at this point. In my case I was only interested in generating sample 'make' metadata so I could fix my bug:<br />
<br />
You would have to query mongodb console to see the make json metadata.<br />
<br />
<span style="background-color: #fff2cc;">This is how a 'make' looks: </span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgICEabA_3szjMD6Ynz4Nmk8MUp2pHzSbaED2QLlqRThpK3vcv846XvPXujczYTWoekpPRIiTOVsJW0Acx1Nt2wGNMmVOC2QEebpT3NtjS4KYjrnQ_P0QKUHfG2EfWDNkiGGIRTV0jSGFQ/s1600/Screen+Shot+2013-09-26+at+3.29.50+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="209" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgICEabA_3szjMD6Ynz4Nmk8MUp2pHzSbaED2QLlqRThpK3vcv846XvPXujczYTWoekpPRIiTOVsJW0Acx1Nt2wGNMmVOC2QEebpT3NtjS4KYjrnQ_P0QKUHfG2EfWDNkiGGIRTV0jSGFQ/s640/Screen+Shot+2013-09-26+at+3.29.50+PM.png" width="640" /></a></div>
<br />
<br />
Note: You don't need to just use mongodb to get this data. You can use the MakeAPI to search for this data. For example see this link:<br />
<br />
<a href="http://localhost:5000/api/20130724/make/search?user=zaktest&contentType=application%2Fx-thimble&limit=50&sortByField=updatedAt%2Cdesc&page=1">http://localhost:5000/api/20130724/make/search?user=zaktest&contentType=application%2Fx-thimble&limit=50&sortByField=updatedAt%2Cdesc&page=1</a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWP3npT58lmBS1NC9EEuJ6LLKpsDKZdhuIj-6BzfgtD5N8Z0BBTukOOrX9U4fO39Fxfeps2anDUfpOI9I1r2cLGANEYi4p5bs0CIfAnvPvTxbDJQPYTRO2REfyyVy1jh0oOz7Z-pMYa2A/s1600/Screen+Shot+2013-09-26+at+3.37.46+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="248" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWP3npT58lmBS1NC9EEuJ6LLKpsDKZdhuIj-6BzfgtD5N8Z0BBTukOOrX9U4fO39Fxfeps2anDUfpOI9I1r2cLGANEYi4p5bs0CIfAnvPvTxbDJQPYTRO2REfyyVy1jh0oOz7Z-pMYa2A/s640/Screen+Shot+2013-09-26+at+3.37.46+PM.png" width="640" /></a></div>
<br />
Leave comments if you find any of this confusing.<br />
<br />
Thanks<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5679551289169654028.post-85476124689902241342013-09-26T12:25:00.001-07:002013-09-26T12:57:34.042-07:00Can't run thimble ".. Loading forever"Hi,<br />
<br />
I've just discovered why thimble failed to install properly. It was displaying a loading symbol. To save others the confusion I've decided to update the "readme" file to include the steps to install bower before running npm install.<br />
<br />
<br />
The reason why you need to install bower in the first place is because of the following:<br />
<br />
<br />
This is the package.json file that is used by npm install to install all the dependences of the project.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-zCGrKQRw6SZpEcOFBXDvK2bepSeGaxS8IbOtsa0fQfWkFeR0IMsICA71nLDvZPJpKwgJ6Dm-S5pei2_Oz8HBU0I_Ot8jmvuJ9i7aeT0duy8vCzKZI04JVbUaby_9Ulqw5z1sJqusmPc/s1600/Screen+Shot+2013-09-26+at+3.55.14+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="466" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-zCGrKQRw6SZpEcOFBXDvK2bepSeGaxS8IbOtsa0fQfWkFeR0IMsICA71nLDvZPJpKwgJ6Dm-S5pei2_Oz8HBU0I_Ot8jmvuJ9i7aeT0duy8vCzKZI04JVbUaby_9Ulqw5z1sJqusmPc/s640/Screen+Shot+2013-09-26+at+3.55.14+PM.png" width="640" /></a></div>
<br />
<br />
Note: Under "postinstall":"bower install"<br />
<br />
If you don't have bower installed globally then thimble will not work.<br />
<br />
How do I install bower globally?<br />
<br />
<span style="background-color: #fff2cc;">npm install -g bower</span><br />
<br />
Warning: When trying to install bower as a root user then you have to do the following when running bower install.<br />
<br />
<span style="background-color: #fff2cc;">bower install --allow-root</span><br />
<span style="background-color: #fff2cc;"><br /></span>
<span style="background-color: white;">If your not logged in as root then you can run this:</span><br />
<span style="background-color: white;"><br /></span>
<span style="background-color: #fff2cc;">bower install</span><br />
<span style="background-color: white;"><br /></span>
<span style="background-color: white;"><br /></span>
<span style="background-color: white;">Good luck on your bug fix's. One other lesson I've learned is don't be afraid to ask questions. Special thanks to ALI from CDOT for helping out with this problem.</span><br />
<span style="background-color: white;"><br /></span>
<span style="background-color: white;"><br /></span>
<span style="background-color: white;"><br /></span>
<span style="background-color: #fff2cc;"><br /></span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5679551289169654028.post-81361795412204984522013-09-17T16:53:00.003-07:002013-09-17T16:53:50.017-07:00Diving deep into MakeAPI and ElasticSearch for Node.jsGoing through the code as well as the dependences for the MakeAPI. I learned a few new technologies:<br />
<br />
<ol>
<li>ElasticSearch:</li>
<ul>
<li>It features real time data, real time analytics, high availability, distributed, high availability, multi-tenancy, full text search, document oriented (JSON format), conflict management, schema free, restful api, per operation persistence, built on top of Apache Lucene and of course open source</li>
<li>This technology opens a world of possibilities. For the inquisitive developer its a must learn technology.</li>
<li>For more information check out: <a href="http://www.elasticsearch.org/">http://www.elasticsearch.org/</a></li>
</ul>
</ol>
<div>
<br /></div>
<div>
How do i get setup?</div>
<div>
<br /></div>
<div>
Download elastic search from elasticsearch.org then run the following command</div>
<div>
<br /></div>
<div>
<span style="background-color: #fff2cc;"><br /></span></div>
<div>
<span style="background-color: #fff2cc;"> elasticsearch -f </span></div>
<div>
<span style="background-color: #fff2cc;"><br /></span></div>
<div>
<b>Note: </b>You should see it running. I would recommend to run this in background so you can continue using your terminal. </div>
<div>
<br /></div>
<div>
<br /></div>
<div>
ElasticSearch provides an API that displays document oriented data in JSON format. The API uses thrift, HTTP and memcached.</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5679551289169654028.post-37541617483655513312013-09-12T12:05:00.003-07:002013-09-12T12:05:39.890-07:00MIT License<br class="Apple-interchange-newline" /><br />
I'd like to point out 3 items that struck me when I was reading the MIT License.<br />
<br />
I've copied the license text below:<br />
<br />
"<span style="background-color: white; color: #494949; font-family: Verdana, sans-serif; font-size: 12px; line-height: 20px;">The MIT License (MIT)</span><br />
<div style="background-color: white; color: #494949; font-family: Verdana, sans-serif; font-size: 12px; line-height: 20px; margin-bottom: 1.2em; margin-top: 0.6em; padding: 0px;">
Copyright (c) <year> <copyright holders></div>
<div style="background-color: white; color: #494949; font-family: Verdana, sans-serif; font-size: 12px; line-height: 20px; margin-bottom: 1.2em; margin-top: 0.6em; padding: 0px;">
Permission is hereby granted, free of charge, to any person obtaining a copy<br />of this software and associated documentation files (the "Software"), to deal<br />in the Software without restriction, including without limitation the rights<br />to use, copy, modify, merge, publish, distribute, sublicense, and/or sell<br />copies of the Software, and to permit persons to whom the Software is<br />furnished to do so, subject to the following conditions:</div>
<div style="background-color: white; color: #494949; font-family: Verdana, sans-serif; font-size: 12px; line-height: 20px; margin-bottom: 1.2em; margin-top: 0.6em; padding: 0px;">
The above copyright notice and this permission notice shall be included in<br />all copies or substantial portions of the Software.</div>
<div style="background-color: white; color: #494949; font-family: Verdana, sans-serif; font-size: 12px; line-height: 20px; margin-bottom: 1.2em; margin-top: 0.6em; padding: 0px;">
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br />IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br />FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br />AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br />LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br />OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN</div>
<span style="background-color: white; color: #494949; font-family: Verdana, sans-serif; font-size: 12px; line-height: 20px;">THE SOFTWARE.</span>"<br />
<br />
-- http://opensource.org/licenses/MIT<br />
<br />
<br />
My Thoughts:<br />
<br />
<ol>
<li>Firstly I was struck by the fact the license is free.</li>
<li>Secondly you don't have restrictions of how to use the software.</li>
<li>Thirdly the last paragraph basically says. You can use the software but don't sue me.</li>
<li></li>
</ol>
Unknownnoreply@blogger.com0