#Stacked2015 conference (Manchester)

#Stacked2015 conference (Manchester)


At the time I never got to write up about the Stacked conference I attended, so here goes:

I was looking at the various conferences going on this year, and decided to go to Stacked2015 - which was marketed as a Windows developer conference. I hadn't been to a windows developer conference, so I wanted to know more about what I could learn. I hadn't heard of Stacked, but was happy it was in Manchester (Where I live) and was free (Always a bonus!)

http://stacked2015.com/

There was a good mix of speakers at the conference:
Jonathan Seal - Strategy Director - Mando
Jeff Burtoft - Senior Program Manager - Microsoft
Martin Beeby - Developer Evangelist - Microsoft
Mary Jo Foley - Microsoft Watcher & Technology Journalist - AllAboutMicrosoft.com & Windows Weekly
Mike Taulty - Developer Evangelist - Microsoft
Paul Thurrott - Microsoft Watcher and Technology Journalist - Thurrott.com & Windows Weekly

The conference theme I was getting was to talk about how Windows development is changing the landscape for developers, how you can build solutions for Windows and what is coming next.

There was a heavy focus on the Universal Windows Platform (UWP) which you can't seem to get away from if you use Visual Studio 2015! It also focused on building apps for IoT devices such as raspberry pi 2, and subtly touched on how you can take advantage of the new ways of user interaction with your apps.

The conference started on time, I grabbed a bit of SWAG and some coffee and attended the welcome and introduction.
  
I couldn't help but notice the machine in the lobby, with smoke coming from the back, but more about that later!


The first session was on The Developer’s Guide to Windows 10 and the UWP - Mike Taulty, Developer Evangelist, Microsoft

Mike explained about the changes between previous versions of windows and windows 10, from a developers perspective. This meant a lot of explanation on how the UWP works, and writing code for multiple platforms using the same code base. He showed examples of writing code for a Raspberry Pi, PC and also a SurfaceHub. He talked about the how the to use the Extension platforms for code that targets specific device families.Microsoft now splits device families into Phones, Phablets, Tablets, Desktops, Xbox, SurfaceHub, Hololens and IOT, and where code deviates from generic platform code, we use one of the extension libraries.



The second session was on Windows 10 Web Platforms - Jeff Burtoft, Senior Program Manager, Microsoft

Jeff talked about the key goals for Windows 10: to try and make Windows the best platform for experiencing the web. There was a lot of brag about Microsoft Edge and its inner workings, lots of explanation of how Microsoft are leaving the legacy behind, and providing users with an elegant experience that’s always up to date, and makes the web “just work” for its users. The complications of continuing development on IE which just became a monster, they showed a graph with all the versions over time, quirks mode, strict mode etc. The balanced this against users impressions of IE (such as its slow, doesn't render sites correctly, doesn't work etc.) and decided it was just easier to start again!

They also revealed a new microsoft tool called sitescan (which is what they had in the lobby in this cool looking robotic machine, but duing the talk, they had it working on a raspberry pi, which you could send an SMS to, and it would scan the site and test its compatibility with Microsoft edge. It looked for things like css prefixes (such as moz- or opera-). It also checked things like whether sites are using browser detection libraries etc.



He also explained that in Windows 10, the web isn’t just an app, it’s a platform. By this he meant it allows web developers to build amazing experiences without changing the languages, tools or workflows that they have grown to love. He touched on hosted web apps which allows writing of apps using Edge and has all the benefits of a store app, such as access to all windows APIs

This then  brought him onto talking about ManifoldJs, which just looked amazing!
To sum up briefly, it allows you to take a website, or a series of artefacts, and convert them into a mobile app within about 5 minutes. I don't mean just Windows Mobile though, it includes iOS, Android, and lots of other platforms. This technology really excites me, so i'll post more about this soon!


The last bit he explained about how Explained how Edge always up to date works Edge will always stay at its version, with over the air incremental updates Rather than being compliant to Http standards, it will use community patterns more (such as iOS standards, chrome etc.) Example of this is mobile edge will render as an iPhone page, if the site is optimised for iPhone (which most mobile sites are optimised for). Will reuse agent string for other browsers to make sites more compatible Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.



The third session was on Making the Computer Experience More Personal - Jonathan Seal, Strategy Director, Mando & Mike Taulty, Developer Evangelist, Microsoft

I must say, this session felt a but fluffy and a bit of a filler session! They talked about about the current model we use for computing, such as icons, mice and pointers and how it's lasted for 30 years. Apparently we’re seeing an explosion of ways in which we can interact with machines, including more natural mechanisms like touch, gesture, speech and pen. We are entering an age of really ‘personal’ computing. There was a lot of talk about how we need to change the model, but it felt like all questions, and no answers!


Lunch was then provided, which was an amazing assortment of curries!



The fourth session was on Microsoft & Developers - Now and Next - Mary Jo Foley, Microsoft Watcher, AllAboutMicrosoft.com (ZDNet) & Windows Weekly co-host

This was a talk by Mary Jo Foley, just a general talk of the direction of Microsoft and where they are headed as a company. She suggested that Microsoft's movement into phones may be being binned in the future (I guess no one saw that coming?), in favour of android. They have abandoned the Android application bridge (well there has been no news on its development for some time)
There's a big push towards open source in order to tap into the open source community developer resource, and a big push towards using azure and it's services. They are aiming for slimmer development teams and there's going to be possible shrinking/streamlining of products and services at Microsoft in future?
She mentioned a new build/code name for windows 10 coming out before Christmas (Would be windows 11? But 10 is a rolling release now). Also Microsoft are looking to move in consulting more at businesses in a hope that more businesses will continue to use Microsoft products. The idea is to be involved in any issues, not just Microsoft problems.


After session four, there was a competition, to win an XBox One Onesie (which I won!)

I didn't want to mention that I'm PS4 at heart!

The fifth session was on Developing for the Internet of Things - Martin Beeby, Developer Evangelist, Microsoft

This was basically a plug for windows 10 on raspberry pi, and interesting projects that have been made using the platform It showed controlling things like a Sphero using an app written for UWP and also how simple it is to write apps for raspberry pi, and how we shouldn't limit ourselves to just the desktop platform. This was really interesting, so much so that not long later I went and purchased some more bits of electronics to try and do some more of my own IOT projects!


Unfortunately I had to leave after this, so I wasn't able to make the recording of Windows Weekly Live with Mary Jo Foley and Paul Thurrott



Mob Programming - FizzBuzz

Mob Programming - FizzBuzz

I was having a chat with another developer at work about mob programming (something that's a bit taboo where we work). I ran a developer huddle for our team and mobbed one of the code katas (FizzBuzz)

Mob programming Definition:
Mob programming is a software development approach where the whole team works on the same thing, at the same time, in the same space, and at the same computer. This is similar to pair programming where two people sit at the same computer and collaborate on the same code at the same time. With Mob Programming the collaboration is extended to everyone on the team, while still using a single computer for writing the code and inputting it into the code base

FizzBuzz Definition:
Imagine the scene. You are eleven years old, and in the five minutes before the end of the lesson, your Maths teacher decides he should make his class more "fun" by introducing a "game". He explains that he is going to point at each pupil in turn and ask them to say the next number in sequence, starting from one. The "fun" part is that if the number is divisible by three, you instead say "Fizz" and if it is divisible by five you say "Buzz". So now your maths teacher is pointing at all of your classmates in turn, and they happily shout "one!", "two!", "Fizz!", "four!", "Buzz!"... until he very deliberately points at you, fixing you with a steely gaze... time stands still, your mouth dries up, your palms become sweatier and sweatier until you finally manage to croak "Fizz!". Doom is avoided, and the pointing finger moves on.
So of course in order to avoid embarassment infront of your whole class, you have to get the full list printed out so you know what to say. Your class has about 33 pupils and he might go round three times before the bell rings for breaktime. Next maths lesson is on Thursday. Get coding!
Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz?".

We only had an hour, so it had to be short. We thought it may be a chance to make sure we are all on the same page when it comes to TDD. Overall it was a lot of fun! It created a sense of shared achievement when we completed, and brought up a lot of debate about splitting up the responsibilities, and writing the smallest unit of work to be tested. I thought I was a bit OCD when it comes to red green refactor, but there's members of the team that are even more strict about it!

Here is our code, it took less than an hour, but was a chance for us to try something a bit different, and some of us learnt something from it, which is always a plus! Hopefully we will run more sessions like this, and maybe start to solve more complex issues in our codebase this way, and maybe using languages we are less familiar with.

Javascript - When to use call and apply

Javascript - When to use call and apply

Call and apply, it's all about "this" and setting the context when inside a function. It's important to know how and why you would need to do this, especially if you are using a pattern such as MVP when writing larger quantities of javascript, e.g. in a website or a node.js project, and you want to maintain readability and maintainability.

In this post, I'm going to attempt to explain the functionality and uses for the javascript method "call". and "apply". The "call" and "apply" methods are built into javascript, so they can be used in node.js, websites etc.

The call and apply methods are useful for when you want to call a function, but replace the context keyword "this" inside the function with a specified parameter. You cannot normally change the value of this, as it is not a real variable, but you can swap its context out by using "call" or "apply".

One thing to remember though, if you are in "non-strict" mode, and the value of the first argument is null or undefined, it will be replaced with the global object. (in a browser, this will be window). You will find this technique especially useful if you are creating a function that has some kind of state, and needs to refer to itself.

The difference between call and apply are just down to developer preference. Call takes a variable for each parameter, and apply uses an array as a variable for all parameters.

Here's an example of where using call is useful.
When making an ajax call, you lose the state of "this" on the call back, but sometimes you may want to maintain the context after a callback. When GetAddress is called, we set "this" to the variable self, and once get has completed, we use "call" to pass "self" to the method, which will swap out "this".

This means, when the callback function is executed, we still have the "this" value as you have expected in a synchronous call.



Apply can be used in the same way, but instead of passing variables to the function, it passes the context and the variables as an array.


Let it snow!

Let it snow!

Oh look, its snowing!! I wanted to bring back one of the best things about the late 90s and Christmas, the infamous javascript falling snowflakes, but with a lot less code and with purely javascript and css. Very festive! Hope you enjoy! Here is my original code:

And adapted for blogger:


12 days of christmas Code kata

12 days of christmas Code kata

I found a nice seasonal challenge for the end of the year - printing out the lyrics to the '12 Days of Christmas':
On the first day of Christmas, 
my true love gave to me,
A partridge in a pear tree.
On the second day of Christmas, 
my true love gave to me,
Two turtle doves, 
And a partridge in a pear tree.
...
On the twelfth day of Christmas,
My true love gave to me,
Twelve drummers drumming,
Eleven pipers piping,
Ten lords-a-leaping,
Nine ladies dancing,
Eight maids-a-milking,
Seven swans-a-swimming,
Six geese-a-laying,
Five golden rings,
Four calling birds,
Three french hens,
Two turtle doves,
And a partridge in a pear tree.
Rules
  • You don't have to worry about capitalization; the entire text can be case insensitive
  • You can sensibly ignore any punctuation: hyphens can be spaces, and commas and periods can be ignored
  • There should be a blank line between each verse
  • You must ordinalize your numbers: "first day of Christmas", "Four calling birds", etc

Here is my submission

Long time no see!

Long time no see!

So, it's been nearly 2 years since my proper last post! So much had happened since then, I've bought a house, spending most of my time getting that nice, and also had a baby, which basically wipes out all my free time!
I'm going to make some extra effort to pay more often, hopefully utilising my commute time to actually get some hobby coding going again! There's so many technologies I want to start using!
I've been recently doing some of the pluralsight courses (mostly the certified ethical hacker) but some others as well! I also recently attended the #Stacked2015 conference in Manchester, which was interested and sparked my interest again back in IOT. Hopefully something that I'll blog about soon, anyway I'll keep this sort and hopefully get some proper posts up soon!