Parameter 2 expected to be a reference

After my recent upgrade to Ubuntu 16.04 I have been making sure all my open source PHP projects work on PHP7. I am thrilled about PHP7 as it is about 2x faster than PHP5. In my experience it brings PHP more or less on par with NodeJS in terms of execution speed. PHP Warning for “bind_param” and “bind_result” When I was porting my PHP MVC framework (MintyPHP) to PHP7 I ran into the following warning: ...

April 29, 2016 · Maurits van der Schee

Install VNC on your Ubuntu 16.04

I upgraded my HTPC from Ubuntu 14.04 to 16.04 and since the box does not have a keyboard or mouse I had to setup remote access. I chose to install x11vnc, which is easy to use, but requires tunneling over SSH to be secure. Install SSH and enable it in the firewall I chose “x11vnc”, which is easy to use and can be configured to be active during the login (greeter). It’s built-in security is not good, so it requires tunneling over SSH to be secure. That’s why we start installing an SSH server using: ...

April 24, 2016 · Maurits van der Schee

Installing PHP7 on Ubuntu 16.04

Today is the release of Ubuntu 16.04! On this release you can install the entire LAMP stack using: sudo apt-get install lamp-server^ sudo apt-get install mariadb-server mariadb-client The command “php -v” will show that PHP7 is included: $ php -v PHP 7.0.4-7ubuntu2 (cli) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies If you get the following error from PHPUnit: ...

April 21, 2016 · Maurits van der Schee

Precompile Handlebars Online

I have been playing around with Handlebars and it is awesome! It is a fast JavaScript implementation of the Mustache templating language. Handlebars allows you to precompile your template into a JavaScript object that you can store in a variable and use as a function to transform JSON into HTML. I was missing an online tool to test this out, so I decided to post it here. I’ve put in some sample data to play with. ...

April 18, 2016 · Maurits van der Schee

Porting PHP-CRUD-API to C#

I have started porting PHP-CRUD-API to C#. I am doing this for the expected improved performance and also to open up this tool for people that do not program PHP. I am considering a Java and a Go port after this C# port. Porting to C# has turned out to be more work than I expected, partly because I’m not that fluid in C#. I noted that it is very good for the code quality as I am forced to re-read and re-consider every line of code I’ve written. ...

April 16, 2016 · Maurits van der Schee

A tiny polymer clone: w3component.js

I like the idea of web components in a web application. I think it well-suited for things like menus, lists and forms. I especially like the concept of having three separate files for each element on your page. Much like this 3-layered MVC separation in back-end applications. You can have a similar separation in the front-end: HTML file holding a component’s template CSS file holding the component’s styling JavaScript file holding the component’s logic I wrote a tiny library, inspired by Polymer, to support this component separation. It is named “w3component.js” and you can find the code on Github. ...

April 11, 2016 · Maurits van der Schee

PHP-CRUD-API now supports SQLite

After 1 year of slowly growing PHP-CRUD-API another milestone is reached. Today SQLite support, the fourth supported database engine, is added to the project. This feature is added in order to facilitate fast prototyping as SQLite is easy to install and configure. I want to thank Antoine Weber for his feature request and contribution to deliver this feature. A few months ago I did some research on the feasibility of a SQLite implementation. I found that there were sufficient reflection methods available for the full functionality of the reflective REST API. Other DBMS systems provide reflection using the INFORMATION_SCHEMA, which is a SQL standard. I found out that SQLite has similar functionality, but with non-standard “pragma” statements. These statements are equally powerful, but less flexible as they cannot be combined with “SELECT” or “WHERE” clauses. ...

April 7, 2016 · Maurits van der Schee

High performance C# web service using EvHttpSharp

In a previous post I announced a attempts at high performance web server implementations in some popular languages (Java, Go, C# and JavaScript). Today I will show you a C# implementation and give you instructions on how to get it running on your own machine. Source code for HttpListener example Below you find a nice and short web server written in C# that I found online. using System; using System.IO; using System.Net; using System.Text; using System.Threading; class WebServer { HttpListener _listener; public WebServer(string address) { _listener = new HttpListener(); _listener.Prefixes.Add(address); } public void Start() { _listener.Start(); while (true) { HttpListenerContext request = _listener.GetContext(); ThreadPool.QueueUserWorkItem(ProcessRequest, request); } } void ProcessRequest(object listenerContext) { var context = (HttpListenerContext)listenerContext; context.Response.StatusCode = (int)HttpStatusCode.OK; context.Response.AddHeader("Content-Type","text/html; charset=utf-8"); var msg = Encoding.UTF8.GetBytes("<h1>Hello World</h1>"); context.Response.ContentLength64 = msg.Length; context.Response.OutputStream.Write(msg, 0, msg.Length); context.Response.OutputStream.Close(); } static void Main(string[] args) { (new WebServer("http://localhost:8000/")).Start(); } } Save this file as “hello.cs” in your project folder. ...

April 4, 2016 · Maurits van der Schee

NoOps: Developer operations manifesto

Consider the following well-crafted text about the malfunctioning of the collaboration between development and operations, posted anonymously to a developer forum I visit regularly: NoOps: Developer operations manifesto This is not pretty, but it must be said. We are tired. The madness must stop. We create software, the product that identifies our company. We are academic software engineers, trained to understand our work. We show responsible behaviour, creating as much value as possible. We do not like meetings, documentation or other waste in this process. We prevent problems by writing tests and by using versioned environments. We fix problems immediately, reducing the impact of issues dramatically. We are not flawless, but that is neither your problem, nor your duty to solve. ...

March 31, 2016 · Maurits van der Schee

High performance Java web service using Jetty

In my previous post I announced a attempts at high performance web server implementations in some popular languages (Java, Go, C# and JavaScript). Today I will show you a Java implementation and give you instructions on how to get it running on your own machine. Jetty for high performance Jetty is a Web server and “javax.servlet” container that can be easily embedded in devices, tools, frameworks, application servers, and clusters. Jetty is known to be the web application of choice of Yahoo’s Hadoop Cluster, Google’s AppEngine PaaS and Yahoo’s Zimbra SaaS. Because it was used for such important projects, I expected that it would be hard to implement, but the opposite turned out to be true. ...

March 28, 2016 · Maurits van der Schee