## 09 Nov 2011

### Monologue

#### Tomas Petricek: F# Math (II.) - Using matrices for graph algorithms

In the previous article of this series, we looked at `complex` and `BigRational`, which are two numeric types that are available in F# PowerPack. Aside from these two, the PowerPack library also contains a type `matrix` representing a two-dimensional matrix of floating-point values.

In this article, you'll learn how to work with matrices in F#, using some of the functions provided by F# PowerPack. I'll demonstrate the library using an example that represents graphs using a, so called, adjacency matrix. If you're not familiar with this concept, you don't need to worry. It is quite simple and it will be clear once we look at an example. The matrix represents which vertices of a graph are connected with other vertices by an edge. Many of the standard operations on matrices are useful when working with adjacency matrix, so this tutorial will cover the following:

• Creating matrices from lists and using functions from the `Matrix` module
• Using slices to read or modify a part of matrix
• Performing standard operations with matrices such as transposition and matrix multiplication
• Using higher order functions for working with matrices

This article is a part of a series that covers some F# and F# PowerPack features for numerical computing. Other articles in this series discuss matrices, defining custom numeric types and writing generic code. For links to other parts, see F# Math - Overview of F# PowerPack.

09 Nov 2011 1:46am GMT

## 08 Nov 2011

### Monologue

#### Jordi Mas: gbrainy 2.06

Here we have gbrainy 2.06, a minor release that represents 3 weeks of work. gbrainy is a game that challenges your logic, verbal, calculation and memory abilities.

What's new in version 2.06 (since 2.03)

• 5 bug fixes
• Updated translations

* http://gent.softcatala.org/jmas/gbrainy/gbrainy-2.06.tar.gz
(md5sum 216ce6e151b526075c5938344ed697c5)

Additionally, gbrainy is available for all major Linux distributions.

Windows version

As part of releasing gbrainy 2.06, I created a new Windows version package. You can download it as usual from SourceForge.

On-line version

gbrainy is also available on-line. All games except memory games are available. This is far from ideal in terms of usability but is still a work in progress and I hope to make more progress during the summer.

Help Wanted!

You can contribute to gbrainy in many ways, but actually I'm specially looking forward help on these areas:

• If you are a native English speaker and you see any English sentence that has broken grammar or it is difficult to understand please let me know
• If you are playing the game and you see a bug in any of the games please also let me know

Report any issue by fill up a bug in gbrainy bug tracking, sending a message to the gbrainy public group or just dropping me a quick message (jmas at softcatala dot org). Your help is really appreciated.

Thanks

Finally I want to say thanks a lot to all the people that has participated in this release: translators, people reporting bugs, giving feedback, etc. You contribution has been key as usual!

08 Nov 2011 8:03pm GMT

## 07 Nov 2011

### Monologue

#### Joe Audette: IOS 5 Finally Supports WYSIWYG Editors

More and more people are accessing the web using smart phones and tablets and while much progress has been made to provide a good web experience for those devices, until now one major shortcoming has been the lack of support for use of web based WYSIWYG editors like CKeditor and TinyMCE. The problem has been that while the WYSIWYG editors would display ok, they did not trigger the keyboard input so they were not usable because clicking/touching them did not put the focus in the editor and did not bring up the keyboard. The best solution we could come up with was to force the use of a plain old textarea which would trigger the keyboard but required entering raw html making it more tedious to use and requiring knowledge of html from the user. We tried to make it a little better by using MarkitUp to at least provide a toolbar with some helpful html elements as shown below in this screen shot from an old iPhone 3.

HTML 5 actually defines a contentEditable attribute which is intended for use in making web pages editable but it wasn't supported in previous versions of IOS/Mobile Safari until now with the recent release of IOS 5. Fortunately for us the makers of the popular open source WYSIWYG editors have been working on this using the beta versions of IOS 5 so that now since the official release both of these editors can work in iPhones and iPads that have IOS 5. Shown below is a screen shot of TinyMCE used in iPhone 4S.

We've modified mojoPortal to take advantage of this and not force the plain textarea if we detect an IOS 5 device. This change is already in our source code repository and will be in the next release of mojoPortal. You can also try it out on our demo site using your IOS 5 device. For other devices we still use the textarea approach but I suspect that over time we will be able to enable the WYSIWYG editors for even more devices.

I'm very excited that this major limitation has been overcome in IOS 5 and especially for iPad which is a great web browsing experience and now is even better since you can actually edit your content easily. Huge kudos to the developers of TinyMCE and CKeditor for their great work in supporting mobile devices.

07 Nov 2011 7:19pm GMT

#### Jo Shields: Bansheegeddon

It's seeming increasingly likely that reports regarding the future of Banshee, Tomboy, and the rest of the Mono stack in the default Ubuntu desktop install are accurate. Ubuntu 12.04 will likely be the first Ubuntu release since 5.10 not to ship with any Mono apps in the default install - ending a run of 12 [...]

07 Nov 2011 5:19pm GMT

#### Sebastien Pouliot: Andr.Unit features parity

Andr.Unit was updated this weekend to reach feature parity with Touch.Unit. What does it means ? Network logging for test results and automation helpers are now available in Andr.Unit. Only that ? Almost, there's a few bug fixes too, e.g. … Continue reading

07 Nov 2011 2:14pm GMT

#### Jeroen Frijters: New Development Snapshot

I've implemented the JDK 7 method overriding behavior. So this should be the final snapshot before the 7.0 release candidate.

It's really a testament to the .NET method overriding model that I was able to easily implement all the weird JDK 7 behavior without resorting to any hacks. It's a simple matter of using MethodAttributes.NewSlot and TypeBuilder.DefineMethodOverride() in the right places.

Changes:

• Updated LICENSE and THIRD_PARTY_README to OpenJDK 7. Thanks to Martin for pointing out in the comments this was still missing.
• Implemented JDK 7 method overriding behavior (minus the part 5 bug).

Binaries available here: ikvmbin-7.0.4328.zip

07 Nov 2011 6:46am GMT

#### Jeroen Frijters: Java Method Overriding Is FUBAR Part 6 of ?

Parts 1 through 5 described behavior that is new in JDK 7, but there are also pre-existing bugs.

When you declare a static method as final (which makes no sense and there is no good reason this was ever allowed) you disallow a virtual method in a base class from being overridden:

```public class A { public void foo() { System.out.println("A.foo"); } } public class B extends A { public static final void foo() { System.out.println("B.foo"); } } public class C extends B { public void foo() { System.out.println("C.foo"); } } public class test { public static void main(String[] args) { new C(); } }```

After you compile this (the easiest trick is probably to rename the B.foo method to f__ and after you compile use a hex editor to patch the resulting class file) and run it, you get:

```Exception in thread "main" java.lang.VerifyError: class C overrides final method foo.()V at ... ```

Like I said, this is not new. I also tried this on JDK 1.1 and JDK 1.5 and on 1.1 behaves as expected and 1.5 has the modern behavior.

07 Nov 2011 6:12am GMT

## 06 Nov 2011

### Monologue

#### Sebastien Pouliot: Kobo Vox : Initial impressions of a developer

I really wanted an original Amazon Kindle - really. In fact too much to wait for them to become available in Canada. So I first got a Sony PRS505, then one (and a second) Sony PRS300 and last summer a … Continue reading

06 Nov 2011 4:35pm GMT

#### Rafi Mizrahi: Presenting at DLD Tel Aviv 2011

DLD (Digital - Life - Design) is a global conference network on innovation, digital media, science and culture. It connects business, creative and social leaders, opinion-formers and investors for crossover conversation and inspiration.

DLD Tel Aviv Summit is one of the events of Tel Aviv Festival.

DLD hosts were kind to invite Rafael Mizrahi, CEO at Feng-GUI to present at the following panels.

1 November
14:30 - 15:15 Brain Machine Interface
Moderated by:
Dr. Rafi Gidron - Chairman, Israel Brain Technologies; Former Co-Founder & Co-CEO, Precede and Chromatis
Discussion:
Rafael Mizrahi - GarageGeeks; CEO, Feng-GUI
Amnon Demri - Engineer and Entrepreneur
Prof. Nathan Intrator - Tel Aviv University
Imad Younis - President & CEO, Alpha Omega

Rafael Mizrahi presenting at Brain Machine Interface

Pick a StartUp - Showcasing Israeli Start-up companies at DLD festival
Out of all the digital Start-Up companies registered to this event, thirty companies will be randomly picked out to pitch its idea and will have the opportunity to give a 5 minute presentation each to to the audience which will include VC?s, Angels, leaders and executives of digital community.

Moderated by:
Commentators:
Yair Goldfinger - Co-founder & CEO, newCo; Co-founder, ICQ; Founder, Dotomi
Shimon Shocken - Computer Scientist Professor, IDC Herzliya
Stephanie Czerny - Managing Director, DLD Media & Ventures, Co-Founder DLD Conference
Marcel Reichart - Managing Director, DLD Media & Ventures, Co-Founder DLD

Feng-GUI presentation at Pick a StartUp

Feng-GUI presentation at Pick a StartUp

GarageGeeks and Yossi Vardi Meet the Industry Leaders at DLD Tel Aviv

In the DLD festival the GarageGeeks and Yossi Vardi will host "Meet the Industry Leaders" party.
We are inviting the entire entrepreneur community to meet with the leaders of the digital media industry.

This event will create a unique opportunity for leaders of the industry to connect with the next generation of leading entrepreneurs and potential business partners.
Moderated by Dr. Yossi Vardi ? Co-Chairmen, DLD Tel Aviv Summit

* Christian Hernandez Gallardo ? Director, Platform Partnerships EMEA, Facebook
* David Lawee ? VP, Corporate Development, Google
* Dan Powers ? Global VP Sales and Business Development, Amazon
* Dr. Hubert Burda ? Co-Chairmen, DLD Tel Aviv Summit
* Haran Sold ? Chief Strategy Officer, Alcatel-Lucent
* Arkady Volozh ? Founder, Yandex
* Bhavneet Singh ? Managing Director and Executive VP, MTV International

Rafael Mizrahi presenting at GarageGeeks party

06 Nov 2011 9:28am GMT

## 04 Nov 2011

### Monologue

#### Jeroen Frijters: Java Method Overriding Is FUBAR Part 5 of ?

One of the bizarre things is that the method overriding behavior changed between Java 6 and Java 7 (and HotSpot preserves the Java 6 behavior for classes that have major class file version < 51), but the spec doesn't mention this at all, where it generally is pretty good about mentioning different behavior based on class file version.

Here's an example that uses a class hierarchy that mixes version 50 and 51 classes to confuse HotSpot JDK 7:

```package p1; public class A { { foo(); } public void foo() { System.out.println("A.foo"); } public static void main(String[] args) { new p3.F(); } } package p2; public class B extends p1.A { { foo(); } void foo() { System.out.println("B.foo"); } } package p3; public class C extends p2.B { { foo(); } void foo() { System.out.println("C.foo"); } } package p4; public class D extends p3.C { { foo(); } void foo() { System.out.println("D.foo"); } }```

Here's a table view of the structure:

p1 p2 p3 p4
A
B
C
D

After you compile this with javac 7 (again using the trick to first compile without the public modifier on A.foo) then use a hex editor to modify p3/C.class to change the class file version from 51 (33 hex) to 50 (32 hex) at offset 7 in the file.

When you run it you get:

```D.foo D.foo Exception in thread "main" java.lang.AbstractMethodError: p3.C.foo()V at p3.C. (C.java:5) at p4.D. (D.java:3) at p1.A.main(A.java:10)```

(This is a variation of the bug I reported here.)

04 Nov 2011 7:54am GMT

#### Jeroen Frijters: Java Method Overriding Is FUBAR Part 4 of ?

Another example of broken JDK 7 behavior:

```package p1; public class A { { foo(); } void foo() { System.out.println("A.foo"); } public static void main(String[] args) { new p3.F(); } } package p2; public class B extends p1.A { { foo(); } void foo() { System.out.println("B.foo"); } } package p2; public class C extends p2.B { { foo(); } void foo() { System.out.println("C.foo"); } } package p3; public class D extends p2.C { { foo(); } void foo() { System.out.println("D.foo"); } } package p1; public class E extends p3.D { { foo(); } void foo() { System.out.println("E.foo"); } } package p3; public class F extends p1.E { { foo(); } void foo() { System.out.println("F.foo"); } }```

To make this is a little clearer, here's a table view of the structure:

p1 p2 p3
A
B
C
D
E
F

When you run it you get:

```F.foo C.foo C.foo F.foo F.foo F.foo```

Not only is this not compliant with the spec, it just plain makes no sense.

04 Nov 2011 7:32am GMT

#### Jeroen Frijters: Java Method Overriding Is FUBAR Part 3 of ?

For another example of weird JDK 7 behavior, start with the code from part 2 and make B.foo final.

When you run that you get:

```C.foo B.foo```

So now C.foo suddenly doesn't override B.foo. This also violates the spec, because when a method that would have been overridden is marked final the verifier should fail to load the class. This shows that the verifier and vtable layout code have different ideas about method overriding semantics.

04 Nov 2011 6:33am GMT

#### Jeroen Frijters: Java Method Overriding Is FUBAR Part 2 of ?

In part 1 of this series I argued that the spec is broken, now I'll show the first example where the reference implementation does not implement the spec.

```package p1; public class A { { foo(); } public void foo() { System.out.println("A.foo"); } public static void main(String[] args) { new p3.C(); } } package p2; public class B extends p1.A { { foo(); } void foo() { System.out.println("B.foo"); } } package p3; public class C extends p2.B { void foo() { System.out.println("C.foo"); } }```

(If you want to compile this with javac you'll need to first compile it with a version of A that does not have a public foo method and then change A and just recompile A.)

Now the question is does C.foo override B.foo? According to the spec it does not, but when you compile this with javac from JDK 7 (because the class file version needs to be 51 to get the new behavior) and run it you get:

```C.foo C.foo```

So C.foo overrides both A.foo and B.foo.

04 Nov 2011 6:27am GMT

#### Jeroen Frijters: Java Method Overriding Is FUBAR Part 1 of ?

The Java Virtual Machine Specification Java SE 7 Edition finally has a section about method overriding (5.4.5). Unfortunately, it does not document the behavior of the Java 7 reference implementation, nor the Java 6 behavior. It also turns out to be a bad design.

Suppose you have a third party widget framework that has a class:

```package org.example; public class Widget { }```

And your application has a subclass of Widget:

```package fubar.tech; public class MyWidget extends org.example.Widget { void frob() { ... } }```

The frob() method is package private and you don't want external code calling it. Now a new version of the widget framework is released that adds a frob method to Widget:

```package org.example; public class Widget { public void frob() { } }```

Starting with Java 7 (and this particular behavior is defined by the spec) your package private MyWidget frob() will now override Widget.frob() and hence be callable by anyone who happens to have a reference to your object. If MyWidget.frob() does anything security critical, the third party framework has now introduced a vulnerability in your code.

04 Nov 2011 6:01am GMT

## 03 Nov 2011

### Monologue

#### Xamarin: Hello From the Xamarin Docs Org!

Hi all, Bryan Costanich here, director of education at Xamarin. I?m totally stoked about what we're doing with documentation and developer education here at Xamarin, and I want to take you backstage and show you what we're up to. AnDevCon II First things first, next week Wally McClure (one of the co-authors of the MonoTouch [...]

03 Nov 2011 2:00pm GMT

## 02 Nov 2011

### Monologue

#### Xamarin: MonoTouch Native Libraries Made Easy

In today's release of MonoTouch 5.0.1, we've made it much, much easier to use native libraries from your C# code. MonoTouch has always allowed developers to access third-party Objective-C libraries. But in the past, it required some familiarity with the way native libraries work on Unix. It also required both the native library (libMyCuteVisualization.a) and the [...]

02 Nov 2011 2:00pm GMT