<?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: Alex</title>
    <description>The latest articles on DEV Community by Alex (@dantal).</description>
    <link>https://dev.to/dantal</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%2F502488%2Fb187725b-250a-479c-a6b7-38ca0ffd912e.png</url>
      <title>DEV Community: Alex</title>
      <link>https://dev.to/dantal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dantal"/>
    <language>en</language>
    <item>
      <title>📢 Why do you need a CDN?</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Sat, 07 Nov 2020 17:00:21 +0000</pubDate>
      <link>https://dev.to/dantal/why-do-you-need-a-cdn-1ob3</link>
      <guid>https://dev.to/dantal/why-do-you-need-a-cdn-1ob3</guid>
      <description>&lt;p&gt;After talking with a lot of specialists, the following problem arose: everyone knows that CDN is very good, it is correct, it is worth using. This article attempts to answer this question and explain in what cases a CDN can solve emerging problems and a number of technological and business problems.


&lt;br&gt;&lt;br&gt;&lt;b class="ttit"&gt;Main Features&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Content availability&lt;/li&gt;
&lt;li&gt;High download speed&lt;/li&gt;
&lt;li&gt;Reducing server load - source of information&lt;/li&gt;
&lt;li&gt;Posting "heavy" content&lt;/li&gt;
&lt;li&gt;Resiliency and security&lt;/li&gt;
&lt;li&gt;Scalability and load elasticity
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Content availability&lt;/h2&gt;

Quite often, every hour of downtime of an online store site is measured in very significant amounts. If the server on which the site is located failed at night, and the store must be available 24 hours a day (for example, due to the wide geographical coverage of users), then this can result in significant financial losses.

&lt;p&gt;A distributed network of servers makes it easy to solve this problem: if one of the available servers fails, then its place is immediately taken by the closest of the network neighbors. Thus, the end user does not notice any disruption to the site.&lt;/p&gt;


&lt;p&gt;In addition, data in a distributed network is also backed up on a large number of servers, which reduces the probable possibility of their loss to almost zero: for this it is necessary that the entire network fails at once, and this is statically impossible if it is not carefully planned by attackers in advance with the involvement of very expensive technological funds.&lt;br&gt;&lt;br&gt;
&lt;/p&gt;
&lt;h2&gt;High download speed&lt;/h2&gt;


Due to the fact that the network route between end users and servers with information is reduced to a minimum (and the servers themselves respond extremely quickly), the speed of requests will be very significant.


&lt;p&gt;As an example, the following figures should be given: the response time of a regular server located on a VPS (not even on shared hosting) is 50-200 ms (depending on various conditions, including the channel load). For CDNs, this number very rarely exceeds 10ms.&lt;/p&gt;
&lt;h2&gt;Reducing server load - source of information&lt;/h2&gt;


The user load when using a CDN is distributed between the servers on the network, and the source server can only be used to receive information updates. If updates are extremely rare (and the site does not provide dynamic pages that depend on user behavior), then the source server simply does not need much power and can be replaced with a server of minimal configuration.


&lt;p&gt;Thus, the entire server load can be assigned to the CDN, and the main server will be responsible only for the relevance of the information provided.&lt;br&gt;&lt;br&gt;
&lt;/p&gt;
&lt;h2&gt;Posting "heavy" content&lt;/h2&gt;


In some cases (hosting software or media materials, creating interactive promo sites), the source server with information can be loaded with "slow" requests (which can last for minutes and hours, wasting server resources and preventing faster requests to get the rest information on the website). In this case, there is also only one way out - to use a CDN.


&lt;p&gt;CDN allows providing simultaneous servicing of tens and hundreds of thousands of "slow" requests without requiring additional qualifications from the staff responsible for the site with the original content. Carrying out a colorful promotional campaign, as a result of which it is planned to serve user requests for files of several (tens, hundreds) MB, it is worth paying attention to the network of distributed servers: it is guaranteed not to fail as a result of high load.&lt;/p&gt;
&lt;h2&gt;Resiliency and security&lt;/h2&gt;


The CDN network is located on the most powerful technological platforms and has hundreds and thousands of servers, which increases the cost of an effective DDoS attack on it to fantastic values. If your business does not bring millions of dollars a day, then you can safely place your site on such a network and be protected from the attacks of unscrupulous competitors.&lt;br&gt;

&lt;h2&gt;Scalability and load elasticity&lt;br&gt;
&lt;/h2&gt;


A distributed server network has another advantage: it allows you to easily expand capacity, from serving 1000 people a day to several million or more. Thus, with a sharp increase in the load (a new product release, an article in a well-known publication, a promotional campaign), this will not affect the availability of your site in any way, its content will still be served quickly and without any interruptions.&lt;br&gt;&lt;br&gt;&lt;a href="https://exceed-team.com/tech/why-do-you-need-a-cdn"&gt;Why do you need a CDN? | Exceed Team Blog&lt;/a&gt;

</description>
    </item>
    <item>
      <title>What programming language is used in Nike+ app?</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Sat, 07 Nov 2020 09:02:30 +0000</pubDate>
      <link>https://dev.to/dantal/what-programming-language-is-used-in-nike-app-1c24</link>
      <guid>https://dev.to/dantal/what-programming-language-is-used-in-nike-app-1c24</guid>
      <description>&lt;p&gt;There are 3 key languages that are used for building an app:&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Java&lt;/b&gt; has been the language of choice for mobile app creation based on Google's Android platform. Java is an extremely common programming language that enables cross-platform support and ease of portability when developing applications for different types of hardware and OSes.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Kotlin&lt;/b&gt;, which is the newest of the programming languages highlighted in this list, was designed to completely interface with Java.&lt;/p&gt;



&lt;b&gt;Swift&lt;/b&gt;, is basically used for ios applications.&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2F95.182.121.107%3A9900%2Fup%2F1188%2F4.webp" alt="what programming language is used in nike app"&gt;&lt;br&gt;&lt;br&gt;&lt;a href="https://exceed-team.com/tech/what-programming-language-is-used-in-nike-app" rel="noopener noreferrer"&gt;What programming language is used in Nike+ app? | Exceed Team Blog&lt;/a&gt;

</description>
      <category>language</category>
      <category>programming</category>
      <category>nike</category>
      <category>app</category>
    </item>
    <item>
      <title>Web2py python wramework main features</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Fri, 06 Nov 2020 20:29:44 +0000</pubDate>
      <link>https://dev.to/dantal/web2py-python-wramework-main-features-4d1h</link>
      <guid>https://dev.to/dantal/web2py-python-wramework-main-features-4d1h</guid>
      <description>&lt;p&gt;The core list of the main &lt;b&gt;Web2py&lt;/b&gt; features are:&lt;/p&gt;
&lt;ul class="u"&gt;
&lt;li&gt;cookies&lt;/li&gt;
&lt;li&gt;request&lt;/li&gt;
&lt;li&gt;cache&lt;/li&gt;
&lt;li&gt;internationalization&lt;/li&gt;
&lt;li&gt;errors / tickets&lt;/li&gt;
&lt;li&gt;GAE&lt;/li&gt;
&lt;li&gt;SQLite&lt;/li&gt;
&lt;li&gt;MSSQL&lt;/li&gt;
&lt;li&gt;MySQL&lt;/li&gt;
&lt;li&gt;Postgres&lt;/li&gt;
&lt;li&gt;Oracle&lt;/li&gt;
&lt;li&gt;FireBird database abstraction&lt;/li&gt;
&lt;li&gt;etc.&lt;/li&gt;
&lt;/ul&gt;* It doesn't need to be enabled-just unzip and click on it-and you can build it in your browser.&lt;br&gt;&lt;br&gt;&lt;a href="https://exceed-team.com/tech/web2py-python-wramework-main-features"&gt;Web2py python wramework main features | Exceed Team Blog&lt;/a&gt;

</description>
      <category>web2py</category>
      <category>python</category>
      <category>wramework</category>
      <category>main</category>
    </item>
    <item>
      <title>Multithreading vs asynchronous programming</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Wed, 04 Nov 2020 08:58:40 +0000</pubDate>
      <link>https://dev.to/dantal/multithreading-vs-asynchronous-programming-222b</link>
      <guid>https://dev.to/dantal/multithreading-vs-asynchronous-programming-222b</guid>
      <description>&lt;p&gt;There are several different concepts related to the field of parallel computing.&lt;/p&gt;

&lt;p&gt;Concurrency&lt;br&gt;
Parallel execution&lt;br&gt;
Multithreading&lt;br&gt;
Asynchronous execution&lt;/p&gt;

&lt;p&gt;Each of these terms is strictly defined and has a clear meaning.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Concurrency&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Concurrency (&lt;em&gt;) is the most general term that says that more than one task is running at the same time. For example, you can watch TV and comment on photos on Facebook at the same time. Windows, even the 95th could (&lt;/em&gt;*) simultaneously play music and show pictures.&lt;/p&gt;

&lt;p&gt;Concurrent execution is the most general term, which does not say how this concurrency will be obtained: by suspending some computational elements and switching them to another task, by truly concurrent execution, by delegating work to other devices, or otherwise. It does not matter.&lt;/p&gt;

&lt;p&gt;Competitive performance means that more than one task will be solved within a certain period of time. Dot.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parallel execution&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Parallel computing means having more than one computing device (for example, a processor) that will simultaneously perform several tasks.&lt;/p&gt;

&lt;p&gt;Concurrent execution is a strict subset of concurrent execution. This means that parallel programming is impossible on a computer with one processor;)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Multithreading&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Multithreading is one way to implement concurrent execution by separating out the worker thread abstraction.&lt;/p&gt;

&lt;p&gt;Threads abstract low-level details from the user and allow more than one work to be done in parallel. The operating system, runtime, or library hides the details of whether multithreading will be concurrent (when there are more threads than physical processors) or parallel (when the number of threads is less than or equal to the number of processors and multiple tasks are physically executing simultaneously).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Asynchronous execution&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Asynchrony means that an operation can be performed by someone on the side: a remote Web site, server, or other device outside of the current computing device.&lt;/p&gt;

&lt;p&gt;The main property of such operations is that the beginning of such an operation requires much less time than the main work. This allows many asynchronous operations to be performed simultaneously, even on a device with a small number of computing devices.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CPU-bound and IO-Bound operations&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Another important point from the developer's point of view is the difference between CPU-bound and IO-bound operations. CPU-Bound operations load the computing power of the current device, and IO-Bound allows you to perform a task outside the current piece of hardware.&lt;/p&gt;

&lt;p&gt;The difference is important because the number of simultaneous operations depends on which category they belong to. It is quite normal to run hundreds of IO-Bound operations in parallel, and hope that there are enough resources to process all the results. To run in parallel too many CPU-bound operations (more than the number of computing devices) is pointless.&lt;/p&gt;

&lt;p&gt;Returning to the original question: it makes no sense to execute the Calc method in 1000 threads if it is CPU-Intensive (loads the central processor), since this will lead to a drop in the overall efficiency of calculations. The OS will have to switch several available cores to serve hundreds of threads. And this process is not cheap.&lt;/p&gt;

&lt;p&gt;The simplest and most effective way to solve a CPU-Intensive task is to use the Fork-Join idiom: a task (for example, input data) needs to be split into a certain number of subtasks that can be performed in parallel. Each subtask should be independent and not access shared variables / memory. Then, you need to collect intermediate results and combine them.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://exceed-team.com/tech/multithreading-vs-asynchronous-programming"&gt;Source article&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>"use strict" in JavaScript</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Tue, 03 Nov 2020 23:27:19 +0000</pubDate>
      <link>https://dev.to/dantal/use-strict-in-javascript-2poe</link>
      <guid>https://dev.to/dantal/use-strict-in-javascript-2poe</guid>
      <description>&lt;p&gt;The "use strict" in your JavaScript code turns on strict mode. (Or does nothing, in pre-fifth ECMAScript implementations). This directive applies to the scope in which it is specified.&lt;br&gt;
Examples of using&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;// file: ok.js&lt;br&gt;
"use strict"; // affects the whole file&lt;br&gt;
alert ("ok");&lt;br&gt;
(function () {&lt;br&gt;
  "use strict"; // valid only within the function&lt;br&gt;
  alert ("ok");&lt;br&gt;
} ());&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;What “use strict” affects?&lt;br&gt;
Below is a list of the most important features of the mode that will save you hours of development.&lt;br&gt;
Prevents duplicate keys in an object&lt;br&gt;
This saves in case of typos and accidental errors.&lt;/p&gt;

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

&lt;p&gt;&lt;code&gt;(function () {&lt;br&gt;
  "use strict";&lt;br&gt;
  var x = {&lt;br&gt;
    a: 1,&lt;br&gt;
    b: 2,&lt;br&gt;
    a: 3&lt;br&gt;
  }&lt;br&gt;
} ());&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Will result in an error&lt;/p&gt;

&lt;p&gt;Uncaught SyntaxError: Duplicate data property in object literal not allowed in strict mode&lt;/p&gt;

&lt;p&gt;Requires always explicit declaration of variables via var&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;(function () {&lt;br&gt;
  "use strict";&lt;br&gt;
  var a = 1; // correctly&lt;br&gt;
  x = 2; // error: no var&lt;br&gt;
} ());&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Uncaught ReferenceError: x is not defined&lt;/p&gt;

&lt;p&gt;This is a great opportunity! It saves you from mistakes that are very difficult to find. When you have two completely independent functions tied through a variable that suddenly turned out to be global.&lt;/p&gt;

&lt;p&gt;But you need to be careful with this feature, it works well only if the entire script is in strict mode. In the following example, strict mode is powerless:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;// file: ok.js&lt;br&gt;
// at the file level strict mode is not enabled&lt;br&gt;
x = 0; // global variable (or rather, in this case, the window property)&lt;br&gt;
(function () {&lt;br&gt;
  "use strict";&lt;br&gt;
  x = 2; // var is not present, but no error will occur, since the global x exists&lt;br&gt;
} ());&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;This can lead to unpleasant consequences. Such a simple and natural code will lead to a fatal looping and falling into a stupor of the browser.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;```function f () {&lt;br&gt;
  "use strict";&lt;br&gt;
  for (i = 0; i &amp;lt;3; ++ i) {&lt;br&gt;
    console.log (i);&lt;br&gt;
  }&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;for (i = 0; i &amp;lt;10; ++ i) {&lt;br&gt;
  console.log (i);&lt;br&gt;
  f ();&lt;br&gt;
}```&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;The fact is that a call to the f() function will each time set the value of the global variable i (and it turned out to be global here) to 3. And the loop to 10 will never end.&lt;/p&gt;

&lt;p&gt;Unfortunately, Strict mode will not help here. But if "use strict" were included globally for the entire file, the browser would immediately inform you about the suspicious code.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Uncaught ReferenceError: i is not defined&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;



&lt;p&gt;&lt;code&gt;Duplicate arguments are not allowed&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Typos are not allowed such as:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;function sum (a, a) {...&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Uncaught SyntaxError: Strict mode function may not have duplicate parameter names&lt;/p&gt;

&lt;p&gt;This design can only occur as a result of a typographical error. There is no sense in it, but such code behaves not well. Calls and result inside a function:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sum (); // a === undefined&lt;br&gt;
sum (1); // a === undefined&lt;br&gt;
sum (1, 2); // a === 2&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;This is most likely not what the developer expects.&lt;/p&gt;

&lt;p&gt;The arguments are frozen&lt;br&gt;
You can lose backward compatibility here. The arguments array in strict mode begins to behave like regular arrays (although it does not become a regular array from this). The result is easier to show with an example:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;```function a (x) {&lt;br&gt;
  arguments [0] = 2;&lt;br&gt;
  console.log (x); // prints 2&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;function b (x) {&lt;br&gt;
  "use strict";&lt;br&gt;
  arguments [0] = 2;&lt;br&gt;
  console.log (x); // will print 1&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;a (1);&lt;br&gt;
b (1);```&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;That is, in normal mode, changing arguments will change the corresponding variables, but in strict mode this does not happen.&lt;/p&gt;

&lt;p&gt;This is one of the pitfalls: you will not receive errors and warnings, and the code will work differently&lt;/p&gt;

&lt;p&gt;Full note is available &lt;a href="https://exceed-team.com/tech/what-does-use-strict-mean-in-javascript"&gt;in my tech blog&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>What are the most interesting HTML/JS/DOM/CSS hacks that you learn in the year?</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Fri, 30 Oct 2020 14:42:27 +0000</pubDate>
      <link>https://dev.to/dantal/what-are-the-most-interesting-html-js-dom-css-hacks-that-you-learn-in-the-year-23ee</link>
      <guid>https://dev.to/dantal/what-are-the-most-interesting-html-js-dom-css-hacks-that-you-learn-in-the-year-23ee</guid>
      <description>

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