Tuesday, March 31, 2015

Running Mac as a production server

For one of my open source projects we were given a server, a mini mac to be precise. Sure, we could have put linux on it, but because all the stack we are using runs on Mac so we decided we could probably use this server, why not. We sent it to a mac mini server farm to host it.

Image result for mac mini server 2013

There were a few wrinkles.

Sleep.
We delegated the server setup to an intern so they could learn how to set up the machine, they forgot to turn off sleep so the server was oddly unresponsive for the first week or so of testing.

Updates.
Macs like updating, and they seem to use RAM to do so. If you don't update the server you can have a significant chunk of your RAM hanging out waiting for you to do the update. We haven't figured out how to accept XCode downloads from the apple store, so this means we had to learn how to turn on VNC.

Turning on VNC
sudo  /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -clientopts -setvnclegacy -vnclegacy yes -clientopts -setvncpw -vncpw mypasswd -restart -agent -privs -all

Turning off VNC

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -configure -access -off


Using pm2 vs forever
At the same time we did the upgrade, we decided wouldn't it be nice to have a new node process manager? So we switched our webservices to use pm2. After a month of sleep like behavior, after we had solved the sleep like behavior, we decided maybe switching process managers at the same time as switching OS was a bad idea. We switched back to forever and now the server is almost normal.

These were a few reasons why we regret using the Mac server instead of formatting it with Linux, although now that its sort of stable with ~97% uptime we aren't planning formatting it just yet.

Wednesday, August 20, 2014

Recognizing Speech on Android

Tonight I'll be giving a talk at Android Montreal. In this talk I’ll show you how to use speech recognition in your own Android apps.

The talk will have something for both beginner and advanced Android devs, namely I will show two ways to do speech recognition: the easy way (using the built-in RecognizerIntent for the user’s language) and the hard way (building a recognizer which wraps existing open source libraries if the built-in RecognizerIntent can’t handle the user’s language).


While I was in Batumi my friends and I built an app so that Kartuli users (code) (slides) (installer) could train their Androids to recognize SMS messages and web searches.



Recognizing Kartuli is one of the cases where you can’t use the built-in recognizer. Kartuli spoken by only 4 million people in the country of Georgia: that is roughly the population of Montreal and surrounding areas.

CaucasusLayout_rev.png

The talk will start with a demo of our Kartuli trainer app to set the context for the talk, and then dig into the code and Android concepts under the demo.
  • * How to use the default system recognizer’s results in your own Android projects,
  • * How to use the NDK in your projects,
  • * How to use PocketSphinx (a lightweight recognizer library written in C) on Android

Live broadcast on YouTube:

http://youtu.be/XNIS0hTzGIA

Friday, March 28, 2014

SMILE is patent pending

This morning Google now let me know that something new had been posted on the Sphinx site.

Google Now has started letting me know if websites I visit often have posted new content,
pretty awesome...


It was an Android app that lets users embed voice data in pictures (along with sharing pictures and doing speech recognition). I went to the play store, the app looked medium unprofessional so I visited their website. They were "seasoned" machine learning experts, but their mobile site had no indication of who they were.

"Seasoned entrepreneurs ... with deep experience in AI and machine learning"

So I said, I like Sphinx, let's see how they used it. I installed their app and giggled out loud at the "patent pending" splash screen. What are they patenting, certainly not Sphinx, certainly not speech recognition, certainly not the ability to take a picture on a smartphone and share it. It must be the embedded voice metadata, which I assume is why they aren't using the built in speech recognition which is far more accurate than Sphinx.
"Patent Pending" technology by seasoned technologists...
It even comes with a splash screen :)
I sent them a few bug reports, it looks as though their app was built maybe a year ago, or at least by someone with limited Android experience and wasn't tested using the camera on Android 4.3...

"Unfortunately Smile has stopped..."

Tuesday, March 25, 2014

Day 11 - The fish market

Tonight we walked through the port to the north side to get to the fish market (1.5 kilometers) to buy fish, and have it cooked next door.

We expected it would be closed but we caught them just as they were closing.
Fish range from 3 lari to 25 lari a kilo


Grilled/fried next door for 3 lari a kilo (beer was also 3 lari a pint).

Monday, March 24, 2014

Day 10 - Working on the beach and Georgian red beans

I went over the university in the morning to help debug an SDK manager that kept closing on Windows. Not knowing Windows, we just gave up and just reinstalled the ADT bundle. 

Then spent some hours with my notes from the day before doing data entry and cleaning on the beach.
My new "office" an excellent place to enter data...


At night I met some cyclists who were biking from England and Italy to Australia and China respectively, and we went for wine and food at Keti's restaurant ;)
Georgian red beans (3 lari) were delicious, with fresh onion and cilantro :)

Sunday, March 23, 2014

Day 9 - The speed of the internet

In the morning Nato taught me how to say my age and other things that you might find in a beginner class. It was cute. Meanwhile, I was talking about grape vines using Google translate offline on my Android. Her vines were just budding, about two months before Montreal ;) I also learned the word for good, /kargi/ I had been hearing it all over the place but didn't know what it meant until I said 'good' and decided to elicit it in case it could be used as a discourse particle, sure enough, it is a very very popular particle ;)

Other translations on Google Translate were just transliterations, and rather comical :)

In the afternoon I bought a WiFi router and set it up at Natalya's house. I forgot to ask the speed there before I decided to rent the room. I found out it was only 500kb down and 10kb up.  Almost a dial up connection from the 90's...

DSL in Batumi can be very very slow, in this case 500kb down and 100kb up.
At that rate it would take 2 hours to deploy...



I had to choose between Georgian immersion, or productivity. It was a very difficult decision and very hard to explain in Georgian to my would-be host family,  but after investigating apartments with Ia, I decided to rent an attic room at a hostel where there was a strong connection and always people around.

There is a window and a table, and by adding my new wifi router, guests will be able to use the internet even out in the back dorm. Tamilla, Esma, Nino and the director are super sweet and are keen to speak to me in Georgian and of course practice English with me ;)