This problem was solved like 40 years ago.

$ sort -t" " -rnk4 data.tsv
ascon1 201707015 Jack 97.5 11.5 11.5 11.5
ascon1 201707013 Josh 79.5 11.5 11.5 11.5
ascon1 201707011 John 77.5 11.5 11.5 11.5
ascon1 201707012 Grld 70.0 11.5 11.5 11.5
ascon1 201707014 Jess 67.5 11.5 11.5 11.5
  • -t" " to tell sort to split on spaces
  • -r for reverse (highest first)
  • -n to tell sort that it's a numeric field
  • -k4 to tell sort that we're loking at the fourth column

So, a quick update.

My spare router that I tried using as a firewall can't block https traffic, which is unfortunate.

Luckily I had Plan B.

I switched the TV to point at my OpenDNS account, after a few hours I checked the logs

link, for some reason the remote image isn't displaying either :/

The image is on imgur because I was getting nginx errors when attempting to upload it to Daniweb.

So, I've blacklisted samsungacr.com . I've had no new adverts, but I suspect the ones already on the TV will expire soon and disappear. If they don't I'll do another soft reset. I'm avoiding that because it means typing in my 35 character Amazon Prime password using the onscreen keyboard, a task I don't enjoy.

For reference, here's my naughty list.


Votes + Comments
Thanks for the list.

In addition to my post, something that made the experience worse was that when I contacted Samsung support they said

Please be informed that the adverts or advertisements depend on the app that you have installed or downloaded from the apps panel.

So, their support teams have been trained to push the blame in my direction. Yet the adverts come from apps that are pre-installed that I cannot disable.


This isn't a typical hardware post, but I couldn't find anywhere better for it.

Last October, after my previous TV packed in, I bought a shiny new Samsung Smart TV. My shortlist of requirements was:

  • Excellent picture quality, preferably 4k
  • No advertising built into the UI
  • Within my price range (I ended up spending £1,400 on it)

The reason for my second requirement is that many years ago I bought a Hard Disk Recorder from Panasonic that had the following style of EPG. Note the advert taking up roughly 1/4 of the width of the screen.


I have not bought anything from Panasonic since, and when asked for recommendations, I've advised against their products.

So, I found a model of Samsung that met my requirements. It did not have adverts anywhere, and the "Smart" features, like Voice Control could be turned off. It supported Amazon Video and YouTube too, so I wouldn't need my Chromecast. Excellent.

Fast forward to the middle of this year, I received a software update from Samsung. Great, software updates will make my already-great experience better, right? Not so much. Now, periodically, the following abomination appears in the actual UI of my TV.


Amazing. On the actual firmware release notes from the website, there's no mention of adverts being added (so I couldn't have checked, even if I'd have wanted to), and now I'm stuck with an expensive advertising board sat in my front room.

Complaining to Samsung hasn't gotten me ...

Attachments epg.jpg 100.49 KB

Are you definitely using a Thunderbolt 3 cable between your MBP and the 5K monitor?

Incidentally, slightly jealous, I need to get one of those monitors but I'm worried my 2013 MBP might not be beefy enough to drive it smoothly.


Hard to tell what's going on without knowing what your server is doing and that you're sending requests to the port it's listening on.

Here's what I'd do, substitute my Ruby for your PHP. First, create a standalone, super-simple API. Here's an example

require 'sinatra'
require 'json'

# world's simplest API
get '/hello' do
  {hello: "world"}.to_json

Now, when I run that file in Ruby, it tells me where it's listening.

== Sinatra (v2.0.0) has taken the stage on 4567 for development with backup from Puma

Finally, I just need to make a sensible request:

http get localhost:4567/hello

And here's the response.

HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Length: 17
Content-Type: application/json
Date: Sun, 27 Aug 2017 17:22:05 GMT
Server: WEBrick/1.3.1 (Ruby/2.4.1/2017-03-22)
X-Content-Type-Options: nosniff

    "hello": "world"

Now, the browser hasn't been involved at all. Everything's simple and visible. If something goes wrong I'll get the feedback right in my terminal window. PHP supports this approach too.


And the moral of the story is, don't try to join tables using manually-entered string/varchar fields. It just won't work. Some people will enter their name as 'Timothy' in some forms, 'Tim' in others and ocassionally 'Timmy'.

Your user table should have a automatically incrementing numeric primary key. Your tracker should have a field called user_id, and you should set up a foreign key between those two tables.

Then your query would be sensible:


    tracker t
inner join
    users u
        on t.user_id = u.id
    t.scheduled_date_start between :d1 and :d2
    u.username = :uname
    -- or if you prefer, u.id = :uid

This looked interesting so I had a go. Did it in Ruby so it wouldn't be of use to anyone with Java, C or C++ homework :)

puts "enter a number:"
number = gets.to_i

# calculate the dimensions of the square
length = ((number-1) * 2) + 1

# create an empty set of nested arrays of the correct length
square = Array.new(length, Array.new(length, nil))

# loop through the rows...
(0...length).each do |row|
  # ...and the cols
  (0...length).each do |col|

        # calc the min distance from each vertical and
        # horizontal edge, and set the value of the cell
        # to the smallest (which we'll increment by 1 to
        # adjust for zero indexing)
        square[row][col] = [
                [row, ((length-1)-row)].min,
                [col, ((length-1)-col)].min
        ].min + 1


  # we're done with this line, pad and print it!
  puts square[row]
        .map {|n| n.to_s.ljust(2) }




Still waiting for links UI. For a bit of entertainment I looked up some amazing contributions UniqueIdeaMan has made to the web. Here's a great one:

Problem is, googling brings out forums and forums are full of amateurs too with amateurish samples

So, let's stop helping him, clearly we're too amateurish.

On a brighter note, here's another person hitting the nail on the head.

Jesus Christ, dude. You have no ****ing clue what you are doing and just stabbing your **** around hoping to hit something. You're submitting your form using GET and then looking for POST. Do you even have an idea what those words mean? What's the difference between them?

The first ****ing thing you do is realize your IF condition is failing if you don't see an echo result, so a normal person would take a look in $_SERVER to see what's going on. Well, a normal person would understand the basics by this point and know what POST and GET mean.

I know you're trying to learn, man, but you keep coming in here with syntax errors. You have no understanding of the basics.


I guess the beauty of markdown is that they can introduce it without it really affecting people who don't know or care about it.

The only markdown directives that might get in the way are, as you said, asterisks. I guess FB chat doesn't allow hyperlinks, headings or lists?

Anything that pushes Markdown more mainstream is good though. I started a business recently that's hopefully going to introduce non-tech people to Markdown, so the more exposure the better.