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…

Continue ReadingPharo Launcher : What? How? #PharoInProgress

searchQuick Apprise: FOUR #GoogleSummerOfCode #FOSSASIA

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. 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. Search 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 :P Stay tuned for more… Post any queries , will be happy to help :)

Continue ReadingsearchQuick Apprise: FOUR #GoogleSummerOfCode #FOSSASIA

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…

Continue ReadingGSoC 2015 with FOSSASIA – Mid-term report

searchQuick Apprise: THREE #GoogleSummerOfCode #FOSSASIA

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. After the GUI was designed with minimal features, the next task was to develop the cardinal search function. Indubitably, a well-run search application/engine requires indexing. Search Application/Engine Indexing basically collects, parses and stores data to facilitate fast and accurate information retrieval. That being, the index for sQuick was built using the Dictionary data structure in Pharo which works like HashTable of other programming languages/platforms. index := Dictionary new. Pharo describes a Dictionary as: "I represent a set of elements that can be viewed from one of the two perspectives: a set of associations, or a container of values that are extremely named where the name can be any object that responds to =. The external name is referred to as the key. I inherit many operations from the Set. " The contents of the text files present in the current Pharo image were split at whitespaces and added to the index along with the corresponding file title. tokens := ' ' split: aDocument contents. The method #indexFiles was used to iterate over all the text files in the current Pharo image to index all the files before the searching begins. Dictionary Entries after File Content Indexing The #queryString method has been temporarily build using #includesSubstring which matches the user input string with all the entries of the index and gives the result in an array form with #tally output as the number of search results. Various test methods are now built to inspect the functioning of the methods designed. Continuous debugging is being done to check out and remove errors, if any ;) UPCOMING: Improve the indexing technique Explore methods to quicken the search functionality Integrate the search routine with the GUI already built Design more test cases to develop a bug-free application Stay tuned for more... Post any queries , will be happy to help :)

Continue ReadingsearchQuick Apprise: THREE #GoogleSummerOfCode #FOSSASIA

TicTacToe Tutorial #FunWithPharo

reposted from jigyasagrover.wordpress.com/tictactoe-tutorial-funwithpharo This tutorial has been included as a chapter in  Fun With Pharo! Tic-tac-toe (or Noughts and crosses, Xs and Os) is a paper-and-pencil game for two players, X and O, who take turns marking the spaces in a 3×3 grid. The player who succeeds in placing three respective marks in a horizontal, vertical, or diagonal row wins the game. Because of the simplicity of Tic-tac-toe, it is often used as a pedagogical tool for teaching the concepts of good sportsmanship and the branch of artificial intelligence that deals with the searching of game trees. It is straightforward to write a computer program to play Tic-tac-toe perfectly, to enumerate the 765 essentially different positions (the state space complexity), or the 26,830 possible games up to rotations and reflections (the game tree complexity) on this space. So , here we make a Pharo version of this well-known game by using Morph. This post provides a step-by-step approach on how to go about building this simple application. A game package will be built having 3 subclasses : TicTacToe TicTacToeCell TicTacToeModel Initially , we have created TicTacToe a subclass of the Object class. The subclasses we will make will be combined in the package game as mentioned in the category: parameter. Object subclass: #TicTacToe instanceVariableNames: 'container model' classVariableNames: '' poolDictionaries: '' category: 'game' A category name is not required in order for the class to work, but you will not be able to access the class to make changes or to look at existing code unless you provide a category name. (The category name used can be a new category name or the name of an existing category.) The poolDictionaries: parameter is seldom used and will not be discussed here, and the category: parameter specifies the category under which this class will be grouped in the system browser. As we know, a class encapsulates data values and methods, and every object contains a set of the data values and can receive any of the methods as a message. The data values in each object are specified by providing a set of names of variables whose values will be an object's internal data values. Each object has its own set of these values, and the set of data values for an object represents the object's state (or value). The variables that contain the data values of an object are called the instance variables for the object, and the instanceVariableNames: parameter is a list of names, separated by blanks, for the instance variables. In the above code snippet , we have declared container and model as two instanceVariables. The classVariableNames: parameter lists the identifiers that are the names of variables shared by the class and all of its objects. That is, there is only one set of these, and they are used by the class and all of its objects. Class variables (so called because they belong to the class, of which there is only one, rather than to the objects that are…

Continue ReadingTicTacToe Tutorial #FunWithPharo

searchQuick Apprise: TWO #GoogleSummerOfCode #FOSSASIA

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. After building various mock-ups for a user friendly graphical interface for the application, the rudimentary features which would be present in the first release were finalized. The chief features would include : Search for word(s) Browse files in the current image Help or Tutorial About section Feedback or Suggestion Aid Explore the code ( Cardinally Open Source ;) ) LATEST MOCK UP OF GUI FOR sQuick At this moment, the most viable options available (apart from the use of GTSpotter, Rubric or Bloc suggested by developers on the forum and #pharo IRC) include: The use of Spec to build the UI which provides a comparatively easier option to implement Button Click Actions, User Input Search String Retrieval etc. But the graphical interface designed by placing the widgets is not a very fancy one and dependent on the current theme of the image. The Morphic GUI gives the application a very pretty look in comparison, however the user input search string retrieval method is not a straight-forward one and is under construction. After considering various pros and cons, the suitable alternative is considered to be the one made with Morph as it gives a refreshing look to the application. UPCOMING: Completion of GUI development Commencement of Index build Stay tuned for more... Post any queries , will be happy to help :)

Continue ReadingsearchQuick Apprise: TWO #GoogleSummerOfCode #FOSSASIA

Starting with Smalltalk, Pharo and Spec

It’s been a few weeks since I started with Smalltalk, Pharo and Spec. Under the guidance of Mr. Martin Bähr, Mr. Sean DeNigris and people from the #pharo community (@thierry, @kilon, @maxleske) I have been able to learn Pharo in a systematic way. I have implemented the knowledge gained by building a few simple desktop applications using the resources available online. This post intends to clear all your doubt regarding the basic definitions of Smalltalk, Pharo and Spec. GETTING THE BASICS CLEARED Smalltalk is an object-oriented, dynamically typed, reflective programming language. It was designed and created in part for educational use, more so for constructionist learning. The language was first generally released as Smalltalk-80. A Smalltalk 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 form 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 Sean DeNigris wrote to me: “You may not realize it, but you have opened a portal to some of the greatest minds in the history of our industry. You have in your hands, not a programming language, but a live, dynamic, turtles-all-the-way-down environment designed to provide 'support for the creative spirit in everyone'. More practically, Smalltalk is a programming tool that allows productivity unimaginable in most systems. And, if you put in enough time and effort to actually think in it, it will help you program better in any language you use.” ; Smalltalk is more dynamic and powerful than what one can think of. 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. Spec is a simple framework for describing User Interface (UI) for Pharo Smalltalk. It takes a model and a layout description, runs it through an interpreter and a UI is produced as a result. All the widget implemented this can then immediately be reused as any other widget. It also allows the separation of concerns between the different parts of the user interface as expressed in the MVP pattern. Spec emphasis the reuse of the widgets as…

Continue ReadingStarting with Smalltalk, Pharo and Spec

searchQuick Apprise: ONE #GoogleSummerOfCode #FOSSASIA

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. In the inceptive coding period of this project development the tasks achieved are as: Designing the basic graphical user interface using Morphs in Pharo 4.0. The morphs elements utilized to make the interface elements included: - TextMorph for labels etc. - PluggableTextMorph to display the contents of the file - ImageMorph for background, header GIFs etc. - TextMorphForEditView to enter the search string. - SimpleButtonMorphs for creating buttons whose click will perform the desired action. - MenuMorph , MenuItemMorph to make the list of files available as 'Browse' menu. - DropListMorph to make a drop down list menu for the selection of languages. Loading the files in the current Pharo image and making methods/classes that would directly access those files from the image and display their names as a menu list Making a Metacello Configuration of the project for easy project loading in Pharo. For further ease, the project configuration was directly added to the Meta Repo of Pharo 4.0 at SmalltalkHub.com and now the project can be directly loaded through Configuration Browser in Pharo 4.0                   World > Tools > Configuration Browser > sQuick(jigyasa) Removing the cache of the instance of the MainInterface so as to allow the users to open up many search/content windows simultaneously Making of a content window that would display the file name and the file content when the file name is clicked from the 'Browse Files' menu Designing mock-ups for the UI for an enhanced user interface which include the latest search engine feel UPCOMING: Augmenting the UI for a pleasant user experience Initiate working on the search tool / indexer build. Stay tuned for more... Post any queries , will be happy to help :)

Continue ReadingsearchQuick Apprise: ONE #GoogleSummerOfCode #FOSSASIA

[Second Draft] Designing a document based collaboration interface

.. this post is the continuation of my first draft which you could find it here -http://dolftax.com/2015/04/Designing-a-document-based-collaboration-interface/. I would ask you to go through the first draft before proceeding here, because here I’ve explained only the wireframes which are modified/tweaked, based on the comments on the first draft. This post is structured as /me resolving the comments on my first draft, with the new wireframes and explaining the reasons for modification. Rooms could be nested #1 : We could not enforce a topic/subtopic structure because rooms can be deeply nested. Topics and subtopics are all rooms. The users are free to organize the rooms as they wish. They could be topics, they could be something else. At every level, there may be documents and more rooms. => Removed topic/subtopic structure. As the rooms are completely nested, a room could contain any number of sub-rooms. Rooms and documents are analogous to folders and files. But wait, there are containers which are multi-part documents. To get the clear idea of what we mean by containers- refer to the discussion we had IRC log -https://tr.im/UOZpT Shared and Private workarea #2: The basic elements in sTeam are users, groups, rooms and documents. Each group has a workarea connected to it, and each user has a private workroom. Each user is a member of at least one group. So when a user enters the server, there are at least two rooms: the users private workarea, and the workarea of the group, that the user is a member of. => Workarea implemented. Under shared workarea, the user will get list of all rooms and documents which he got access to. Under private workarea he would get list of his private documents and rooms, which when shared will move to the shared workarea. Shared Workarea Private Workarea If you notice, you could create a room or document only in your private workarea. When you change permissions for a room/document in your private workarea, it would be pushed to shared workarea automatically. Permissions are inherited If a room has rw permissions, then everything inside the room also has rw permissions. Room view - Level two Notice the settings icon? Except for the first level, (levels are tracked by the level/stage bar) a user could change room/document attributes with the help ofsettings icon which pops up a window with following options. The settings option appears only in the levels inner to level 1, because obviously, if the user is in the first level, he is not into any room. Navigation between rooms #3: The user can move from room to room. The server keeps track of where the user is, and actions taken (such as creating a document) are relative to the users location. Users can pick up documents (the document is moved from the room, to the user itself), move to another room and drop the documents there. => When a document is selected, the copy and paste buttons (look at the above wireframe. buttons next to sort…

Continue Reading[Second Draft] Designing a document based collaboration interface

[First Draft] Designing a document based collaboration interface

This post is about my way of approach to develop User Interface for a document based collaboration platform. The Ideation is based on Martin’s thoughts, which you can find it here - http://societyserver.org/Topics/sTeam/Interface-elements-for-Document-Management . I would ask you to read the post and be back here. The structure lives and evolves. and so do the documents. - Martin Alright, You’re back! The primary goal was not to develop a separate admin panel. Rather the interface adds up extra admin options based on the permissions given to the logged-in user (Maybe, admin). When I say admin, it means the authorized user who has Read/Write permissions and guest stands for non-authorized user who has only Read permissions. As quoted, everything here would be documents, of any type (images, plain text, source code, ..) They should be structured into hierarchies. The admin/authorized user should be able to add new room, able to sort by Title/Author/Date, able to Re-arrange the documents, implemented as drag and drop. ![Home Admin && User ](https://raw.githubusercontent.com/dolftax/dolftax.github.io/master/sTeam/wireframes/1.png) Each room should have Topic Description Keywords and good to have various other attributes which might explain the room well. The admin has a sidebar which options to perform CRUD (Create/Read/Update/Delete) operations on a room. The sidebar is hidden for guest user. The wireframe below is detailed/zoomed view of a room in the above image. ![Room - Detailed View Admin](https://raw.githubusercontent.com/dolftax/dolftax.github.io/master/sTeam/wireframes/2.png) Creating a room asks for Room specific information. If you look at the wireframe below, they are self-explanatory. Permission would be set at this level whether it could be Shared/Private. On click of a Room/Topic opens up the sub-topics under the room. The listing could be sorted and searched. Communication, being one of the major element for collaboration would be of comments. The admin gets to moderate (Approve/Delete) the comments. At this level, the comments are room-specific. ![onClick of Room Admin](https://raw.githubusercontent.com/dolftax/dolftax.github.io/master/sTeam/wireframes/4.png) You should have noted the >> on the right. It opens up a sidebar with Room/Topic listing which then nests into Sub-topic listing. These are the doors which helps the user for hassle-free navigation between rooms. The sub-topic ( as same as Topic) has description, keywords and various other attributes. The sidebar of options and Add Sub-topic for admins to perform CRUD operations on them. The Sub-topic sidebar would be hidden for guest user. Considering the hierarchy as a tree, the leaf node be the document. A document could be of any type, markup-text (markdown, html, others) xml, json, csv source-code image audio video binary object (instance of a script) Displaying the content of a document in the browser would be based on the type of the document. Anything text based, images and videos are displayed. For other binary files or objects, only metadata is displayed (owner, date of creation etc). And binaries would have a download link. Comments at this level is document specific. At any level, one should be able to navigate to any room/topic (or) sub-topic with the help of the right sidebar drawer. The admin has the following…

Continue Reading[First Draft] Designing a document based collaboration interface