<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[Butenko's dev notes]]></title><description><![CDATA[Thoughts, stories and ideas.]]></description><link>http://www.butenkoms.space/</link><generator>Ghost 0.7</generator><lastBuildDate>Sun, 12 Oct 2025 03:24:44 GMT</lastBuildDate><atom:link href="http://www.butenkoms.space/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[InterProcessPyObjects - Fast IPC. Share and modify Python objects across processes using shared memory.]]></title><description><![CDATA[Blazing-fast inter-process communication through shared memory, enabling Python objects to be shared across processes with exceptional efficiency]]></description><link>http://www.butenkoms.space/interprocesspyobjects-fast-ipc-share-and-modify-python-objects-across-processes-using-shared-memory/</link><guid isPermaLink="false">20917ec9-2310-4424-b9a0-c7347bd09b21</guid><category><![CDATA[Python]]></category><category><![CDATA[IPC]]></category><category><![CDATA[Shared memory]]></category><category><![CDATA[Inter-process communication]]></category><category><![CDATA[Shared objects]]></category><category><![CDATA[Shared dict]]></category><category><![CDATA[Shared list]]></category><dc:creator><![CDATA[Butenko MS]]></dc:creator><pubDate>Fri, 17 May 2024 00:17:50 GMT</pubDate><content:encoded><![CDATA[<p>Fast IPC. Share and modify Python objects across processes using shared memory.</p>

<p><a href="https://github.com/FI-Mihej/InterProcessPyObjects">https://github.com/FI-Mihej/InterProcessPyObjects</a></p>

<p><a href="https://pypi.org/project/InterProcessPyObjects">https://pypi.org/project/InterProcessPyObjects</a></p>

<p><img src="https://github.com/FI-Mihej/Cengal/raw/master/docs/assets/InterProcessPyObjects/ChartThroughputGiBs.png" alt="Throughput GiB/s"></p>

<p><img src="https://github.com/FI-Mihej/Cengal/raw/master/docs/assets/InterProcessPyObjects/ChartDictPerformanceComparison.png" alt="Dict performance comparison"></p>

<p>This high-performance package delivers blazing-fast inter-process communication through shared memory, enabling Python objects to be shared across processes with exceptional efficiency. By minimizing the need for frequent serialization-deserialization, it enhances overall speed and responsiveness. The package offers a comprehensive suite of functionalities designed to support a diverse array of Python types and facilitate asynchronous IPC, optimizing performance for demanding applications.</p>

<p>Comparison With "multiprocessing.shared_memory"</p>

<p>While both "InterProcessPyObjects" and "multiprocessing.shared_memory" facilitate inter-process communication, there are several key differences to note. Unlike "multiprocessing.shared_memory", "InterProcessPyObjects" offers the following enhancements:</p>

<ul>
<li>High-Performance Mutable Objects: Both connected processes can modify shared objects at runtime, and these changes are immediately reflected on the other side. This feature not only increases flexibility but also delivers exceptional performance, with the capability to handle up to several million changes per second.</li>
<li>Synchronization Features: Ensures that operations are thread-safe and data integrity is maintained across processes.</li>
<li>Message Queue: Integrates a system for queuing messages, making communication between processes more structured and reliable.</li>
<li>Extended Type Support: Supports a broad range of data types, including custom classes, which goes beyond the basic types typically handled by multiprocessing.shared_memory.</li>
</ul>

<p>These features make InterProcessPyObjects a more robust option for developers requiring advanced inter-process communication capabilities.</p>

<p>API State</p>

<p>Stable. Guaranteed to not have braking changes in the future.</p>

<p>License</p>

<p>Licensed under the Apache License, Version 2.0.</p>]]></content:encoded></item><item><title><![CDATA[Broken WSL2 networking]]></title><description><![CDATA[<h1 id="symptoms">Symptoms</h1>

<p>No network access from the WSL to the Internet. Both domain and IP based ping commands failed. Other advices from the Internet does not help. Newly installed distro from the Store has same problems as well.  </p>

<h1 id="cureinmycaseatleast">Cure (in my case at least)</h1>

<ol>
<li>Backup distros you need (<a href="http://www.butenkoms.space/wsl2-backup-and-restore/">See Backup section</a></li></ol>]]></description><link>http://www.butenkoms.space/broken-wsl2-networking/</link><guid isPermaLink="false">3971d7b6-5c92-4079-9a07-0dfeba10e8d8</guid><dc:creator><![CDATA[Butenko MS]]></dc:creator><pubDate>Tue, 04 Oct 2022 14:41:28 GMT</pubDate><content:encoded><![CDATA[<h1 id="symptoms">Symptoms</h1>

<p>No network access from the WSL to the Internet. Both domain and IP based ping commands failed. Other advices from the Internet does not help. Newly installed distro from the Store has same problems as well.  </p>

<h1 id="cureinmycaseatleast">Cure (in my case at least)</h1>

<ol>
<li>Backup distros you need (<a href="http://www.butenkoms.space/wsl2-backup-and-restore/">See Backup section</a>)  </li>
<li>Uninstall an each installed distro  </li>
<li>Go to Apps -> Programs and Features -> Turn Windows features on or off, make a screenshots of the current state and ensure next features unchecked: <br>
<ol><li>Virtual Machine Platform (Since it was on my Windows Home)</li>
<li>Windows Hypervisor Platform (might be required if was in use)</li>
<li>All Hyper-V related features maybe (in order of Windows Pro)</li>
<li>Windows Projected File System</li>
<li>Windows Subsystem for Linux</li></ol></li>
<li>Turn off your PC and then turn in on. Preffered than Reset in order to trully reset thirdparty hardware like network controllers (Wi-Fi/Ethernet)  </li>
<li>Reset your network settings: <br>
<ol><li>Run CMD as an Admin and execute commands from the "Network Reset Commands" section bellow</li>
<li>Hit "Windows" key, type "Network reset" and hit "Enter". Click "Reset now" button.</li></ol></li>
<li>Turn off your PC and then turn in on  </li>
<li>Go to Store and install not required distro (Debian in my case since I'm using a Ubuntu) <br>
<ol><li>Start distro from the Store by clicking an appropriate button</li>
<li>Ensure that ping is working properly</li></ol></li>
<li>Restore previously backupped distros (<a href="http://www.butenkoms.space/wsl2-backup-and-restore/">See Restore section</a>)</li>
</ol>

<h2 id="networkresetcommands">Network Reset Commands</h2>

<pre><code class="language-bash">ipconfig /flushdns (Clear the dns cache)  
nbtstat -RR (release and refresh NetBIOS names)  
netsh int ip reset (reset ip settings)  
netsh winsock reset (Reset Winsock Catalog)  
netsh interface ip delete arpcache (reset Address Resolution Protocol cache)  
</code></pre>

<h1 id="sources">Sources</h1>

<p><a href="https://www.tenforums.com/network-sharing/130063-err_name_not_resolved-connect-internet-odd-failure-post1608688.html#post1608688">1</a>,
<a href="https://kb.wisc.edu/helpdesk/page.php?id=70821">2</a></p>]]></content:encoded></item><item><title><![CDATA[WSL2 Backup and Restore]]></title><description><![CDATA[<h1 id="prerequisites">Prerequisites</h1>

<pre><code>wsl --list  
</code></pre>

<p>Result:</p>

<pre><code>Windows Subsystem for Linux Distributions:  
Ubuntu20.04LTS (Default)  
Debian  
</code></pre>

<p>We will work with <code>Ubuntu20.04LTS</code></p>

<h1 id="shutwownwsl">Shutwown WSL</h1>

<pre><code>wsl --shutdown  
</code></pre>

<h1 id="exportbackupimage">Export (Backup) image</h1>

<p>Template:  </p>

<pre><code>wsl --export &lt;Image Name&gt; &lt;Path to exportable .tar image file&gt;  
</code></pre>

<p>An actual command in my case:  </p>

<pre><code>wsl --export Ubuntu20.</code></pre>]]></description><link>http://www.butenkoms.space/wsl2-backup-and-restore/</link><guid isPermaLink="false">4ec90de7-707f-470d-beb6-93f99101e272</guid><dc:creator><![CDATA[Butenko MS]]></dc:creator><pubDate>Tue, 04 Oct 2022 14:34:08 GMT</pubDate><content:encoded><![CDATA[<h1 id="prerequisites">Prerequisites</h1>

<pre><code>wsl --list  
</code></pre>

<p>Result:</p>

<pre><code>Windows Subsystem for Linux Distributions:  
Ubuntu20.04LTS (Default)  
Debian  
</code></pre>

<p>We will work with <code>Ubuntu20.04LTS</code></p>

<h1 id="shutwownwsl">Shutwown WSL</h1>

<pre><code>wsl --shutdown  
</code></pre>

<h1 id="exportbackupimage">Export (Backup) image</h1>

<p>Template:  </p>

<pre><code>wsl --export &lt;Image Name&gt; &lt;Path to exportable .tar image file&gt;  
</code></pre>

<p>An actual command in my case:  </p>

<pre><code>wsl --export Ubuntu20.04LTS c:\back\Ubuntu20.04LTS.tar  
</code></pre>

<h1 id="importrestoreimage">Import (Restore) image</h1>

<h2 id="importimage">Import image</h2>

<p>Template:  </p>

<pre><code>wsl --import &lt;Image Name&gt; &lt;Directory where you want to store the imported image&gt; &lt;Path to exported .tar image file&gt;  
</code></pre>

<p>An actual command in my case:  </p>

<pre><code>wsl --import Ubuntu20.04LTS c:\WSL_Dir_With_Read_Write_Permissions\Ubuntu20.04LTS c:\back\Ubuntu20.04LTS.tar  
</code></pre>

<p>Distro will be started automatically with a root prompt</p>

<h2 id="setdefaultuser">Set default user</h2>

<ol>
<li>Execute <code>awk -F: '/\/home/ {printf "%s:%s\n",$1,$3}' /etc/passwd</code> and find decimal ID of required user. <code>1000</code> in my case (line <code>my_user_name:1000</code>)  </li>
<li>Enter <code>exit</code> command  </li>
<li>Ensure you are in CMD without Admin privileges and execute <code>wsl --shutdown</code> command  </li>
<li>Launch 'regedit'  </li>
<li>Go to <code>HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss</code>  </li>
<li>Find your distro ID and go to an appropriate subkey  </li>
<li>Ensure value of name 'DefaultUid' and of type 'REG_DWORD' with value data <code>1000</code> with base Decimal  </li>
<li>Close Regedit</li>
</ol>

<h2 id="setdefaultdistro">Set default distro</h2>

<pre><code>wsl --setdefault Ubuntu20.04LTS  
wsl --shutdown  
</code></pre>

<p>Start WSL:  </p>

<pre><code>wsl  
</code></pre>

<p>Ubuntu 20.04 LTS will start with your chosen user prompt</p>

<h1 id="sources">Sources</h1>

<p><a href="https://www.virtualizationhowto.com/2021/01/wsl2-backup-and-restore-images-using-import-and-export/">1</a>,
<a href="https://pureinfotech.com/set-default-distro-wsl2-windows-10/">2</a>,
<a href="https://superuser.com/questions/1566022/how-to-set-default-user-for-manually-installed-wsl-distro">3</a></p>]]></content:encoded></item><item><title><![CDATA[Undocumented iOS. Coroutines with C/C++]]></title><description><![CDATA[<h3 id="problem">Problem</h3>

<p>We have some third-party project (made with C or C++) with syncronos network code which produces big memory consumption by opening a thread on each incomming connection. As result of this behavior, OS kills our application.</p>

<h3 id="theclassicsolutions">The classic solutions</h3>

<p>Actually we have two main different solutions:</p>

<ol>
<li><p>Rewrite this third-party</p></li></ol>]]></description><link>http://www.butenkoms.space/coroutines-on-ios/</link><guid isPermaLink="false">008b9122-7852-4b9b-a1a1-bc7c8e09a42b</guid><category><![CDATA[Development]]></category><category><![CDATA[Software]]></category><category><![CDATA[Undocumented]]></category><category><![CDATA[iOS]]></category><category><![CDATA[C]]></category><category><![CDATA[C++]]></category><category><![CDATA[Cpp]]></category><category><![CDATA[C/C++]]></category><category><![CDATA[coroutines]]></category><category><![CDATA[ucontext]]></category><category><![CDATA[boost.context]]></category><dc:creator><![CDATA[Butenko MS]]></dc:creator><pubDate>Mon, 15 Apr 2019 22:46:14 GMT</pubDate><content:encoded><![CDATA[<h3 id="problem">Problem</h3>

<p>We have some third-party project (made with C or C++) with syncronos network code which produces big memory consumption by opening a thread on each incomming connection. As result of this behavior, OS kills our application.</p>

<h3 id="theclassicsolutions">The classic solutions</h3>

<p>Actually we have two main different solutions:</p>

<ol>
<li><p>Rewrite this third-party project in a callback based asynchronous code. This is a hard way. It needs alot of time for investigation, alot of time for development, alot of time for debugging and alot of time for testing. Also, after this work we will be unable to update this third-party project to a newer version without investin the same amount of resources again.</p></li>
<li><p>We can move from the threads to coroutines and implement coroutine manager and a stack compression code. It need time for development, debugging and testing almost only for a coroutine manager and a stack compression implementation. Ofcourse we still need some time for original sources investigation but only once. Also we will be able to update this third-party project in a future without significant time investment.</p></li>
</ol>

<p>Of course coroutines are preffered.</p>

<h3 id="sowhatswrongwithcoroutinesonios">So what's wrong with coroutines on iOS?</h3>

<p>Usually we can use POSIX <em>ucontext</em> related calls for coroutines implementation. Or <em>fibers</em> on Windows. <br>
The bad thing is that we can't use <em>ucontext</em> related calls on iOS: although they exist in SDK and can be included and calld, their code is not implemented internally at all - those calls are just stubs for returning an error. This behavior is unfortunatelly undocumented in Apple docs.</p>

<h3 id="mmmandwhatcanwedowiththis">Mmm. And what can we do with this?</h3>

<p>Actually solution exists.</p>

<p>In a C++ world, there is a well known library - Boost. <br>
For a C++ project we can use <a href="https://www.boost.org/doc/libs/1_61_0/libs/context/doc/html/index.html">Boost.context</a> which is stated and actually has an iOS support. </p>

<p><em>Boost.coroutine</em> hovewer, does not support iOS at the moment of this post writting.</p>

<h3 id="okwhataboutc">OK. What about C?</h3>

<p>Actually almost the same. <em>Boost.context</em> functions only thanks to several assembly files and a header. We just need to include needed assembly files and a header into our C code build config (and of course include header into our C code sources).</p>

<p>Assembly files are in the folder <br>
<code>src\asm</code>
We are interested in three arm64 related files for <em>macho</em> executable file format (Apple made file format):  </p>

<pre><code>jump_arm64_aapcs_macho_gas.S  
make_arm64_aapcs_macho_gas.S  
ontop_arm64_aapcs_macho_gas.S  
</code></pre>

<p>Header: <br>
<code>include\boost\context\detail\fcontext.hpp</code></p>

<p>Header should be slightly modified to be compatible with C code of course.</p>

<p>For Xcode we just need to drag all needed files into the list of files of our project.</p>]]></content:encoded></item><item><title><![CDATA[Undocumented Python. Sockets. TimeoutError]]></title><description><![CDATA[<p>Both <a href="https://docs.python.org/3/library/socket.html#socket.socket.connect">connect()</a> and <a href="https://docs.python.org/3/library/socket.html#socket.socket.recv">recv()</a> related calls can raise <a href="https://docs.python.org/3/library/exceptions.html#TimeoutError">TimeoutError</a> exception as result of the network cable unplugg on a client side.</p>

<p><em>TimeoutError</em> exception is raised as result of receving 'ETIMEDOUT' socket error which can be generated by <a href="https://linux.die.net/man/3/connect">connect()</a> and <a href="https://linux.die.net/man/3/recv">recv()</a> calls. </p>

<p>It can be raised on a connected socket only</p>]]></description><link>http://www.butenkoms.space/python-3-undocumented-0/</link><guid isPermaLink="false">5a91966e-875a-4fa2-9d63-5e7636440bbd</guid><category><![CDATA[Development]]></category><category><![CDATA[Software]]></category><category><![CDATA[Socket]]></category><category><![CDATA[IO]]></category><category><![CDATA[Python]]></category><category><![CDATA[solution]]></category><category><![CDATA[Undocumented]]></category><category><![CDATA[TimeoutError]]></category><dc:creator><![CDATA[Butenko MS]]></dc:creator><pubDate>Mon, 15 Apr 2019 21:23:59 GMT</pubDate><content:encoded><![CDATA[<p>Both <a href="https://docs.python.org/3/library/socket.html#socket.socket.connect">connect()</a> and <a href="https://docs.python.org/3/library/socket.html#socket.socket.recv">recv()</a> related calls can raise <a href="https://docs.python.org/3/library/exceptions.html#TimeoutError">TimeoutError</a> exception as result of the network cable unplugg on a client side.</p>

<p><em>TimeoutError</em> exception is raised as result of receving 'ETIMEDOUT' socket error which can be generated by <a href="https://linux.die.net/man/3/connect">connect()</a> and <a href="https://linux.die.net/man/3/recv">recv()</a> calls. </p>

<p>It can be raised on a connected socket only (TCP connection for example)</p>

<p>This exception can be raised as result of: <br>
1. network cable unplugged (on a client or/and on a server side) <br>
1. client device power off <br>
1. router power off <br>
1. client application crash or kill <br>
1. etc.</p>

<p>This exception will be raised after a while of the actual cause. Usually after a 10 minutes after the actual client disconnection. Actual timeout is OS dependent.</p>

<p>Incomplete list of Python functions that can raise <em>TimeoutError</em>: <br>
socket.connect, socket.recv, socket.recv_into</p>

<p>Also, I believe, asyncio corresponding functions are inherit the same behavior.</p>

<p>I've encountered this exception in my <a href="https://github.com/FI-Mihej/FI-ASockIOCore">ASockIOCore</a> during the testing phase: as result of the network cable unplugging on a client side.</p>

<h6 id="conclusion">Conclusion:</h6>

<p>During the development I've not realized that Python documentation can lack a such kind of crucial information. It would be nice to add to the description of each function, a complete list of exceptions that can be raised by this function.</p>]]></content:encoded></item><item><title><![CDATA[Learn Clojure/ClojureScript in a few days. True story!]]></title><description><![CDATA[<p>To be precise, less than two days of the initial investigation before I started writing code. And you can too.</p>

<p>Of course you will not become an expert of any kind, but you can learn enough to make real applications like this: <a href="https://github.com/FI-Mihej/English-Checkers-Web-App">English Checkers Web App</a>. Also you need to</p>]]></description><link>http://www.butenkoms.space/learn-clojure-clojurescript-in-a-few-days-true-story/</link><guid isPermaLink="false">419435c5-3d87-4b70-a61b-9b9160037a11</guid><category><![CDATA[Development]]></category><category><![CDATA[Software]]></category><category><![CDATA[solution]]></category><category><![CDATA[tutorial]]></category><category><![CDATA[Clojure]]></category><category><![CDATA[ClojureScript]]></category><category><![CDATA[Web]]></category><dc:creator><![CDATA[Butenko MS]]></dc:creator><pubDate>Sun, 11 Sep 2016 13:25:17 GMT</pubDate><media:content url="http://www.butenkoms.space/content/images/2016/09/screencapture-Clojure-EnglishCheckersWebApp-GitHub-repo-2---cropped---1233x636.png" medium="image"/><content:encoded><![CDATA[<img src="http://www.butenkoms.space/content/images/2016/09/screencapture-Clojure-EnglishCheckersWebApp-GitHub-repo-2---cropped---1233x636.png" alt="Learn Clojure/ClojureScript in a few days. True story!"><p>To be precise, less than two days of the initial investigation before I started writing code. And you can too.</p>

<p>Of course you will not become an expert of any kind, but you can learn enough to make real applications like this: <a href="https://github.com/FI-Mihej/English-Checkers-Web-App">English Checkers Web App</a>. Also you need to have development background in some other languages.</p>

<p><em>Actually, I do not know who will read my article. Therefore, in some places I can give even basic information for beginners. For example, for those people who is beginner in some particular tool.</em></p>

<h1 id="sowhatallofthisisfor">So what all of this is for?</h1>

<p>In short:</p>

<ul>
<li><p><em>Clojure</em>. Is good for Java developers: less code, easier concurrency, etc.</p></li>
<li><p><em>ClojureScript</em>. Is great for Web as a substitute for the JavaScript for the projects with complex logic. Just because its concurrency design, its functional essence, its tools for the Web development, because it is easy to learn and to use ClojureScript even by the developer who is accustomed to the imperative programming. And because you may use same code on both server and client side, using great JVM with Java libs instead of the NodeJS on the background. If you want of cource.</p></li>
</ul>

<h1 id="firstofall">First of all</h1>

<p>First of all, you need a task. I came across a good task and I’ll share it. You can see (and download) it here – at initial commit of one of my GitHub repositories: <a href="https://github.com/FI-Mihej/English-Checkers-Web-App/tree/6905a5b59c2b9426a1ffbce7e989e8122492596f">https://github.com/FI-Mihej/English-Checkers-Web-App/tree/6905a5b59c2b9426a1ffbce7e989e8122492596f</a> . There is enough information in the Readme to start the research. And the skeleton of a simple but working project greatly simplifies matters. But it is still painful sometimes. So I decided to share my experience. About some sharp edges.</p>

<h1 id="nextideoreditor">Next. IDE or Editor</h1>

<h2 id="lighttable">Light Table</h2>

<p>Yes, there is a <em>LightTable</em> (<em>LT</em>) around. It has definitely beautiful yet simple design. And there is Clojure plugin for LighTable. But. But <em>LT</em> can be really annoying: it even can’t “just highlight” word occurrences in the file, for example. Even some common “find” was introduced only after a few years (!) from the first public opening. And it is just the natural way of that tool. Code investigation with this tool will be big pain. REPL built in to editor? Ha! You may use dozens of another Clojure REPL implementations: Web apps, REPL started on your machine and used from your own browser, console apps, etc. Also I’m installing all my soft to secured locations like Program Files and <em>LT</em> just could not start its own REPL from those location…</p>

<h2 id="visualstudiocode">Visual Studio Code</h2>

<p>Instead I recommend <em>Visual Studio Code</em> (<em>VSC</em>). It has built in Clojure support (it’s not like <em>PyCharm</em> or real <em>Visual Studio</em> of course, but really better than <em>Windows® Notepad</em> or <em>LT</em>). Also I recommend to install one of “Join line” add-ons: it will be really handy to join line with for example <code>Ctrl+J</code> (and you will do line joins frequently). <br>
So in my future talk will mention <em>Visual Studio Code</em> when it goes to code writing.</p>

<h2 id="andyesaboutthecodewriting">And yes – about the code writing</h2>

<p>Clojure is like a Lisp. So be prepared to (())))((()() to biiig amount of ())(()))(((()))). :) And all those brackets need a tool to not be painful in the work. An there is a such tool in <em>VSC</em>: you just need to select some text and click ‘(‘ button, or ‘[‘ button, or ‘{‘ button. And voila: <em>VSC</em> will turn the text into the brackets! Believe me - you will understand why I so like this feature. But I’ll talk about it later. And now some</p>

<h3 id="fewsmalltips">Few small tips:</h3>

<p>Try to tend to select text from the end rather than from the beginning: there are always big tail of closing brackets at the end of the expression and it is difficult to remember the exact closing bracket while you selecting  the text (in contrast to the opening bracket).</p>

<p>It is handy to use split screen in <em>VSC</em>: you may use second “window” (it is not really window – it rather panel, but still…) to find through some distant parts of file you currently working on (“find” is the second windows is independent of “find” of your main window). Or you may use it as a some kind of constant viewer of some distant data structure, etc.</p>

<h2 id="anotherimportantthinggitandwindows">Another important thing. Git and Windows</h2>

<p>If you are using Windows and some antivirus tool – than you already know that Git is slow and GUI tools for Git are even slower. <em>VSC</em>, unfortunately is no exception. If you will open folder with Git repo, <em>VSC</em>, as well as other Git GUIs, will start dozen of Git instances. Actually <em>VSC</em> is faster than for example <em>SourceTree</em> (in a few times), but still slow: 30 and more seconds of 100% CPU load after each file saving is not really pleasant. It is better to leave Git to the command line or to the quality tools like <em>SmartGit</em>.</p>

<p>So let’s go! To turn off Git support in <em>VSC</em> you will need to do:</p>

<ul>
<li><p>Go to File->Preferences->User_Settings. It will open who panels/windows. Left – is a template for all available settings (with their defaults). And Right – your own settings. It may be empty if it is the first time you’ll opened it. Format is JSON. So place all settings in the already available ‘{‘ brackets (see left panel for example). Left panel is searchable by the way (so you may just search for ‘git’ word and skip to the next article section).</p></li>
<li><p>Place <code>"git.enabled": false</code>, into the right panel, save it (while focus in on the right panel), close settings and restart <em>VSC</em>.</p></li>
</ul>

<h1 id="clojureandclojurescript">Clojure and ClojureScript</h1>

<p>You may google about it by yourself, so I will just mention things important for fast learning.</p>

<h2 id="repl">REPL</h2>

<p>To be able to experiment with following code immediately, I recommend to use one of online REPL. Just google <code>clojure repl online</code> or/and <code>clojurescript repl online</code>.</p>

<h2 id="language">Language</h2>

<p>ClojureScript is some kind of subset of Clojure. So ClojureScript tutorials can be used to learn Clojure as well. And some Clojure parts will not work in ClojureScript, but they are easy to identify by trying them (in REPL for example) and by google them. So</p>

<h3 id="fewbasicthingstobeginwith">Few basic things to begin with</h3>

<h4 id="firstofall">First of all</h4>

<p>First of all, as I already mention, Clojure is like Lisp. So it is using S-expression: <br>
<code>(+ 2 3)</code> will return 5 and <code>(str 42)</code> will return string “42”. It is obvious. But it is possible to miss that <code>(+ 2 4 1 14)</code> is also possible (and it will return 21) as well as <code>(str 12 4 53)</code> (will return string “12453”) and <code>(+ "Hello " "my " "world " (str 42) "!")</code> (will return string “Hello my world 42!”).</p>

<h4 id="next">Next:</h4>

<p>“How can I see the program flow?”</p>

<p>You can use <code>(print )</code> (<a href="https://clojuredocs.org/clojure.core/print">docs: print</a>)  and <code>(println )</code> (<a href="https://clojuredocs.org/clojure.core/println">docs: println</a>) functions. For example <code>(println "This is my-var value: " my-var " ;")</code> will print value of some <code>my-var</code> variable. In the ClojureScript your ‘print’ output will go to the browser console (<code>F12</code> and so on). And it is turned off by default. To make <code>(print )</code> and <code>(println )</code> available in your ClojureScript app, you’ll need to turn it on using <code>(enable-console-print!)</code> expression, as is done here on the fifth line of the code: <a href="https://github.com/FI-Mihej/English-Checkers-Web-App/blob/6905a5b59c2b9426a1ffbce7e989e8122492596f/src/lg_checkers/board.cljs">board.cljs</a>. OK? OK. <br>
But how to inject ‘println’ into another functions in the functional language? And this is the</p>

<h4 id="thirdpossiblequestion">Third possible question:</h4>

<p>“How the hell to evaluate few independent expressions in order, one after another without calling one from within another in idiomatic way?”</p>

<p>There is special operator for this purpose: <code>(do )</code> <a href="https://clojuredocs.org/clojure.core/do">docs: do</a> operator. <br>
For example:</p>

<pre><code class="language-clojure">(do
  (send-something-to-some-server)
  (println “Send - Done”)
  (if (&gt; 3 0) 35 0))
</code></pre>

<p>will send something to some server, print “Send – Done”, and whole <code>(do )</code> expression will return 35 to the calling code (because 3 is greater than 0)</p>

<h3 id="documentationandtutorials">Documentation and tutorials</h3>

<p>As I already mention, you may use <em>ClojureScript</em> tutorials to learn <em>Clojure</em>. But you should remember that ClojureScript is running on top of JavaScript (which is dynamically typed), and Clojure is running on top of JVM (which is statically typed). So sometimes ClojureScript rules are not so strict as in the Clojure.</p>

<p>To start you can read this ClojureScript tutorial (at least the first half - which is responsible for the language description): <a href="https://www.niwi.nz/cljs-workshop/">https://www.niwi.nz/cljs-workshop/</a> </p>

<p>Quick and easy overview of Clojure built in functions by category: <a href="http://clojure.org/api/cheatsheet">http://clojure.org/api/cheatsheet</a> . <br>
Same for the ClojureScript: <a href="http://cljs.info/cheatsheet/">http://cljs.info/cheatsheet/</a> .</p>

<p>Clojure specifications can be seen here: <a href="http://clojure.org/reference/documentation">http://clojure.org/reference/documentation</a> <br>
Most valuable topics for our purpose are: </p>

<ul>
<li><p><a href="http://clojure.org/reference/reader">http://clojure.org/reference/reader</a> - about language basics</p></li>
<li><p><a href="http://clojure.org/reference/data_structures">http://clojure.org/reference/data_structures</a> - about numbers, strings, lists, maps, etc.</p></li>
<li><p><a href="http://clojure.org/reference/special_forms">http://clojure.org/reference/special_forms</a> - about defining variables, functions; about ‘if’ and ‘do’ operators; and about other important things.</p></li>
<li><p><a href="http://clojure.org/reference/vars">http://clojure.org/reference/vars</a> - about changing already defined variables (it is not just <code>my-var = 5</code> !)</p></li>
<li><p><a href="http://clojure.org/reference/atoms">http://clojure.org/reference/atoms</a> - you’ll be writing concurrent programs with Clojure or/and ClojureScript so you’ll need it.</p></li>
</ul>

<p>And also there is nice DOCs site with a handy search: <a href="https://clojuredocs.org">https://clojuredocs.org</a> . You may use it if you need to get reference to for example “do” operator.</p>

<p>After that you may check out next stuff:</p>

<ul>
<li><p><a href="http://clojure.org/community/resources">http://clojure.org/community/resources</a> </p></li>
<li><p><a href="http://clojurescript.org/reference/documentation">http://clojurescript.org/reference/documentation</a> </p></li>
<li><p><a href="https://github.com/magomimmo/modern-cljs">https://github.com/magomimmo/modern-cljs</a> </p></li>
</ul>

<h1 id="andintheend">And in the end</h1>

<p>That’s all for today. Now everything depends on you. Good luck!</p>

<p>Next time I’ll talk about <a href="https://github.com/tonsky/datascript">DataScript</a> – in-memory DB which works inside the browser (inside your Web App) and naturally supports complicated queries.</p>]]></content:encoded></item><item><title><![CDATA[Async Socket IO Core. Open source now.]]></title><description><![CDATA[<p><strong>ASockIOCore</strong>. Robust (even more robust than asyncio - see tests results), fast and simple to use async socket IO core in Python + Cython (few modules). It has the same speed as <strong>asyncio</strong> module but slightly different purpose. And asyncio a low level library in comparison with ASockIOCore.</p>

<p>More information on</p>]]></description><link>http://www.butenkoms.space/async-socket-io-core-open-source-now/</link><guid isPermaLink="false">ada9e2dc-2a61-4fe1-b1d9-360ba82a1fd3</guid><category><![CDATA[Development]]></category><category><![CDATA[Software]]></category><category><![CDATA[Release]]></category><category><![CDATA[Python]]></category><category><![CDATA[Library]]></category><category><![CDATA[Async]]></category><category><![CDATA[IO]]></category><category><![CDATA[Socket]]></category><category><![CDATA[Open Source]]></category><category><![CDATA[GPLv3]]></category><dc:creator><![CDATA[Butenko MS]]></dc:creator><pubDate>Sun, 03 Jul 2016 13:06:40 GMT</pubDate><content:encoded><![CDATA[<p><strong>ASockIOCore</strong>. Robust (even more robust than asyncio - see tests results), fast and simple to use async socket IO core in Python + Cython (few modules). It has the same speed as <strong>asyncio</strong> module but slightly different purpose. And asyncio a low level library in comparison with ASockIOCore.</p>

<p>More information on <a href="https://github.com/FI-Mihej/FI-ASockIOCore">https://github.com/FI-Mihej/FI-ASockIOCore</a></p>]]></content:encoded></item><item><title><![CDATA[My compiler to and decompiler from Unreal Engine 3 bytecode. Announcement]]></title><description><![CDATA[I made UE3 compiler and decompiler with a handy utilities set.]]></description><link>http://www.butenkoms.space/my-compiler-to-and-decompiler-from-unreal-engine-3-bytecode-announcement/</link><guid isPermaLink="false">ae1105ba-dc9f-4d6f-b55b-a316ea92bf6a</guid><category><![CDATA[Development]]></category><category><![CDATA[Software]]></category><category><![CDATA[Python]]></category><category><![CDATA[PyPy3]]></category><category><![CDATA[Compiler]]></category><category><![CDATA[Decompiler]]></category><category><![CDATA[Tools Set]]></category><category><![CDATA[bytecode]]></category><category><![CDATA[UE3]]></category><category><![CDATA[Unreal Engine 3]]></category><category><![CDATA[Modding]]></category><category><![CDATA[Announcement]]></category><category><![CDATA[Release]]></category><dc:creator><![CDATA[Butenko MS]]></dc:creator><pubDate>Thu, 21 Jan 2016 10:35:55 GMT</pubDate><content:encoded><![CDATA[<blockquote>
  <p>I was going to write a post later. But I replied to a message and then made a <a href="http://forums.nexusmods.com/index.php?/topic/3706140-ue3-compiler-announcement/">topic</a> at the nexusmods.com forums anyway. So... </p>
</blockquote>

<p>I made UE3 compiler and decompiler with a handy utilities set. Part of the utilities are using <a href="https://github.com/wghost/UPKUtils">UPKTools</a> as a backend (thanks to <a href="http://forums.nexusmods.com/index.php?/user/905332-wghost81/">wghost81</a> for a such good tool set!).</p>

<p>I'll release it soon. So no more problems with integers or floats, etc. anymore. </p>

<h2 id="exampletokens">Example tokens:</h2>

<ul>
<li><strong>float</strong>: FloatConst(("0.4059738695"))</li>
<li><strong>integer</strong>: IntConst(("2325839"))</li>
<li><strong>integer HEX</strong>: IntConst((09 0f 04 a0))</li>
<li><strong>string</strong>: StringConst(("色の良いセット Ывдлфо адЦыфо у sljf aeOirJa rfjh "))</li>
<li><strong>auto label</strong>: @to_label(35)</li>
<li><strong>named label</strong>: @to_label("Script Ret")</li>
</ul>

<p>Code between /<em>DESCRIPTION_BEGIN</em>/ and /<em>DESCRIPTION_END</em>/ tags is for a dev-helping purposes and ignored by a compiler.</p>

<h2 id="exampleofformattedcode">Example of formatted code:</h2>

<p><img src="http://www.butenkoms.space/content/images/2016/01/UCB-Original-Source-Code-Example.png" alt="Example of formatted code"></p>

<h2 id="exampleofthedescriptionpartofdecompiledcode">Example of the Description part of decompiled code:</h2>

<p><img src="http://www.butenkoms.space/content/images/2016/01/UCB-Source-Code-Example-1.png" alt="Example of the Description part of decompiled code"></p>

<h2 id="examplemod">Example mod:</h2>

<p>Using this compiler I made <a href="http://www.nexusmods.com/xcom/mods/663/?">http://www.nexusmods.com/xcom/mods/663/?</a>. You may use it as an example. <br>
Source code you can see and download here: <br>
<a href="https://github.com/FI-Mihej/Realistic-Damage-Model-mod-for-Long-War">Realistic Damage Model</a></p>

<ul>
<li><a href="https://github.com/FI-Mihej/Realistic-Damage-Model-mod-for-Long-War/blob/master/Release/Universal/UCB%20Source%20Code/XComGame.XGAbility_Targeted.RollForHit.ucb">Diff-installable source code</a></li>
<li><a href="https://github.com/FI-Mihej/Realistic-Damage-Model-mod-for-Long-War/blob/master/Src/Work/LongWar/15f/XComGame.XGAbility_Targeted.RollForHit.ucb">Full function source code</a></li>
</ul>

<p>UCB source code files can be highlighted by <a href="https://github.com/FI-Mihej/UCB-Source-Code-highlighter">UCB Source Code highlighter</a></p>

<h3 id="links">Links:</h3>

<p><a href="http://forums.nexusmods.com/index.php?/topic/3706140-ue3-compiler-announcement/">Topic with discussion on nexusmods' forum</a></p>]]></content:encoded></item><item><title><![CDATA[Realistic Damage Model. Mod for both the original XCOM:EW and the mod Long War]]></title><description><![CDATA[<blockquote>
  <p>The higher the accuracy is – the higher the damage is. But don’t relax: there is always a chance of maximum damage.</p>
</blockquote>

<p>I made <a href="https://github.com/FI-Mihej/Realistic-Damage-Model-mod-for-Long-War">my first game mod</a> with my compiler for Unreal Engine 3 bytecode.</p>

<p>Source code can be seen in the "Src" folder content. And in the .ucb</p>]]></description><link>http://www.butenkoms.space/realistic-damage-model-mod-for-both-the-original-xcom-ew-and-the-mod-long-war/</link><guid isPermaLink="false">f43ea092-0c3f-49e7-afbf-d44f1718d884</guid><category><![CDATA[Development]]></category><category><![CDATA[Modding]]></category><category><![CDATA[bytecode]]></category><category><![CDATA[UE3]]></category><category><![CDATA[Unreal Engine 3]]></category><category><![CDATA[XCOM]]></category><category><![CDATA[XCOM: EW]]></category><category><![CDATA[Long War]]></category><category><![CDATA[Improvement]]></category><category><![CDATA[UCB]]></category><dc:creator><![CDATA[Butenko MS]]></dc:creator><pubDate>Thu, 21 Jan 2016 10:34:48 GMT</pubDate><content:encoded><![CDATA[<blockquote>
  <p>The higher the accuracy is – the higher the damage is. But don’t relax: there is always a chance of maximum damage.</p>
</blockquote>

<p>I made <a href="https://github.com/FI-Mihej/Realistic-Damage-Model-mod-for-Long-War">my first game mod</a> with my compiler for Unreal Engine 3 bytecode.</p>

<p>Source code can be seen in the "Src" folder content. And in the .ucb file inside of "Universal Release" folder.</p>

<p>Formula can be found in the "Notes" folder content.</p>

<p>Charts been made with Matplotlib for Python 3.</p>

<p>Also I can say that Matplotlib's documentation is unfortunately is not very handy to use in some infrequent situations.</p>

<h3 id="links">Links:</h3>

<p><a href="https://github.com/FI-Mihej/Realistic-Damage-Model-mod-for-Long-War/blob/master/README.md">Mod's repository</a></p>

<p><a href="http://www.nexusmods.com/xcom/mods/663/?">Mod's page on Nexusmods</a></p>]]></content:encoded></item><item><title><![CDATA[GPU acceleration in Adobe CC Illustrator is broken on almost all laptops! Shame yourself Adobe and call your developers already!]]></title><description><![CDATA[<p>Me personally and <strong>dozens or maybe even hundreds of thousands of people have the same issue</strong>: they are <mark>already have last GPU drivers from laptop manufacturer</mark> but Illustrator says that <em>"Software drivers of one or more cards are not up-to-date. To use GPU performance, update the software drivers to the</em></p>]]></description><link>http://www.butenkoms.space/adobe-illustrator-gpu-acceleration-is-broken-on-almost-all-laptops-shame-your-self-adobe-and-call-your-developers-already/</link><guid isPermaLink="false">d9ed6f2a-f5c8-46a3-a8c2-a0f544c8d277</guid><category><![CDATA[issue]]></category><category><![CDATA[Adobe]]></category><category><![CDATA[Illustrator]]></category><category><![CDATA[Adobe Illustrator]]></category><category><![CDATA[CC Illustrator]]></category><category><![CDATA[GPU]]></category><category><![CDATA[GPU driver]]></category><category><![CDATA[GPU acceleration]]></category><category><![CDATA[poor software design]]></category><dc:creator><![CDATA[Butenko MS]]></dc:creator><pubDate>Sun, 13 Dec 2015 15:36:21 GMT</pubDate><content:encoded><![CDATA[<p>Me personally and <strong>dozens or maybe even hundreds of thousands of people have the same issue</strong>: they are <mark>already have last GPU drivers from laptop manufacturer</mark> but Illustrator says that <em>"Software drivers of one or more cards are not up-to-date. To use GPU performance, update the software drivers to the latest version, and then restart Illustrator"</em>.</p>

<h2 id="whythisishappens">Why this is happens?</h2>

<p>Simple: <br>
Illustrator tries to check is user have the last GPU driver by comparing drivers versions: version of installed driver with version of the last <mark>generic driver</mark> available online. <br>
But. Laptops are like mobile phones: manufacturer modifies generic drivers provided by Intel, nVidia, AMD to be compatible with custom hardware of specific laptop model. In the result, last versions of generic drivers just are not compatible and can't be installed on the laptop. <br>
<em>Thanks to <a href="https://forums.adobe.com/people/butz">butz</a> for info: <a href="https://forums.adobe.com/message/7773402#7773402">Re: When I start illustrator, I get a message that my graphics card drivers are not up to date</a>.</em></p>

<h2 id="apossiblesolutionsoftheproblem">A possible solutions of the problem:</h2>

<ol>
<li><strong>Simple</strong>: Illustrator should not check drivers. And just run without any tests. That's all. Simple. But it can be used only as a fast fix for a no more than for a couple of weeks.  </li>
<li><strong>Good</strong>: Illustrator should use good well-known practice of software industry. It shouldn't try to check versions of the drivers. It should test for the presence of the required feature itself. And then use available features. <br>
<mark>To be more convincing for non-technical professionals</mark> I quote from the MSDN (official Microsoft Developers Network Portal): 


<blockquote>
  <em>"Identifying the current operating system is usually not the best way to determine whether a particular operating system feature is present. This is because the operating system may have had new features added in a redistributable DLL. Rather than using the Version API Helper functions to determine the operating system platform or version number, test for the presence of the feature itself."</em> <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms724832(v=vs.85).aspx">Operating System Version (Windows)</a></blockquote></li>
  </ol>
  <h2 id="alistofsomeopentopicsonthissubject">A list of <em>some</em> open topics on this subject:</h2>


<ol>
<li><a href="http://www.butenkoms.space/adobe-illustrator-gpu-acceleration-is-broken-on-almost-all-laptops-shame-your-self-adobe-and-call-your-developers-already/">When I start illustrator, I get a message that my graphics card drivers are not up to date.</a> <br>
Created: <em>08.07.2015 12:34</em> <br>
Views as on December 13, 2015: <strong><em>7915</em></strong> <br>
State: <em>not resolve</em>d  </li>
<li><a href="http://www.butenkoms.space/adobe-illustrator-gpu-acceleration-is-broken-on-almost-all-laptops-shame-your-self-adobe-and-call-your-developers-already/">GPU Acceleration disabled since today with the 2015.2 update</a> <br>
Created: <em>01.12.2015 16:45</em> <br>
Views as on December 13, 2015: <strong><em>456</em></strong> <br>
State: <em>not resolved</em>  </li>
<li><a href="http://www.butenkoms.space/adobe-illustrator-gpu-acceleration-is-broken-on-almost-all-laptops-shame-your-self-adobe-and-call-your-developers-already/">Illustrator GPU acceleration not working</a> <br>
Created: <em>12.12.2015 2:47</em> <br>
Views as on December 13, 2015: <strong><em>76</em></strong> <br>
State: <em>not resolved</em>  </li>
<li><a href="http://www.butenkoms.space/adobe-illustrator-gpu-acceleration-is-broken-on-almost-all-laptops-shame-your-self-adobe-and-call-your-developers-already/">Illustrator Issues after the adobe updates</a> <br>
Created: <em>08.12.2015 17:05</em> <br>
Views as on December 13, 2015: <strong><em>133</em></strong> <br>
State: <em>not resolved</em>  </li>
<li><a href="http://www.butenkoms.space/adobe-illustrator-gpu-acceleration-is-broken-on-almost-all-laptops-shame-your-self-adobe-and-call-your-developers-already/">GPU Acceleration don't activate</a> <br>
Created: <em>21.10.2015</em> <br>
Views as on December 13, 2015: <strong><em>64</em></strong> <br>
State: <em>not resolved</em></li>
</ol>

<p><a href="https://forums.adobe.com/message/8291315">My original post on Adobe forum</a></p>]]></content:encoded></item><item><title><![CDATA[PyPy3 + pickle + lzma = slowness. Solution.]]></title><description><![CDATA[How to handle  lzma+pickle performance issue under PyPy3]]></description><link>http://www.butenkoms.space/pypy3-pickle-and-lzma/</link><guid isPermaLink="false">5d3eef49-be45-455f-9c9e-1db2d3c0ca90</guid><category><![CDATA[Development]]></category><category><![CDATA[Python]]></category><category><![CDATA[PyPy3]]></category><category><![CDATA[PyPy3 2.4.0]]></category><category><![CDATA[Software]]></category><category><![CDATA[Practice]]></category><category><![CDATA[pickle]]></category><category><![CDATA[lzma]]></category><category><![CDATA[performance]]></category><category><![CDATA[issue]]></category><category><![CDATA[solution]]></category><dc:creator><![CDATA[Butenko MS]]></dc:creator><pubDate>Fri, 11 Dec 2015 01:59:00 GMT</pubDate><content:encoded><![CDATA[<h2 id="initialdata">Initial data:</h2>

<pre><code class="language-python">        with lzma.open(file_name, 'rb') as file:
            data = pickle.load(file)
</code></pre>

<ul>
<li>40Mb file</li>
<li>90000 of objects inside the file</li>
<li>File created by CPython-optimized code</li>
</ul>

<h2 id="problem">Problem:</h2>

<p>This code needs only 6.43s when launched under CPython, but in needs <strong>more than 5min</strong> to complete under PyPy3 (in fact, I did not even wait for the end: I just shut it down after 5 minutes of running)!</p>

<h2 id="solution">Solution:</h2>

<pre><code class="language-python">        with lzma.open(file_name, 'rb') as file:
            raw_data = file.read()
            data = pickle.loads(raw_data)
</code></pre>

<p>This code needs 6.35s when launched under CPython and 39s under PyPy (of which 36s is spent on <em>pickle.loads()</em> ).</p>

<p>Also recreating file under PyPy is not the case:</p>

<ul>
<li>this is a very slow operation (82s for <em>pickle.dumps()</em> and 74s for <em>file.write()</em> );</li>
<li>it leads to slightly slower reading (54s for <em>pickle.loads()</em> ) under PyPy.</li>
</ul>

<h2 id="conclusions">Conclusions:</h2>

<p>It is good to prepare pickled data under CPython.</p>]]></content:encoded></item></channel></rss>