<?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>Forem: dragonwocky</title>
    <description>The latest articles on Forem by dragonwocky (@dragonwocky).</description>
    <link>https://forem.com/dragonwocky</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%2F65487%2F8c9ca4a6-1dcf-4846-8d18-de6e1febe366.png</url>
      <title>Forem: dragonwocky</title>
      <link>https://forem.com/dragonwocky</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/dragonwocky"/>
    <language>en</language>
    <item>
      <title>Microsoft bought GitHub? How's that going to affect text editors?</title>
      <dc:creator>dragonwocky</dc:creator>
      <pubDate>Tue, 05 Jun 2018 11:58:17 +0000</pubDate>
      <link>https://forem.com/dragonwocky/microsoft-bought-github-hows-that-going-to-affect-text-editors-270b</link>
      <guid>https://forem.com/dragonwocky/microsoft-bought-github-hows-that-going-to-affect-text-editors-270b</guid>
      <description>&lt;p&gt;So, yeah. If you somehow haven't heard (seriously though, how could you not have heard), Microsoft bought GitHub the other day. I'm not going to go into much detail on that, but I would recommend having a look @ &lt;a href="https://dev.to/maxart2501/what-i-think-is-bad-about-microsoft-acquiring-github-gme"&gt;this post by Massimo Artizzu&lt;/a&gt; if you want to know more.&lt;/p&gt;

&lt;p&gt;One thing that nobody else seems to be paying much attention to is what will happen to a couple of the tools that many developers probably use daily. To those of us who don't want a full-blown IDE, but want a little more than Notepad, these are awesome tools, customisable yet still light, with a fairly nice UI.&lt;/p&gt;

&lt;p&gt;Yep, I'm talking about text editors. Atom and Visual Studio Code are two of the big favourites when it comes to free text editors that are for both Windows and macOS. Most developers prefer one or the other. Obviously, these two aren't necessarily the best editors around, but for most people they do the job.&lt;/p&gt;

&lt;p&gt;GitHub made Atom, and it's amazing.&lt;br&gt;
Microsoft made VS Code, and it's incredible.&lt;/p&gt;

&lt;p&gt;Microsoft just bought GitHub. Now... it owns both Atom and VS Code?&lt;/p&gt;

&lt;p&gt;I'm curious. Are they going to continue to be developed separately, as they are currently, or is some sort of "VS Atom" going to come out? Is Atom going to get integration with MS services built-in? Will nothing happen at all? Have I completely misunderstood the situation and Microsoft has no power over Atom? I have no idea.&lt;/p&gt;

&lt;p&gt;What do you think is going to happen to these editors?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here's a response to this by &lt;a href="https://github.com/lee-dohm"&gt;Lee Dohm&lt;/a&gt;, the Open Source Community Manager at GitHub: &lt;a href="https://github.com/atom/atom/issues/17454/#issuecomment-394421141"&gt;https://github.com/atom/atom/issues/17454/#issuecomment-394421141&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also, just to clear something up. I know Atom is Open Source and is under the MIT License. When I talked about "owning" it, I meant that they created it and it's mainly their team working on it, even though it is open source and I expect the community has contributed sizeable amounts of code to it. Plus - they own the repository itself.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>github</category>
      <category>microsoft</category>
      <category>editors</category>
    </item>
    <item>
      <title>Service Workers... aren't working</title>
      <dc:creator>dragonwocky</dc:creator>
      <pubDate>Sat, 05 May 2018 07:06:56 +0000</pubDate>
      <link>https://forem.com/dragonwocky/service-workers-arent-working-2jh6</link>
      <guid>https://forem.com/dragonwocky/service-workers-arent-working-2jh6</guid>
      <description>&lt;p&gt;Well, I know there are articles all over the internet that talk about service workers. However, I'm stuck.&lt;/p&gt;

&lt;p&gt;I'm trying cache a few files for offline use, for a small game I'm working on, which I would've thought would be relatively simple. Previous versions of it used &lt;code&gt;&amp;lt;html manifest="cache.manifest"&amp;gt;&lt;/code&gt; to cache the files necessary, and I had planned to do the same once again... until I did a bit of research, and found it was deprecated.&lt;/p&gt;

&lt;p&gt;Service workers are, apparently, the recommended replacement for the appcache. For some reason, I can't get them working, though. I've tried following the instructions for making a web-app work offline with service workers off the &lt;a href="https://developer.mozilla.org/en-US/Apps/Progressive/Offline_Service_workers"&gt;MDN web docs&lt;/a&gt;, but I keep getting &lt;code&gt;Uncaught (in promise) TypeError: Request failed&lt;/code&gt; in the console.&lt;/p&gt;

&lt;p&gt;Help would be much appreciated.&lt;/p&gt;

&lt;p&gt;View the game @ &lt;a href="https://car-cricket.glitch.me"&gt;https://car-cricket.glitch.me&lt;/a&gt;&lt;br&gt;
View the source code @ &lt;a href="https://glitch.com/edit/#!/car-cricket"&gt;https://glitch.com/edit/#!/car-cricket&lt;/a&gt;&lt;/p&gt;

</description>
      <category>help</category>
    </item>
    <item>
      <title>Explain Pseudocode</title>
      <dc:creator>dragonwocky</dc:creator>
      <pubDate>Fri, 06 Apr 2018 21:15:21 +0000</pubDate>
      <link>https://forem.com/dragonwocky/explain-pseudocode-1jgg</link>
      <guid>https://forem.com/dragonwocky/explain-pseudocode-1jgg</guid>
      <description>&lt;p&gt;Okay. I've just started learning Python, and I'm finding it way easier to understand than pseudocode. This post is less of a serious debate, and more of a search to satisfy my curiosity.&lt;/p&gt;

&lt;p&gt;Normally I come up with an idea and jump into coding it without much planning, so before now writing pseudocode was an unknown to me. I've done a bit of googling, and the basic concept is simple enough - "pseudo" (fake) code, written in plain English, so that it can easily be converted to almost any language by developers. Makes sense.&lt;/p&gt;

&lt;p&gt;Now, my problem is the syntax. Does it actually have any agreed upon / recommended syntax, or is it literally just write whatever? If it does have recommended syntax that the majority of devs agree on, then what would that be? Most things I've found online have maybe one or two sentences about pseudocode and are mostly about flowcharts, or seem to be in complete disagreement with each other.&lt;/p&gt;

&lt;p&gt;Take, for example, this simple Python script that flips a coin:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# import modules
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;random&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;time&lt;/span&gt;

&lt;span class="c1"&gt;# flip coin
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;flip&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;coin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;''&lt;/span&gt;
    &lt;span class="n"&gt;rand&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;getrandbits&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;rand&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;coin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'heads'&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;coin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'tails'&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;coin&lt;/span&gt;

&lt;span class="c1"&gt;# allow for multiple games
&lt;/span&gt;&lt;span class="n"&gt;playagain&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'Y'&lt;/span&gt;
&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;playagain&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;'y'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'yes'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;''&lt;/span&gt;&lt;span class="p"&gt;}:&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'The coin spins in midair...'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'...and lands on &lt;/span&gt;&lt;span class="se"&gt;\033&lt;/span&gt;&lt;span class="s"&gt;[1m'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;flip&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;'&lt;/span&gt;&lt;span class="se"&gt;\033&lt;/span&gt;&lt;span class="s"&gt;[0m!'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;playagain&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;Do you wish to flip the coin again (Y/N)? '&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I've attempted to write some pseudocode for this. Which one of the below would people say is better? Could anyone demonstrate how they would write pseudocode for this?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# attempt 1

set playagain to yes
while (playagain is y, yes, or an empty string (ignoring capitalisation)) do
    tell user the coins spins in midair
    wait 1 second
    run function "flip"
        set rand to a randomly generated booleen (true/false)
        if (rand is true)
            set coin to heads
        else (rand is false)
            set coin to tails
        return coin
    tell user what the result of "flip" was
    ask user if they want to play more games and set playagain to user response

# attempt 2

FUNCTION flip() =
    rand = random booleen
    if (rand)
        coin = heads
    else
        coin = tails
    return coin

playagain = yes
while (playagain == y, yes, or an empty string (ignoring capitalisation)) do
    output "The coin spins in midair..."
    sleep 1 second
    ouput "...and lands on " flip()
    output "Do you wish to flip the coin again (Y/N)?"
    playagain = input
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This may seem ridiculous to the majority of you, but I would appreciate any help!&lt;/p&gt;

</description>
      <category>pseudocode</category>
      <category>help</category>
    </item>
  </channel>
</rss>
