Sunday, September 4, 2016

TIL Software Series

I am starting a new series today where I will post some everyday tips that I find useful in my course of work. These tips are short and are helpful to my personal workflow. I hope that you could also find some use of these tips.

So to start, here are two of them.

Matplotlib in Python

Last Saturday, I tried working with Pandas and Matplotlib for our company hackathon. Unfortunately, I found out that Matplotlib doesn't work with the non-framework version of Python in OSX. This is the error that comes up if I try to run the non-framework version.

  globals(),locals(),[backend_name],0)
  File "/Users/avsimon/Envs/python-data-visualization-learning/lib/python2.7/site-packages/matplotlib/backends/backend_macosx.py", line 24, in <module>
    from matplotlib.backends import _macosx
RuntimeError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are Working with Matplotlib in a virtual enviroment see 'Working with Matplotlib in Virtual environments' in the Matplotlib FAQ


Fortunately, there is work around for this issue. You can see it here.

How to insert quotes, code, examples, etc in Org-mode

I was updating my TIL repository when I realized that I needed to add multiline code text in it. Since enclosing multiline text with "~" doesn't work as intended. So I tried to find a solution to this problem which I am certain exists. Sure enough there is a way to do it.

Sunday, August 21, 2016

How to run another instance of Skype in Mac OSX

My workplace recently mandated a company wide Skype policy that requires me to create a new Skype account. As I was using my personal account before, this raised a problem. I want to be logged in to both my personal and work accounts at the same time.

I searched around for ways to this problem. I found a solution that allows me to run a second instance using the command line. To do it, just run this command

sudo /Applications/Skype.app/Contents/MacOS/Skype /secondary

Just authenticate yourself as root and voila, you got a second Skype instance running.

Sunday, August 14, 2016

Cagayan de Oro Google I/O Extended 2016

Before the event


"I wonder what they will show today?". That was the question that keep popping in  my head when I entered MUST. I went up until the 6th floor of the Performing Arts Theater until I realized that I got lost. After asking some of the students there, I found the right room across the east wing of the building.

I saw some familiar faces of some GDG volunteers in the crowd. I arrived 1 hour early for the event. It gave me ample time to chat with Aryan, one of my friends in the CDO-ITG group and Jeff, a VR enthusiast. We talked about the K-12 program, wireless routers and the future of VR.




The receiving area had been flooding with participants after I arrived. The registration booth opened 30 minutes after my arrival. By that time the venue was already packed with participants. We figured that its better to register later so we went down and got refreshments at the bottom floor. We met Eric, a co-worker with his friend Mark while I was drinking water from a fountain. After some small talk, we went back to the room to register.

Inside the event room, before the event starts


We discovered that the theater was circular in dimensions. When we went inside, we were greeted with the sight of 4 projected tarps at the center, facing the 4 cardinal directions.



We opted to take the seats on the east part of room, at the middle distance from the center. I knew the air conditioner system was working because the venue was cool in spite of the mass of people inside.

While waiting for the participants to dribble in, I went around and took some photos of the venue. I noticed that at there was a giant Android plushie at the center of the theatre.



Keynote Speech


The event kicked off around 2 pm. The keynote speaker for the event was Josan Astrid Dometita-Chug. She is GDG CDeO's manager and the Creative Director at Aestrea Software.

Her talk started with the encouraging message that "Technology should not be intimidating". She exhorted young students to embrace technology. To experiment, to take risks and not be afraid to fail. After all, they still have an "artificial safety net" in the form of their parents. They are still not exposed to the consequences of failure in the real world.

Technology should not be intimidating

The next thing that she talked about was the importance of having a vision of the future. To have ambitions and not to settle for the mediocre. She also talked about the importance of building the community and to engage with other people.

The last part of her talk involved discussing the Google I/O event held last May.  It was held at Shoreline Amphitheater in Mountain View. She also talked about the technologies featured in it. Among these technologies are

- Google Home, a voice-activated home product that allows people to get answers from Google and manage everyday tasks
- Allo, a new messaging app
- Duo, a one-to-one video calling app
- Android Nougat, the new Android release for this year
- Polymer, a library to create Web Components
- Firebase, a backend as a service provider
- Daydream, a virtual reality platform from Google

Intro to Machine Learning and Tensor Flow


The next speaker for the event was Jordan Aiko Deja, the group head of the Seamless Interfaces Group of ComET. He is also an assistant professor lecturer at De La Salle University.

He started by showing us an online demonstration of Tensor Flow. When the page was shown, many confused faces was seen in the crowd. It was not surprising since this is likely their first taste of Data Science and Machine Learning.

Seeing or anticipating this, he proceeded with talking about Machine Learning for the uninitiated. He started with giving a layman's definition of Machine learning.

"Machine learning is a subfield of computer science. It gives computers the ability to learn without being explicitly programmed." - Arthur Samuel

He clarified that Machine Learning is not simply a new name for Artificial Intelligence. He then gave a Machine Learning definition in more formal terms

"A computer program is said to learn from an experience E with respect to some task T and some performance measure P, if its performance on T as measured by P improved by some experience E" - Tom Mitchell

An example that he showed us was playing with checkers. In this activity,

- the task is playing checkers
- the performance measure was the number of games won against opponents
- the experience is playing practice games with itself

Other activities where Machine Learning can be used was briefly touched. This includes handwriting recognition, robot driving and facial learning.

He also said that Machine Learning is also different from Data Mining. Machine Learning focuses on prediction on *known* properties learned from training data. However, data mining focuses on the discovery of *previously-unknown* properties in the data. Machine Learning requires lots of data. They need to be good data too. As they say, garbage in, garbage out.

"Machine Learning focuses on prediction on *known* properties learned from training data. However, data mining focuses on the discovery of *previously-unkown* properties in the data."

The final part of his talk emphasizes that Machine Learning is not a futuristic and immature technology. We don't have to wait for it to ripen. It is already in use today. You can see it in Bots, Google's self-driving cars, reading of muscle signals, etc. And to make it more enticing, jobs in Machine Learning are in high demand with very good compensation.

Virtual Reality and Google Cardboard


The next speaker is Edmund Salcedo Jr., a MUST alumnus who now works at Engagis Software. He is also a VR Enthusiast and Unity Developer.

He started by showcasing a 3D environment with a hilarious dancing on screen. This was followed up by giving a short talk about the tools that he uses. This includes applications like Blender and Unity.



He then whipped out a slick looking phone and asked the audience to guess the price, brand and model of the device. 5 persons were picked from the audience to guess. Those who guessed the correct answer would get a prize. In my own seat, I guessed was that it was the Alcatel Idol 4S and the price to be around 8k.

I was wrong. To the crowd's pleasant surprise, the model turned out to be the Cherry Mobile XL. The price was also only 3.5k PHP. That includes the VR headset. This would make the device ideal for testing out your VR applications since it won't cost you an arm and leg to buy.

Besides getting a prize, the winner got to try the VR headset on. While he was tinkering with it, a live feed of what he was seeing is shown in a projector. We were able to observe the capabilities by watching the feed.


Internet of Things using Firebase


The next speaker is Elymar Apao, founder of JumpSparc and a UX/IoT coach.

He started by recounting an anecdote about feeding his cat. The problem was how to feed his cat when he was away on long vacation days. To solve this problem, he needed to devise a clever solution. He went to work on creating prototypes for his ideas. Some of these include an auger screw system and an open close system. It took him 3 prototypes to arrive at a solution to his satisfaction.

His next discussion was about the Internet of Things, a development that is gaining traction today. He introduced us to electronics that help us do create devices for IoT. One of this is Wido, a combination of Arduino and Wifi. Another one is Photon, a $19 postage sized hackable wi-fi module for Jumpsparc.

He then pivoted his talk to Firebase, a backend as a service provider. He showed us how he used an Android app connected to Firebase to control some of his custom devices.




His last discussion revolves around the "Makers" culture. He showed as a trailer of the "Makers" documentary film. He clarified that being a maker doesn't mean that you must be an engineer. Instead, you only need to want to solve your own problems. He recounted an instance where a 12 year old kid proposed an alternative to the jeepney barker system. Instead of utilizing barkers, the system uses signage and sensors to display the destination. It makes it easier for people to know where jeepneys are going.

LED + Fiber Optics + GEMMA


For the last talk of the event, Josan once again took the stage. But not in the way that you think.



She entered the stage while performing a LED Poi dance in her LED woven dress that she made for the Google I/O events. This performance was then followed up by two veteran Poi performers, Jesson and Gilbert.

When the performance was over, Josan then proceeded to talk LED use. She recounted how she incorporated LED into her wedding dress. She told us that she used a kit called GEMMA to do it. She went on a brief anecdote of how bringing the GEMMA kits to other countries almost caused some problems with immigration.




Her last demonstration was showing us how to control devices using the the Myo armband. It is a gesture control wearable device. It works by analyzing the electrical signals in the forearm muscles. It then maps these signals to gestures. By using these gestures, people are able to control devices wirelessly.

Conclusions

To my pleasant surprise, the event was not the I/O extended that I used to know. As a software developer, the event was enlivening. The Machine Learning and Virtual Reality talks convinced me of their big role in the future. The hardware talks motivates me to learn electronics and tinker with tangible things. The IoT talk encouraged me to engineer solutions to my problems. You don't need to be an engineer to be able to do it.

I hope to see more events like these from GDG CDeO. It was a blast. Thanks for the free shirt!




P.S. Thanks to Aryan for letting me use some of his pictures for the event.

Monday, July 25, 2016

Change global npm install modules destination


There are many ways to change the installation destination of your global npm modules. IMO, using a user config file is the cleanest way to do this. If you want to do it this way, just follow this 2 steps.

  1. Create ~/.npmrc file if you don't have one. 
  2. Add this line to your npmrc file

    prefix={Folder Name}

    For example, if you want to do global npm installs in ~/.npm-global, then add this line

    prefix=~/.npm-global

Viola! That's it! You can now do an npm install and it will install that module to the new folder.

Monday, December 15, 2014

SVG Sequential Transforms Priority

When you want to do a series of sequential transforms on an SVG element, keep in mind that it is applied right to left.

In this example, this SVG code does the translate first, then the scaling, then the rotation.


<g transform="rotate(45) scale(2) translate(100, 100)">

It is counterintuitive but that is how it works.  Hopefully this solves some problems you might have on your SVG transforms.

Monday, October 14, 2013

Local Devfest, Software Freedom Day and Frameworks



The last 4 weeks were awesome!

There were not 1 but 2 events that any local web developer was anticipating!

The first one was Software Freedom Day held last September 21. The second one is the GDG(Google Developers Group) Devfest, the 1st one held in Mindanao, Philippines ever!

I was also able to utilize some new frameworks in my job. One is a JS framework called KnockoutJS. The the other one is Laravel, a PHP framework that is the talk of the PHP community nowadays

More information are shown below.

Software Freedom Day

Last September 21, Software Freedom Day was being celebrated here locally in Capitol University.

The tracks in the morning ranged mostly dealt with Web technologies
The tracks in the afternoon most dealt with the Sysadmin side, a programming language and a continution of the tracks in the morning
  • More Open Source tools
  • Kali Linux, a Linux distribution focused on Security
  • Common System Administration task for Novices
  • Ruby Programming

GDG DevFest Cagayan de Oro

Immediately on the next day, the first ever Devfest in Mindanao, Philippines was being held in Cagayan De Oro City. N Hotel near the Kauswagan highway was the chosen venue to host it.

As a Web Developer, it was a very exciting event! We fully expected to learn some cool new language or some new technologies being shown.

Unfortunately, there was a travel ban in effect at that time for some countries because of some bombing incidents in the southern part of Mindanao. It was sad that some delegates such as the one from Australia who should have been the one doing the track on Go, was not able to go. 

But even with that setback, some delegates were able to push through with their tracks. Woohoo!

The tracks for the event were divided into two groups, a room for each of the groups. You can freely move over to the other room if a track there interested you.

Here is the list of tracks

Group A
  • HTML 5 Frontend Development
  • HTML 5 Game Development
  • AngularJS
  • Technoprenuership
Group B

KnockoutJS

One of my jobs was to implement a simple ledger mobile app. KnockoutJS was the one that is chosen for the job.

I found out though that KnockoutJS is more like a bare bones data binding library as compared to AngularJS which is more of a full blown stack.

It doesn't have any advanced features like routing system, directives, etc. But I feel that this is intentional.

After using it for many days, it certainly taught me a lot on Javascript Frameworks and how they work. It really is fun doing everything without reloading the page.

Laravel

Laravel was something I stumbled upon easily because of the amount of information and praise PHP developers were giving it.

It piqued my interest because of it's OOP centric framework and PHP 5.3+ support. Morever, Codeigniter has not been in a very good place lately so I was looking for something new that could replace it.

I have just been using it for a few times and I found it very good. It has that same Codeigniter feel where you feel that the system doesn't force you to follow a rigid convention.

Why bother with all of this?

The programming/IT field is a field in constant state of flux. You can't just learn one thing and ride it into retirement. Languages, frameworks, skills usually become irrelevant quickly.

On the bright side, learning something new is something that people in this field mostly enjoy so it is not really something to dread.

It is imperative that developers learn new stuff so that their skills will stagnate but that means learning new stuff which is enjoyable.

Thursday, September 12, 2013

CI Multilanguage Module v0.2 released

One of my ExpressionEngine projects needed to support Multilingual output for the frontend interface. Here are the feature set that I wanted

  • I only need it to change static data and lookup table values. There is no need to translate the Control Panel.
  • Since I already worked on Codeigniter before and ExpressionEngine is using Codeigniter as its underlying framework, I wanted an addon that leverages that existing framework
The first thing that an ExpressionEngine developer does when he sees that a specific feature is needed, he should check out if an existing solution already exists.

For ExpressionEngine, sites like Devot:ee and Github make it very easy to find an addon that you need.

I tried finding a good and free solution but unfortunately, I can't find one after evaluating the free available ones. Paid solutions are out of the question due to project budget restrictions.

I decided to just make my own add-on since I felt no one bothered to build it. I am putting it on Github in case someone might find out that it works for them.

Get it at Github

Programming and Computer Science

Powered by Blogger.