<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dave</title>
    <description>The latest articles on DEV Community by Dave (@190245).</description>
    <link>https://dev.to/190245</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F162134%2Fd7e2c0dc-102c-40ff-a61f-53dc325a1350.png</url>
      <title>DEV Community: Dave</title>
      <link>https://dev.to/190245</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/190245"/>
    <language>en</language>
    <item>
      <title>Greek PLF: Problems can be fixed</title>
      <dc:creator>Dave</dc:creator>
      <pubDate>Sat, 25 Jul 2020 09:37:09 +0000</pubDate>
      <link>https://dev.to/190245/greek-plf-problems-can-be-fixed-224d</link>
      <guid>https://dev.to/190245/greek-plf-problems-can-be-fixed-224d</guid>
      <description>&lt;h2&gt;
  
  
  Problem definition
&lt;/h2&gt;

&lt;p&gt;I was due to go on holiday a few days ago, booked many months before the Covid situation even started to evolve. Unfortunately that was cancelled.&lt;/p&gt;

&lt;p&gt;Now that the world is cautiously opening up again, we've changed the booking and will be leaving in a few days time. But there's a problem...&lt;/p&gt;

&lt;p&gt;My partner and I will be going to Greece, the Greek Authorities require a Passenger Locator Form (PLF), and the PLF website doesn't accept the postcode for where we will be staying. I'm not about to enter a fake postcode (because we should be telling the truth on the form), and our airline have said "no PLF, no boarding" - so I can't even argue the point in Greece.&lt;/p&gt;

&lt;p&gt;But thankfully, every problem has a solution (and if you think otherwise, you simply need more information about the problem).&lt;/p&gt;

&lt;h2&gt;
  
  
  Investigation &amp;amp; reasoning
&lt;/h2&gt;

&lt;p&gt;Being a developer, I understand that the Greek Authorities were in a rush to put the PLF together, and made mistakes (lots of comments online about the problems with the PLF).&lt;/p&gt;

&lt;p&gt;But also, thanks to the rush, I know the developers will have made mistakes in the implementation too, so lets investigate a little.&lt;/p&gt;

&lt;p&gt;First things first, I popped open the dev tools in Chrome &amp;amp; looked at the input for the postcode, standard div, nothing special. No use of "form" here, so everything is in the JavaScript. The JavaScript has been minified, so let's go ahead &amp;amp; tell Chrome to pretty-print that.&lt;/p&gt;

&lt;p&gt;OK, the JavaScript is a bit of a mess thanks to it being minified &amp;amp; pretty-printed, so lets work backwards... trigger the validation error, then search for the text displayed, and walk backwards through the stack.&lt;/p&gt;

&lt;p&gt;It turned out that the postcode validation is a pretty simple &lt;code&gt;if array contains value then OK&lt;/code&gt; - and the postcode of our stay wasn't in the array.&lt;/p&gt;

&lt;h2&gt;
  
  
  The workaround
&lt;/h2&gt;

&lt;p&gt;Quite simply breakpoint on the validation method, then &lt;code&gt;arr.push(...)&lt;/code&gt; in the console. Then it accepted the value I was telling it, and let us complete the PLF's.&lt;/p&gt;

&lt;h2&gt;
  
  
  Closing notes
&lt;/h2&gt;

&lt;p&gt;I've deliberately not included screenshots, and deliberately not given details of the problematic postcode. There's a good chance there's a reason it's not there (maybe the hotel is still closed, maybe the border guards won't be happy with what I've done etc).&lt;/p&gt;

&lt;p&gt;I understand why the validation problem happened, and I'm glad it did, otherwise we wouldn't be getting a flight.&lt;/p&gt;

&lt;p&gt;Ultimately, I now have a partner that's very thankful she married a developer. We will, of course, be taking every possible measure to keep ourselves &amp;amp; everyone else safe in the current climate.&lt;/p&gt;

&lt;p&gt;If you're in a similar situation &amp;amp; have some programming knowledge (why else would you be reading Dev?) then have a look at the page, see if you can figure out a workaround.&lt;/p&gt;

&lt;h2&gt;
  
  
  Follow up
&lt;/h2&gt;

&lt;p&gt;Looking at the statistics in Dev, this has proved quite popular (probably because of the current travel restrictions around the globe), so an update is probably worth while. At the time of writing this part, we've been home for a little over a week.&lt;/p&gt;

&lt;p&gt;The key points:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I was a little nervous at the airport, the last thing I wanted was to be pulled aside, questioned and sent home! Thankfully, I showed the Greek Police officer the QR codes and he waved us straight through, no conversations, no Covid-19 tests.&lt;/li&gt;
&lt;li&gt;Other people at our hotel reported the same problem with the postcode. I didn't ask when they submitted their form, or how they worked around it, but a few did admit to me that they entered a valid but incorrect postcode, and no-one stopped them at the airport either.&lt;/li&gt;
&lt;li&gt;After our trip, it is now possible to enter the postcode without a problem. I suppose that the array is initially populated by "select unique value from previously submitted entries" and as a result, I inadvertently "fixed" that specific problem for everyone else. That's certainly more likely than manual intervention by the Greek authorities, but this is pure speculation on my part.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Other things to note
&lt;/h3&gt;

&lt;p&gt;In my (non-affiliated, non-expert) opinion, the PLF form is broken. That in itself is to be expected in our field. No-one writes good code when rushing, no-one writes good requirements when rushing. However, in my job, our peer review process only cares "is it &lt;em&gt;good enough&lt;/em&gt;?" - and yes, the PLF website is likely considered "good enough" by most people's standards.&lt;/p&gt;

&lt;p&gt;I'm aware that other people online have been complaining about both the postcode issue, and a plethora of other issues with the PLF - I haven't seen those issues myself, so my comments on them will be pretty limited.&lt;/p&gt;

&lt;p&gt;It is a great shame however, that a (again, my opinion) buggy system was released &lt;em&gt;and then&lt;/em&gt; treated by other companies as the rule of law. In my case, if I hadn't been a developer, we wouldn't have been on holiday unless I was prepared to enter factually incorrect information - our airline would not have let me board without a PLF. In other cases in the media, people were refused flights because they didn't fill in an &lt;em&gt;optional&lt;/em&gt; piece of information. That level of bureaucracy is mind boggling!&lt;/p&gt;

&lt;p&gt;Lastly, but not least - a guest at our hotel travelled from the UK, was tested at the airport and then transferred to our hotel - &lt;em&gt;while we were there&lt;/em&gt;. Subsequently they had a positive result, and were transferred to a Greek isolation facility of some description. The media articles that I've seen state something similar to "all guests were informed" - this is &lt;em&gt;categorically&lt;/em&gt; false. No-one told us, I happened to find out because an article popped up in Google Now about it. As a result, anyone we spent any time around since returning home has been told by us about it, and we are choosing to self-isolate for 14 days, just because we don't see the point in taking the risk. 10 days since returning home, neither of us have shown any symptoms (thankfully).&lt;/p&gt;

</description>
    </item>
    <item>
      <title>We're hiring! New Junior test - thoughts?</title>
      <dc:creator>Dave</dc:creator>
      <pubDate>Fri, 26 Jun 2020 10:00:28 +0000</pubDate>
      <link>https://dev.to/190245/we-re-hiring-new-junior-test-thoughts-4j6h</link>
      <guid>https://dev.to/190245/we-re-hiring-new-junior-test-thoughts-4j6h</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;My employer is hiring, at all levels, and I've been asked to do the technical side of the interviews. We have a pretty decent test for Senior's already, but I'm aware that it's a little too much to ask of a junior without freaking them out.&lt;/p&gt;

&lt;h1&gt;
  
  
  Not a job advert, but reach out if you're interested!
&lt;/h1&gt;

&lt;p&gt;Incidentally, this isn't a recruitment advert, but if you're inside a commutable range of large cities in North West UK, or prepared to move there, and looking for work... feel free to get in touch with me. I can tell you a little about what we do, and tell you where to send a CV. Hell, even if you're a recruiter reading this, get in touch, and I'll happily point you at HR.&lt;/p&gt;

&lt;p&gt;Again, we're looking at multiple levels (Junior, Mid &amp;amp; Senior), so if you're not a Junior, don't let that put you off!&lt;/p&gt;

&lt;h1&gt;
  
  
  The nuts &amp;amp; bolts of it
&lt;/h1&gt;

&lt;p&gt;So I've come up with a new litmus test for Junior Java developers that we might talk to. Note, for the purposes of this article, this &lt;em&gt;isn't&lt;/em&gt; the test we would give to a Junior, this is just a close approximation, just in case someone I'm interviewing happens to have read this post.&lt;/p&gt;

&lt;p&gt;My thought process: For a Junior, be passionate about learning, know some basics about the language (I'm not a University lecturer...) and fail-fast (i.e., tell me if you're out of your depth &amp;amp; need a helping hand).&lt;/p&gt;

&lt;p&gt;The code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package com.junior.test;

public class Main {

    public static void main(String[] args) {
        System.out.println("1: " + taskOne());
        System.out.println("2: " + taskTwo());
    }

    /**
     * Task: Fix the bug(s).
     * @return The sum of all even integers between 1-10
     */
    public static final int taskOne() {
        int sum = 0;
        for (int i=0; i&amp;lt;10; i++) {
            if (i % 2 == 0); sum = sum + i;
        }
        return sum;
    }

    /**
     * Fix the bug(s), and optimise the solution.
     * @return sum(N) where N is between 1-1000, a perfect square, and sqr(N)&amp;lt;1000
     */
    public static final int taskTwo() {
        int sum = 0;
        for (int i=0; i&amp;lt;1000; i++) {
            boolean isPerfect = false;
            int j;
            for (j=0; j&amp;lt;i; j++) {
                if (j * j == i) {
                    isPerfect = true;
                    break;
                }
            }
            if (isPerfect &amp;amp;&amp;amp; j&amp;lt;1000) sum = sum + j;
        }
        return sum;
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h1&gt;
  
  
  Summary
&lt;/h1&gt;

&lt;p&gt;The intent here, is that during the interview, I'll share my screen/hand my laptop over &amp;amp; ask them to walk me through what they would do to solve these tasks. There will be nothing in the project other than this one class (and the IDE pre-configured to run the code).&lt;/p&gt;

&lt;p&gt;Please note, if you're a Junior looking at &lt;code&gt;taskTwo&lt;/code&gt; wondering what the hell a "perfect prime" is - see my point on fail-fast. Task two uses perfect primes because, in part, I'm looking at how quickly you raise the fact that you don't understand something. If you know what a perfect prime is, fine, I have other ways to find out that bit of your personality.&lt;/p&gt;

&lt;p&gt;Also of note, I don't care if my laptop keyboard layout is strange for you. I don't care if you don't understand the IDE (I have 3 installed, take your pick, I literally don't care if you don't understand how any of those 3 work). I don't care if you actually &lt;em&gt;complete&lt;/em&gt; each task. I'll make allowances for you stumbling with my keyboard/IDE etc, don't worry about it.&lt;/p&gt;

&lt;p&gt;I do care about your approach, and how well you communicate (without giving spoilers, yet).&lt;/p&gt;

&lt;h1&gt;
  
  
  Your comments
&lt;/h1&gt;

&lt;p&gt;So, what do you think? &lt;/p&gt;

&lt;p&gt;Juniors reading this, would it scare you? Would you be able to confidently tackle the tasks? (NB, I do &lt;em&gt;not&lt;/em&gt; expect you to actually attempt tackling the tasks).&lt;/p&gt;

&lt;p&gt;Seniors reading this, would you be looking for something different from a Junior? Do you think these questions would generally help get the information I'm after?&lt;/p&gt;

</description>
      <category>java</category>
      <category>hiring</category>
      <category>junior</category>
      <category>discuss</category>
    </item>
    <item>
      <title>That time a KnowBe4 phish test caught the wrong person</title>
      <dc:creator>Dave</dc:creator>
      <pubDate>Tue, 05 May 2020 14:43:17 +0000</pubDate>
      <link>https://dev.to/190245/that-time-a-knowbe4-phish-test-caught-the-wrong-person-31c1</link>
      <guid>https://dev.to/190245/that-time-a-knowbe4-phish-test-caught-the-wrong-person-31c1</guid>
      <description>&lt;p&gt;My employer pays KnowBe4 to randomly conduct phishing tests on all employees, and not so long ago, I got an email that looked (at first glance) legit, from "LinkedIn Security."&lt;/p&gt;

&lt;p&gt;The first thing that peaked my interest, was that I have a LinkedIn account, but not associated to the email address that their "Security" team were talking to me about. Since I'm now interested, I paid closer attention to the sender address, and they were missing an E in "LinkedIn" - bingo, it's 100% bogus.&lt;/p&gt;

&lt;p&gt;So, following corporate policy, I kick a ticket at our First Line staff along the lines of "hey, if this isn't a KnowBe4 test, consider blacklisting the domain."&lt;/p&gt;

&lt;p&gt;A while later the reply came back, saying that they were blacklisting the domain. I replied, with a screenshot of the &lt;code&gt;host&lt;/code&gt; command demonstrating that the host in the "click me" link is a CNAME'd alias for KnowBe4.&lt;/p&gt;

&lt;p&gt;KnowBe4 targetting is off a little, but they definitely caught someone that needs training!&lt;/p&gt;

</description>
      <category>knowbe4</category>
      <category>humour</category>
    </item>
    <item>
      <title>How to deal with an argumentative code review?</title>
      <dc:creator>Dave</dc:creator>
      <pubDate>Fri, 13 Sep 2019 14:17:32 +0000</pubDate>
      <link>https://dev.to/190245/how-to-deal-with-an-argumentative-code-review-5eml</link>
      <guid>https://dev.to/190245/how-to-deal-with-an-argumentative-code-review-5eml</guid>
      <description>&lt;p&gt;So, for my first post here, I thought I'd try to garner some opinions. There's no wrong here.&lt;/p&gt;

&lt;p&gt;I'm a senior developer, and a little over 6 months ago, I was asked to interview a woman - whom 3 of us agreed should be hired into the team. She was hired as a junior.&lt;/p&gt;

&lt;p&gt;Fast forward 6 months, and she's working on small projects with lots of time investment from myself &amp;amp; others to start a Sprint. She then works for a full sprint having the usual standups etc, and has delivered a project within a single sprint.&lt;/p&gt;

&lt;p&gt;My issue, is the code reviews.&lt;/p&gt;

&lt;p&gt;I've always treated code reviews as "if it fits the requirements, it gets merged" and we don't have anything like style guides to worry about. If I can't work out quickly (based on the review content and the commit history) what a section of code is doing, I'll ask the author.&lt;/p&gt;

&lt;p&gt;Unfortunately, code reviews with her are &lt;em&gt;ALWAYS&lt;/em&gt; world war 3, everything is taken personally, and combative responses are the norm. Simple things like "did you consider X here, would have probably been a bit more efficient?" get a response of "no, and I'm not going to change it, this should have been discussed in requirements before the task was given to me." Consider here, I'm talking about things like static import use in Java, nothing complicated.&lt;/p&gt;

&lt;p&gt;Yes, I still merge the code (because it obeys the functionality rule). But I can do without the arguments daily over the tiniest of things.&lt;/p&gt;

&lt;p&gt;I could stop commenting, but that runs the risk of simply whitewashing her changes &amp;amp; allowing the defect rate to rise if I'm not paying attention.&lt;/p&gt;

&lt;p&gt;I could take the hard line of "buck up or get another job" but I'd rather find a way to help her take on feedback healthier.&lt;/p&gt;

&lt;p&gt;So, after that lengthy rant, what are your tips for reducing combative responses while helping juniors grow?&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
