<?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: CodeAbbey</title>
    <description>The latest articles on Forem by CodeAbbey (@codeabbey).</description>
    <link>https://forem.com/codeabbey</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%2Forganization%2Fprofile_image%2F1882%2Fe31401b0-27ee-4012-b4df-87c4e19ff1c5.png</url>
      <title>Forem: CodeAbbey</title>
      <link>https://forem.com/codeabbey</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/codeabbey"/>
    <language>en</language>
    <item>
      <title>Personality Swap - new problem based on Futurama episode</title>
      <dc:creator>Rodion Gorkovenko</dc:creator>
      <pubDate>Thu, 05 Mar 2020 17:42:29 +0000</pubDate>
      <link>https://forem.com/codeabbey/personality-swap-new-problem-based-on-futurama-episode-48ip</link>
      <guid>https://forem.com/codeabbey/personality-swap-new-problem-based-on-futurama-episode-48ip</guid>
      <description>&lt;p&gt;One of episodes of Futurama series (&lt;em&gt;Prisoner of Benda&lt;/em&gt;) is about personality-swapping machine - it can exchange two people's bodies, but only once for each given pair.&lt;/p&gt;

&lt;p&gt;This makes quite a problem about returning personalities to their bodies. You may test your algorithmic skills trying to solve it :)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.codeabbey.com/index/task_view/personality-swap"&gt;&lt;strong&gt;Personality Swap @ CodeAbbey&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_WgHIs66--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/4D8PmUN.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_WgHIs66--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/4D8PmUN.png" alt="Prisoner of Benda"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>challenge</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>Ads or Donations - what you prefer to gain money with your site?</title>
      <dc:creator>Rodion Gorkovenko</dc:creator>
      <pubDate>Sun, 16 Feb 2020 06:39:18 +0000</pubDate>
      <link>https://forem.com/codeabbey/ads-or-donations-what-you-prefer-to-gain-money-with-your-site-797</link>
      <guid>https://forem.com/codeabbey/ads-or-donations-what-you-prefer-to-gain-money-with-your-site-797</guid>
      <description>&lt;p&gt;After you get, say, your first steady 1000 daily pageviews with your web-site, you become curious - is there a way to make some profit from it?&lt;/p&gt;

&lt;p&gt;At least to return money paid for hosting, domain name etc.&lt;/p&gt;

&lt;p&gt;If you have some experience in this - please share! If not - welcome to read about mine :)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mgG0qSG_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/n8iqoyvs1wkqslsgdguv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mgG0qSG_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/n8iqoyvs1wkqslsgdguv.png" alt="Survey about Ads"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;results of survey about ads - people either hate them or block them&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Approach tried - Ads from Google
&lt;/h2&gt;

&lt;p&gt;So I started thinking about &lt;a href="https://www.codeabbey.com"&gt;CodeAbbey&lt;/a&gt; - my hobby web-site with coding exercises - after about a year and half after its start.&lt;/p&gt;

&lt;p&gt;I read about &lt;strong&gt;Google Adsense&lt;/strong&gt; and after some efforts added small ad banner to top-right corner, shown on most of pages. I just didn't want to annoy my users with something larger. However even with this I found that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;only about half pageviews load ads - obviously many people use ad-blockers!&lt;/li&gt;
&lt;li&gt;my users are of specific category - mostly techies and many of them studying - who don't pay much attention to ads at all&lt;/li&gt;
&lt;li&gt;some ads are quite inappropriate, silly or embarrassing, especially on mobile (so I switched them off on mobile);&lt;/li&gt;
&lt;li&gt;in total, return is small - in best times it generated about 10-15 bucks per month (with hosting currently about 13 per month);&lt;/li&gt;
&lt;li&gt;during last one or two years ads have become even more silly and their revenue dropped to about 7-8 per month.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's just ain't no good! Of course Google Adsense proposes "to improve your revenue" by putting large (half-screen) ads on pages, but I feel it will look like "damned boolsheet" for our users. And we value our users more than few bucks, right? :)&lt;/p&gt;




&lt;h2&gt;
  
  
  Considering Donations
&lt;/h2&gt;

&lt;p&gt;So currently I'm thinking about turning off ads at all and switching to donations. I previously had few occasional transfers from some kind people - notably one fellow affectionately sent me $100 after he have impressed his opponent while being interviewed for some developer job - by showing his profile at my site and explaining solution of some advanced tasks.&lt;/p&gt;

&lt;p&gt;I've tried survey about people's feeling and it seems to be favorable:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dQb_VvNv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8b439jglys4w5oseoldk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dQb_VvNv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8b439jglys4w5oseoldk.png" alt="donations survey"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However there seem to be several things to care about yet:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;seemingly I need "business"-type account at paypal - correct me if I'm wrong&lt;/li&gt;
&lt;li&gt;and as I'm going to send some small gifts (mugs, t-shirts) in case of too generous donations - it is important to get notified timely - and arrange some way of asking people for their postal address&lt;/li&gt;
&lt;li&gt;and obviously it is important to come up with some design for any gift postcards, mugs or t-shirts - and find out where to produce them and how to pack them.&lt;/li&gt;
&lt;li&gt;last but not least, I'm sure I'll need to figure out how to properly pay taxes according to our local laws (taxes from normal salary in our country are deducted automatically and we never need to care of this).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;So I'm still working to this switch. If you have any advice - please share!&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>money</category>
      <category>web</category>
    </item>
    <item>
      <title>Hacking Random Generator (linear congruential generator)</title>
      <dc:creator>Rodion Gorkovenko</dc:creator>
      <pubDate>Wed, 12 Feb 2020 20:56:05 +0000</pubDate>
      <link>https://forem.com/codeabbey/hacking-random-generator-linear-congruential-generator-1mpi</link>
      <guid>https://forem.com/codeabbey/hacking-random-generator-linear-congruential-generator-1mpi</guid>
      <description>&lt;p&gt;New problem: &lt;a href="https://www.codeabbey.com/index/task_view/cracking-lcg"&gt;Cracking "LCG" Random Generator @ CodeAbbey&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Default random generators in some languages (&lt;code&gt;Python&lt;/code&gt;, &lt;code&gt;PHP7&lt;/code&gt;, &lt;code&gt;JavaScript&lt;/code&gt;) switched to XorShift or Mersenne Twister. However in others - most notably, &lt;code&gt;Java&lt;/code&gt; and linux/posix &lt;strong&gt;rand&lt;/strong&gt; used in &lt;code&gt;C/C++&lt;/code&gt; - it still uses linear congruential generator in very simple form:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;X_next = (A * X_cur + C) % M
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The new problem at CodeAbbey is dedicated to exercise of hacking such generator. I.e. about predicting next results after observing few first ones.&lt;/p&gt;

&lt;p&gt;This both helps to get better understanding of modular arithmetic - and to remember that default random generators shouldn't be used for hashing or encrypting sensitive data - or building online casinos :)&lt;/p&gt;

</description>
      <category>security</category>
      <category>computerscience</category>
      <category>challenge</category>
      <category>codeabbey</category>
    </item>
    <item>
      <title>Interview problem: Sick Travelers</title>
      <dc:creator>Rodion Gorkovenko</dc:creator>
      <pubDate>Wed, 12 Feb 2020 10:58:05 +0000</pubDate>
      <link>https://forem.com/codeabbey/interview-problem-sick-travelers-31c3</link>
      <guid>https://forem.com/codeabbey/interview-problem-sick-travelers-31c3</guid>
      <description>&lt;p&gt;&lt;strong&gt;Now, with New Coronavirus situation, this problem gives interesting epidemic simulation!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5u_3jsq1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/lp77u9udt1giej0lfm9j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5u_3jsq1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/lp77u9udt1giej0lfm9j.png" alt="sick travellers problem explained"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;There is &lt;a href="https://www.palantir.com/"&gt;Palantir Technologies&lt;/a&gt; and one of our fellows had been interviewed there (for internship or junior developer position, I assume). He retold me this problem, as a curiosity, proposed to him at interview and suggested to add it as another task at &lt;strong&gt;CodeAbbey&lt;/strong&gt;. After some googling I found the problem is known to some extent, so I did as suggested.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.codeabbey.com/index/task_view/sick-travellers"&gt;Here is the link to problem at CodeAbbey&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Supposedly it may take from 30 minutes to 2 hours. But if you'll try solving it - please, share your experience!&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem Statement
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;There is some quantity of cities and some quantity of travelers.&lt;/li&gt;
&lt;li&gt;Every traveler has schedule to visit several cities in certain order, staying 1 day in each (and travelling speedily by night). When schedule ends, traveler just starts again.&lt;/li&gt;
&lt;li&gt;Each traveler can be &lt;code&gt;healthy&lt;/code&gt;, &lt;code&gt;sick&lt;/code&gt; or &lt;code&gt;recovering&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;One who is &lt;code&gt;sick&lt;/code&gt; will become &lt;code&gt;recovering&lt;/code&gt; next day.&lt;/li&gt;
&lt;li&gt;One who is &lt;code&gt;recovering&lt;/code&gt; will become &lt;code&gt;healthy&lt;/code&gt; next day.&lt;/li&gt;
&lt;li&gt;One who is &lt;code&gt;healthy&lt;/code&gt; will become &lt;code&gt;sick&lt;/code&gt; next day if today he/she is in the city with someone &lt;code&gt;sick&lt;/code&gt; or &lt;code&gt;recovering&lt;/code&gt; (i.e. contagious).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For example look at the picture above. There are two persons and 4 cities. The time is increasing by days from left to right. One person travels between cities &lt;code&gt;A&lt;/code&gt; and &lt;code&gt;B&lt;/code&gt; (and is marked by blue lines). Another travels according to &lt;code&gt;C-B-D&lt;/code&gt; schedule (purple lines).&lt;/p&gt;

&lt;p&gt;The first (blue) is sick initially (let's call it day-1) - this is marked by red color. He/she moves to &lt;code&gt;B&lt;/code&gt; on the day-2 and meets second (purple) here. Blue is recovering (pink) on the day-2, but some of his viruses land on Purple. Thanks to this, Purple becomes sick on day-3 when reaching city D.&lt;/p&gt;

&lt;p&gt;Luckily in this example people density is small and both are soon healthy (green) for good. Epidemic doesn't happen.&lt;/p&gt;

&lt;p&gt;The task is to simulate this for hundred days or while all become healthy. But we can invent more interesting questions. E.g. to figure out what people density leads to epidemic on average. Or even detect loop in situation change sequence over many days.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Problem seems to be pretty straightforward, not about some whimsical algorithm, but rather good coding exercise - to write it neatly, choose suitable data structures etc.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>career</category>
      <category>challenge</category>
    </item>
    <item>
      <title>HTTP-based games for Programmers</title>
      <dc:creator>Rodion Gorkovenko</dc:creator>
      <pubDate>Tue, 11 Feb 2020 22:21:56 +0000</pubDate>
      <link>https://forem.com/codeabbey/http-based-games-for-programmers-30ha</link>
      <guid>https://forem.com/codeabbey/http-based-games-for-programmers-30ha</guid>
      <description>&lt;p&gt;&lt;em&gt;So I've created "organization" for my side-project here at DEV. And it is time for introduction post. I don't like "blank" intro posts, so I'll tell about one of the features at once.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Most of the problems at CodeAbbey are typical - you have input data (e.g. for "Fahrenheit-to-Celsius" calculation), you need to produce and submit some answer. Web-site checks it and if it's ok, you get higher in the ranking table.&lt;/p&gt;

&lt;p&gt;But it may become boring sooner or later :)&lt;/p&gt;

&lt;p&gt;At some point I've invented "interactive" problems. They are more like 2-player game - &lt;strong&gt;your code&lt;/strong&gt; is one player and &lt;strong&gt;web-server&lt;/strong&gt; is another. They communicate with simple HTTP requests.&lt;/p&gt;

&lt;p&gt;For now there are just 4 problems of such kind (&lt;a href="https://www.codeabbey.com/index/task_list/interactive"&gt;here is the link&lt;/a&gt;):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Say 100&lt;/strong&gt; - quite trivial, server gives you number, just answer with number adding total to 100. Simply to help figure out the exchange process.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Nim Game&lt;/strong&gt; - this game is famous in all math or logic related books. You'll need to find strategy for it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Maze of the Wumpus&lt;/strong&gt; - based on classic (ancient!) console game. You are to find Wumpus in the maze and kill it before it gets on you. Not sure about strategy :)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Connect Four&lt;/strong&gt; - well-known game, I believe, this requires you to implement typical Minimax algorithm.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;Well, hopefully it's enough for introduction. And hopefully I'll invent more problems of such kind if you, friends, find them funny. Suggestions are welcome!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>challenge</category>
      <category>sideprojects</category>
    </item>
  </channel>
</rss>
