And again a Monday. Besides the fact that Monday, as the beginning of the week, probably is one of the scariest days of the week, there’s a second thing that always takes place on Mondays: My “Best of Web” series.
Today, it is already the 8th episode and this time there is again a novelty. There is no video in addition to some interesting articles at the end this time, like every week, because nothing suitable has crossed my paths this week.
But everything remains the same. That means – there are a few more bits of web development, the C# world and of the subject of hardware hackers. And now, I hope you enjoy reading.
HDMI over IP Windows client
Daniel was looking for a way to capture videos from HDMI sources with his PC. Since he had had to realize that HDMI capture cards were too expensive, he decided on the following HDMI over IP adapter. Adapters such as this one take a HDMI source, convert the frames into IP packets and send them over the network to a matching receiver. However, instead of using the matching receiver, Daniel wanted to use his PC and, in particular, its network card. So he analyzed the protocol of the HDMI over IP adapter by using Wireshark and then he wrote a client software for the PC.
This kind of project really gives me inspiration and so I’m just dreaming about a project working the other way aound at the moment. So, for example, bringing the image of the PC via LAN to a receiver, which then brings it to the TV via HDMI. So you could take the loud media server in the basement and stream its image over the network.
Dynamic favicons with favico.js
One use case would be to show small badges on the favicon to realize a notification system, so you will immediately know about news/messages, even if the appropriate tab is not in the foreground. All in all, the project is still slightly buggy and not 100% compatible with all browsers. Still, I think Miroslav Magda’s favicon library “favico.js” is worth mentioning.
What does the ??-operator in C# do?
Attention dear friends of C#. Who of you has programmed in C# and has ever used the “??-operator”? And who of you has not yet used it or does not know it? I admit that I have not used the ??-operator, also called null-coalescing operator, too often so far. It is actually a useful enrichment. You can read on code project Sampath Lokuge’s article about the ??-operator and what it does and how und when to use it.
Regex testen im Browser
That I’m a fan of regular expressions should be clear if you have read more than one or the other article on my blog. (At this point, the ingenious regex crossword puzzle needs to be mentioned again.) To find the correct regular expression, however, can sometimes be quite tricky and therefore, there are, as for all difficult things, also great tools and helpers.
Today it is once again time for another round of “Best of Web”. This week I have a few more links on the hand, I would like to share with you. Overall, it comes back this week to some technical topics – good for geeks and nerds among you, rather poor for lovers of more “lighter fare”. Among others, today is about compilers, the history of Windows, some web design basics and a bit of image recognition in C#. I hope there is one or the other interesting article for everyone.
As always – who has more link tips, is hereby invited to send me these for one of the rounds of my “Best of Web” series. And now have fun with my recommendations of the week.
Quick introduction to compiler construction
On TechPro Tristan McNab explains in a detailed article the basic principles of compiler construction. As part of his article, the basic fundamentals are explained first and then a small compiler is written step by step. That one can not deal with the entire issue about compiler construction in a single article that should be clear. However in my opinion the article is written in an interesting way and therefore worth reading.
An overview of 30 years of Windows
Over 30 years ago, in November 1983, Bill Gates announced Windows 1.0. Since then, several versions have been released and lots of blue screens passed. On winsource.com Joe Fedewa wrote an overview of all previously released Windows (desktop-)versions with always a screenshot of the respective version and a few additional facts. Easy to digest, nice to see what has changed over the years and therefore also in the Best of the Web roundup for this week.
What technology is behind StackOverflow?
Anyone ever had to do with software and hardware stuff should have heard about Stack Overflow. A lot of questions are asked, answers written and discussions held on the portal and its several divisions pages in every second. Nick Craver, hired as software developer at StackOverflow, wrote an article on his personal blog where he gives an insight on the hardware, which is needed to run such a mammoth project like StackOverflow.
px, rem, em, ex, pt, % – when should I use which?
Probably every developer has ever seen measurements in CSS stylesheets, such as px, pt and em. Has written probably. But how many of all the developers actually know when it’s the right time and the right context to use them? Ok, you will get to the goal always, no matter which measurement you use. But there’s still a difference between getting to goal “somehow” or on the “right way”. When to use which unit of measurement, you can read on the design division of tutsplus.com as well as on Dudley Storey’s blog. Both articles are really insightful and a recommendation on my part, if you have to do even remotely with CSS.
Recognize playing cards with webcam in C#
With this link tip we go again into the corner of .NET-developers. In the following article on codeproject.com it is explained how to recognize playing cards by means of a webcam and the Aforge library. To what extent that has a practical use, was once an open question. Much more interesting is the technique and methodology behind it, which certainly can be transferred to some other application areas.
Surfing through the Internet with a Mac Plus
To conclude, there’s another video like every week. In the following clip Jeff, who has once again dusted off his 27-year-old Mac Plus, shows how hes has taken his Mac to the Internet of today. The load times are overwhelming and anyone who thinks their smartphone or PC was too slow, should lead this video to his/her heart first.
When it comes to online storage and sync, then Dropbox is my number 1 and because I’m pretty sure I’m not alone with this sight, below there is a collection of 20 tools which will help you to realize the full potential of your Dropbox.
#1 – dropplets.com / Blog with Dropbox
With dropplets your Dropbox becomes a blogging platform. After the “installation” your Dropbox behaves like a web server.
New articles can be written in the easy to learn Markdown language and published by simply save them in your Dropbox. The whole thing is quick, easy, and also looks quite chic.
#2 – calepin.co / Publishing by Dropbox
Calepin.co is the second blog system in our listing. Also Calepin supports the markup language “Markdown” and allows easy publishing of blog posts.
readwrite.com said about Calepin that it’s “the easiest blog platform in the world”.
DropShorty is a so-called droplet. So a program which which does an action if you drop a file onto the programs icon.
If you pull a file on the DropShorty logo, drop Shorty loads the file into your Dropbox, then creates a sharing url and then shrinks this url by use of a link shortening service of your choice.
“Secure your cloud” – this is the slogan of the BoxCryptor service. BoxCryptor extends Dropbox by a virtual drive that is synchronized with your Dropbox.
The cool thing about that? – all files will be automatically encrypted before they are synced and uploaded to your Dropbox.
With tunesBag you can build your own online streaming service out of your Dropbox. Similar to Spotifiy or Google Music, tunesBag will deliver a web interface to you, which enables you to listen to music.
The difference – tunesBag uses the music which you have previously stored in your Dropbox. Supported music formats currently include mp3, m4a, wma and ogg.
Dropbox Encore is a program for Mac OS X that allows you to use two Dropbox accounts including two synced folders simultaneously.
This makes sense for example when looking for a solution to use a private and a second account for work.
Dropbox Uploader is a small bash script, which allows yout to up- and download files from the bash (shell) into your Dropbox account.
This makes, for example, sense if you want to back up files from your web server. Another example would be a CronJob which is conceivable that a folder automatically backs away at specified intervals.
DROPitTOme allows any web user to upload files anonymous into your Dropbox. Anonymous in this case means that the uploader does not need to know your credentials, not that he or she is 100% anonymous.
After DROPitTOme is connected to the own Dropbox, DROPitTOme creates a custom upload page, where anyone who know the url can upload files into the linked Dropbox. The Dropbox owner may be informed by mail in turn about new uploads.
With the Dropbox Automator from Wappwolf you get a tool which can manage a handful of helpful tasks and link services.
So it’s easy to set up, for example, that images after their upload Facebook are automatically saved in the Dropbox too or that text-documents will be automatically converted into PDF format.
Behind the cryptic name ifttt, which stands for “if this, than that”, there is another automation solution. As the name suggests, the principle is based on action and reaction.
So you can create any number of pairs of rules, such as “If an email with an attachment comes in, then automatically save the attachment in my Dropbox”.
URLDroplet is a service that allows you to load arbitrary files directly into your own Dropbox, without these being previously cached on your own computer. Therefore you have to enter the URL of a desired file and then URLDroplet copies this file into your Dropbox.
DropPages is a little like the first two tips in this listing. So DropPages also uses your Dropbox to manage and publish a websites.
The difference lies rather in the target orientation. Where link-tip 1 and 2 want to be a blogging platform, DropPages wants to be a “classic homepage CMS”.
Gimme Bar is the “little different bookmarking service”. Instead of simply storing links to the content and organize them, Gimme Bar stores the whole website/content in your Dropbox.
Once synchronized with the home PC, one has his favorite web content offline available.
After sign-in at “Send to Dropbox” you obtain a personalized email address. Now if you send an e-mail with an attachment to this address, the attachments are automatically stored into your Dropbox by the Send to Dropbox servers.
So you can put your files from any device which supports mailing into your Dropbox in no time.
Drop Tunes is another media player which takes Dropbox as a source for the music files. By design, the player looks really similar to iTunes, and is available both as an iOS app as well as a web application.
Dropbox Uploader is a PHP class that allows you to upload files to your Dropbox account by using the PHP scripting language.
So if you are looking for a opportunity to connect the Dropbox service in a Web project, you should have a look at the Dropbox Uploader class.
#17 – Scriptogr.am / Minimal blogging
Scriptogr.am is another platform, which makes blogging possible by using your Dropbox account. Here scriptogr.am focuses not only on simplicity, but also has a minimalist layout and clear design language.
The special features include the presence of a theme for mobile devices and the possibility to connect your own (top-level) domains onto your scriptogr.am blog.
By means of pancake.io you can publish plaintext as also html documents to the web. In contrast to the already introduced blogging solutions, pancake.io doesn’t try to be a CMS and/or a complete blogging system, but much more of a simple platform to offer you an easy to handle tool to publish individual files and documents quickly.
WriteBox is a text editor for Dropbox. While using the minimalist interface of WriteBox, you can open, edit and save directly documents directly from your Dropbox.
The interface focuses on the essentials – the text. Quite nice – key combinations such as Ctrl+S for saving still work, even if Writebox is a webapplication.
By means of the tutorial and a small script from labnol, a folder named “Print” is created inside your Dropbox folder. If you save a filel into this folder, no matter from where and from which device, the document will be printed on your local printer.
<?php $date1 = "2012-1-12"; $date2 = "2011-10-12"; if ($date1 > $date2) echo "$date1 is newer than $date2"; else echo "$date1 is older than $date2"; ?>
2012-1-12 is newer than 2011-10-12
At first glance this seems to be a workable solution. But what if the two data is in a different format?
<?php $date1 = "12-1-12"; $date2 = "2011-10-12"; if ($date1 > $date2) echo "$date1 is newer than $date2"; else echo "$date1 is older than $date2"; ?>
12-1-12 is older than 2011-10-12
Now the date in 2012 is declared to be older than the date in 2011, which is of course wrong. However, from PHP’s point of view, this behavior is correct, because two strings were compared and so the 2012 date string was definitely the smaller/shorter string.
How to properly compare dates in PHP
A working solution would be to first convert the date into timestamp format and then to compare these numerical timestamps each other. To convert a date string into a timestamp, PHP provides the function strtotime ($time_string), which accepts a date or a time value and returns the corresponding timestamp.
<?php $date1 = "12-1-12"; $date2 = "2011-10-12"; $dateTimestamp1 = strtotime($date1); $dateTimestamp2 = strtotime($date2); if ($dateTimestamp1 > $dateTimestamp2) echo "$date1 is newer than $date2"; else echo "$date1 is older than $date2"; ?>
12-1-12 is newer than 2011-10-12
However, well known, many roads lead to Rome, so there are still other solutions for the initial problem. So one of these alternative solutions would be to use the DateTime class that is provided by PHP as of version 5.2.0.
<?php $date1 = new DateTime("12-1-12"); $date2 = new DateTime("2011-10-12"); if ($date1 > $date2) echo $date1->format("Y-m-d")." is newer than ".$date2->format("Y-m-d"); else echo $date1->format("Y-m-d")." is older than ".$date2->format("Y-m-d"); ?>
2012-01-12 is newer than 2011-10-12
How do you compare two dates in PHP? Do you use one of the two identified ways or is it another? I would be interested to know how you solve yourself the problem.