CSS – Transition Tips & Tricks

I’m amazed at how CSS has changed since the last time I looked into it. Something that previously required a tone of Javascript is now possible to implement by putting a single line of CSS code:

div {
  transition: all 0.5s ease;
  background: red;
  padding: 10px;
}

div:hover {
  background: green;
  padding: 20px;
}

That’s all it takes to transform a div from red to green and back again!

Source: http://css-tricks.com/almanac/properties/t/transition/

CSS – Transition Tips & Tricks

I’m amazed at how CSS has changed since the last time I looked into it. Something that previously required a tone of Javascript is now possible to implement by putting a single line of CSS code:

div {
  transition: all 0.5s ease;
  background: red;
  padding: 10px;
}

div:hover {
  background: green;
  padding: 20px;
}

That’s all it takes to transform a div from red to green and back again!

Source: http://css-tricks.com/almanac/properties/t/transition/

Interesting behaviours with enum in .NET

This is completely plausible and the check is avoided first for performance reasons. Just imagine the CLR having to enumerate all the valid values and check whether yours falls in it, this no longer becomes a simple cast. The other reason is versioning. That is why you have Enum.IsDefined(…). Some developers now rely on this feature when dealing with an enum defining flags. When they want to set all flags they simply cast int.MaxValue to Enum

Bernado Nguyen-Hoan's Blog - Coding Stories from an IT Mercenary

When defining an enum type, we can assign an int value to each of the enum members. Below is an example.

Now there are two behaviours that you may not be aware of. Firstly, given the above definition, you can actually assign any int value to a variable of type Status. Let say I have a class as below.

The following code will then happily compile and execute:

OK, who on earth would be doing something like that? Probably not many, but this leads on to the second behaviour: by default, the value of the enum will be 0, even if 0 is not one of the defined enum members.

So with the code below, the value of record.Status will be 0, which does not match any of the defined status values:

This behaviour could have an impact on your code if not handled properly. This is because when defining an enum…

View original post 95 more words

Compressing and decompressing files with BZip2 in .NET C#

Exercises in .NET with Andras Nemes

BZip2 is yet another data compression algorithm, similar to GZip and Deflate. There’s no native support for BZip2 (de)compression in .NET but there’s a NuGet package provided by icsharpcode.net.

You’ll need to import the following NuGet package to use BZip2:

sharpziplib nuget

You can compress a file as follows:

…and this is how you can decompress the resulting bz2 file again:

Read all posts dedicated to file I/O here.

View original post

Windows 10 preview: A glimpse of our desktop future

The good: The Start menu rises from the dead: Will you welcome it back?

In a valiant attempt to be all things to all people, Microsoft has re-created its Start menu as a massive hybrid of application list, live tiles, suggested help topics, and “Everyday apps.” Once you get your head around it, the design is fairly flexible. The tile portion can be re-arranged just like the Start screen in the Modern UI of Windows 8.

Not so good news…

The Start display (its not quite correct to call it either a menu or a screen, and it isn’t exactly a window) can also be shown either fullscreen or as a smaller version more similar to the old-fashioned Start menu. Purists will quickly notice that the actual menu portion only displays a few items (Places and Most used items) by default.

Just funny: Cortana may have had a few too many drinks before her debut

As promised, Cortana has been integrated into the Taskbar, but it isn’t very useful or easy to use yet. In theory, when you hit the Windows key and start typing, your keystrokes will go to Cortana. It (she?) will then handle the (hopefully) very quick search for matching applications (e.g. if you type Word or OneNote or Control Panel) and also more sophisticated questions (ala Siri or Google Now or Amazon’s Alexa). From having used Windows Phone 8, I know Cortana is capable of quite a lot. But the implementation in Windows 10 is currently really broken. Sometimes typing does nothing, other times Cortana is confused. And it doesn’t have nearly the sophistication of the Windows Phone version. Its ability to answer questions also seems to vary from hour to hour.

The best news is that Microsoft is listening

An under-reported segment of Microsoft’s event, and of Windows 10 preview, is the very extensive user feedback system built-in. Microsoft has taken great pains to explain that it is trying really hard to listen to users about what they want to see (and not see) in Windows 10. I can already hear many of you exclaiming, “It’s about time!” or “Likely story!” but it seems like it really is trying to shape Windows 10 to fit the needs of its users. On one hand that is a little sobering, as it means that Microsoft itself is heavily conflicted about its vision for the future of Windows, but if Microsoft can successfully incorporate all this “bottom-up” feedback into a coherent product, Windows 10 will not only be what most of us hoped Windows 8 would be, but will go far beyond it.

View original

First look at the new Power BI Preview

This week Michael Tejedor joins Jeremy Chapman on Office Mechanics to give a first look at the updates to Power BI. The preview announced yesterday adds a number of new Power BI capabilities, including dashboards, new visualizations, support for popular software-as-a-service applications, a native iPad app and live “hybrid” connectivity to on-premises SQL Server Analysis Services tabular models. Michael demonstrates all this and more on the show and explains how to establish a secure connection to on-premises data using Power BI.

View original

Blog at WordPress.com.

Up ↑