GSoC#4: Project and pre-first evaluation period

My project is about adding support to automate the migration process, in particular, after an OS upgrade or hardware change. So, from a set of manual migration instructions, the project aims to narrow it down to `port migrate`.

The project is divided into three phases: getting the information (in our database), removing the (existing) information, restoring the (updated) information. I know, it doesn’t seem to be a really efficient logic but we plan to improve it further as we go.



First Phase: The action `snapshot` aims to replicate the user install commands. The plan was to implement this using database and not files, so it justifies the need to add support for the tables to the entire stack up from cregistry.
  • The snapshot action basically takes a complete copy of all the installed ports and the metadata. Till now,
    • 3 new sqlite tables have been added to the registry’s create and update function and regsitrydb version renewed so that existing installations get them too.
    • snapshot_create in registry2.0/entry.c enables access to the sqlite database from Tcl frontend using registry APIs. It calls cregistry/entry.c reg_snapshot_create internally.
    • reg_snapshot_create creates a snapshot in the snapshots table, calls snapshot_store_ports.
    • snapshot_store_ports stores info on all currently installed ports in the snapshot_ports table (and requested flag)
    • snapshot_store_port_variants stores port variants with the sign in the corresponding table. It depends on getting parsed variants which I have not written yet (reason below).
  • Time spent on figuring out things initially counts as well, right? Only if this does not become an endless excuse.


Talk about Future: Go according to the Timeline mentioned in the proposal. Quickly finish the left outs in this 4-day planned buffer and start with the migrate action. Things seem to be picked up fast compared to the initial weeks. I’m now more aware of where lies what, hopefully.


I was stuck at.. 
  • for a long time, Tcl or C? In what language do I have to write the above three functions, Tcl or C? Believe me, this is not something you ask your mentor or community or perhaps, anyone. Then I started looking at the implementation of existing commands, one by one, took 3 to 4 days, and then one fine morning, I saw the mapping array from command to function. It was there, right at the bottom of entry.c. Yes, if you give this argument to registry::entry, this method will be called. Had a sound sleep that afternoon.
  • for a short time, probably for a day, that there exists something like reg_entry_propget to help you see through dark, to get what you want, just give the key. Should have spent more time going through C files than Tcl ones during community bonding period :/.


I am stuck at ..
  • Only one variant of a port can be active at a time. Makes sense. Running `port install apache2 -preforkmpm +workermpm` and then `port install apache2 +openldap` saves apache2 as two different ports in the registry. So, reg_entry_propget only returns one variant of a port when passed as reg_entry pointer. Now, how do I link the two variants installed (note installed and not active) to the same port in my database? If not, all we are left is with one variant mapped to “each” port, questioning the need for snapshot_port_variants table.
  • Till ^ gets resolved, I won’t be able to write get_variants_parsed function.
  • IMPORTANT: where to add the OS check? I tried starting a discussion on this but never arrived at a decent conclusion.


Still not clear ..
  • where to include the --list for listing snapshots? if with `snapshot` action, then it creates the need for --create which I do not prefer personally. But if with `restore`, then `port restore --list` doesn’t appeal as well. Only if a command existed which lists the choices first and then proceeds so that I could simply copy their design strategy and save myself from confusion every time I decide to do things nicely.
  • limiting the number of snapshots that a user can take?
  • and more to come :).
Screenshot if someone enjoys looking at it, I just like the shutter sound:




I like this one:


Also, I forget, the unreviewed commits are here.




EDIT:
A doubt, so fundamental to my project, that got cleared while writing this post:
  • We’re solving for these two end use cases (correct me if I'm wrong):
    • running simply `migrate` is (snapshot the current installed state + restore).
    • `snapshot` followed by `restore`: restoring back some existing snapshot.
  • Interactive restore could be a solution for --list?

GSoC#3: A 'miss'-communication

This happened in the very first week of the coding period of my GSoC. I had things in mind to talk about but they just remained in my mind forever until I received an email that scared me out of my wits and condemned me for not communicating at all for the last ten days. And it was true. 

Failing your evaluations just because you are not communicating properly is like not accepting help from the rescuers but waiting for God to come to rescue you while you're drowning.

Communication is the key. How much did you think about the project over the last week? How much effort did you put into thinking about your proposal? What does your research say? They need to know and you need to tell. It becomes difficult when it's remote.

Think of it as an office internship in some company. Not communicating at all means you go to the office but do not speak at all or engage with anyone and just watch around. Isn't this when we start calling the person weird and alien? People have fought for the freedom of speech and now, you're just being shy. Stupid!

Know how to sell yourself. Research well before making your points but if it takes time, then throw a mail to let the community know that you ARE researching and have the following updates to share. They don't know if you were staring at a blank screen all the time or even existed for that while. Play on your strengths and work on your weak points.

The community is not interested in the project code or the small fixes you make but in your approach to solving larger problems. The bigger things are more interesting to you and to the organization. What is it that you bring to the table? What would you do to improve the project beside the small fixes? Think about how you would spend your time this summer. 

They are interested both in your technical skill, but also your holistic understanding of the project. Ultimately, they will judge you by the thoughtfulness of your proposal.

GSoC is just another way Google provides you to connect with the people around the world. Review each other's code, your mentor's code each day. Think of it as a score for your personal development. You are not given this opportunity to complete one project and just get done. You failed if that's what you plan to do, even if you pass the official evaluations. You are given a life long opportunity to be a part of a community having members from all around the world and all you did was write five hundred lines of code. Ha!

To quote my mentor, "Communication is the foundation of a team. It is as important as any code you ever write. It is unlikely you will focus on building things only for yourself and success in building with and for others will largely depend on your ability to communicate. Always work at refining your communication skills. They will pay off in many dimensions of your life."

There are absolutely no limits to what someone can do! It's just how badly you want it.

Good luck!

GSoC#2 It begins... Community Bonding!

Now that Google Summer of Code 2017 has officially begun, I am not sure what to do.

Well, I had a lot of plans for this period in my proposal but they just seem trivial as well as confusing now, reading code and all that stuff. So most of the community seem to pass by and I lost hope. Who can even dare to go through a minimum of three to four files having more than 5000 lines of code?

Finally, a video on Introduction to MacPorts Base recorded by Clemens last MacPorts meeting came to rescue which gave the overview anyone needs to find and fix things in base. Basically, the video is a tour through MacPorts base hopping between port client, macports1.0, Tcl slave interpreters and C code for database access and to deal with system settings like proxy.

My notes (in raw form) while watching the video:

  1. port.tcl - port commands and corresponding procedures.
  2. macports.tcl -
    • mportinit - 
    • mportlookup - sources (default, ... ), PortIndex
    • mportopen - run the PortFile, does some caching as well, also, work done in a slave interpreter ($workername), aliases of macports APIs for use by portfiles
    • mportexec - takes mport returned by mportopen, gets the slave interpreter instance from mport
    • Example - portfetch, elevateToRoot and dropPrivileges, curl as a Tcl extension
    • functionality for command line users to keep it simple and easy to write port clients vs. complicating it for UI
  3. port1.0 - *portfile context*, eval_target, target_run
  4. package1.0 - downloading pre-compiled packages, verifying and extracting files
  5. darwintracelib1.0 - implementation of the trace mode, loaded into processes while they build
  6. machista1.0 - mach-O parser used by ref upgrade, SWIG
  7. programs - daemondo for launchd scripts
  8. CFLib1.0 - core foundation, bridge between Tcl and others, cocoa APIs, getting proxy settings (redundant)
  9. tclobjc1.0 - bridge between Tcl and Objective C (redundant)
  10. tests
  11. registry2.0, cregistry (C API for the registry database), port activate and deactivate, multiple versions and revisions of ports
There's no point in expanding the above into paragraphs. They are more like keywords. To the left of hyphen are the modules present in macports-base src directory. I know this isn't any interaction with the community but helps me at least know what to ask. Also, by now, I have got commit access to MacPorts's Git repository and a MacPorts @macports.org handle :D!

I'll be talking about my project in the next post, soon.

GSoC#1 Sounds like Summer!

After waiting anxiously for the results and refreshing the page hundreds of times to see, if, by any chance, the results were out before 2130 UTC, officially I'm in!!!

It seems like yesterday when I was an open-source newbie on IRC, with a little knowledge of programming in C and a bit of Python learned through university courses. Little did I know that writing programs is just the Prolog of the process called software engineering. Looks like the summer is going to be a lot of cmakes and compilation errors.

I will be working as a student developer under Google Summer of Code (GSoC) for The MacPorts Project. I would like to thank pixilla, cal, and ijackson for helping me get started, being patient throughout my doubts, and giving feedback on my proposal.

                                               GSoC'17MacPorts


I'll try to post updates over here every 2 weeks and try to document as much as it's feasible for me. So, watch out for more about the project.

My GSoC: MacPorts proposal can be found here.

TOPICS OF CBSE SCIENCE EXHIBITION
Sub‐Theme 1 Biodiversity: Conservation and Sustenance

The exhibits/ models on this sub‐theme may pertain to:
 Exhibits showing the methods of measurement of biodiversity;
 Models showing the significance and importance of the biodiversity;
 Strategy for ecological restoration of the micro and macro habitat;
 Impact of climate change on biodiversity and their remedial measures;
 Impact Assessment study of various developmental activities on biodiversity;
 Strategy/ methods for the presentation and protection of threatened / rare/
endangered plants and / or animals;
 Assessment of the impact of various human activities on the biodiversity of a
region;
 Identification of plants of medicinal value in the biodiversity rich area;
 Report of already known medicinal plants from a new area;
 Impact of monoculture in forest during afforestation and reforestation;
 Studies on the impact of introduction of exotic species in a natural ecosystem;
 Causes and impact of deforestation due to various river valley projects;
 Causes and impact on biodiversity rich hilly region due to construction of large
dams;
 Causes and impact of deforestation due to various industrial activities;
 Inventorisation of biological resources in different regions/ parts of the country;
 Strategy for sustainable use of genetic resources / germ plasm;
 Reclamation of wasteland and revival of their biological potential through
microorganism conservation;
 Understanding of the intricate relationships and linkages between plants and
animal species in an ecosystem;
 Role of biological sciences including biotechnology in multiplication of the rare,
endangered and endemic species;
 Strategies for in situ conservation of wild life by multiplication and restoration of
threatened, rare and endangered species; etc.

Sub‐theme 2 Agriculture and Technology

The exhibits/models in this sub‐theme may pertain to:
 Studies of climatic change on the agriculture;
 Managing crop yield due to climatic change arising from global warming;
 Eco‐forestry of protect and restore eco‐system for sustainable forest
practices/preserving and enhancing forest biodiversity;
 Preservation and conservation of soil and judicious use of water;
 Growing fodders in hydro‐panic environment;
 Indigenous designs of farm machinery, agriculture implements and practices;
 Application of biotechnology and genetic engineering to agriculture for improved and
high yielding varieties;
 Application of biotechnology and genetic engineering in improving breeds and
production of animal products that are used as food;
 Improved / improvised method of processing, preservation, storage and transport of
animal products;
 Application of biotechnology, microbiology, genetic engineering and genomics to
agriculture for improved and high yielding varieties;
 Use of biotechnology for economically and ecologically sustainable biofuels;
 Ecologically sustainable farming methods;
 Organic fertilizers versus chemical fertilizers;
 Environment friendly measures of pest control;
 Harnessing of animal products keeping environment concerns;
 Innovative/inexpensive/improved/indigenous technologies/methods of
storage/preservation/ conservation/ transport of agricultural products and good
materials;
 Growing plants without seeds;
 Identification of medicinal plants and their applications;
 Effects of radiation. Electric and magnetic fields on the growth of plants and protective
measures;
 Sugar levels in plant sap at different time and dates;
 Genetic variations among plants;
 Models of improved versions of various types of machines and manufacturing plants;
 Schemes/designs to help reduce production cost and conservation of raw materials;
 Use of eco‐friendly innovations that may help in increasing the industrial production;
 Innovative methods of exploration and processing of minerals, crude oil. Etc;
 Issues related with the service industries like tourism, banking, It etc.;
 Plan for proper management of natural resources and environment;
 Monitoring the changes in wildlife caused by the human encroachment;
 Devices or methods that control pollution;
 Impact of pollution on living and non‐living;
 Devices to control and measurement of the noise, air, soil, water pollutions;
 Study of chemical spills in industry;
 Awareness about various aspects of environment and disposal of harmful effluents;
 Preservation, conservation and management of soil;
 Analysis of soil samples for their components;
 Ecological studies of plants and animals;
 Experiments with biodegradability;
 Efficient methods of harvesting and using plankton;
 Effect of lubricants on gears;
 Study and record of varying water levels over the years in the water body, surrounding
environment;
 Design and development of an automatic weather recording device;
 Ozone destruction experiments; etc.

Sub‐theme‐3 Green Energy

The exhibits/models in this sub‐theme may pertain to;
 Green roof technologies/roof mounted solar technologies such as solar water heater,
solar lighting system/heating system of building by solar heater;
 Devices to make breeze funneling towards your home / natural cooling of the house;
 Designs of insulated bricks for very cold / hot places/ methods of heat retention in
material / heat control in the design of house;
 Green bricks using waster materials / different innovative materials for furniture /
construction / road laying;
 Innovative designs of solar cooker / solar distiller / solar dryer for food processing / solar
heated houses;
 Solar thermal electricity / community solar project;
 Innovative designs for installation of solar tower/mounting solar panels for electrification
in buildings;
 Hybrid solar lighting (solar illumination by routing daylight into the interior part of the
building by reflecting a focused beam of sunlight through optical fiber cables ;)
 Studies of variation in sunshine intensity at a given place for developing indigenous
method of its usage;
 Projects for measuring availability of solar/ wind energy in a given area;
 Wind turbines for domestic use with vertical / horizontal axis;
 Design of low noise wind farm;
 Innovative/indigenous design of domestic hydroelectric generator /wind/ water mill for
grinding grains/ drawing water from the well and to generate electricity;
 Use of tidal waves/ oceans currents/ salinity gradient for generating electricity;
 Wave energy from oscillating water column/ ocean thermal energy;
 Tidal barrage generator / conversion / production of energy from tornadoes/ floods/
cyclones;
 Innovative designs of geothermal house / green building/ environment building which
harvest energy, water and various materials / self sufficient, sustainable village/ office/
home designs;
 Various ways of harnessing geothermal energy such as energy from hot springs/
electricity generated from naturally occurring geological heat sources;
 Geothermal desalinization/ geothermal power/ geothermal heating controlling heating
and cooling of a building using underground heat by vertical / horizontal loops;
 Production of electrical energy from mechanical energy/ nuclear resources;
 Energy from biomass such as seaweeds, human/ animal wastes, keeping in view
environmental concerns;
 Improvised designs of biogas/ biomass plant/ improvised technologies for effective
usage of biofuels;
 Fuel farming / bio diesel from plant oils (obtained from canola, palm oil, micro algae oil,
waste vegetable oil etc ;)
 Low cost liquid fuel (bio‐ethanol, bio‐methanol from cellulose biomass by improving
conversion techniques);
 Impact of bio‐energy on food security;
 Role of nanotechnology and superconductivity in harnessing energy;
 Innovations in batteries/ inverters/ photovoltaic cells to reduce cost;
 Usage of technology for production, storage, transport for using hydrogen/ methane/
CNG as fuel;
 Designs/ models of fuel‐efficient automobiles/ machines;
 Innovative designs of internal combustion engine which can function on various boifuels;
 Innovations in mechanism of extraction, storage and processing of fossil fuels; etc.
Sub‐Theme 4 Transport and communication
The objective of this sub‐theme is promoting innovations in knowledge networks involving
transport and communication technology in all segments of the society. Children need to
reason and communicate to solve problems and to understand effective use of information and
communication technology for a variety of purposes.
The exhibits/models in this sub‐theme may pertain to;
 Indigenous/ improvised/ improved devices for world‐wide communication of verbal/
printed/ pictorial information;
 Improvised/ indigenous models for efficient transport and fast communication especially
internet for communication in rural areas;
 Working models of fuel efficient/pollution‐free designs of automobiles other vehicles;
 Models showing use of innovative/ inexpensive/ locally available materials designs for
construction / maintenance of roads/ railways tracks;
 Innovative ideas for efficient management of road, rail, water and air transport systems,
e.g. Better safety measure, especially unmanned railway crossings checking/ control of
pollution, providing immediate relief to accident victims, etc;
 Models showing preparedness for disaster‐both natural and man‐made management;
 Working models of devices for recoding and reproduction of audio‐visual material for
entertainment and recreation, use of computers in motion pictures including cartoons,
animation, graphics and television;
 Working models of printing technology‐communication with graphics and multi‐media
and low‐cost methods.
 Working model/ charts of GPS enabled vehicular movement;
 Demonstrating the principle and functioning of modern devices of communication;
 Designs for making existing operation of communication more efficient;
 Showing the use of information technology for preservation and conservation of
soil/water management and maping of water resources;
 Showing the use of information technology for developing improved designs of
machineries for textiles, engineering goods, machines, tools, chemicals, drugs and
pharmaceuticals, plastics and eco‐friendly materials;
 Demonstrating the use of information technology in developing improved
designs/indigenous designs/devices, which may be used on a small scale for
production/manufacturing of utility items of daily use;
 Showing application of communication technology in making innovative designs of
weaving, pottery, metal and leather wares, dyeing, printing and other crafts practiced in
cottage industry;
 Developing innovative designs/models of multimedia equipments/ materials and
packages for the children with special needs, especially with visual and audio
impairment;
 Exploring uses/applications of transport and communication technology in generating
employment/ eradicating illiteracy;
 Technologies of emerging web designs/ effective use of bookmark sharing;
 Projects against attack aimed on information services/ cyber security;
 Technologies in forecasting and warning of cyclones floods and storms;
 Improvised improved devices for effective transport and communication between
various emergency services, namely medical, police, military and other administrative
bodies/committees;
 Information management from ships and oceans buoys‐use of radars in cyclone
detection/information management and early warning system for flash floods;
 Use of geo‐stationary satellites in providing information pertaining to meteorological
processes; etc.
 Emergency mechanisms and mobilization centers/improvement in communication and
transportation systems; etc.

Sub‐theme 5 Community Health and Environment

The exhibits/models in this sub‐theme may pertain to;
 Demonstration of health and differentiation from the state of ill health;
 Demonstration of factors affecting the health, different ailments in the body;
 Showing and designing activities on infectious and non‐infectious diseases, relationship
with causative factors and their sources;
 Innovation to develop control measures at different levels, role of various agencies;
 Presenting medical assistance and facilities, rural\urban and gender aspects;
 Sensitizing people to be careful in heath matters, explore the possibilities and make use
of the facilities available;
 Development of knowledge‐base and understand new scientific, technological aids in
bio‐medical area;
 Demonstration of means and ways to adopt methods for self concentration and
meditation and their uses;
 Demonstration of known facts and research findings in different medical systems like
Indian, Modern, Homeopath etc.,
 Demonstration of lifestyle and relationship with good and bad health based on known
facts and researches;
 Demonstration of the role of traditional knowledge of herbal products for community
health; etc.
Sub‐theme 6 Mathematical Modelling
Mathematical modeling is the process of transformation of a physical situation into
mathematical analogies with appropriate conditions. Physical situation need some physical
insight into the problem. Then it is solved by using various mathematical tools like percentage,
area, surface area, volume, time and work, profit and loss, differential equations, probability,
statistics, linear, nonlinear programming, etc. It is a multi‐step process involving identifying the
problem, constructing or selecting appropriate models, fighting out what data need to be
collected, deciding number of variables and predictors to be chosen for greater accuracy,
testing validity of models, calculating solution and implementing the models. It may be an
iterative process where we start from a crude model and gradually refine it until it is suitable for
solving the problem and enables us to gain insight and understanding of the original situation.
It is an art, as there can be a variety of distinct approaches to the modeling, as well as science,
for being tentative in nature.
In mathematical modeling, we neither perform any practical activity nor interact with the
situation directly, e.g. we do not take any sample of blood from the body to know the
physiology, and still our mathematical tools reveal the actual situations. The rapid development
of high speed computers with the increasing desire for the answers of everyday life problems
have led to enhanced demands of modeling almost every area. The objective of this sub‐theme
is to help children to analyse how mathematical modeling can be used to investigate objects,
events systems and processes.
The exhibits/models in this sub‐theme may pertain to:
 Mathematical modeling to solve various problems of our everyday life/ environment
related problems;
 Mathematical modeling and computer simulation of climate dynamics/production of
weather phenomena based on a number of predictors;
 Mathematical modeling physical geography such as rotation and revolution of earth,
precession and equinoes etc.;
 Mathematical modeling to how disease might spread in human in the event of
epidemics/bioterrorism;
 Mathematical modeling to show spread of forest fire depending on the types of trees,
weather and nature of the ground surface;
 Mathematical modeling of the working of heart, brain, lungs, kidneys, bones and
endocrine system;
 Computer diagnosis of human diseases;
 Mathematical modeling of fluid flow in drain, spillways, rivers, etc.;
 Using mathematical modeling and computer simulation to improve cancer
therapy/wound healing/tissues formation/corneal wound healing;
 Mathematical modeling of intracellular biochemical reactions and metabolism;
 Mathematical modeling to describe traffic flow/stock market options;
 Studies of storage and retrieval techniques for computer systems;
 Data manipulation and information management techniques;
12
 Statistics and random number problems;
 Developing video games;
 Mathematical modeling on social insects such as honeybees, termites etc, to know how
they use local information to generate complex and functional patterns of
communication;
 Mathematical modeling of maximum speed in fibre optic links;
 Mathematical modeling of highly abstract problems arising from control and
communication process in the brain;
 Mathematical modeling of urban city planning;
 Mathematical modeling to prevent an unwanted future/to understand various natural
and unnatural phenomena;
 Mathematical modeling to show the effect of climate changes/ global warming;
 Mathematical modeling on balance of carbon cycle, etc.
 Mathematical modeling for predicting future population and knowing the impact of
population;
 Mathematical modeling for increasing production of crops.
........