RSS

Category Archives: New Technology

Introduction to Cassandra

Introduction to Cassandra

Welcome back ! to NoSQL DB  most of Software engineers know what is MongoDB – CouchDB

What is Cassandra ?

Cassandra is Apache project working in large platforms such as facebook

you can download it from here

1- Edit Configuration file from here

conf/cassandra.yaml

The distribution’s sample configuration conf/cassandra.yaml contains reasonable defaults for single node operation, but you will need to make sure that the paths exist fordata_file_directoriescommitlog_directory, and saved_caches_directory.

Verify storage_port and rpc_port are not conflict with other service on your computer. By default, Cassandra uses 7000 for storage_port, and 9160 for rpc_port. The storage_port must be identical between Cassandra nodes in a cluster. Cassandra client applications will use rpc_port to connect to Cassandra.

It will be a good idea to change cluster_name to avoid unnecessary conflict with existing clusters.

initial_token. You can leave it blank, but I recommend you to set it to 0 if you are configuring your first node.

 2- Edit log4j-server.properties
# Edit the next line to point to your logs directory
log4j.appender.R.File=/var/log/cassandra/system.log

 3- Edit cassandra-env.sh

Cassandra has JMX (Java Management Extensions) interface, and the JMX_PORT is defined in conf/cassandra-env.sh. Edit following line if you need.

# Specifies the default port over which Cassandra will be available for
# JMX connections.
JMX_PORT="7199"

By default, Cassandra will allocate memory based on physical memory your system has. For example it will allocate 1GB heap on 2GB system, and 2GB heap on 8GB system. If you want to specify Cassandra heap size, remove leading pound sign(#) on the following lines and specify memory size for them.

#MAX_HEAP_SIZE="4G"
#HEAP_NEWSIZE="800M"

If you are not familiar with Java GC, 1/4 of MAX_HEAP_SIZE may be a good start point for HEAP_NEWSIZE.

Cassandra will need more than few GB heap for production use, but you can run it with smaller footprint for test drive. If you want to assign 128MB as max, edit the lines as following.

MAX_HEAP_SIZE="128M"
HEAP_NEWSIZE="32M"
 Start up cassandra

And now for the moment of truth, start up Cassandra by invoking bin/cassandra -f from the command line1. The service should start in the foreground and log gratuitously to standard-out. Assuming you don’t see messages with scary words like “error”, or “fatal”, or anything that looks like a Java stack trace, then chances are you’ve succeeded.

Press “Control-C” to stop Cassandra.

If you start up Cassandra without “-f” option, it will run in background, so you need to kill the process to stop.

 

bin/cassandra-cli is a interactive command line interface for Cassandra. You can define schema, store and fetch data with the tool. Run following command to connect to your Cassandra instance.

bin/cassandra-cli -h host -p rpc_port

example:
% bin/cassandra-cli -h 127.0.0.1 -p 9160

 

 
Leave a comment

Posted by on March 25, 2012 in Featured, New Technology, Programming

 

let's forge !! ()

let's forge !! ()

welcome all ,

sure you are wondering what’s Forge !!
Forge is a Cross-platform app framework  which enables you to create native apps for multiple platforms from a single HTML5 codebase.

Here are a few benefits of Forge:

    • ** Single code base
    • ** Ability to generate mobile applications for Android and iPhone
    • ** Ability to generate browser extensions for Chrome, Safari, Firefox, and IE
    • ** Rapid development
    • ** Reduced maintenance costs

 

It doesn’t require to write any line of  java or objective-c or learn any platform-specific APIs.
now let’s get started

 

    1.  Download the development environment
              ** To use Forge, you will first need to sign up for the service at https://trigger.io/forge/
      •  download the Forge development environment and unzip it to any directory .

 

    1.  For Win users >> run go.bat
      • ** for linux and MAC users >> from the terminal change the directory to wherever you extracted the zip file run source  go.sh

 

    1.  Creating your first app
               ** by now u should have a command terminal look something like that.

 

(forge-environment)

** HINT ** if u want to keep each of your apps separated u should use another directory for them

mkdir “../test-apps”
cd “../test-apps”

now we are in a separated directory , let’s create the app

forge create
after that you will be prompted to enter the app name , your user-name , password and that’s it you are done 🙂

you can switch to the app directory and try run your index page named index.html Now if u wanna start your app as an extension to chrome , or Firefox add-on or android , iphone app >> let’s move to another level i would prefer to start it as an extension to chrome .

by now u should see src  directory under the app directory , this is where all the extensions will be placed

inside , u should see “config.jsonwhich automatically generated and holds all the settings for the extension .

 

1- Create a file called background.js” inside the “src” directory and add the following code
     window.alert(‘Hello Chrome’);

2- Open config.json and add this file to the background_files array
     “background_files”: [“background.js”],

3- Building and load Chrome Extensions Using Forge

** Navigate to the directory where you extracted the build tools from the terminal

** Windows users run go.bat. OSX/Linux users run source go.sh

** Run forge build.

** When the build finishes take a look inside the development directory and you should see your generated Chrome extension

** Open the Chrome browser and go to chrome:extensions.

** If Developer mode isn’t already enabled click the [+] button at the top right.

** Click Load unpacked extension.

** Navigate to the development directory which contains the generated extension.

** Select the chrome folder and click OK.

** You should see ‘Hello Chrome’ alert window as soon as the extension has loaded.

>> NOTE  <<
only the “Get Started” apps are FREE , more pricing here >> https://trigger.io/pricing/

>> REFERENCE <<
https://trigger.io/

 

 

Technologies This Year!

Technologies This Year!

hello everybody , you can find here the most common technologies throughout this Year – 2011-  AND HAPPY NEW YEAR , Wish 2012 full of New technologies , here’s the links sorted by dates . 🙂

 

24-2-2011

———————————————————————————————————————————————

3-3-2011

———————————————————————————————————————————————

17-3-2011

———————————————————————————————————————————————

24-3-2011

———————————————————————————————————————————————

1-4-2011

———————————————————————————————————————————————

FireFox7!

———————————————————————————————————————————————

 

30-9-2011

———————————————————————————————————————————————

7-10-2011

———————————————————————————————————————————————

الكهرباء اللاسلكية

———————————————————————————————————————————————

Gmail with it’s new Dress

 
2 Comments

Posted by on December 27, 2011 in Featured, New Technology

 

Tags: , , , ,

Memristor

Memristor

Memristor :  A Groundbreaking New Circuit

What is it?
As its name implies, the memristor can “remember” how much current has passed through it. And by alternating the amount of current that passes through it, a memristor can also become a one-element circuit component with unique properties. Most notably, it can save its electronic state even when the current is turned off, making it a great candidate to replace today’s flash memory.

Memristors will theoretically be cheaper and far faster than flash memory, and allow far greater memory densities. They could also replace RAM chips as we know them, so that, after you turn off your computer, it will remember exactly what it was doing when you turn it back on, and return to work instantly. This lowering of cost and consolidating of components may lead to affordable, solid-state computers that fit in your pocket and run many times faster than today’s PCs.

Someday the memristor could spawn a whole new type of computer, thanks to its ability to remember a range of electrical states rather than the simplistic “on” and “off” states that today’s digital processors recognize. By working with a dynamic range of data states in an analog mode, memristor-based computers could be capable of far more complex tasks than just shuttling ones and zeroes around.

When is it coming? Researchers say that no real barrier prevents implementing the memristor in circuitry immediately. But it’s up to the business side to push products through to commercial reality. Memristors made to replace flash memory (at a lower cost and lower power consumption) will likely appear first; HP’s goal is to offer them by 2012. Beyond that, memristors will likely replace both DRAM and hard disks in the 2014-to-2016 time frame. As for memristor-based analog computers, that step may take 20-plus years.

 
Leave a comment

Posted by on December 1, 2011 in Featured, New Technology

 

Tags:

Get ready for some popcorn!

Intro

Popcorn  is Mozilla’s new HTML5 media toolkit, launched 5 November 2011 “version 1

Popcorn.js is an HTML5 media framework written in JavaScript for filmmakers, web developers, and anyone who wants to create time-based interactive media on the web. Popcorn.js is part of Mozilla’s Popcorn project.

Popcornjs Demo

Download

Popcorn-complete.js : http://popcornjs.org/code/dist/popcorn-complete.js

 Popcornjs : http://popcornjs.org/download

Start using popcorn

1 –   the GUI popcorn makerit’s a graphical user interface to insert your video and add your preferred effects, images, notes, text, etc… Then export the project in two formats “HTML or JSON” or just copy the code to your preferred web page 😀 2 – create a web page and add video & effects by yourself

  • create a html page
  • add two <div> elements in the page and give each one ID “one for the video – one for footnote “
  • link the popcorn core library
  • add the script for videos

Here is a HTML sample file

<!doctype html>
<html> 
<head>
 <script src="http://popcornjs.org/code/dist/popcorn-complete.min.js"></script>

 <script>
      // ensure the web page (DOM) has loaded
      document.addEventListener("DOMContentLoaded", function () {

           // Create a popcorn instance by calling the Youtube player plugin
         var example = Popcorn.youtube(
           '#video',
           'http://www.youtube.com/watch?v=CxvgCLgwdNk' );

         // add a footnote at 2 seconds, and remove it at 6 seconds
         example.footnote({
           start: 2,
           end: 6,
           text: "Pop!",
           target: "footnotediv"
         });

         // play the video right away
         example.play();

      }, false);
    </script> 
</head>
 <body> 
 <div id="video" ></div>
 <div id="footnotediv"></div>
 </body> 
</html>

It’s a simple web page with video element

The script just create an instance of popcorn by calling YouTube player plugin then adding footnotes and play the video

now just test the sample in your browser

More

Mozilla popcorn

popcorn.js     Enjoy your popcorn 😀

 
Leave a comment

Posted by on November 18, 2011 in Featured, New Technology