Latest Entries »

I wrote an article on how to call native code on Android from JavaScript in Sencha Touch through PhoneGap over at the new Behavioural Technology Blog, where I will be documenting the development of a mobile sensing framework.
Divided the Theta channel by one thousand – instead of two hundred, as it was still maxing out.
Divided the Theta channel by two hundred – instead of one hundred, as it was maxing out for some user. Thanks to Cystasy from Neurodream for finding the problem.
I encountered some strange behavior while implementing role-based security. The web application would get stuck in an endless loop at around 16h00 every day. This only happened while running on the web server and could not be reproduced locally in a development environment.

The problem was that the Central Authentication Service (CAS) would invalidate the session tokens after 8 hours. And since most people start at 08h00, the problem would only manifest after 16h00. At this point, the authentication system and the response filter started a tug o’ war – the authentication system trying to redirect the response to the login page and the response filter trying to flush the filtered response back to the client.

Special thanks to Mike D for figuring it out, without even looking at a single line of code… I had to hand over one of my hats.

The solution was simple – to bypass the filter if the response is being redirected (301), line 11:

public class WebApplication : System.Web.HttpApplication
{
    public WebApplication()
    {
        ReleaseRequestState += new EventHandler(OnReleaseRequestState);
    }

    void OnReleaseRequestState(object sender, EventArgs e)
    {
        // Ensure that the request is not being redirected before applying the filter
        if (HttpContext.Current.Response.StatusCode == (int)HttpStatusCode.Redirect)
            return;

        // Install the filter
        var response = HttpContext.Current.Response;
        var request = HttpContext.Current.Request;
        response.Filter = new SecurityFilterStream(response.Filter, request);
    }
}

Read more »

Enabled loadFromRemoteSources as the plugins weren’t being picked up anymore because of a change in the .Net Framework.

From MSDN:

In the .NET Framework version 3.5 and earlier versions, if you loaded an assembly from a remote location, the assembly would run partially trusted with a grant set that depended on the zone in which it was loaded. […] If you try to run that assembly in the .NET Framework version 4 and later versions, an exception is thrown; you must either explicitly create a sandbox for the assembly, or run it in full trust.

So I added the following to app.config to get it working again:

<configuration>
  <runtime>
    <loadFromRemoteSources enabled="true" />
  </runtime>
</configuration>
Initialized the buffer when receiving data from the COM port and added error handling. The plugin should now start plotting!

Lucid Scribe 1.2.0

Upgraded to .Net Framework 4.0, because plugins compiled with Visual Studio 2010 weren’t loading. And tagged “Lucid” on the splash screen graph!

Dream Research Contest

I was lucky enough to win a dream research contest! The challenge was to look at the word usage frequencies of six sets of dreams (available here) and make the following three predictions for each set:
a) Is the dreamer a male or female?
b) Is the dreamer younger or older than 18?
c) Is this a set of most recent dreams (MRDs) or highly memorable dreams (MemDs)?

I simply plugged the values from the baseline hypotheses into column B and the values from the sets into column C, then applied the following formulae:

=IF(C2>B2, "Female", "Male")
=IF(C19>B19, "Older", "Younger")
=IF(C25>B25, "MemD", "MRD")

And I added a test for cognition and perception, based on the findings in part 3 of “Creating a Baseline for Studying Patterns in Dream Content”.

It was a great learning experience for me and got the gears turning for some new features for Lightened Dream…

Keyboard 1.0.3

Added the installer and shared the source code.

Download now

Added the installer to the source code.