In my recent post I have shown, how to track web requests issued against remote server I don’t have a control over. Curious reader could ask at this point – but what have I broken this time? And the answer is as usual – personally did nothing wrong, I was just doing my job. I had to port some HTTP related code from using Windows Runtime-specific HttpClient (i.e. Windows.Web.Http.HttpClient) to also work outside the sandbox on a regular .NET 4.5 desktop version and start using System.Net.Http.HttpClient instead.

Then I noticed that everything worked fine except multipart form-data submissions using POST method that were behaving unexpectedly bad (timeouting or returning an error immediately). There was nothing unusual mentioned on MSDN, so I started to compare sent requests using both implementation. It turned-out of course, the problem lied deeper in the framework in a value serialized as a *boundary* part of the Content-Type field. HttpClient from the System.Net.Http somehow was adding extra quotes around it, while the one from Windows.Web.Http didn’t. Even though server should accept both values (according to RFC2046 section 5.1.1), it actually didn’t and was waiting for correct *boundary*.

Simple fix by manually overwriting the guilty header can look like that:

var request = new HttpRequestMessage(HttpMethod.Post, url);
var boundary = "--" + Guid.NewGuid().ToString("D");
request.Content = new MultipartFormDataContent(boundary);

// fill content
// ...

// update the Content-Type header to be accepted by the server:
request.Content.Headers.TryAddWithoutValidation("Content-Type", "multipart/form-data; boundary=" + boundary);

// send request:
var result = await _client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, token);


World saved. Job done!


I am a freelancer more than 5 years now. After so much time I started having this (really stupid as turned out) idea of abandoning that state of mind. Maybe I could hire myself for a big company, wear the uniform and work only limited part of the day (instead of whole time) and generally rest for some period. So as I usually never reply to headhunter offers, I did a try. Somewhere in December last year, ~3 months ago, I received invitation from Dolby Digital of my home city Wrocław, Poland – to join their team as Windows Phone developer and port Dolby Voice to Windows Runtime etc. The project tempted me a lot, if you look on main page and compare with my skillset. After all, there is only one most important aspect of being a developer – code what you like to code and makes you keep smiling. Then we started to talk…

And each time we did talked it was worse and worse. I don’t want to personally blame anybody. Here is just my version of this story and maybe they work this way for such a long time, they think it’s normal. Believe me, it’s NOT. The way Dolby tries to hire people in Wrocław is kindly saying cheating and making fool of interviewee. I am pretty sure they would never behave like that in US or in Germany. They made me so angry I even created this post! You have been warned and you apply for any position there at your own risk.

After few calls we agreed on facts like – I am already mobile/embedded developer, I have experience with Windows/Windows Phone, I know C/C++/C#, I submitted few dummy apps through Windows Phone Marketplace, I already have a contract till mid February with an option to extend it (so I am secured!) and in general I am well motivated to join their company. We had roughly 1.5 month to agree to anything or give up. Then beginning of January I had first 2h interview with a promise that if we meet again it will be much longer interview. I remembered two things after. First – comments I need some extra training about C++. Sure I need! but I wasn’t applying for a guru position. Secondly – really strange questions about salary. I already answered, how much I would like to earn, during very first calls via phone and now we immediately turned into this dead-end road of opposite questions like: why that much, what would be the minimal amount I would work for etc. That’s not how you bargain, especially if I had never heard any counteroffer.

Then it took 3 weeks to invite me for a second interview. Amazing fast process, right. Pretty obvious they were looking for some other candidate, maybe a cheaper one, don’t know, but also means I was not so weak developer they tried to sell me before. Or maybe they wanted to just give me more time to learn C++ before another round ;). Anyway, I expected promised whole-day testing of my skills. Ended up with a 1h meeting about C++ and C++11. And again questions, why I have such a high salary expectations, what would be the minimal amount I would work for etc. But at the same time no one wanted to answer my doubts about anything, as we were in the middle of recruitment process.

There was one thing I liked during this interview – when I was asked to write some program on a paper. I don’t know why I hate this type of coding. Probably because I just can’t have IntelliSense in my pen. I do like this blog post on codinghorror.comWhy Can’t Programmers… Program? But the problem I was asked to solve was a bit more complicated than simple loop from 1 to 100. My task was to write an input processor to:

Evaluate expressions for a simple variant of Lisp, with identities: a, (a,b). Example expression: (((a,b),a),(a,b)).

I didn’t manage to produce it on paper. After few minutes, time for the whole meeting ran out and we agreed I’ll make it on a PC later at home. Good for me. Then following is my reply. I just didn’t want this code to be thrown away. Additionally, somehow I didn’t find a reason, why I should make it a C++ class and stayed with plain C.


#include <stdio.h>
#include <tchar.h>
#include <iostream>
#include <cassert>

static bool InternalExpressionValidator(TCHAR *expression, size_t length, size_t &i)
    assert(i < length);

    // single-char variables are the only one supported:
    if (_istalpha(expression[i]))
        return true;

    if (expression[i] == '(')

        // is the left variable defined?
        bool leftVar = InternalExpressionValidator(expression, length, i);
        if (!leftVar)
            return false;

        // is the separator in place?
        if (expression[i] != _T(','))
            return false;

        // is the right variable defined?
        bool rightVar = InternalExpressionValidator(expression, length, i);
        if (!rightVar)
            return false;

        if (expression[i] != _T(')'))
            return false;

        return true;

    // incorrect symbol!
    return false;

bool CheckExpression(TCHAR *expression)
    if (expression == nullptr)
        return false;

    size_t i = 0;
    size_t length = _tcslen(expression);

    if (length == 0)
        return false;

    bool result = InternalExpressionValidator(expression, length, i);

    // check if validation of the whole text was done:
    return result && length == i;

And some way to actually test, if it works at all:

 * Execute expression validation and print the result.
static void Validate(TCHAR *expression, bool expectedResult)
    static CodeTitans::ExpValidator validator;
    bool result = validator.CheckExpression(expression);

    std::wcout << _T("Validating: \"") << (expression != nullptr ? expression : _T("")) << _T("\": ");

    if (result == expectedResult)
        std::wcout << _T(" [OK]") << std::endl;
        std::wcout << _T(" [FAILED], expected: \"") << (expectedResult ? "true" : "false")
                   << _T("\", but was \"") << (result ? "true" : "false") << _T("\"") << std::endl;

        // just for testing

int _tmain(int argc, _TCHAR* argv[])
    // verify some common examples:
    Validate(nullptr, false);
    Validate(_T("a"), true);
    Validate(_T("(a,b)"), true);
    Validate(_T("(a"), false);
    Validate(_T("(a,(a,b))"), true);
    Validate(_T("((c,(d,e)),(f,g))"), true);
    Validate(_T("(((a,b),a),(a,b))"), true);
    Validate(_T(")"), false);
    Validate(_T("a,b"), false);
    Validate(_T("(a,b"), false);
    Validate(_T("(a,b)c"), false);
    Validate(_T("d(a,b)"), false);

    return 0;

Even this nice code didn’t help me much. I hope it helped anybody at Dolby to implement another great feature and that their software will be better somewhere at the end of the day ;)

However my sad story continued. I had to wait yet another 2 weeks to receive any response about my progress and if we are closer to hiring or not. Instead of any assessments or results I was invited for final test, this time about C# and summary with some manager. That would be fine even despite the fact it was supposed to be executed on 18th February. It is 4 days after I kindly asked at the very beginning to finish the whole process. After 1.5 month I had no vision, where we are going and when it will end. What will happen, if after this test they ask me to postpone it yet another 2-3 weeks? I really like that corpo-lazy style and hiding behind processes. Pity no one tried to wear my shoes. Imagine I work for myself, I have my own customers and if I don’t work, I don’t have a salary and I am starting to become seen as unstable and irresponsible contractor. Can I afford to do that? No, I don’t. I hate, when someone breaks the promise and doesn’t care about me and my time. There wasn’t even single proposal from Dolby till that time nor any sign, if they are interested or not. Somehow my whole enthusiasm, I had at the beginning, disappeared. That’s why my assumption was, this is the final interview.

Then suddenly Dolby made all the decisions crystal clear somehow. The meeting was scheduled for 10:00 AM, so they called me at 3:00 PM a day before. Time I was picking up my daughter from a dancing lesson. They again were totally not interested in my experience, skills etc. The most important subject was the minimal amount of salary I would like to work for them. The hiring process was still not finished, so they couldn’t offer me anything, even a good word and I was again supposed to guess, what amount would fit them. So I said, since tomorrow I will meet with the division manager I will revisit my proposal and we will eventually agree on something. But no, tomorrow was too late, I was supposed to tell the amount now, really, REALLY? This is, how you make business?

One hour later I got an email, saying I was rejected as a candidate. Couldn’t afford a call even ;)


Post Scriptum.

1.5 month hiring process that didn’t explain anything. I didn’t hear conclusions, no single proposal. They are giving the job, so only they can demand and the rest doesn’t care. OK I got the initial theory that I need to learn more. But this is actually what I do each day! I just wish people at Dolby did the same. Let this post be a reminder of their lesson. Have fun and good luck.

Just checked their website. Wrocław – suddenly 4 opened internship positions for students to write applications for Windows Phone and port Dolby Voice framework. Sounds familiar. Only 4, instead of a single pro? Nice deal. Probably someone will receive a bonus.