Feed aggregator

news

Nieuws van Sportduikclub 'de Walrussen' - Sat, 07/14/2018 - 10:22

Het zomer reces van het zwembad duurt van 10 juli tot 21 augustus 2018.

Date: zaterdag, 14 juli, 2018

Double precision issues

Wim's Space - Thu, 04/26/2018 - 17:13

Due to some interaction with a Swagger related project and a simple yet fast and easy to use C# JSON library SimpleJSON I used in the code generated by my swagger parser and code generator, I stumbled upon some issues regarding storing integers as double. The SimpleJSON library removed the task for generating huge amounts of model classes to deserialize REST call results into.

SimpleJSON uses double as internal storage, as that is fine as long as integer numbers are 32 bits. The trouble and mind-blowing issues start when you have to use 64 bits integers. In my case the Int64 numbers are sometimes used as ID’s of things to fetch. So they have to be exact. In the following text I ignore the unsigned integral numbers but they exhibit the same issue.

A simple examination shows both int64 and double are 8 byte data structures, so where’s the problem?

Double.MaxValue   (1.7976931348623157E+308)

is way larger then

Int64.MaxValue   (9223372036854775807 or 9.223372036854775807E+18)

But problems arise in the proximity of Int64.MaxValue to be precise.

The coding first attempt was to use the following in C#:

Double d = Double.Parse(Int64.MaxValue.ToString());

At first glance it returns a strange and incorrect value of 9.223372036854776E18, which is almost correct the correct value of 9223372036854775807, except that it’s only 7 off the correct value and 2 digits are wrong.

Given the byte-wise size of 8 for a Double, this is understandable, it reserves 52 bits for the fraction, 11 bits for the exponent and 1 bit for the sign (See IEEE Standard 754 Floating Point Numbers).

An Int64 in comparisment has a 63 bit integral part and 1 sign bit. So it can never fit with full precision into the Double fraction. It’s not the byte size of the double that is the limit, but the precision that is less because the double also contains a exponential part.

Doing the same with an Int64, e.g, load a number to big to represent, like:

Int64.Parse(“9223372036854775808”)

throws a nice out of range error.

The cause in this case is clear: the input is larger then the type’s MaxValue. When using a Double, Int64.MaxValue is still magnitudes  smaller than Double.MaxValue, therefor not triggering the same out of range error.

Trying to go safer with:

Double.TryParse(Int64.MaxValue.ToString(), out Double d)

returned true (e.g. no problem during conversion) and the same value that was 7 off. expected was false as the conversion is not flawless.

Even stranger is trying to convert the Double d outcome to a string using:

Double.TryParse(Int64.MaxValue.ToString(), out Double d); d.ToString(“F0”)

returned  “9223372036854780000” instead of the expected value 9223372036854775807. Now it’s a whopping 5 digits off track.

These issues might occur whenever data is stored as tekst and not as binary values, Because in formats like json there is often no way to determine whether a  value is an integer or a floating point:

5

might be a Byte, Int16, Int32 or Int64 but also a Float and a Double.

5.0

on the other hand is clearly a floating point number so a Float of a Double. As Double is the largest of the two, it’s the safes choice, it will fit.

Even a blunt bit by bit copy (just use the Double’s 8 byte as storage) will probably fail as a Double has some bit patterns that signal special numbers like +/- Infinity and NaN or ‘Not a Number’ and might trigger exceptions. Both of these special numbers have their exponential part filled with all 1’s. (See IEEE Standard 754 Floating Point Numbers).

As can be seen above, taking a Double is most of the time (but not always) a safe choice.

So it this all a C# problem/issues? By far!

In Java:

System.out.println(Double.parseDouble(“” + Long.MAX_VALUE));
System.out.println(“” + Long.MAX_VALUE);

returned 9.223372036854776E18 instead of correct value of 9223372036854775807 (so 4 digits wrong, due to some rounding it seems),

In 64-bit Python 3.6:

float(sys.maxsize)
int(sys.maxsize)
print:

returns 9.223372036854776e+18 instead too of the correct value of 9223372036854775807 (so like java 4 digits off).

PS. An unrelated issue is that in C/C++ parsing strings with methods like strtof() into numbers usually stops at the first character that is not understood. One of the returned values of for example strtof() is the index where the parsing failed. So in case of a wrong decimal separator you might end up with only the integral part (so 5 instead of 5.5235).

Kerst 2017

Nieuws van Sportduikclub 'de Walrussen' - Sat, 12/23/2017 - 18:27

 

Mooie feestdagen en een mooi en avontuurlijk duikjaar toegewenst.

 

​Het bestuur

Date: zaterdag, 23 december, 2017

Algemene ledenvergadering

Nieuws van Sportduikclub 'de Walrussen' - Fri, 04/21/2017 - 09:07

De algemene ledenvergadering is vind plaats op

​Dinsdag 25 april 2017 om 19.30 uur.

De locatie is zwembad 't Anker te Buchten.

Het Bestuur

Date: vrijdag, 21 april, 2017

Carnaval 2017

Nieuws van Sportduikclub 'de Walrussen' - Wed, 02/22/2017 - 10:29

Wegens carnaval is het Zwembad Het Anker niet ge-opend op 28-Februari en is er derhalve geen training.

Date: woensdag, 22 februari, 2017

Nieuwjaarsborrel

Nieuws van Sportduikclub 'de Walrussen' - Tue, 01/03/2017 - 15:49

De nieuwjaarsborrel voor leden, partners en eventuele kinderen vind plaats op Zondag 8 januari 2017 vanaf 15:30 uur in het zwembad “het Anker “ te Born.

Zie de e-mail of de activiteiten agenda voor meer informatie.​

Date: zondag, 8 januari, 2017

Kerst

Nieuws van Sportduikclub 'de Walrussen' - Sat, 12/24/2016 - 15:15

Wij wensen alle leden en partners hele Prettige Kerstdagen toe en dat het een heel mooi en avontuurlijk duikjaar mag worden.

Het Bestuur.

Eric, Jolanda, Wim, Daniela en Adri.

Date: zaterdag, 24 december, 2016

Zomerreces

Nieuws van Sportduikclub 'de Walrussen' - Tue, 07/05/2016 - 18:06

De laatste training voor het zomer-reces is op 19-Juli.

Allen een zeer goede vakantie gewenst.

De trainingen starten weer op 6-September.

Date: dinsdag, 5 juli, 2016

Jaarvergadering

Nieuws van Sportduikclub 'de Walrussen' - Sun, 03/06/2016 - 11:37

De jaarvergadering vind plaats op dinsdag avond, 15 maart 2016 in 't Anker te Buchten en begint om 19:30.

Date: zondag, 6 maart, 2016

News

Nieuws van Sportduikclub 'de Walrussen' - Fri, 12/25/2015 - 21:46

Ik wens jullie allen hele Prettige Kerstdagen en een voorspoedig en actief Nieuwjaar toe.

Met vriendelijk groet,

Eric

Date: vrijdag, 25 december, 2015

WHS 2011 Client Backup Drive Full

Wim's Space - Mon, 12/21/2015 - 09:53

This week I had that dreaded message for the second time. Probably due to modern GB games that patch themselves regularly and entering the Windows Insider program (so a new Windows 10 version every now and then).

The last time (quite desperate) I deleted one of recent the Data.4096.nn.dat files and did a repair. It worked but I just lost a lot of backups. So I wanted to avoid that at all cost.

What happens when the client backup drive starts filling up is that beyond a certain point the weekly cleanup task will at most only adjust the indexes and not shrink the actual cluster storage files (the Data.4096.nn.dat and Data.512.nn.dat). So even if you mark backups as to be deleted at the next cleanup it still does not free-up disk space. If the disk becomes even more filled-up, even the adjustment of the cluster indexes stops after a few backup-ed machines.

Yesterday I found a much simpler and better (and not destructive to start with)!

First and very important is not to make things worse, so do not forget to stop both backup services so no backups are added during this operation.

It turned out that using the build-in compression feature of NTFS (which happened to be enabled on my client backup drive, so probably by default), could free up the GB’s I needed to get things working again. After compressing around 64 of the smallest Data.4096.nn.dat my free space went up from 4GB to 25GB (around 6GB more that the largest file on the disk).

As my client backup drive is 2TB, I was quite happy that I did not have to compress all files.

After that it was a matter of marking old backups as ‘to be deleted at next cleanup’ and run the clean-up job. After the cleanup it’s best to revert the compression so you can do the trick again if needed.

You can apply the compress attribute by selecting a number of files and right-click them for the property dialog. There use the Advanced Button. It takes a while to compress so take some coffee or better a lunch in the meantime.

For command-line lovers, the command to look for is called compact.

Removing the compression is just a simple compact /u * command from within the Client Computer Backup directory located in ServerFolders on the Client Backup Drive.


News

Nieuws van Sportduikclub 'de Walrussen' - Tue, 12/01/2015 - 11:24

Bij deze zijn de leden, en hun partner met eventuele kinderen, uitnodigd voor de nieuwjaarsborrel op

Zondag 17 Januari 2016 vanaf 15:00 uur
in het zwembad “het Anker “te Born.


Voor meer details zie de email van Ine.

Date: dinsdag, 1 december, 2015

News

Nieuws van Sportduikclub 'de Walrussen' - Thu, 10/15/2015 - 09:58

Er is in de duikplanning een checkbox toegevoegd om aan te geven of de activiteit een club of prive activiteit (dit om verschil te kunnen maken tussen georganiseerde duiken en prive duiken waarvoor buddies gezocht worden).

Date: donderdag, 15 oktober, 2015

Reindexing WHS 2011’s DNLA Server

Wim's Space - Sun, 07/19/2015 - 16:16

Searching for this subject reveals a couple of links of which each has some issues. So I started combining code and testing in so I would be able to rebuild the index without restarting the server.

The reason for rebuilding is that the indexing seems to work on directory notifications and also indexes files that are moved out of the indexed folders. If that happens one will start seeing drive letters in the DNLA file lists.

This proved somewhat more difficult. The database called ‘CurrentDatabase_372.wmdb’ is located under the profile of a special user called ‘MediaStreamingAdmin’. The processes related to the DNLA server also run under this account. Basically these are the services whsmss (Windows Server Media Streaming and HomeGroup Service) and WMPNetworkSvc (Windows Media Player Network Sharing Service).

Both services needs to be stopped before an attempt to delete the database can be made.

This however still fails when the server has run for a while and midnight has passed. The reason is that two other processes are started under the same account and accessing the same database (most solutions ignore this and ask to reboot the server before triggering a reindex).

These two processes are WMPAxHost .exe and WMPlayer.exe. WMPAxHost seem to control the WMPlayer.exe process and restart it when terminated. The purpose of these two processes seems to be updating the metadata of the media files with internet based metadata. This is probably the same feature WMPlayer offers when started interactively.

Terminating these processes will not be a problem as they are restarted next midnight. It’s off-course obvious that WMPAxHost has to be terminated before WMPlayer. To kill these processes some force has to be applied (hence the /f switches of the taskkill statements).

During the search for a solution I also came a way to disable and enable the Media Sharing with PowerShell commands. I have not tested if the batch file runs without these two lines as I find it more elegant to disable the Media Sharing feature during modification.

The last trick used is to rename the database file (which is under Windows NT or later allowed on files that are open). So even if final delete of the renamed database in the script fails, next reboot would create a new database.

The complete script looks like:

cd /d c:\program files\windows server\bin

wsspowershell.exe set-wssmediaserverenabled “-enable 0″

net stop whsmss
net stop WMPNetworkSvc

taskkill /f /im wmpaxhost.exe
taskkill /f /im wmplayer.exe

ren “C:\Users\MediaStreamingAdmin\AppData\Local\Microsoft\Media Player\CurrentDatabase_372.wmdb” *.old

net start WMPNetworkSvc
net start whsmss

wsspowershell.exe set-wssmediaserverenabled “-enable 1″

del “C:\Users\MediaStreamingAdmin\AppData\Local\Microsoft\Media Player\CurrentDatabase_372.old”


News

Nieuws van Sportduikclub 'de Walrussen' - Sun, 07/19/2015 - 12:15

Ietswat off-topic, maar deze video is van de nogal bijzondere terugreis van Maarten en zijn klasgenoot uit Gran Canaria.

 

Dus gisteravond terug gevlogen vanuit gran canaria. Toen we in het vliegtuig stapte kwamen we erachter dat we de enigste 2 in het gehele vliegtuig waren.

Posted by Michael Grühn on Saturday, July 11, 2015Date: zondag, 19 juli, 2015

News

Nieuws van Sportduikclub 'de Walrussen' - Fri, 07/10/2015 - 17:58

De automatische link met Facebook is gebroken doordat de dienst die dit (gratis) aanbood gestopt is.

Wordt aan gewerkt !

Date: vrijdag, 10 juli, 2015

News

Nieuws van Sportduikclub 'de Walrussen' - Fri, 07/10/2015 - 17:55

Zowel Ron als Maarten hebben afgelopen week hun 100e duik gemaakt, Ron in de Bosmolenplas en Maarten in Maspalomas op Gran Canaria.

Beiden proficiat!

Date: vrijdag, 10 juli, 2015

News

Nieuws van Sportduikclub 'de Walrussen' - Fri, 07/10/2015 - 17:38

Met dank aan een oplettende lezer genaamd Felix is de betekenis van 4 tal markeringen op de hals van een duikfles nu ook bekend.

Date: vrijdag, 10 juli, 2015

News

Nieuws van Sportduikclub 'de Walrussen' - Tue, 06/23/2015 - 08:44

Ron's foto's en video van de midzomernachtduik in de Bosmolenplas staan on-line.

Date: dinsdag, 23 juni, 2015

News

Nieuws van Sportduikclub 'de Walrussen' - Thu, 06/18/2015 - 20:39

Dinsdag 14-Juli is de laatste training voor het zomerreces 2015.
Veel plezier met (veilig) buitenduiken en een fijne vakantie gewenst.
De eerste training na de zomervakantie is op dinsdag 1-September.

Date: donderdag, 18 juni, 2015

Pages