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

Monday, September 2, 2013

3 simple things you must absolutely do when starting an i18n PHP-MySQL Application

These are 3 simple things to do that will not take much of your time before starting on your project.

  • Make sure the database is in UTF-8 format when you create it
  • Make sure the MySQL connection uses UTF-8
  • Make sure you use UTF-8 encoded files

Many unnecessary and hard to debug bugs could be avoided if you do these 3 things. 

Saturday, August 24, 2013

How to delete versioned SVN files from repository without deleting locally in TortoiseSVN

TortoiseSVN


If you are a developer working on a Windows operation system and using SVN for your version control, chances are that you are using TortoiseSVN so that you don't have to manually input SVN commands. Instead, you can just use the context menu items to click whatever command that you want to execute.



I will be particularly be talking about the delete command in this article.



Don't delete my local files!


There is one use case that really annoyed me about deletion in SVN. 

That is when I am trying to remove SVN files from the repository but somehow retain it in my local copy.

The delete in the context menu deletes both the files from the repository and the local copy.

To circumvent this problem, here are the steps that I did
  1. Copy the files and folders that I want to retain to a temporary folder. 
  2. Delete the files using the SVN context menu. This will delete the local copy too.
  3. Move the files back to where I copied them from
This solution is tedious and error-prone. What If I copied the .svn files? What if I forget to copy an obscure yet essential file? Surely, the whole purpose of version control is avoid these problems entirely!

I grudgingly used this workflow before because I didn't have the time to come up with an elegant solution to the problem. It is only recently that I finally decided to find a better solution. I didn't believe that SVN doesn't have a feature for this exact use case since I think this is a common enough to warrant this feature.

Sure enough, SVN does have it.

The Solution


To do it via the command line, you can simply type this
svn delete filename --keep-local

However, TortoiseSVN users will probably prefer a "point-and-click" solution to do this. Fortunately, there is a way!

The way to do it is
  1. Select the file(s) that you want to delete
  2. Hold the Shift button
  3. Right click on the file(s) that you want to delete
If you go to the SVN context menu, you will now see that there is a new command called Delete(keep local)



This is the command that we want to run.

Hope this helps!






Sunday, August 11, 2013

Android 4.3 Features



After a long wait, I got the OTA(Over the Air) update for Jellybean 4.3 for my Nexus 7.

I waited for weeks for the my Nexus 7 to get the update. My Nexus 7 is stock Android so I don't have the problem of other,carrier branded devices of not being able to get Android updates as soon as Google releases it.

But like most people downloading the update, I really don't know what improvements Jellybean 4.3 brings. So in order to not look like a fool, I searched the internet about the new features and fixes.

The official android page contains the list of new features. No need for me to repeat what is being said in that site since I will only discuss in length only those those features that are significant for me.

Multiple Profiles/Restricted Profiles


Before anything else, this feature is only available for tablets for now. Since I have the Nexus 7, I was able to enjoy this feature.

This feature happens to be very useful for a number of reasons. One is that people who want control over their own profiles will appreciate. It is very easy for some people(especially kids) to just randomly or accidentally change features that you may have painstakingly set.

It is also good for streamlining your tablet for specific tasks only. For example, some companies distribute work-only tablets to their employees. Restricted profiles will allow those companies to control the types of applications those people will use. Companies don't really appreciate it if you are wasting company time on unproductive applications(like games for instance).

Bluetooth LE/Smart


I don't have any device or accessory that actually uses these technologies so I can't really expound on what the benefit this has. But the main advantage that is implied by the site is low power consumption.

New Camera App


I can't really expound on this since my Nexus 7 doesn't have a back camera and no pre-installed camera app. Sure, there are ways to get a camera app for the front camera but I decided that it was not worth the time getting it since the front camera is really made for just video conferencing rather than taking pictures seeing that it only is 1.2 Megapixels.

Improved Keyboard/Gesture Typing


I always preferred manually typing letters as opposed  to "swiping" to compose my messages because I am in a country where English is not the native language. Regardless, just by trying out keyboard in 4.3 using swiping, I can definitely say that many people will find the functions very useful.

I remember being annoyed that I have to input space every word when swiping before. The 4.3 keyboard makes it so that you don't have to. Just lift the word and it automatically adds the space. The new keyboard also has better text prediction/anticipation abilities now since it can now complete sentences based on a few words.

Better Game Graphics/Google Games


Honestly, I played games after the update but did not see something significantly changed. I guess this only matters when you are playing 3D games(and even then, only those that really push processing power and graphics). I did not have any 3D games installed on my Nexus 7 since I prefer light, 2D games on tablets.

Google Games is a new app that offers leaderboards and matchmaking. For me, this is really has the potential to be a great feature. However, it seems to me that current games doesn't utilize it in such a way that is seems to be exciting to me. I have yet to see a multiplayer mobile game application that is as exciting as LAN parties of old or the MOBA games of the present. 

We will see if game developers can utilize the new features in the future.

Better Location through Wifi


You can see this feature in WiFi-> Settings -> Advanced -> Scanning


Basically, it lets Google use your WiFi to better determine your location without having to turn on WiFi all the time. They say that WiFi is more accurate than GPS in big cities, or rather densely populated area when determining your location so I guess that one reason why they implemented this feature. 

However, some people are wary of anyone, even Google, tracking their location all the time in the background. This feature may be left unused for them.

Monday, July 29, 2013

How to Enable Sync in Samsung Galaxy Note 2

I was made aware of this problem when I attended a Google Developer Group Meetup this month. While the event was going on, I suddenly remembered that I can use the Party Mode feature of Google Plus to share the photos taken in the event. That way, everyone has a common place to access all the pictures

I tried to turn the feature on. But I was surprised when it complained that I needed to turn on Automatic Syncing in "Accounts and Settings". The last time I used this feature, I did not get this notification at all. I thought I never need to.

So after exploring the Settings, I found out that that I can turn on automatic syncing in Settings -> Accounts -> Google for each of the accounts that I had.


I thought that was the end of it, but it did not do what I expected. When I tried to sync all of my accounts, the indicator that is supposed to show a green light to indicate that automatic syncing is disabled.


I was confused.

I have some friends in the meetup that have Samsung Galaxy phones and assured me that it should work.

But it never did.

So I tried many things like restarting my phone, trying to change it on my tablet and looking for other Setting options which might be the real option to change. But those actions proved fruitless.

I was frustrated enough by then that I searched Google for answers. I tried may keyword searches until I got the one that leads me to a site that gave me the clue to the answer.

The forum's solution said that I should simply go to my notification shade bar and turn on my sync there.



But I noticed something strange. There was no Sync toggle at all! This led me to believe that there must be some specific peculiarity with the Note 2.

So I went to Display -> Notification Panel, and sure enough, it was there. It was just not included into the default setup


So what I did was I put it there


I pulled down the Notification Shade, toggled on the Sync and bam! The syncing was fixed!




Finally! Problem solved. I was able to use Party Mode to take pictures :D

Friday, July 19, 2013

Expression Engine Parse Order

I have been using Expression Engine while working on some freelance projects the last few months. It is not free and I am only able to use it because a colleague I am working it bought a license for it.

Expression Engine is touted as the best Content Management System(CMS) for web designers. Even if I am not one of those creative types, I can certainly attest to the ease of use it provides to people who wants works on how the the page is displayed as opposed to knowing how the system works.

However, it can be a pain for web developers looking to implement a solution that requires lots of custom code and tweaks.

I am talking about the template parse order

Their templating system goes through specific steps when parsing each template. Usually, you don't need to know about the parsing order when working on your templates. In fact, it isn't apparent when you code your code is simple at first.

But the more complex your template tags are, the higher the chance of encountering an error that is caused or related to the parsing order.

In order to solve this problems, you need to understand the parsing order. The links below will prove useful.

Ellislab's Template Engine Documentation
Low's Expression Engine Parse Order(PDF)

Tuesday, July 16, 2013

Goodbye Enso, Hello Launchy

For the longest time, I have been using Humanised Enso as my launcher way back 2008.




At that time, launchers were not as popular today. There were only a limited number of launcher applications available so you have very few choices. Out of all the launcher options that I had, Enso was what caught my eye and I downloaded it to try it out.

And was it a joy to use. I was delighted by the fact that I don't need to use the tedious Start -> Programs Menu process anymore to access my applications. I can quickly access them with just a press of a button and typing the name of the application. Enso even has a "learn" feature where I can make it directly open folders, links, or portable applications by telling Enso to associate it with a word that I want. And most of all, it looks cool!

But the times has changed. While I was content using Enso, other launchers have tried catching up to Enso's features and succeeded.

Today, Enso's internal process of using shortcuts to access files is less efficient than indexing the filesystem. I also noticed that it was less responsive than the new competing launchers.

So I finally decided to try out other launchers. I quickly searched the internet for the best one out there and it was Launchy that was consistently suggested.




At first try, Launchy has these look and feel that is minimalistic. I also found out that you can navigate through your filesystem by just typing the path(very much like Unix/Linux filesystems), a feature I found very useful. We will see how Launchy fares against Enso(I will probably writing a review about it in a future blog post).

All in all, Enso has a good run but it is starting to show it's age. It was nice working with it but it is time to move on.


Programming and Computer Science

Powered by Blogger.