littlelogs

Keep a social journal of your work progress as you make and learn things.

#json

May 2017

rhitakorrr
rhitakorrr

Got the #MidnightMurderParty editor back in working condition! As I thought, tonight was dedicated to entirely rewriting the #JSON encoding/decoding using #PureScript Argonaut. Mostly, it was pretty simple—just a lot of rewriting—but I did run into one super sneaky “gotcha!” right at the end. For some reason, my encoding was leaving out a field, no matter what I was encoding.

"secretKey" := secretKey
~> "data" := postData 

This was leaving out the "data" field, for example. I only figured out what was wrong because, after the server got mad at me for sending bad data (or no "data", rather), I dumped my other JSON to the console and dug through the keys until I spotted the correlation. Whichever field was encoded last just didn’t get encoded at all.

Turns out the fix was simple:

"secretKey" := secretKey
~> "data" := postData
~> jsonEmptyObject

Yup, just slap an empty JSON object onto the end of the extend (~>) chain, and it works.

rhitakorrr
rhitakorrr

Upgraded the #PureScript version for the #MidnightMurderParty editor tonight. I tried the upgrade on Sunday on my Ubuntu laptop, but nothing was working out. The upgrade went much more smoothly tonight on my Windows desktop. Go figure. In any case, PureScript is now an #npm dependency instead of a global install, and I’ve added a build task in #gulp. Still working on adapting the code since all the #JSON encoding/decoding stuff has been changed around in this version of PS and VS Code is being finicky after the upgrade.

April 2017

rhitakorrr
rhitakorrr

Worked on the #MidnightMurderParty editor some more. I rigged up the front-end with the back-end finally. I’d started that last night but got stuck on mismatched types, cursed at the language for a little, and gave up. Today, I looked at it again, saw the issue immediately, and fixed it. Sometimes it helps to take a break… and sleep.

Wiring up the #AJAX requests revealed a lot of bugs in my #JSON encoding/decoding—the code I wrote at the beginning of the month when I was just starting with #PureScript. Here’s a photo of me from way back then:

After much head-scratching and cryptic errors, I got it all working and now have an ugly/barebones CMS. I can add (from Docs), delete, reorder, and edit chapters. Next is finishing the module that will let me sync an existing chapter with Docs, then mostly cleanup and UI.

Finished Camp #NaNoWriMo at ~14,000 words.

rhitakorrr
rhitakorrr

Finally got the #JSON encoding and decoding working for the #MidnightMurderParty editor. I’m finding that, while I really enjoy #PureScript as a language, the packages are lacking. I think #Elm has it beat so far in the useful docs and full-featured packages department, even if Elm is a much weaker language.

Tonight I finished adding audio to the MMP promo animation—at least as much as I’m going to be able to do before I have music to work with. Simulating movement through a room by automating the volume and panning of two clock-ticking clips with different amounts of reverb/EQ was fun. One for close to the clock, one for in another room, and a lot of tweaking.

I’m also a little ahead of my Camp #NaNoWriMo goal, which isn’t too impressive since I only committed to 10,000 words this month, but I have been writing nightly. My next goal is to shift my writing to the mornings again. I really like writing in the morning, but I don’t like waking up very much at all.

January 2016

belle
belle

Had a #guestpost about habit building go live on the Buffer Open blog overnight, so jumped into the comments first thing this morning. Nice to have such positive feedback from everyone. #content

Last night I played with #swift a bit more. I’m slowly porting my #littlelogs #ios app from #objectivec to #swift. It feels good to actually write some swift code, because the ideas really aren’t sticking in my brain just from reading about them. I’m really enjoying the syntax so far, but I’m a bit frustrated at the extra coercion needed to get swift to play nicely with #json, since I deal with #API results a lot. #laterlog

josh
josh

Finished all the relevant code for heart rate in #exist, including Withings and Runkeeper now too, but can’t test every service without a means to put fake data in there so I’m putting that off for a little bit. I’ll come back to it when I can make myself care more.

Moving on now to drafting a set of new attributes that we’ll support, things that people can put into Exist even if we don’t have a service that provides them (yet). Things like commits, emails sent and received, time spent meditating. Should hopefully be handy for people wanting to use the API to track stuff themselves.

On a slightly related note, yesterday I discovered that #mysql has just added a #json field type which means I might be able to put off our switch to postgres potentially forever. Woo! That makes my life a lot easier.

Sirpaulus
Sirpaulus

Technologies

  1. User Stories - I will use #Trello as my agile storyboard / user story management and change management
  2. Wireframes - I will use #Axure for wireframes and mock prototyping.
  3. Environment setup - I will use #XAMPP on a local machine with #MySQL as the chosen database and #PHP as my chosen programming language.
  4. Code Management - I will use #bitbucket to practice the behaviour of managing code branches and merging.
  5. Other Technologies - I will employ #css but most probably a bit later once the functional aspects have been covered. The likelihood also is, if I find another technology which assists in meeting the use case and it can be implemented I will. i.e. #JSON / #JQUERY.

Conclusion

Thanks #Littlelogs community for the opportunity to share this with you, sorry the post is too long.

November 2015

October 2015

josh
josh

Today I'm starting to look at how I can bring the current #exist codebase in line with the functionality I wanted out of the planned exist-core v2, rather than rewriting and being susceptible to the Second System Effect. This involves:

  • Migrating from #mysql to to #postgres
  • Adding the new event stream table with #json-b metadata field
  • Potentially migrating to #python 3 (perhaps relying on 2to3?)
  • Pruning away a lot of accumulated cruft that wouldn't have appeared in v2
  • Potentially open-sourcing the result

Right now I'm on the first step. I'm looking at using pgloader to migrate data into postgres. In the past I've run into issues migrating to postgres (and so quickly gave up) but I'm hoping pgloader will be my shining light.

September 2015

August 2015

July 2015