PHP-CRUD-API version 2 released

Yesterday I released version 2 of PHP-CRUD-API, the TreeQL reference implementation in a single PHP file. About 6 months ago I wrote about my progress on version 2. I was expecting it would take me about 2 months until I could release a final version 2. It took 6 months and I created 8 beta releases in the process. I’m very thankful to the people that were trying these beta versions out and for the issue reports that I have received. ...

October 14, 2018 · Maurits van der Schee

TreeQL vs. GraphQL

Many people compare GraphQL to REST and come to the conclusion that both have their strengths. In this post I argue that you can have the best of both worlds by using TreeQL, an improved REST protocol. Downsides of GraphQL According to Stubailo and Doerrfeld the downsides of GraphQL (compared to REST) are: It’s results can’t be cached using HTTP caching. It has limited endpoint security enforcement. It doesn’t have as many tools yet. That last point is fortunately changing fast, as GraphQL adoption is rising. ...

October 4, 2018 · Maurits van der Schee

GopherCon 2018: videos online

GopherCon is the original Go conference. It debuted in 2014 and is now celebrating it’s five-year anniversary. Like every year it was held in the Colorado Convention Center in Denver and it had about 1500 attendees. The videos are posted on the Gopher Academy Youtube channel and are also linked here: Tuesday August 28 9:00 Welcome Gophers Kavya Joshi - The Scheduler Saga [30:48] Tess Rinearson - An Over Engineering Disaster with Macaroons [23:48] 10:05 Morning Break ...

September 14, 2018 · Maurits van der Schee

Java's synchronized block in PHP

In Java the “synchronized” block may help to make implementations “thread safe”. PHP does not have this language construct, but with the help from “flock” (file lock) and it’s “LOCK_EX” (exclusive lock), we can implement this behavior ourselves. This is useful because web servers run multiple threads/processes to execute PHP and these may read/write from the same files. In yesterday’s post we presented a lock-less solution, today we further explore the possible uses of “flock”. ...

September 10, 2018 · Maurits van der Schee

A locking file cache in PHP

The functions “file_get_contents” and “file_put_contents” can be used to implement a file based cache in PHP. Unfortunately the read function is missing a critical feature: support for file locking. Without file locking the function reading the contents may return an empty string (or partial cache content) while the content is being written. Shared and exclusive locks explained If you run the following writer script: <?php // write.php $filename = sys_get_temp_dir().'/test.txt'; $string = 'test'; $file = fopen($filename, 'w'); $lock = flock($file, LOCK_EX); sleep(10); file_put_contents($filename, $string); flock($file, LOCK_UN); fclose($file); And in another tab (at the same time) this reader script: ...

September 9, 2018 · Maurits van der Schee

GopherCon Singapore 2018: videos online

GopherCon Singapore is the largest Go programming language conference in Southeast Asia. In 2018 the conference day was on May 4th at the Marina Bay Sands Expo & Convention Centre in Singapore. You can find the videos on the YouTube playlist and also linked here: 09:00 Welcome address Russ Cox - Opening keynote: Go with Versions [40:50] Elissa Lim - Project-driven journey to learning Go [17:33] 10:20 Tea break Rajeev N Bharshetty - Resiliency in Distributed Systems [23:32] Hana Kim - Understanding Running Go Programs [23:24] Stephen Kruger - Go for Grab [30:37] 12:30 Lunch ...

September 8, 2018 · Maurits van der Schee

Go Northwest 2018: videos online

Go Northwest is single day, community driven conference devoted to the Go programming language. It was the first time this event was organized. It was held in Seattle on July 30, 2018 at McCaw Hall in the Seattle Center. It had an attendance from 280 software developers who write in Go and there were 14 speakers and 3 sponsors. You can find the videos on the YouTube channel and also linked here: ...

September 7, 2018 · Maurits van der Schee

GopherCon UK 2018: videos online

GopherCon UK 2018 was held at The Brewery from August 1 to 3, in the heart of the City of London. It aims to deliver fantastic up-to-date content about Go programming and related technologies in a comfortable and professional setting. This is an event that you don’t want to miss. Did you miss it? No problem, you can watch the videos on YouTube: Aditya Mukerjee - You Might Be a Go Contributor and Not Know It [41:17] Amy Chen - Code, Content, & Crafting Your Voice [25:45] Bernd Rucker - Orchestration of Microservices [44:42] Christopher Biscardi - Going GraphQL [39:21] Grant Griffiths - Black Box Monitoring in Go [26:47] Michael Hausenblas - Three Billy GOats Gruff: from VMs to Serverless [43:47] Pawel Slomka - Documenting Go Code with Beautiful Tests [36:24] David Hernandez - Secrets about using Machine Learning and Go [40:33] Sean Kelly - Broadcasting Channels [46:38] Matthew Campbell - Blockchain Apps in Go [42:18] Contributor Workshop [12:48] Carmen Ruiz Vicente - Using Go for Healthcare [37:39] Mahdi Jelodari - GoPro: More Concurrent than Parallel! [43:56] Dmitry Matyukhin - Component & Integration Tests for Micro-services [29:38] Kat Zien - How do you structure your Go apps? [44:42] Grant Griffiths - Building Resilient Data Pipelines in Go [21:43] Eleanor Deal - Go's role in publishing data for National Statistics [33:13] Cassandra Salisbury - Growing a Community of Gophers [27:53] Brian Ketelsen - Athens: The Center of Knowledge [22:55] Alexandre González - From source code to Kubernetes, a CI/CD tale [37:47] Daniela Petruzalek - The Best Feature of Go [34:44] Sean Kelly - Go Test: Under the Hood [48:25] Florin Patan - Production Ready Go Service in 30 Minutes [44:38] Roberto Clapis - Goroutines: The Dark Side of the Runtime [37:42] Marty Schoch - Scorch! a New Index for Bleve [52:11] Jelmer Snoeck - Experimental Refactoring with Go [45:20] Diana Carolina Ortega Munoz - Deep Learning, Ready? Go! [33:19] Andre Carvalho - Understanding Go's Memory Allocator [47:15] Liz Rice - Debuggers From Scratch [37:49] Nathan Davies - Reducing Fragmentation in System Architectures [38:45] Enjoy! ...

September 1, 2018 · Maurits van der Schee

Visual Basic in ASP.Net Core 2.1

I love programming in Visual Basic. It gives me a feeling of nostalgia. It reminds me of my early programming days in which I was programming GW-Basic, QBasic and Turbo Basic. I was still in primary school and for me computers were full of secrets and had unlimited possibilities. The Basic programming language survived the test of time and became Visual Basic. VB.NET is no longer a 1st-class citizen Later Visual Basic was the second language of Microsoft’s .Net platform. Unfortunately (for Basic programmers) that second position (behind C#) seems to have been overtaken by F#. I conclude this because some of the new features of the .Net platform (such as the “VB Razor templates” and “Nullable reference types”) have not been implemented for VB in ASP.Net Core. ...

August 18, 2018 · Maurits van der Schee

Equalizer for PulseAudio in Ubuntu 18.04

Do you like late night programming, while listening to music? Do you have these fancy modern speakers that produce way too much bass? Well I do. I use Ubuntu and “Audacious” (a WinAmp clone) as my music player and it has a very nice graphical equalizer. But whenever I switch to YouTube or a streaming radio station the bass is again way too loud. To have maximum freedom while also keeping my neighbors happy I was in need of a system-wide equalizer. I have found the equalizer module of PulseAudio which does exactly what I want. PulseAudio is the standard sound system for a while in Ubuntu Linux. You can play with the equalizer by issuing the following commands: ...

July 27, 2018 · Maurits van der Schee