Regeländerungen 2019

28. Januar 2019

Alle Jahre wieder… kommen Regeländerungen.

Die im Bereich des AFVD verwendeten Regeln basieren auf den amerikanischen NCAA-Regeln, welche für Colleges gelten. Es ist üblich (wie auch bei der NFL), dass sich am Ende jeder Saison Vertreter aller Liga-Mitglieder zusammensetzen und die Saison rückblickend analysieren um das Regelwerk anzupassen.

Ein bekanntes Beispiel ist das Verbot bestimmter FaceMasks (sogenannte ‚BigGrill‘), nachdem medienwirksam halbe Ritterhelme zur Schau gestellt wurden und sich viele Leute Sorgen um die gesundheitlichen Auswirkungen dieser Gitter gemacht haben. In den letzten Jahren spielt die Gesundheit gerade in den USA eine große Rolle, weshalb es schnell zu einer klaren Richtlinie kam.

Solche Änderungen werden in Deutschland geprüft und meistens übernommen – hierbei kommt es dann jedoch zu einem Zeitversatz von fast einem Jahr… die Saisons liegen nunmal zeitlich versetzt.

Der American Football Verband Bayern hat aktuell eine sehr schöne Aufstellung der Änderungen im Jahr 2019 erstellt.

Manche dieser Änderungen treffen auf wenig Verständnis bei den Spielern. Bei den BigGrills sowie dieses Jahr bei den Kneepads dürfen wir Schiedsrichter bestimmt den ein oder anderen Dialog führen, warum das auf einmal so ist wie es ist…

Werbeanzeigen

Missing ConnectionString parameter in Entity Framework Constructor

15. März 2016

After working several years with LinQ2SQL and the DBContainer classes I recently switched over to Entity Framework.

When starting my new WebApplication project I compared LinQ2SQL, ADO.Net and EF6 with some possible database operations and finally decided to pick EF as it got the best results. (Details and my regrets may be following up on another blog post).

So when working with EF I also decided to place all files in a seperate project as I had to share the classes among several subprojects. Unfortunately this construct ends in not sharing application settings (app.config / web.config) so I was looking for some way to pass a connection string along with the constructor, as the web.config settings wouldn’t be recognized.

Thanks to StackOverflow and Google I found the most obvious:
The EF-context files inherit from DBContext which owns such an constructor. But the automated generated files lack of this constructor.

Blog_EF_001

So the obvious is (shame on me that I didn’t saw this in first place) to add the missing constructor by hand:

Blog_EF_002

But unfortunately this file is auto-generated – it will be overwritten each time you change something in the designer.

So to prevent the unwandet deletion of your manual constructor is easy if you know how: All you need is a partial class which simply adds the missing constructor:

Blog_EF_003

And that’s it… 🙂


Missing Silverlight Unit Tests in VS2012

31. Juli 2013

When you are missing the Silverlight unit test project templates in Visual Studio 2012 then you should check this link: http://social.msdn.microsoft.com/Forums/silverlight/en-US/180283df-6cac-45fd-bdce-ff3aec31cb7c/unable-to-create-a-silverlight-unit-test-project-on-vs2012

The problem is that the Silverlight Toolkit will install the template files to the first Visual Studio folder found – or even the default folder in case you installed your VS to a different location. So when you have VS2010 and VS2012 installed on your computer this may be the reason why you will not find the templates in VS2012.

To fix this simply lookup the ZIP files in the VS2010 folder (eg C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplates\VisualBasic\Silverlight\1033 and C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\VisualBasic\Silverlight\1033) and copy the Silverlight Test zips to the equivalent VS2012 folder.

Finally you will need to start „devenv.exe /installvstemplates“ manually to apply the new templates.

To create or use a new test project you will currently also need the Silverlight Unit Test Adapter – this will enable VS2012 to make the project visible as test in the testbrowser.

If this plugin does not fix the error message when creating a new test project you may need to edit the MyTemplate.vstemplate file inside the project templates ZIP:

Just edit the following line in the „Wizzard“-section to raise the version:
<Assembly>Microsoft.VisualStudio.Silverlight, Version=11.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly>

I had to go through all the steps to get the project working… Hope Microsoft will fix this soon.

EDIT:

There seems that there exists a different approach via NuGet (see in the answer here):

Just install „Install-Package SilverlightToolkit-Testing“ to the Testproject and manually add the „usings/imports“ to your test classes.

Unfortunately it was too late for me when I found this link – any comment approving this way would be great!

EDIT2:

Another problem came up with the „TestDiscoverer“ (test explorer won’t show the new tests). To fix this I had to add the missing DLLs to the GAC via gacutil:

Open the Visual Studio Command prompt as administrator, go to C:\Program Files (x86)\Microsoft SDKs\Silverlight\v5.0\Toolkit\dec11\Testing and there use gacutil to add the missing DLLs Microsoft.Silverlight.Testing.dll and Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll

Still I’m struggeling to get my tests working – but finally they’re executed… Maybe my solution will come with a new post soon.

 


Touch & Gestures in JavaScript with Windows 8

29. Januar 2013

Recently I had to implement touch & gesture support in JavaScript for a Windows 8 touch device (Asus Ultrabook). As I prior had to add Android support to my existing iOS-library I picked a nice framework: hammer.js which supports iOS & Android… but even then they recently updated to support Windows RT on a Surface this did not work out on our new Asus Ultrabook which we bought especially for developing touch support with JavaScript.

So I had to study how Microsoft did implement their touch support. Pretty fast I stumbled over their well documented library. But unfortunately I had to discover that (again) Microsoft did something on their own: Even if Android and iOS did manage to support nearly the same eventtypes („touchstart“, „touchmove“, „touchend“) so you can easily use the same code for both device types, Microsoft introduced two proprietary event types: MSPointer and MSGesture.

So this lead to the point where I had to extend the nice hammer.js framework with new code which handles the special Microsoft events. You can find a fork on github which I will try to add it to the original framework soon when I’ve finished testing.

The main thing about the gesture support is that you have to create a MSGestureObject for each element you want to handle gestures – otherwise you will only get PointerEvents and will need to handle all interpretation by yourself. After you registrated such an object you will get the events with a plentyfull of information about the current gesture and it’s changes – like rotation and scaling. But here comes the disappointment: The online documentation only names it as rotation but unfortunately it’s more like a translation of the CSSMatrix which is also a proprietary object of Microsoft to handle CSS-transformations. So as I wanted to extend a framework which delivers a wrapper-event with these information I had to pull back and calculate the scaling and rotation by myself instead of using the quite cool but in this scenario unuseful features.

During my work I stumbled over several issues with the MSPointer & MSGesture events which I would like to share:

Event Bubbeling
One issue is that the event bubbeling in IE10 works bottom-up – on iOS or Android it’s top-down… so after realizing this (and it unfortunately took quite long) I finally got an answer why I retrieved events from the wrong HTML elements – something which can be real disturbant when you try to register the MSGestureObject only for these elements you want events for.

Dual Events
Another problem is that even when MSGesture-events are fired the browser still continues to throw the MSPointer-events – fortunately this is something positive as you can now record your own „touches“-array… As the MSGestureEventObject comes with already calculates scale and rotation, they simply miss an array of touches with the coordinates of the finger-tips… As the hammer.js and my own implementation take big usage of these arrays I had to implement my own array with the MSPointerEvents.

Still MouseEvents
On our Ultrabook we had also the problem that the touch device also fires a Mouse-event each time you tap or drag something… as this is normally not to be expected the initial author of the hammer.js-framework simply ignored this and interpreted each mouse event as a touch-event… I expected Windows 8 to hold back the mouse events as I’m really only touched the screen.

Debugging
Finally there is to say that there does not really exists a nice debug-tool for the IE10 in touch-mode (or Metro-Style or however it is called)… so I had to turn back to classic „debug.print“/“console“-debugging by writing my own debug-console to the DOM… Every iOS-developer without Safari 6 (see my last post) will know what I mean.

Identify
UPDATE: Currently I’m struggeling with identifying whether the IE10 comes as Metro or desktop version… unfortunately there is no clear way to identify. The best practice is that you can only hope the desktop version is not started as 64-bit application and so you can lookup the userAgent-string. See this stackoverflow question for more details.

Our next question is how a Microsoft Surface behaves with Windows 8? On Windows RT it seems to simply send „touch“ events as there is a contributor of the hammer.js-framework who added Surface-support without interpreting new event types. But unless I do not have a Surface-device in my hands I will not be able to say something about it. But when I get hold of such a device I will post an article of course.


Installing Silverlight 4 Tools via Web Platform Installer

20. Dezember 2012

After my Web Platform Installer process finally reached the „Silverlight 4 Tools“ task it failed with the following message:

Installation Blockers:
1) Visual Studio 2010 or Visual Web Developer Express 2010 or Visual Phone Developer Express 2010 that matches the language version of Silverlight Tools 4 must be installed before installation of Silverlight Tools can continue. Silverlight Tools is available in other languages at http://go.microsoft.com/fwlink/?LinkId=177432.

 

Luckily a short search via Google gave me the answer:

I’ve installed the Visual Studio 2010 Service Pack 1 in prior and with this package the Silverlight Tools are already installed – unfortunately the Web Platform Installer does not recognize this. Well… even Microsoft seems to fail from time to time 🙂


What really annoys me about the Microsoft Web Platform Installer

20. Dezember 2012

The Microsoft Web Platform Installer is a pretty cool tool: One single program which will help you install all the tools, SDKs, frameworks and software you may need for developing on a Windows computer.

As you may guess I recently got a new machine which needs several of these things to be installed – so first pick is the platform installer.

But there is one single but seriously annoying problem with the installer:

No progress, no duration

No progress, no duration

As you may see there is no real progress bar nor any duration information. You can only guess how long the installation will take. It may take 5 minutes or couple of hours – no real chance to plan to do anything between that.

Fortunately the old machine is still there and I can go on working… or at least write a nice blog article about things which annoy me 😉


Error Reporting Tool

10. Oktober 2012

You recognize an problem or an issue but its too complicated to put it into words? Well, Microsoft delivers a nice solution for that with Windows 7 and Windows 8: The Problem Step Recorder.

Scott Hanselman wrote a nice blog article about that which I want to share: http://www.hanselman.com/blog/HelpYourUsersRecordAndReportBugsWithTheProblemStepsRecorder.aspx

This is a pretty nice and easy tool to report any bug, issue or problem… I think every programmer would love error reports in this format.