1. Some princesses

Recently I bought a Panini sticker album with Frozen. I know, but I like animated movies and it reminded me of the time when I was collecting and trading stickers myself 🙂

panini frozen all
Images: paninishop.be

Some notes: In theory, you should not have any duplicate in a pack of 5 stickers.
Also, all the 192 stickers have the same representation in the envelopes. From my past experience, I know that’s not true. Even after swapping stickers with friends, some of the stickers were impossible to find.
Prices are pack of 5 stickers – 0.6€, 50 stickers 6€, 250 stickers – 30€.

2. The Birthday problem

So, I wanted to play a bit with the probabilities involved in this little collection game. The starting point was the Birthday problem, and the apparent paradox that in a class of 23 students, the probability of having 2 students with the same birthday is 50%.
The formula to find this probability is:
prob_same_birthday
(more…)

How SPDY is making the web faster

Written on 28 January 2014, 12:09pm

Tagged with: , , ,

SPDY is one of the things that keeps me busy 🙂 The people from Akamai came up with a nice video explaining how Google’s SPDY experimental protocol leads to defining the next version of HTTP.
httpv://www.youtube.com/watch?v=WkLBrHW4NhQ

TL;DNW:

Background

The current HTTP 1.1 exists since 1999 (and hardly changed since 1996)

spdy

1. HTTP headers

– SPDY offers header compression (with HTTP 1.1 only the HTTP content is compressed)
– SPDY will avoid sending HTTP headers with every single request

2. Parallel requests

– HTTP 1.1 pipelining: multiple requests on a single connection; but the response must come in the same order they were requested. Browsers open like 6 concurrent connection for every host
– SPDY – true multiplexing: send as many requests as you want at once; get responses in whatever order (even in pieces). All this, over a single SPDY connection.
But this requires prioritization. SPDY leaves the decision to the server, but SPDY allows the client to mark priority requests (ex JS, CSS).

3. Server Push and Server Hint

The server can push data to the client – if the client previously established a SPDY connection.
This can be also used for sending assets to the client (ex CSS). To avoid unnecessary pushing of cached data, SPDY provides Server Hint (a suggestion to the client).

Limitations

– HTTPS needs to be used to hide SPDY
– Multiplexing happens on a per host basis (so if content comes from multiple hosts, SPDY improvements are not so visible)
– Limited browser support

Conclusion

SPDY pushed the IETF to define the next version of HTTP: HTTP 2.0 is expected in 2014.
See more: http://www.chromium.org/spdy/spdy-whitepaper

Update, 9 February 2015: Hello HTTP/2, Goodbye SPDY

Oracle trunc

Written on 27 January 2014, 04:40pm

Tagged with: , , ,

A quick note about what the Oracle TRUNC function can do:
If you have a table ORDERS with a date field DATE_CREATION and you want to filter the records with a given date, you can use the TRUNC function.


SELECT ID 
FROM ORDERS
WHERE TRUNC(ORDERS.DATE_CREATION) = TO_DATE('27/01/2014', 'DD/MM/YYYY')

This will truncate the time from the DATE_CREATION and leave out only the date.
The full syntax for TRUNC is:

TRUNC ( date, [ format ] )
date is the date to truncate.
format is the unit of measure to apply for truncating. If the format parameter is omitted, the TRUNC function will truncate the date to the day value, so that any hours, minutes, or seconds will be truncated off.
techonthenet.com

Update, 28/feb/2014: Another Oracle goodie – how to find out details about sequences:


select sequence_owner, sequence_name, min_value, max_value, last_number 
from all_sequences 
order by sequence_owner, sequence_name;

https://community.oracle.com/thread/2340939