salopek.eu

development & random thoughts about the world

Look up from your phone and see that there are problems in the World

Sometimes I feel the world really needs a reminder that it has problems, so I'm going to spell out a few of them here. Generally it helps if you have problems spelled out, as humans tend to forget what things are important and just focus on the newest, shiniest phones and apps. Even as a developer, I must admit that apps are not going to change the world. Not really. Not in any REALLY, I mean REALLY important way.

OK, this was a gross generalization, as our precious phones and apps all help us to lead better and more comfortable lives in some way. You can connect with your long-lost friends. You can send messages to people more cheaply. Of course, sometimes these wonders of technology will save somebody's life. This is all great. But I sometimes feel that humanity in general has lost sight of the fact that there are REAL, bigger problems in the world.

1. Water Crisis

Water crisis or water scarcity means that there's a huge amount of people (even as high as 2 billion) that don't have access to clean water. There's a huge amount of people that don't have enough for their daily needs. "One in five people in the developing world lacks access to sufficient clean water (a suggested minimum of 20 litres/day)" (source - Food and Agriculture Organization of the United Nations).

Taken by fir0002 | flagstaffotos.com.au Canon 20D + Tamron 28-75mm f/2.8 - Own work, GFDL 1.2, https://commons.wikimedia.org/w/index.php?curid=729941

Projections of population growth predict that by 2024 world population will reach 8 billion and 9 billion by 2040. (wikipedia). Humanity must work hard to ensure that there will be enough clean water for everyone.

Currently, there doesn't seem to be a global scarcity as such, but there are regions that are very short on water. So, basically, humanity is currently simply unable to govern properly all the water resources on this planet. For example, one in five people in "developing world" don't have access to enough clean water, while citizens of Europe and US have access to more than necessary.

More...

The Bechdel Movie Test

There's this thing called The Bechdel Movie Test.

It's a very simple way to gauge the presence and influence of female characters in movies. Or to be more accurate, determine if a certain movie test has even a minimum presence of any meaningful female characters.

It's a very simple test that has only three simple rules for movies:

  1. It has to have at least two [named] women in it
  2. Who talk to each other
  3. About something besides a man

As you can see from the rules, this isn't a "feminism" test. It's a basic gender presence test and it doesn't demand a lot from a movie. However, even this very, very simple test is hard for a movie to pass, as there's a staggering amount of movies where a woman is nothing more than a love interest or a object prize to be won by a main masculine hero character.

But, it may shock you to find out that only about half of all films meet these requirements, according to user-edited databases and the media industry press. (wikipedia)

Also, this is not the only statistic that is devastating to women in movies. According to a 2014 study by the Geena Davis Institute on Gender in Media, in 120 films made worldwide from 2010 to 2013, only 31% of named characters were female, and 23% of the films had a female protagonist or co-protagonist.

Image by Sandstein - Own work, based on en:Bechdel test, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=48215556

To return to the point, 50% of all films don't pass this simple test.

More...

Kindle or Real books?

I have one-word answer for you: BOTH! This is what I do. I just can't help it, but I really, really love both. It's really like asking: "Beauty or Brains"? Both, of course!

So, let's go through pluses of both real quick, just so that you can see why, if you care about reading, you should have both.

1. Kindle

  • Kindle is so practical and compact that you can carry it literally everywhere. It even fits in the back pocket of your jeans. You only need to be careful when sitting down. But who sits down, without something to read anyway? :)
  • You can take thousands of books with you, no matter where you go. If you try to take a trip and you want to bring more than one book along, be prepared to leave a lot of clothes behind. Or just put a Kindle in your pocket.
  • As it's not a "tablet", but it uses e-ink technology, battery lasts for like a week. There are just no battery problems, ever. You can charge it wherever there's a USB port available and a micro-USB cable handy.
  • You can read PDFs on it! Simply copy the PDF into the documents folder, and you can read them on Kindle.
  • It's easy on the eyes. Like reading from paper. Again, it's not a tablet. It's based on e-ink technology. It doesn't have this glow that phones and tablets have.
  • You can highlight and "take notes" without damaging the books.
  • It's actually EASIER to read on a Kindle than to read a "Real Book". This one was like a revelation to me and it's something I would have never guessed before. When you are holding a book, you almost always need to use both hands, as papers have the tendency to run away if you're not holding them. With Kindle, you can only use one hand to hold it and to turn the pages, and you have your other hand free .. for other stuff. Or simply to lean on it. However you wish.
  • Get the book instantly. Click and it's there. OK, this also might be a minus, as bookstores are really ... dare I say ... romantic places.
  • Books are lot less expensive in Kindle edition. There's a huge, huge amount of free ones, too. All the classics, you can get them all for free basically. This is also a huge point for me. You can buy a lot of good books in Kindle version for only a few euros.
  • Read at night time more easily. No getting up to turn off the light.

More...

A few facts about the Universe everyone should be aware of

Here's a few facts I learned (or better said - picked-up) during my long-time fascination with the Universe. I am not an expert in any of this, but I like to acquire information. I also like to share with others what I learned. So, here goes ...

1. Universe is big. Really BIG.

To start thinking about the size of the Universe we don't need to immediately start thinking about billions of light-years to have an idea that Universe is really big. For the start, it's enough to think only about the distance between us and the star that is closest to the Earth.

The closest star to the Earth (outside the Sun) is Proxima Centauri, at 4.22 light-years distance. So, how much is a light-year?

Light moves at speed of 300 000 (three-hundredth thousand) kilometers per second. A light-year is a distance light travels in a year. So, by using some math, we get that one light-year is actually 9.461x1012 km, or better said - 9.461 trillion (nine trillion) kilometers.

Hubble's New Shot of Proxima Centauri, our Nearest Neighbor

Hubble's Shot of Proxima Centauri, our Nearest Neighbour.

Credit: ESA/Hubble & NASA. (source)

 

The fastest man-made object in history is the Voyager 1 probe, which "as of 2013, was moving with a relative velocity to the Sun of about 17030 m/s" (wikipedia). Even at this speed, it would take Voyager 73.000 years to reach the star closest to us. Remember, it's only 4.22 light-years.

And only our galaxy has a diameter of 100 000 light-years.

Humanity knows that universe is at least 91 billion light-years in Diameter. How? Well, because this is actually the size which we can see with any type of light. We calculated that Universe is 13.8 billion years old. And we also know that universe is expanding. As light travels to us, the universe itself expands. The red-shift in the light enables us to calculate when the light was emitted. So, if light left 13 billion years ago, this distance is now 46 billion light-years in either direction.

This is just the size of the Observable Universe. The total size of the Universe is much bigger and also probably Infinite.

Here's a few videos that help to understand this.

More...

Development tip - Try using Visual Studio Code Snippets

If you haven't been programming in visual studio for long, chances are you haven't heard about code snippets.

Code snippet is actually code which you can quickly insert into the code editor. Typically snippets are common language constructs which you use often and a number of them come bundled with VIsual Studio. You probably noticed them in IntelliSense as you were typing code.

As the tooltip says, you can simply go to code snippet and then hit TAB key twice to insert it.

Some useful C# snippets are:

  1. #region - Inserts #region and #endregion, puts a cursor where you would normally type the name.
  2. try - Inserts a try-catch
  3. tryf - Inserts a try-finally
  4. for and forr - Insert for and reverse for loops
  5. prop - Inserts an automatic property
  6. propfull - Inserts a property and a backing field

As snippets for these short constructs exist, there are also snippets for entire classes and methods. And you can also create your own. To see all snippets that are shipped with Visual Studio, simply go to Tools -> Code Snippets Manager...

This nifty little thing is also available in Visual Studio Community Edition. You can play with the snippets, download new ones from the Internet and if you try to get into a habit of using them, possibly even improve your coding practices.

In a future blog post we'll create a small code snippet of our own.

Happy coding!

Great developer resources - Issue #1 - MSDN code samples

There are a lot of great developer resources out there on the Internets, so it occurred to me that it would be interesting to showcase some of them, especially ones that are jam-packed with great resources, such as a Developer code samples sub-site on MSDN.

The basic premise on this site is that everybody can upload a code sample, and then community votes on it, meaning that the best quality samples are really, really good and useful.

More...

Functional Principles for Object-Oriented Development by Jessica Kerr

Lately I have been playing a bit with F#, mainly out of curiosity. To be honest, functional programming looks a bit scary to me, especially the syntax. But the guys over at fsharp.org and fsharpforfunandprofit.com are pretty persuasive, so I did decide to invest a bit more time in playing with it. I will see where it will lead me. Hopefully I'll blog something concrete about #fsharp in a little while.

As a part of my journey so far I stumbled upon this video where Jessica Kerr explains the basics of functional principles and how to apply them in our "main" languages, like Java or C#. I strongly suggest you invest a bit of time and at least take a look at what it's about and how you can apply functional principles already today.

I really, really think you can watch the video and take away something from it immediately. It might even inspire you to try a bit of functional programming yourself.

Jessica also has a blog and she also tweets under @jessitron. I suggest you pay her a visit.

The Expert (Short Comedy Sketch)

I had to take a minute out of my day and share this wonderful and funny video about how is it like to be an engineer in a corporate world.

I really suggest that you take a few minutes to watch it.

Of course, as with everything, it can be up to interpretation. The engineer could also have asked what do they really want to accomplish by asking to draw lines in this fashion and then maybe a better way would have come up for the real goal to be achieved. Others might say the rest of the team should have asked clients (or themselves) this first.

A lot of time clients do not know what they really want and what the best solution is unless it's suggested or recommended to them. As developers we should try to keep this in mind always. Dialog is everything. When in doubt, ask. This should be our contribution to our companies and to the world of software development in general.

My Reading List - Issue #1: Simon Blackburn - Think: A Compelling Introduction to Philosophy

I'm one of those people that like to read. I only wish I had more time to read all the programming books and also all the great and important stuff which has nothing to do with development.

I have always had more than a passing interest in philosophy, so last year I got this interesting book from Amazon. Kindle Edition costs only 8 Euros here in Germany, which I would say is 8 Euros well spent.

It's a relatively simple introduction to all the big questions you might ask yourself at some point. And parts of it really help to expand your mind a bit, once you start thinking about all the concepts presented here. I have read it and for many moments I was really stunned while following author's train of thought, because sometimes you're just not programmed to think in a certain way. Take this small example:

... let us imagine a man who, while standing on the street, would say to himself:

"It is six o'clock in the evening, the working day is over. Now I can go for a walk, or I can go to the club; I can also climb up the tower to see the sunset; I can go to the theater; I can visit this friend or that one; indeed, I also can run out of the gate, into the wide world, and never return. All of this is strictly up to me, in this I have complete freedom. But still I shall do none of these things now, but with just as free a will I shall go home to my wife".

This is exactly as if water spoke to itself: "I can make high waves (yes! in the sea during a storm), I can rush down hill (yes! in the river bed), I can plunge down foaming and gushing (yes! in the waterfall), I can rise freely as a stream of water into the air (yes! in the fountain), I can, finally boil away and disappear (yes! at a certain temperature); but I am doing none of these things now, and am voluntarily remaining quiet and clear water in the reflecting pond.

Arthur Schopenhauer, Essay on the Freedom of the Will

 

This quote is used in the book when author speaks about free will. The book has many more interesting quotes, concepts and discussions about philosophical themes and I would really recommend it to anyone looking to expand their mind, if even by just a little bit. Reading this book will definitely do that.

Firefox Add-On of the ... month? Issue #1: HttpRequester

Let me quickly introduce an interesting add-on for Firefox to you. It's called HttpRequester and it's very very useful add-on for basically any developer.

What it does, it enables you to quickly send a HTTP request using method which is not easily done through browser (PUT/POST/DELETE).

You can also use a "browser view" instead of plain-text view.

It also contains a history of your previous requests so when you click on a previous request you can see what previously happen and you can execute it again.

There's even an option to save/load previous requests and to view raw request info.

All in all, a very useful little add-on that stays out of your way when you don't need it and when you do, it's immediately available. If your primary browser for development is Firefox, I strongly suggest you give this add-on a try.