C# Vectorization with Microsoft.Bcl.Simd

April 22, 2014

tl;drA couple of weeks ago at Build, the .NET/CLR team announced a preview release of a library, Microsoft.Bcl.Simd, that exposes a set of JIT intrinsics on top of CPU vector instructions (a.k.a. SIMD). This library relies on RyuJIT, another preview technology that is aimed to replace the existing JIT compiler. When using Microsoft.Bcl.Simd, you program against a vector abstraction that is then translated at runtime to the appropriate SIMD instructions that your processor supports.In this post, I'd like to take a look at what exactly this SIMD support is about, and show you some examples of what kind of...
no comments

Wrapping Up TechDays Netherlands 2014

April 17, 2014

What a crazy week it was! On Monday evening I was totally stuffed from the traditional Passover dinner at my parents' house, and on Tuesday morning I was already flying to Amsterdam for TechDays Netherlands 2014 to deliver three talks on Azure Mobile Services and Notification Hubs. Thanks everyone for coming to my talks and I'm sorry for the botched demo at the end of the third one -- there's only so many times you can tempt the demo gods before something goes wrong, and in this case it was the Internet connection (both wired and wireless) towards the end...
no comments

Wrapping Up DevWeek 2014

April 6, 2014

I have landed from London six hours ago after a wonderful week at DevWeek. Three talks and a workshop made for a pretty busy schedule, but I still had time to enjoy London, with its unusually sunny weather. What's New in C++ 11 My first talk, at 9:30am in the morning, attracted a small audience of C++ developers. C++ 11 is a very extensive new standard, and if you read code developed in the modern C++ style, you might think it has nothing to do with your favorite language of the 1990's. Indeed, I tried to illustrate the major...

iOS Gesture Recognition and Animation with Xamarin

March 28, 2014

In the previous post, we looked at Android gesture recognition and animations. This post completes the picture by looking at the same features in iOS. Touch gestures and animations are really cool experiences for users, and iOS ships them out of the box because it is both touch-first and touch-centric, and touch naturally leads to rich, immersive animations. As with Android, Xamarin.iOS very closely mirrors the native Objective C API, so it should be very easy to port the example code below to a native iOS application, should the need arise. Gesture Recognition Every view (UIResponder subclass) on iOS has built-in support...
tags: , ,
one comment

Android Gesture Recognition and Animation with Xamarin

March 20, 2014

In this post we'll take a look at how to recognize simple and complex touch gestures in an Android application and apply animations to views on screen. Touch gestures are a fundamental way for users to interact with mobile applications, and animations are key to designing a pleasant user experience. As with all other Xamarin APIs, the native (Java) versions are very similar, so it should be easy to port the examples below to Java if you need to. Let's get started with recognizing gestures. Gesture Recognition Android's support for touch begins with the onTouchEvent method that every View-derived class can override....
one comment

“Attacking Web Applications” at O’Reilly Fluent

March 12, 2014

I've just finished my presentation "Attacking Web Applications" at O'Reilly Fluent, a web developers' conference in San Francisco. I've really enjoyed the conference atmosphere and had some great conversations. If you were at my talk, thanks a lot for coming! (I'd also really appreciate it if you rate the session and provide any feedback in the comments.) Here are the slides: Attacking Web Applications from Sasha Goldshtein The basic premise of this talk is that web developers need to be aware of the way attackers think and operate. It isn't enough to be familiar with common attacks on the theoretical...
tags: ,
no comments

Back to Basics: Regular Expressions and Formal Languages

March 6, 2014

Regular expressions are a very powerful tool to have on your toolbelt. They have an arcane syntax and often end up looking like a random stream of characters, but they can save you a lot of time parsing and interpreting text. Here are some problems that you can solve with regular expressions: Find a list of phone numbers in a large text file Check that a user-provided email address is valid Verify that a password meets custom strength requirements Locate all outgoing links in an HTML document Modify all <img src="..."> tags to refer to an HTTPS address In this post I'd like to take...

Canada Tour 2014: Toronto User Groups and ConFoo

February 28, 2014

I spent a great week in Canada despite the super-cold weather for my taste. After all, in Israel, sub-freezing temperatures are enough of a reason to cancel school and bring public transportation to a halt. So for me, stepping outside in -15 degree weather was pretty much of a shock. The week started with three days in Toronto, visiting the Sela Canada branch and delivering two talks at user groups - an introduction to Android development with Eclipse and Xamarin, and an introduction to Node.js on Windows Azure. Then, I flew in to ConFoo, a conference for web developers in Montreal....
no comments

Diagnosing a Non-Paged Pool Leak with Asynchronous I/O

February 20, 2014

I spent a few hours last week chasing a non-paged pool leak caused by a simple Win32 application. After some divide-and-conquer work, we were able to pinpoint the line of code causing the leak -- a seemingly innocent WSARecv call that performs an asynchronous socket receive. How can a user-mode application cause a non-paged pool leak that quickly accumulates to dozens of megabytes of kernel memory? Read on for the details. If you'd like to replicate this problem yourself and experiment with the diagnostic process described below, use the following gist. It's 54 lines of code including error handling and #includes. Capturing...
no comments

Productivity, Exploration, Diagnostics, and Collaboration: Visual Studio 2013

February 14, 2014

On Thursday I had the pleasure of delivering a session at the High-Tech Mizpe Ha-Yamim event for decision makers (VP R&Ds, CTOs, and CIOs) in the beautiful and tranquil Safed/Rosh-Pina area. My talk focused on Visual Studio 2013 and how it can make developers' lives better by improving productivity and collaboration, making it easier to diagnose difficult problems in development and production environments, and helping explore large amounts of existing code. I built the talk around four core areas: productivity, exploration, diagnostics, and collaboration. The demos included using IntelliTrace with Windows Azure Cloud Services, using Visual Studio's .gcdump support with...
no comments