A morning with new Phantom 4 Advanced

Got up at 3am yesterday to take the new drone for a spin. Went to a lake, canal, mountain drawing, windmill and a hill.

Had a really close call first thing in the morning when the drone went into the brunches of a tree. No way did I think it would be able to survive that and I thought it would plummet into the canal under the tree. To my surprise the drone came unscathed! No propeller damage, just dirt from the tree. Phew! Great job DJI!

Again the collision avoidance just made things worse! It is now permanently turned off.

The parabolic reflectors seem to decrease the range rather than increase it, so they are going to the bin.

Positives: managed to clock about 2 hours of flight. Phantom 4 Advanced seems to get along very well with Phantom 4 Ver 2 propellers and I’m averaging 29-30 minutes of flight time with 10% to spear!

Got a lot of great footage, which needs to be cut, edited, colour graded etc.

Some photos from yesterday:


Still can’t believe how great the camera on the drone is. 1 inch sensor is definitely worth it. The UHD footage looks unbelievable on 4K monitor!

Advertisements

Efficient linked lists in .NET

Exercises in .NET with Andras Nemes

Sometimes you need a collection that’s modified a lot: you insert, update and remove items. A List of T is then inefficient as it needs to constantly rearrange all other items. The LinkedList class might be a better candidate.

A linked list is a doubly-linked list. Each item has a Next and Previous pointer to look at which element comes right before and after a particular object in the list. A linked list is very efficient at inserting and deleting items in particular.

Initialisation:

View original post 181 more words

SQLite EntityFramework 6 Tutorial

ErazerBrecht's Blog

Hello,

UPDATE 13/10/2015/
I made another post about MVVM and EntityFramework. After reading this, you should really check that one out!
It’s really worth it to use MVVM 🙂
Link to another post: Click Here

I’ll explain the basics to get SQLite working with EntityFramework 6. It’s a straight forwarded tutorial / explanation. I will not tell you everything about EF (there are a lot of tuturials on the web). Instead I’ll show you the most basic example to get EF working with SQLite, after all it wasn’t that easy!

View original post 1,783 more words

Mocking Entity Framework DbContext with Moq

Mirko Maggioni

When we have to test methods that involves Entity Framework, a typical choice that we have to face is use integration tests, with an effective database, or unit tests.

If we choice the first option, with a database like SQL LocalDB, we’ll have performance problems because the cost of the database creation and the data inserts in the test startup is very high, and in order to guarantee the initial conditions we’ll have to do it for each test.

What we can do is use a mock framework that help us to mockup the entity framework context; it would be an in-memory db context, like the in-memory db context of .NET Core, that we have seen in this post.

The factory

In pratice, mocking a class means substitute the real implementation of a method with our custom behaviour; what we can do for every method of the class is…

View original post 482 more words

C# Regrets: Top Worst C# Features

Stumbled upon this article written by no other than Eric Lippert listing the top 10 design faults of C# language. Here is the summary,  the source to the full article is at the bottom. 

#10: The empty statement does nothing for me

Reflects on the fact that lone “;” is a legal statement

#9: Too much equality

There are too many ways check for equality: ==, Equals, ReferenceEquals, CompareTo(…).

From personal experience double.NaN == double.NaN is false but double.NaN.Equals(double.NaN) is true

#8: That operator is shifty

Weirdness around << and >> operators

#7: I’m a proud member of lambda lambda lambda

The way C# 2.0 implements anonymous delegates

#6: Bit twiddling entails parentheses

Flags Enums

#5: Type first, ask questions later

C# borrows the “type first” pattern from C and many of its other successor languages – something I got used to and the “correct” way now seems illogical to me

#4: Flag me down

The fact that you can create invalid enum values and have to manually check for this in the code

#3: I rate plus-plus a minus-minus

++i, i++, i +=1 etc. how much confusion and the pain it caused.

#2 I want to destruct finalizers

Agree with the author that finilisers in C# are symptoms of a bug. Seen it way too many times myself.

#1 You can’t put a tiger in the goldfish tank, but you can try

“array covariance” and how this could lead to run-time exceptions.

Source: http://www.informit.com/articles/article.aspx?p=2425867

Structs, C#7 and Performance Improvement 

C# 7 provides a very powerful feature from the performance standpoint. This feature is returning by ref. Essentially this allows for value types to be returned without having to copy them.

The guidelines are normally that you shouldn’t use a struct with too many fields. Various sources quote various size guidelines. Whenever the struct was over the prescribed size it was recommended that you pass it by reference.

With the new syntax for returning types by reference, it’s now more convenient (no more methods returning via out parameter) to use structs. 

In performance critical scenarios where you need to avoid polluting managed heap with too many Gen #0 objects using structs has now become more natural. In the past dealing with structs was somewhat cumbersome if you dealt with a large number of fields and needed to avoid copying of values. 

I have worked on a large application at McLaren – Telemetry Acquisition System that is supplied to all teams. The performance of the application is very critical as it has to process gigabytes of telemetry data. We have used structs extensively to squeeze out every bit of performance from .NET runtime.

I think it’s my second favourite feature after value tuples.

My Past and Present PCs

Before

I think it says a lot about the developer what sort of PC he/she has. Back when I was in my early 20 I had several:

  • Linux (Fedora) Box – running exclusively traffic shaping (sometimes uptime of that box exceeded 1 year!). The actual script for traffic shaping took a lot of time and effort to write
  • Windows Server – used as a DNS server and a POP3/SMTP server
  • Windows Server with RAID5 – for storing all important data
  • Windows Media Center – primarily for recording programs
  • Main PC – Extreme CPU with water cooling, 4 GB Ram – back in those days it was a monster

MyRig

These days I only have 2:

  • Samsung Ativ Book 9 – 256 SSD, 8GB of RAM, have to say one of the best notebooks
  • Main PC – Intel Extreme Edition CPU with 6 cores (2 logical for each core, so 12 in total), 64GB of RAM, OCZ SSD that goes directly into your motherboard, 2 Intel SSD, 1 x 2TB Hybrid HDD, 7 x 1 GB HDDs – that I need for running virtual machines.

2015-01-18 15.49.18

So despite me getting older I am still a geek

Blog at WordPress.com.

Up ↑