sample: Command line filter for random sampling of input written in C

Bicycle Silhouette


sample FILE              # randomly choose & print 4 lines from 
                         # file, in order
input | sample           # same, from stream (file defaults to 
                         # stdin)
sample FILE FILE2 FILE3  # randomly choose 4 lines between 
                         # multiple input files
sample -n 10 FILE        # choose 10 lines
sample -p 10 FILE        # 10% chance of choosing each line
input | sample -p 5      # randomly print 5% of input lines
input | sample -d a,b,c  # append input to files a, b, and c, 
                         # even odds
input | sample -d a,b,c, # append input to files a, b, c, or 
                         # /dev/null

Google Mobile-Friendly Test

Google logo

From the Google Official Webmaster Blog:

Starting April 21, we will be expanding our use of mobile-friendliness as a ranking signal. This change will affect mobile searches in all languages worldwide and will have a significant impact in our search results. Consequently, users will find it easier to get relevant, high quality search results that are optimized for their devices.

Bad Layering: The layering software architecture pattern

Stock Photo of sedimentary rock layers

The trouble arises when the layers are built such that we have to drill through several of them to do something common. Have you ever checked in a commit that had a bunch of new files like “Foo”, “FooController”, “FooForm”, “FooFragment”, “FooMapper”, “FooDTO”, and so on? That, dear reader, is a breakdown in layering.