feed

Aaron Parecki

Day 64: Documentation and Fixes for my GPS Logger App #100DaysOfIndieWeb

I track my location continuously using an iOS app I wrote a few years ago. The app is not published on the app store, but it is open source. Today I added a bunch of documentation describing what all the controls in the interface are for.

The settings screen is somewhat overwhelming, mostly because this is actually intended to be an app for learning what the various iOS location APIs do.

So now the readme file has a description of each of these controls.

Head over to the readme for the details! https://github.com/aaronpk/GPS-Logger-iOS#documentation

I also added a new control, "points per batch", which controls how many location updates are sent to the server in each HTTP request. Prior to this setting, it was always sending 200, which works well but sometimes causes problems. When I take a long plane flight and queue up thousands of points on the device before I am back to a data connection, sending them 200 at a time actually takes quite a while to send them all. Now I can set the batch size to 1000 which should flush them much more quickly.

During this process, I also discovered a weird bug where none of the controls in the settings screen could be tapped! I suspect this is some iOS 10 API change that caused this, since I haven't changed anything about the app since I used it on iOS 9. I still don't know the underlying cause, but I was able to fix it by removing one level of nesting of the UI elements. Previously, a ScrollView contained a ContentView which contained the StackView that has all the controls. I removed the ContentView from the middle and now the buttons are tappable again. No idea what went wrong! I am clearly not an iOS developer.

Ben Werdmüller

Homebrew Website Club SF is at Matter tonight. 6:30pm; optional writing hour at 5:30pm. Come join us! https://www.facebook.com/events/171653883330781/

Ben Werdmüller

This is so important. Decent, collaborative people make things happen - and make people want to work with them. https://medium.com/matter-driven-narrative/in-search-of-human-entrepreneurs-48a9ad71c3b4#.pgt0swh44

Aaron Parecki

Just tested out decoupling my Google Voice number from Hangouts thanks to the new Voice update. Mixed results as of now. After decoupling: • SMSs are sent and received only through the Google Voice app and voice.google.com, no longer in the Hangouts app. • The Google Voice app and website don't support making or receiving voice calls at all. • When I call from the Hangouts app, it still shows my Google Voice number as the caller ID. • Receiving calls to my number rings through Hangouts *only* on my phone. (It used to also ring through Gmail on my computer.) Tested using the Google Voice iOS app. Thanks to @eayoungs for helping me test this out!

Ben Werdmüller

Cuts to the arts and public media - but yet more military spending. We already spend far more than anyone else. https://mobile.nytimes.com/2017/02/17/us/politics/trump-program-eliminations-white-house-budget-office.html?referer=

Ben Werdmüller

I strongly support this call for a new kind of American endowment-based media organization. http://www.cjr.org/tow_center/mark-zuckerberg-facebook-fix-journalism.php

Aaron Parecki

Day 63 - Build

Day 63. Got a late start on this again today. I was going for another super short "audio logo" style thing today. I made a totally different style video to accompany this to hint at the kind of thing I imagine this would be used for. Also had fun finding a few string samples like some major scale runs to use at the end.

Aaron Parecki

Day 63: Autolinking Emoji to my Emoji List Pages #100DaysOfIndieWeb

Now that I have pages showing all posts that use a specific emoji such as 👍, I found myself wanting to be able to click the emoji in my posts to see other posts with that emoji. This is the same as how my autolinked hashtags work, where you can click on any hashtag in a post and see other posts with that hashtag.

This was relatively straightforward to accomplish with my new Emoji Detector library, there was only one trick needed. Because some emoji are composed of others (such as 🏳️‍🌈 being composed of 🌈 plus 🏳), the particular byte sequence for 🌈 actually appears twice in a string that has both of those emoji. Once for the standalone rainbow, and another as part of the rainbow flag. This means if we tried to replace all instances of 🌈 with a hyperlink, we'd actually catch the 🌈 byte in 🏳️‍🌈 as well, breaking it into separate emoji!

So to avoid this problem, I used two tricks. 

First, since the Emoji Detector library returns the number of code points in each emoji found, I first sort the list so that the longer emoji strings are first in the list.

$emojis = \Emoji\detect_emoji($text); 
usort($emojis, function($a,$b){ 
  return $a['num_points'] < $b['num_points']; 
});

Second, instead of doing an inline replace of the post text with the hyperlink, I create a mapping of placeholder strings for each emoji found, and replace the emoji with those placeholders instead.

$map = [];
foreach($emojis as $emoji) {
  if($emoji['short_name']) {
    $k = md5(mt_rand().$emoji['emoji']);
    $map[$k] = $emoji['emoji'];
    $text = str_replace($emoji['emoji'], $k, $text);
  }
}

Then, in a separate loop, I loop through the mapping and replace each random string with the emoji including a hyperlink wrapping it.

foreach($map as $k=>$emoji) {
  $text = str_replace($k, '<a href="/emoji/'.$emoji.'" class="emoji">'.$emoji.'</a>', $text);
}

This way, I avoid the "clobbering" issue of double matching the duplicate byte sequences.

Lastly, I noticed that when I use several emoji in a row, they end up appearing squished together like this:

Since I was already wrapping each emoji with a hyperlink, I was then able to style them to add a bit of spacing around them, so now they appear a little nicer:

Ben Werdmüller

"Recently I had to tell 50 enemies of the people that I will soon have jobs for only 30 of them." http://www.dallasnews.com/opinion/commentary/2017/02/18/need-know-enemies-american-people-president-warned

Ben Werdmüller

DE corps are required to provide financial statements to their employees if they've awarded $5m+ in stock that year. http://go.theinformation.com/BMvFrRJZGwg

Aaron Parecki

Some pictures of my progress on BarBot today! 🍸🤖 I ran the tubes through the pumps, and up the top to form a faucet. I tested them all with water. The nice part of this design is all of the electronics are suspended above the liquor bottles, so I don't have to worry about any drops falling onto the circuits. I formed the faucet shape by bending a wire to the shape I wanted, and clamping it to the cabinet with a wide washer. I ran the tubes along the wire and ziptied them.

Aaron Parecki

Day 62 - Pipes

Day 62. I spent most of the day on other projects, so wanted to do a simple song today. The video is my other project I worked on! I ran all the tubing for the pumps for BarBot today, and got to try out pouring a drink!

Aaron Parecki

It's aliiiiive! I finished all the plumbing today! #barbot 🤖🍸

Aaron Parecki

Look at that! First pump installed and successfully pumped exactly half an ounce! #barbot

Aaron Parecki

I suspect this new page on my site showing my emoji usage is going to heavily encourage my use of emoji 😂 😎 🤓 https://aaronparecki.com/emoji

Aaron Parecki

Day 62: Indexing Emoji Use in my Website #100DaysOfIndieWeb

The real reason I wrote my Emoji Detector library was for today's project. My website now has URLs that list every post containing specific emoji!

My site finds any emoji that I used in the post content, and indexes those in a separate database table. It uses that table to create a page listing all the emoji I've ever used, as well as emoji feeds showing all posts containing a specific emoji. Try it! 

https://aaronparecki.com/emoji/😂

Behold: All the emoji I've used in posts, sorted by most used first!