Community Building in India

Along with Arnav and Jigyasa we organised an event to promote contributions to open source projects. We especially wanted to get people interested in the projects we are working on this summer with FOSSASIA. So yeah, we had an awesome event planned in collaboration with the Organising committee of Esya’15 (My college’s Technical festival) and Women who code Delhi. Also, Another fellow working with the Python software Foundation Yash volunteered as speaker to share his experiences.

We had an awesome turnout of about 150 odd people. So Arnav started off with his presentation where he talked about his experience with Open source technologies and How he got into development. He talked about some important things like Why he likes FOSS, his contributions etc. which got the participants really excited. He also talked about some of his projects and GSoC. Then he moved on to our project and how’s it been like till now. You can find his slides here.

During Arnav’s presentation, Mario came online and just after Arnav was done, We put Mario on Live hangout’s video call with the participants. Mario talked about his experience with OSS and why he likes it. He also talked about some projects as well as answered questions that the attendees had. It was a very informative and inspiring talk. Thank you mario for that.

Then Jigyasa made her presentation. Right when she was in the middle of her presentation, his mentor Martin came online on hangouts and her presentation was cut short. It was pretty cool to have Martin as well. Though his children were playing in the background and making some noises😛 but the talk was pretty informative.

Next I put on the pre recorded video Mohit had sent me talking about his experience and some tips to start a beautiful journey into the open source world. His video very precise and to the point. I liked that about the video. The content was really good. Thank you Mohit to take out time to make the recording.

Lastly I gave my presentation where I talked about some myths regarding open source. Then I talked about my experience as a programmer and an Open source enthusiast. For the maximum part of my presentation, I talked about our GSoC project. Arnav also joined me during the time where I was showing some of our work. The participants also asked questions about our project during the allocated time. We also gave them the links to the repos and mailing list etc. to get them a starting point to contribute to FOSSASIA. It was a cool event all in all.

Continue ReadingCommunity Building in India

Personal Recap on First Project Phase

Time has has flown by. It feels like yesterday when we started working and now we’re half way through the GSoC project time already.

But I must say that it has been really lovely working with such awesome people. We are working really nicely as a team. The project that we’re doing ‘Open-Event’ is also going to help so many organisers. It would take away so much burden off of the organisers head. I mean the biggest worry for the organiser is to get the info about the event to the people and get them excited through the medium of the apps like the web-app and the android app and the pain of finding a developer who is worthy enough and then pay a lot to get the app ready in time. All of this is taken care off by our project. It’s cool, right?

Anyway, We have already done the basic stuff in the app and made it operational but yeah now I am working on some other necessary stuff like notifications, bookmarks etc. and Rafal is working on login and stuff to keep the editing rights with the owner only. Arnav is also working on the UI of the app and he has made the app totally on material UI using Bootstrap material. So has rafal on the server frontend.

All of us also had a hangouts call to discuss the future of the project and how we’re going to proceed. Unfortunately rafal couldn’t make it. We discussed about how we’re going to get ready for the final events. So the conclusion was to get 3 environments ready : Staging, production and development, So that we can develop cool new features without harming the work that has been accomplished. So this will be like keeping an alpha, beta and stable version for the server.

At the end I must say that I have learned a lot as well as enjoyed by working on this project and I am sure that ther’s a lot of learning to do in the future as well. Adios !!

Continue ReadingPersonal Recap on First Project Phase

Intriguing Read (Bootstrapping Reflective Systems: The Case of Pharo)

Hiya Fellas 😀

So, while I was browsing through various developments in Pharo, I came across a very eye-catching paper on Bootstrapping Reflective Systems: The case of Pharo .

For beginners, Bootstrapping is basically the process of writing a compiler or an assembler in the source programming language in which it is intended to compile. Applying this technique leads to self-hosting compiler that proceeds without external input.

Though, I am still a newbie and in the process of grasping all this ingenious stuff.
But I am sure that this paper ( Poli12-BootstrappingSmalltalk-SCP ) by G. Polito , S. Ducasse , L. Fabresse , N. Bouraqadi , B. van Ryseghem would make for an interesting read.

Do scan through it and post below your ideas and queries !


Continue ReadingIntriguing Read (Bootstrapping Reflective Systems: The Case of Pharo)

How to implement JSONP to download XML resource

According to the same-origin security policy, web page can freely share images, stylesheets, scripts… but web fonts and AJAX requests are only accessible from the same domain.

Sometimes this is not desired behaviour, such as when getting a json / xml file from a different domain, using AJAX. In such cases, it all comes down to two solutions :

1- The source sets its header to allow specific domain cross-origin resource sharing (CORS). In PHP, this is done with header function :

<?php
header('Access-Control-Allow-Origin: *');

2- Use JSONP.

JSONP is short for JSON padding, a well-known “workaround” to solve CORS. It only works with GET.

To send AJAX requests using JSONP, the server must first knows how to respond to JSONP requests. It usually detects JSONP requests using callback parameter.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
// compute result
[...]

// output result
JsonpHelper::outputXML($result);

// json helper class - credits : @andibraeu
class JsonpHelper {
	private static function is_valid_callback($subject)
	{
	    $identifier_syntax
	      = '/^[$_\p{L}][$_\p{L}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*+$/u';
	    $reserved_words = array('break', 'do', 'instanceof', 'typeof', 'case',
	      'else', 'new', 'var', 'catch', 'finally', 'return', 'void', 'continue', 
	      'for', 'switch', 'while', 'debugger', 'function', 'this', 'with', 
	      'default', 'if', 'throw', 'delete', 'in', 'try', 'class', 'enum', 
	      'extends', 'super', 'const', 'export', 'import', 'implements', 'let', 
	      'private', 'public', 'yield', 'interface', 'package', 'protected', 
	      'static', 'null', 'true', 'false');
	    return preg_match($identifier_syntax, $subject)
	        && ! in_array(mb_strtolower($subject, 'UTF-8'), $reserved_words);
	}

	public static function outputXML($string) {
		# JSON if no callback
		if( ! isset($_GET['callback']) )
		    exit($string);
		$string = str_replace("\n", " ", str_replace("'", '"', $string));
		# JSONP if valid callback
		if(JsonpHelper::is_valid_callback($_GET['callback']))
		    exit("{$_GET['callback']}('$string')");
		# Otherwise, bad request
		header('status: 400 Bad Request', true, 400);
	}
}

Line 29 is dedicated to replace all single-quote characters to double-quote, and new lines to simple space. This is to be able to pass xml document as valid javasript string parameter.

Then, the client can use jQuery to get the document from a different domain (it works on same domain as well, which is convenient for testing & development) :

1
2
3
4
5
6
7
8
9
$.ajax({
	url : source_url,
	dataType : 'jsonp',  // if dataType is set to 'jsonp' 
			    // a 'callback' parameter will be appended to the request url
	success: function(data) {
		$data = $($.parseXML(data));
		items = $data.find('item');
	}
});

Something worth noticing on the client side is on line 5 : the data needs to be converted to xml first, with $.parseXMLbefore converting to jQuery object. Converting the result string directly to jQuery won’t work : $data = $(data);.

That’s about it ! To know more about JSONP, please refer to its wiki https://en.wikipedia.org/wiki/JSONP.

References :

Continue ReadingHow to implement JSONP to download XML resource

Wrapping up our first steps – Event Server, Material Design, Daily Scrum

The Event Organizer application has already the basic features and we can move to apply more advanced feature. But let explain me, what me and my friends have done recently.

Our application is already able to manage conferences and events. An owner can edit and change events in the way he/she wants to. And we have two version of this app for websites and for mobile phones(Android). The orga serv which I prepared share Json API to both Android and Web app. I guess it is really comfortable solution because it enables to share date between web and mobile app. Our app’s template style is based on material bootstrap, the same is used by Arnav in his application. It is very flat design.

Zrzut ekranu 2015-07-06 o 22.58.07
First Version of Open EVent Menu Bar

What I really like during this term is daily scrum, where we can share what we have already done, what are we going to do next, and what were the obstacles. Because of it, we can easily be in touch and avoid duplicating our work. We can also discuss and quickly choose the most useful solution. Duke and Mario accompany us and as always were ready to help with any trouble.

Arnav and Manan also organized a conference on their university. Many students were invited and discussed about taking part in open source projects. I regret not to having taken part in it, but India is so far from my country, that I could not get there.

I hope that the starting up part of this project will be also so developing and exciting, and we will finish it with a huge success. And all of us will be very proud, learn many new things, and improve our experience.

In the nearest future Arnav, Duke and me are going to create three environments: staging, production, and development. It helps us to organize our work. I am sure that we manage to do it.

Ok, so stay tuned. “Show must go on”! We don’t stop working! 😉

Continue ReadingWrapping up our first steps – Event Server, Material Design, Daily Scrum

Pharo Launcher : What? How? #PharoInProgress

reposted from jigyasagrover.wordpress.com/pharolauncher-tutorial-what-how-pharoinprogress

This tutorial has been included as a chapter in  Pharo In Progress.



This post aims to provide a basic overview of what PharoLauncher is and give a step-by-step approach on how to use this application of great advantage.

Overview

Pharo is an open source implementation of the programming language and environment Smalltalk. Pharo is not Smalltalk. Pharo is Smalltalk-inspired.

Pharo offers strong live programming features such as immediate object manipulation, live update, and hot recompilation. Live programming environment is in the heart of the system. Pharo also supports advanced web development with frameworks such as Seaside and more recently Tide.

The official Pharo website defines it as: ”Pharo is a pure object-oriented programming language and a powerful environment, focused on simplicity and immediate feedback (think IDE and OS rolled into one). ”

Pharo relies on a virtual machine that is written almost entirely in Smalltalk itself. Pharo environment is its own little world, designed around a conception of a computer with a minimal operating system and populated with living objects. A Smalltalk implementation is composed of an image (binary code), a major source file and a ‘changes’ file. The image is called Virtual Image (VI) because is independent of the platform you use for running Smalltalk. Smalltalk systems store the entire program state (including both Class and non-Class objects) in an image file. The image can then be loaded by the Smalltalk virtual machine to restore a Smalltalk-like system to a prior state.

As Pharo is open source, it growing rapidly owing to the contributions of people all around the world. Each day we have a new update of the image of Pharo which makes it cumbersome to keep track of updates. It becomes quite a task when one has to download a new image seperately each he/she plans to work on something having the latest issues fixed, new features added etc. That’s where the PharoLauncher comes in the picture. Pharo Launcher, a cross-platform application that

  • lets you manage your Pharo images (launch, rename, copy and delete);
  • lets you download image templates (i.e., zip archives) from many different sources (Jenkins, files.pharo.org, and your local cache) and create new images from any template.

The idea behind the Pharo Launcher is that you should be able to access it very rapidly from your OS application launcher. As a result launching any image is never more than 3 clicks away. “PharoLauncher” is useful to a user who develops and needs to constantly switch between images. PharoLauncher is also a very handy tool to download specific image update versions if you want to reproduce or fix Pharo bugs.Pharo Launcher is a Pharo-based application allowing you to manage a list of images (download, rename, delete) and switch between them without aditional tools.

Downloading/Installing PharoLauncher

As discussed earlier about the rapid evolvement of Pharo , kindly check out http://www.pharo.org/download to get the latest download/install instructions for Pharo Launcher.

Linux Ubuntu:

(http://pharo.org/download#ubuntu) Ubuntu users can use the dedicated ppa to install Pharo

sudo add-apt-repository ppa:pharo/stable
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install pharo-launcher

If you don’t have the add-apt-repository command, install the software-properties-common package and try again. If you are on a server (no GUI), you can get a Pharo Virtual Machine by installing pharo-vm-core.

On Ubuntu, the Launcher is installed as /usr/bin/pharo, so you can type the following command on the terminal to start the Pharo Launcher.

pharo 

ArchLinux :

(http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/2014-March/010932.html)

$ yaourt pharo-vm-latest
$ pharo /path/to/your/image

There’s also a pharo-launcher package that depends on pharo-vm:

$ yaourt pharo-launcher
$ pharo-launcher

Windows:

Download and install the executable from the link provided here.

MacOS:

Use the link (http://files.pharo.org/platform/launcher/latest.dmg)to install Pharo Launcher on Mac system. After installation , you’ll observe that the Launcher is installed in /Applications.

Using PharoLauncher

Launch the Pharo launcher image using the platform-specific VM. The image below depicts how a PharoLauncher looks like when it is opened.

pharolauncher_edited_new

The screen displayed initially has been divided into two parts.

The left part ‘Existing Images’ displays the images already created by the user. Initially after the installation the left side with local images is empty. Whereas the the right side is the ‘Templates’ section which displays the image templates from various resources available for download from the internet. The ‘Existing Images’ section has 3 buttons : Launch, Delete and Refresh. The ‘Templates’ section has 2 buttons : Create Image and Refresh.

At the bottom of the launcher we have the buttons for quit and settings.

Select the image you wish to work on from the list and the sources provided in the ‘Templates’ section and download it. For instance you can download “Pharo4.0 (beta)” from the options provided which is the latest image as of today. By clicking on the ‘Create Image’ button at the top right corner.

Note that also the images from contribution CI are available. So you can easily download “Artefact”, “Moose”, … images according to your choice.

It will download the image into a specific directory somewhere in your users home directory. Each image gets an own folder. Use the “Show in folder” menu item to open this location.

The location of the images can be changed through the ‘Settings Browser’ option located at the bottom-right corner. Go to the ‘Open Settings’ > ‘Location of your images’. Now enter the desired path in the place provided as shown in the figure.

location

After ‘Creating an image’ , a dialog box appears which asks you to give a name to the image as shown in figure below.

rename

After entering the suitable name , the image is displayed in the ‘Existing Images’ section.

myimage

To launch the image, simply select your option and click on the ‘Launch’ button located at the top right corner of the ‘Existing Images’ section and voila ! You have the pharo image of your choice running with the name of your choice.

myimg

You could watch this video on Pharo Launcher by Kilon Alios to get a clearer view (https://www.youtube.com/watch?v=fNim2Yxs320) Resources to explore further:

Do like the post if it was helpful. For any queries/suggestions please comment below. Thank You

Continue ReadingPharo Launcher : What? How? #PharoInProgress

Improve the command line tools of the sTeam collaboration platform

First of all, I really thank Google for organizing such an event for students in the summer and I am fortunate to be a part of such a program. I would also like to thank FOSSASIA for accepting my proposal for the project and for providing me with the experience of working with them.

When you see your name on the list

Name on the list? Google’s server being stacked up with lots and lots of request, Students impatiently clicking the refresh button to see whether their names are present in the list, a lot of students, a lot of projects, and suddenly, that one refresh, when the list loads with the projects matching the student names. (CTRL+F) ”Trilok Tourani” and there it was,

  • Organization : FOSSASIA
  • Project : Improve the command line tools of the sTeam collaboration platform
  • Student : Trilok Tourani
  • Mentors : Martin Bahr(Working mentor) , Chris Angelico, Aruna Herath, Markus(Backup mentors)
  • Status : Accepted

Dumbstruck for a minute, but when it hit me, that I got selected, the happiness was beyond what I had expected. I went on the IRC and thanked my mentors. All I knew was I had a project in hand and a long way ahead to perform beyond their expectations.


About the project

What is sTeam?

sTeam is a collaboration platform which helps people to share their documents, chat with them, have a look at their virtual workarea, and ease the sharing/developing in big groups. You can also look at the current development on the sTeam web interface here. It is still in the development phase, so please feel free to provide us with any ideas to improve. To know more about sTeam, please visit societyserver.

sTeam is completely built on pike programming language. To know more about pike programming, please visit Pike. If you already know about pike, and are good at it, please visit Fossasia’s IRC channel #fossasia and ask for tasks/bugs on this project to solve right away. If you are looking for something other than sTeam, FOSSASIA has a wide range of projects in various fields, and also welcomes any new project ideas.


My part of the project

I would like people to know the kind of work that I am doing currently for sTeam and show them how interesting it is to develop for it.

My project is to develop the command line tools to ease the work for the developers, and people who choose to work with command line, over a web interface.

These tools include,

  • Exporting your documents to your Github repository with just a command.
  • Importing document from Github right into sTeam for people to see.
  • A easy to use debug client that helps you while developing for this platform, or to see the various documents/containers you have in which room, move them, copy them, use them, all with commands similar to the Linux command line.
  • A way of to edit your documents directly with command line editors, without having to go to the web, type in the url, clicking on a document, and then finally editing it.
  • Chat with your friends/group members over the IRC.
  • and more being added to the list….(Please contact us if you have any)

These tools are already built up, but with more development, they will be very efficient and easy to use commands which a normal user can type in and get things done, and this is where my part comes in.

For some of these tools, which are already built, some development is needed. While some other tools, I have to develop by myself and enhance the command line usage for sTeam.

These are few of the commands with their screenshots to help you understand exactly what these tools are meant for,

The sTeam debug client

The editing documents client,

and edit the document in a simple command-line editor (used vim here),

Exporting documents from sTeam to git (version-wise)

Importing documents to sTeam from git (version-wise)

If you really like what I am doing, or are interested in developing for sTeam, please join our IRC channel #fossasia or join fossasia@googlegroups.com .

If you are looking for some other project, FOSSASIA has a lot of projects to be worked on. Please visit FOSSASIA for more info.

Continue ReadingImprove the command line tools of the sTeam collaboration platform

searchQuick Apprise: FOUR #GoogleSummerOfCode #FOSSASIA

banner-gsoc2015.png.pagespeed.ce.1-XG35qq3R8SQJ5DGgL9

The intended “searchQuick” (sQuick) is an application to enable a user to search a set of books or texts, like an encyclopedia, or some other topical book collection offline built in the open source platform Pharo 4.0.

header



After indexing the content and the next task that was covered was searching for the user input string. The #queryString: does a fantastic job as of now.
The search results were printed in a scroll-able pane by iterating through a loop so as to cover each and every existence of the desired string. The search results window also enables the user to view the content of the chosen file.

02Search Results Display

Acting on the suggestion of my mentor, I have also loaded the Pharo image with text versions of large books (Thank You Project Gutenberg 🙂 )  to test the working of the search function.

UPCOMING

  • GUI Modification
  • Integrated Exhaustive Testing
  • Addition of help/tutorial

PS: The GUI of the application is under constant evolvement, Kindly ignore the poorly structured window 😛

Stay tuned for more…
Post any queries , will be happy to help 🙂


Continue ReadingsearchQuick Apprise: FOUR #GoogleSummerOfCode #FOSSASIA

Knitting machine abstractions for Knitlib

Hello, during the last weeks we have been working on Knitlib and Knitpat, a knitting machine control library and a standardized format that allows for exchange and storage of patterns.

In order to achieve a common platform for knitting machine development we have the need to abstract away implementation details that can difficult the generic usage of the lib, while keeping extensible and powerful control features. Among the most important abstractions developed for Knitlib is the Knitting Machine Finite State Machine, an abstract representation of the procedures needed to operate a knitting machine.

BaseKnittingPlugin
BaseKnittingPlugin, the basis of knitlib’s machine knitting controller plugins.

The architecture of Knitlib allows for easy integration of different knitting machine plugins for varied use cases, hardware, and software protocols. All functions of the plugin are non blocking except for .knit(), which is blocking due to the physical interaction needed in order to execute this command. To ease usage and to enable more versatile behaviour from the .knit() function, without limiting the interaction facilities needed for operation, the callback infrastructure allows for blocking and non-blocking callbacks from the Plugin to the machine operator (the Knitlib client), such as Information, Warnings, Error Notifications or Mechanical Required Actions (moving spools, switches, needles, etc). Callbacks abstract away the notification and interaction paradigms from the plugin, allowing for simpler behaviour, a more elegant design and ease of testing. Callbacks also allow for future plugins to not take care into implementing user interfaces, but to focus on functionality.

The pending remaining challenge is to standardize configuration options, flags and settings in order to allow for UI that respond to each plugin requirements and options, and to specify which features are supported on each machine plugin. Insofar, most of the standardization has been done on Knitpat, but some specifications such as physical resource assignation (Serial Ports, input streams, etc) are still to be implemented soon.

Thank you, and I hope this article helps you to understand the software architecture and design patterns of the implementation of Knitlib.

Regards,

Sebastian

Continue ReadingKnitting machine abstractions for Knitlib

GSoC 2015 with FOSSASIA – Mid-term report

TL;DR No Chicken Little, the sky is not falling.

Well. I’ve been selected for GSoC under organization FOSSASIA and I am working on the project sTeam Collaboration platform, mentored by awesome guys Martin and Aruna.

It is mid term already and as planned I am half way through the project. If you haven’t seen my past blogposts, go check them out to get clear idea of the project.sTeam is a document based collaboration platform. There is already an existing web interface for the platform. Interestingly REST APIs are being developed for the same and we planned to rewrite the web interface with AngularJS and make calls to the REST APIs.

Technology stack

  • bower for easy management of external modules. There are a lot of sub modules which are to be loaded and are not part of the angular itself. Though, some of the modules are bloated. The unnecessary files will be removed by using bower prune task with gulp.
  • angular-ui-router for handling deep nested routes. Interesting thing is, angular-ui-router works on state based concept and is very handy to maintain and route to certain state.
  • angular-ui-bootstrap gives us easy to use, clean and responsive UI blocks.
  • angular-local-storage We use it for saving the user’s login credentials and are sent to the API with every REST based call. This would be changed in future and session maintenace should be developed.
  • textAngular is lightweight and two way bound WYSIWYG Text Editor for handling plain text files. It can also handle source code, markdown, etc ..
  • ng-audio and ng-video for viewing audio and video files respectively.

Views

  • login and workarea are two base templates. And the router loads one of these based on the login credential value stored in local storage.
  • With workarea as base template, at this level, two nested views. Groups, which displays the groups which the user is part of and Private, where the user’s private documents are displayed.
  • The options view has various options like, permission management for the current level, copy, link, etc.. and also create room and document modals.
  • comments view fetches the comments for the current path. It is hidden if no permission to comment.

Controllers

  • loginCtrl for passing the credentials to the API, authenticate and parellely store them in localStorage. And all the other calls will use the stored value along with its payload. You know, REST is stateless! Session management is scoped to the API and is planned for future.
  • handler has functions for CRUD operations on the API. The functions do GET, PUT, POST, DELETE, .. on the passed paramater (which is the path to the room/document) and will return the value.
  • router handles the routes. It has base states with views loaded into each states with its own templates and controllers.
  • The run methods load are used for state change control.
  • workareaCtrl handles the scope for options loading and current level display in breadcrumb.
  • workspaceCtrl fetches and controls the main workspace which has the rooms, documents and containers displayed.
  • config has the hostname where the sTeam is deployed and change here is reflected systemwide for easy deployment.

Road ahead

  • Depending on the type (room/document), the appropriate view should be loaded and when document, the viewer/editor wrt to the mime type should be loaded. Follow the issue here – https://github.com/dolftax/sTeam-web-interface/issues/10
  • Implement search, document/room sorting based on Author, Title, document type and date.
  • Setup right sidebar which lists all the rooms (for easy navigation).
  • Settings popup for changes to attributes of the objects.
  • Automate tasks with certain gulp modules – gulp-angular-templatecache, gult-concat, gult-lint, gulp-uglify, ..
  • Write unit tests with mocha and chai.
  • Tidy up and add more documentation, which is already being done here –https://github.com/eMBee/sTeam/wiki/Installation-steps

Apart, we do scrum meet everyday. Check out the logs – http://dpaste.com/2A3J121

Currently, node-static module is used to serve the app and our development server is hosted in azure – http://steam-web.azurewebsites.net/

Note: The project is heavily under development and things might break.

Sign-up API is not implemented yet. Find some of the working screenshots below

Login

Private workarea

Groups

Create room

Create document

Future plans

The REST APIs are under development and a lot of features are yet to be developed. I have a brief listing of the yet to be developed APIs and the list grows eventually as we figure out something is missing.

Thats all for now. Will get back soon!

Continue ReadingGSoC 2015 with FOSSASIA – Mid-term report