//TODO: professional stuff of software engineer 1001010
Category Archives: Code
Swift: prefix/postfix ‘=’ is reserved

Neat – Apple released x-code 6 beta for free! Which means I finally got a chance to try swift in the “playground”.

As I go through the book and teach myself all about this shiny new tech bauble I may comment on it here.

OH LOOK, a scuff mark already

Playground looks interesting, but where’s the “run” button?  The book tells me to try “println("Hello World")” – but I can’t figure out how to launch it.  Oh well, I don’t care that much.  It looks like it’s real value is a teaching environment to play with code structures & simple flow – sort of like a code calculator.

First “code” section: “Simple Values”

var myVariable = 42

myVariable = 50
let myConstant = 42

Excerpt From: Apple Inc. “The Swift Programming Language.” iBooks. https://itun.es/us/jEUH0.l

That’s great – but I’m a terrible typist.  I ended up typing “var myVariable= 42”  And it errored.  WTF?

Swift irregular spaces around equal sign

As you can see, “x = y” and “x=y” are valid, but “x= y” and “x =y” are not.

W. T. F. ?

This.. is a new problem for me. In my experiences with C languages or Python, I’m not accustomed to casual compiler problems with spaces around an equal sign.  Looking at the error, there are a few things going through my head.

  1. The lexer is borked – it’s a new language after all, so not too unexpected
  2. Whitespace has meaning?  Yes, there are times where whitespace removes confusion in code.  Say in C++ where you have a template containing template params: std::map<int, std::vector<int>> needs to be std::map<int, std::vector> >” – but that’s a lexing issue.
  3. Someone is a fan of The Whitespace Programming Language
    It’s still early in the book – I hope they’re not a fan of brainfuck as well 🙁
  4. OK.. Let’s check the book

Damn it.  It’s in the book.  Here’s the relevant section..

Operators are made up of one or more of the following characters: /, =, -, +, !, *, %, <, >, &, |, ^, ~, and .. That said, the tokens =, ->, //, /*, */, ., and the unary prefix operator & are reserved. These tokens can’t be overloaded, nor can they be used to define custom operators.

The whitespace around an operator is used to determine whether an operator is used as a prefix operator, a postfix operator, or a binary operator. This behavior is summarized in the following rules:

If an operator has whitespace around both sides or around neither side, it is treated as a binary operator. As an example, the + operator in a+b and a + b is treated as a binary operator.
If an operator has whitespace on the left side only, it is treated as a prefix unary operator. As an example, the ++ operator in a ++b is treated as a prefix unary operator.
If an operator has whitespace on the right side only, it is treated as a postfix unary operator. As an example, the ++ operator in a++ b is treated as a postfix unary operator.
If an operator has no whitespace on the left but is followed immediately by a dot (.), it is treated as a postfix unary operator. As an[…]

Excerpt From: Apple Inc. “The Swift Programming Language.” iBooks. https://itun.es/us/jEUH0.l

Matching space count and it’s a binary operator?  FOR EQUAL?

Space on one side only and it’s a PREFIX/POSTFIX UNARY OPERATOR?  FOR EQUAL?


Two pages in & two issues.  Maybe this is a journey into Brainfuck


-Jason De Arte

Remember CodeProject?

I forgot all about it too.  It’s still there, I even have a bit of sample code on their site.  Long-long ago I wrote a /delayload replacement because it was the cool thing to do. At the time it was the best spot to find Win32 code examples other than MSDN.  CodeProject did a decent job answering that core software engineer need for it’s readers: “How do I implement X?”.

Looking back I see that it was backwards.  It was an article/publisher model that relied on people to create the answers to the questions people might be seeking before the questions were answered.  Since psychic powers are in short supply among the technically minded, the reach will always be limited.

Today we have a better answer: StackOverflow.  Instead of waiting for someone to write an answer to the unwritten question, we have a place where we can write the actual question and (if it’s well written & not a plea from someone stuck on their CS homework) get quality answers.

Now the cool geek thing to do is to be the one that writes the best upvoted answers on StackOverflow. For a few of my co-workers, they’ve made a sport* of writing quality answers before anyone else.  It’s sort of like doing Project Euler problems on hard mode.

-Jason De Arte

*I know, a sport involves a ball. whatever

FOASS on GitHub

Experimentation time!  I created a GitHub account and put the two file source to http://foass.1001010.com on it.

Why? Because I can.

I created my FOAAS clone to learn how to create a stateless web service in Python.  Maybe someone else wants to learn how to and they just need an example on how to do it.

OK – maybe my example is not the best one, but it works – and I got to play with the GitHub Windows client.  I wonder what the OSX one is like & how well pyCharm integrates with it?

-Jason De Arte

FOASS – Fuck Off As a Service (version

Previous Post


OK – I finished my version of FOAAS, I mean FOASS. It’s much prettier, flexible and to the best of my informal testing, it is mostly bug free 🙂

try it here

Bug List

  • /wp/ on the homepage URL.  This is caused by this being a sub-domain of JasonDeArte.com where I have a rewrite .htaccess that poorly sends root traffic to the WordPress install in /wp/
  • Naked commands without a trailing “/:something”.  I.e. /off/ will work (and insert random names), /off will not & instead return a 404.  I consider this a low priority bug & will probably just set up a 404 page with belligerent language.

It supports all the currently listed (2013.07.21) commands, as well as a few more commands.  Most were suggested by my co-workers.

If you request it in json or plaintext, it will return it as json or plaintext, respectively.

If you leave out values, it will use random names from a list of co-workers and friends that I’m sure that would find this hilarious. Oh, if you’re name is in the list and you don’t find it funny, it’s not You-you, it’s that other guy with the same name. Sorry 😉

I also hooked up Google Analytics (or at least I think I did, I’ll find out later when the reports are available) so that I can more easily track which links are the more popular ones.  Awesome discovery: my hosting provider, Dreamhost, has a panel setting that allows you to set the analytics code in the domain configuration – so I don’t even have to put in a google web-bug to track it all.  Which is awesome if anyone were to actually use the JSON API, because I could then actually track it without having to rely on client side JavaScript.

I wish I had more time to hook up Google App Engine to run it, but time on the weekends are limited.


-Jason De Arte

FOAAS – Fuck Off As A Service

Yesterday, Nico introduced me to a groundbreaking new web service in field of telling people to Fuck Off.

I know, right? Why do I need a Web Service to tell people to fuck off. We all know how easy it is to do. I do it several times just on the drive to work.

I was pleasantly surprised – it does make it easier!
But it’s not extensible. 🙁

So late last night, when my two year old was not going to sleep like she should have, I wrote my own clone as a Python programming project.
Check it out

And now I can tell my co-worker Oliver to Fuck Off using a language he understands

-Jason De Arte

P.S. Yes, I know it’s childish. And your point is?

Previous Page · Next Page