Wikimedia Tool setup for LCM-Dashboard (GSoC Project)


Wikimedia tools login screen using ssh

Wikimedia tools login screen using ssh

wikimedia tool setup is very tedious work but #wikimedia-labs helps a lot.

After creating an account and being approved by admin. You will log in to your tool using this command.

ssh -A username@tools-login.wmflabs.org

After logging into your tool you have to use following command to switch to your service

become toolname

Now this have following things

  • public_html – where you can place your html, php, css, js

  • cgi-bin – where you can place your python script etc

  • replica.my.cnf – contains username and password

Now Creation of databse for your project

In the first step you have to find you username and password by using “” file.

After that your database name must be USERNAME__DBNAME (2 underscore)

mysql --defaults-file="${HOME}"/replica.my.cnf -h tools-db 

after that MariaDB console will open and in that you can create databasw

MariaDB [(none)]> CREATE DATABASE USERNAME__DBNAME;

you can access this database by using this command

mysql --defaults-file="${HOME}"/replica.my.cnf -h tools-db USERNAME__DBBAME

If you want to connect the database to your project

host = tools-db
uname = your_username
pass = your_password
dbname = USERNAME__DBNAME

Then you can push the file to remote using git via clone or you can use scp command to push files from remote to local like this

scp <files> USERNAME@tools-login.wmflabs.org:/data/project/<tool-name>

Hope it will help you 🙂

Link of my tools on wikimedia labs : lcm-dashboard

Advertisements

Being Google Summer of Code Intern


I am very excited (and also a little late :D) to share the news that I have been selected as an intern for Google summer of code in Wikimedia Foundation for the project of developing language coverage matrics dashboard for language engineering team of Wikimedia Foundation.

I would like to thank my mentors Runa Bhattacharjee and Alolita Sharma, for guiding me throughout and very special thanks to Amir Aharohi for his valuable inputs for this proposal. Last but not the least special thanks to Sumana and Quim for polishing up my proposal, and the feedbacks all this while.

Being selected as a GSoC intern was finally a good news after quite while. The result came at 12:30 midnight – I couldn’t sleep. Nevertheless, great night it was and so was the news.

Community bonding period started right after. I tinkered around a few new technologies and did the overall planning for my project.

Until June 17

Until June 24

  • Created new language entry system

    Search + New language button

    Search + New language button

    Language Entry form

    Language Entry form

     

  • Created language search system with suggestion

Language search with suggestion facility

Language search with suggestion facility

Language Search result

Language Search result

 

Until July 1

  • created and set up primary thing on wikimedia labs

  • jquery.ime implemented in project

  • done minor changes in language search system

  • created on the spot editing facility for any language detail under admin privileges

Edit button for on the spot editing

Edit button for on the spot editing

when click on edit button this menu will appear

when click on edit button this menu will appear

After saving the changes it will change

After saving the changes it will change

Until July 8

  • set up basic filtering functionality

  • set up some test cases to find smooth and fast filter facility

  • created simple idea of API for language data

Until July 15

  • Created Filtering functionality : By this time, a filtering functionality seemed to be an important feature to have on the LCMD interface. Filtering simply means that there would be a list of the language tools on one side along with checkboxes and the checking those would output the list of the languages that have those tools enabled. So, if say suppose, we have both jquery.ime and jquery.webfonts checked in, the language output will give a list of the common languages with both the tools enabled. This was kind of important. Screen shot and more detail on another blog post.

  • Set up tools instance for project tool instance

  • Set up new repo for project with lots of commits New repo

  • Created simple php API for language data :  Here I have developed a simple prototype version of Language detail APIs so that any website / user want to use that information that can fetch the details using that API

Return dataType is : JSON and if you are using cross domain data transfer then it should be JSONP.


$.ajax({
    url : 'http://tools.wmflabs.org/lcm-dashboard/lcmd/api/php/dataapi.php?query=jquery_ime',
    dataType : 'JSONP',
    type : 'GET',
    //data : 'query=webfonts jquery_ime' ,
    success : function(data){
        console.log(data);
    },
    error : function(data){
        console.log(data);
    })

It will return the data in JSON format.

Beautiful example of this API usage is here

http://mikipedian.blogspot.in/2013/07/i-see-rather-what-all-i-now-visualize.html

 

OpenCV on your MAC – Easy to install and Configure


OpenCV

OpenCV

OpenCV (Open Source Computer Vision Library) is a library of programming functions mainly aimed at real-time computer vision, developed by Intel, and now supported by Willow Garage and Itseez. It is free for use under the open source BSD license. The library is cross-platform. It focuses mainly on real-time image processing. If the library finds Intel’s Integrated Performance Primitives on the system, it will use these proprietary optimized routines to accelerate itself.

Here in this BlogPost I will explain you to install OpenCV(version 2.3, 2.4) on your MAC 🙂

There are two way to build openCV on your MAC.

1. You can use MacPorts

For this first you have to install MacPorts. The easiest way to install MacPorts on a Mac OS X system is by downloading the dmg for Mountain LionLionSnow Leopard orLeopard and running the system’s Installer by double-clicking on the pkg contained therein, following the on-screen instructions until completion. Installation package is here.

After installing MacPort you have to update it to latest version.

$ sudo port selfupdate

Now you can install OpenCV by running following command

$ sudo port install opencv

If you want to install python building

$ sudo port install opencv +python27

or with python 2.6

$ sudo port install opencv +python26

or with QT

$ sudo port install opencv +qt4

So by this way you can install OpenCV in your MAC OS.

2. You can use CMake

By using CMAKE you can also install OpenCV on  your mac. For that first you should have to install CMake, which thankfully comes with Mac binaries – so that was easy. You can download .dmg file here.

After installing CMake you have to download the OpenSource Package that you can download by clicking here.  Now you have OpenCV-2.4.3 ter.bz2 and unzip to folder. Now open terminal and go to that folder and write following commands in Terminal.

$ mkdir build

$ cd build

$ cmake -G "Unix Makefiles" ..

$ make -j8

$ sudo make install

Now You have done. Congrats you have installed OpenCV on your MAC 🙂

Now you can check by doing following thing.

GO to TerminalType Python

Now type

>>> import cv

Now if it run without any error then \m/ but if you encountered with following error

>>> import cv
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
ImportError: No module named cv

Then close python by pressing ctrl + D key and now you have to run following command

 $ export PYTHONPATH=/usr/local/lib/python2.7/site-packages/

after running this command restart the Terminal and then open python and import cv this will work 🙂

If you have any doubt or problem then you can comment here. Thanks.

CoffeeScript – The Awesome way to write JavaScript


Do you struggle with Braces and semicolon in writing code of JavaScript. There is a solution of this problem and that is – CoffeeScript.  In this post I’ll explore  CoffeeScript – a minimalistic language that compiles to JavaScript.

CoffeeScript – The Awesome way to write JavaScript

CoffeeScript

CoffeeScript

CoffeeScript is a little language that compiles into JavaScript. Underneath all those awkward braces and semicolons, JavaScript has always had a gorgeous object model at its heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way.

The golden rule of CoffeeScript is: It’s just JavaScript. The code compiles one-to-one into the equivalent JS, and there is no interpretation at runtime. You can use any existing JavaScript library seamlessly from CoffeeScript (and vice-versa). The compiled output is readable and pretty-printed, passes through JavaScript Lint without warnings, will work in every JavaScript runtime, and tends to run as fast or faster than the equivalent handwritten JavaScript.

The language adds syntactic sugar inspired by Ruby,Python and Haskell. NO braces and semicolons. Since March 16, 2011, CoffeeScript has been on GitHub‘s list of most-watched projects, and as of 29 August 2012 is the eleventh most popular language on GitHub. CoffeeScript compiles predictably to JavaScript and programs can be written with less code, typically 1/3 fewer lines, with no effect on runtime performance

Syntax of CoffeeScript – Easy to use – Easy to Read

Here I am showing some example.

1. Assignment

str = "CoffeeScript"

2. Function

square = (x) -> x * x

3. Condition

string = "Passed" if  condition

4. Multiply numbers with 2

[1..10].map (i) -> i*2 

5. Object

math =
  root:   Math.sqrt
  square: square
  cube:   (x) -> x * square x

6. Loop

eat food for food in ['toast', 'cheese', 'wine']

CoffeScript vs JavaScript Code

CoffeScript vs JavaScript

Installation

The CoffeeScript compiler is itself written in CoffeeScript, using the Jison parser generator. The command-line version of coffee is available as a Node.js utility. The core compiler however, does not depend on Node, and can be run in any JavaScript environment, or in the browser.

To install, first make sure you have a working copy of the latest stable version of Node.js, and npm(the Node Package Manager). You can then install CoffeeScript with npm:

npm install -g coffee-script

(Leave off the -g if you don’t wish to install globally.)

If you’d prefer to install the latest master version of CoffeeScript, you can clone the CoffeeScriptsource repository from GitHub, or download the source directly. To install the lastest master CoffeeScript compiler with npm:

npm install -g http://github.com/jashkenas/coffee-script/tarball/master

Or, if you want to install to /usr/local, and don’t want to use npm to manage it, open the coffee-script directory and run:

sudo bin/cake install

For More Information and learning
1.http://coffeescript.org
2.http://jashkenas.github.com/coffee-script/documentation/docs/grammar.html

What makes C++ so good?


Answer by Harsh Kothari:

1: Stronger Type Checking – the use of classes, inheritance &amp; automatic type conversions mostly eliminates the need for the abominable void* of C.

2: Type safe linkage – you can’t accidentally call a routine from another
module with the wrong type and/or number of arguments – even if your header files get out of date.

3: A complex data type is provided. It includes all the standard arithmetic operations, implemented as operators, not function calls.

4: User-defined operators and function overloading are supported. When you design a data type you can specify which operators &amp; functions are provided.

5: You can use class libraries to provide robust new data types which can be made exceptionally easy to use.

For example, the Rogue Wave ‘math.h++’ class library implements general multi-dimensional arrays which can be manipulated with high-level operations
and an intuitive syntax:

DComplexArray a(10,10); // Construct a 10×10 complex array
cin >> a; // read it in from standard input
DComplexArray b = inverse(a); // Calculate the inverse
cout << b; // write out the inverse
cout << variance(b.diagonal()); // write out the variance of the diagonal
elements of b

6: You can define automatic type conversions to convert between data types.
For example, the Rogue Wave library provides a conversion from a double array
to a complex array.

DoubleVec a(10, 0.0, 1.0); // Construct a double vector in initialised to
{0,1,2,3,4…
DComplexVec z = a; // Construct a complex vector initialised to
{(0,0),(1,0),(2,0),…
cout << a; // write them out
cout << z;
cout << cos(z)*exp(DComplex(0,1)*a);

7: Provides inline functions which combine the efficiency of using macros
with the safety of using functions – simply prepend the word ‘inline’ in
front of the function – if the compiler can inline it, it will.

inline Double
SumOfPositiveElements
(const DoubleVec&amp; v)
{
Double theSum = 0;
for (int i = 0; i < v.length(); i++) {
if (v[i] > 0) {
theSum += v[i];
}
}
return theSum;
}

8: C++ Compiles most ANSI C code directly and can call compiled C code
directly, so you don’t even have to learn anything new at all!

9: You don’t have to put all of your declarations at the top of each block
in C++.
This means
that you can organise your code into logically related ‘paragraphs’ complete
with their necessary declarations. This makes code much more maintainable –
you can easily move sections of code around, taking the necessary
declarations along at the same time. If you use the const modifier you can
also ensure that variables whose value should not change after it is first
calculated do not do so.

Double x,y; // Declare two variables
cin >> x >> y; // read in their values
const Double sqrtX = sqrt(x); // Calculate the square roots
const Double sqrtY = sqrt(y);
cout << sqrt(sqrtX+sqrtY);
sqrtX = 42; // Will give an error…

10: Classes provide extensible types, promoting code reuse. This can
result in major savings in the amount of code written. I saw a recent
article which stated that the new Taligent operating system, which is written
in C++, consists of 250,000 lines of code, whereas WindowsNT, written in C,
was said to consist of 4,000,000 lines of code.

View Answer on Quora

Which is the best siri like app for android?


Answer by Harsh Kothari:

I found out that there are quite a few good Siri alternatives for Android readily available in the Android Market and most of them are free too. Here is quick collection of top free Siri alternatives for Android.

1. Iris

2. Skyvi

 

3. Vlingo Virtual Assistant

 

4. Speaktoit Assistant

View Answer on Quora

Wiki Loves Monument Competition kicks off – Participate, Upload Pics and Win Prize


Competition : 1st of September to 31st of September

 

Countries are participating

Wiki Loves Monuments is an international photo contest around cultural heritage monuments in September. Starting from the Netherlands in 2010 and organized on a European level in 2011, we go global in 2012!

Everybody can participate and improve Wikipedia in their local and regional neigbourhood. Cultural heritage is everywhere around you, you just need to look and learn!

In every participating country you can win awards, and the best photos in each country continues to the international jury – which will select the best monument photos in 2012.

Global photography contest Wiki Loves Monuments 2012 (WLM) kicks off , while India participates along and competes with other 35 nations.This competition will runs from 1st of September to 31st of September.

List of monuments in India is now ready, which qualifies for the contest.

Rules


There are a few rules for photos to participate in the international contest. Most of these rules are also adopted as rules for participation on a national level. Every submission should be:

  • Self taken and self uploaded;
  • Uploaded in September 2012 and before 30 september;
  • Freely licensed;
  • The default license will be CC-BY-SA 3.0;
  • Contain an identified monument;
  • Nominated through a national contest

Next to that, there are a few practical rules:

  • The participant should have an activated e-mail address on the upload platform;
  • The first winner will get to choose the first prize etc.

If necessary, the rules can be adapted via the international coordinators.

Special categories


Besides the regular contest, there are may be special categories – with their own award and jury. Besides that, the normal rules apply.

Get Started Here for the competition

Get started!

You Can also Download Android app here

Awards

National awards

First Prize 20,000 INR
Second Prize 15,000 INR
Third Prize 10,000 INR
4th and 5th Prize 10,000 (5,000 INR each )
6th to 10th Prize 15,000 (3,000 INR each)
Trophies 15,000

International awards

The national juries will nominate photos for the international contest, which has its own jury and awards. The main prize will be a photo trip to Hong Kong, connected to a visit to Wikimania, the annual meeting where Wikimedians from all over the world meet each other, with a maximum value of 2000 euro! Besides that there will be a number of photography-related vouchers, ranging from 400 euro worth (second prize) to 50 euro worth (tenth prize).

The distribution of these awards is determined by the principle that the first prize winner will have the first choice from the prizes, and so on – to ensure that every prize winner gets the prize he or she would like the most. Prizes are not exchangeable for money.

Special awards

This year, there will be also a special award for the best photo of a gallery, library, archive or a museum building (the GLAM category), awarded and sponsored by Europeana), the European federation of organisations active in the field of European heritage.

  1. For More Info visit website
    www.wikilovesmonument.in
  2. All the images should be uploaded under a different upload campaign created for WLM in India.
    http://commons.wikimedia.org/w/index.php?title=Special:UploadWizard&campaign=wlm-in
  3. Stay Connect on Facebook group Wiki Loves Monument
    https://www.facebook.com/groups/wikilovesmonumentsindia/
  4. and Facebook Page
    https://www.facebook.com/WikiLovesMonumentsIndia