<?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: AndreiKeino</title>
    <description>The latest articles on DEV Community by AndreiKeino (@andreikeino).</description>
    <link>https://dev.to/andreikeino</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1017845%2F3511fa1d-7a62-46e0-a1e5-72d6cad02e87.png</url>
      <title>DEV Community: AndreiKeino</title>
      <link>https://dev.to/andreikeino</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/andreikeino"/>
    <language>en</language>
    <item>
      <title>Just published a website with the Constant State Detection Algorithm implementation.</title>
      <dc:creator>AndreiKeino</dc:creator>
      <pubDate>Wed, 28 Oct 2026 02:21:28 +0000</pubDate>
      <link>https://dev.to/andreikeino/just-published-a-website-with-the-constant-state-detection-algorithm-implementation-31gf</link>
      <guid>https://dev.to/andreikeino/just-published-a-website-with-the-constant-state-detection-algorithm-implementation-31gf</guid>
      <description>&lt;p&gt;A couple ow days ago I've published a website &lt;br&gt;
with the Constant State Detection Algorithm implementation. &lt;br&gt;
Website itself is made with Python, django &amp;amp;&amp;amp; htmx. &lt;br&gt;
Algorithm implementation is made with C++ &amp;amp;&amp;amp; Cython.&lt;/p&gt;

&lt;p&gt;Website is here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://constant-state-detection-website.onrender.com/constant-state-detection/" rel="noopener noreferrer"&gt;https://constant-state-detection-website.onrender.com/constant-state-detection/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The website can be quite slow as the hosting is free. Also, I can’t promise a good uptime. If you have troubles with accessing it, please let me know.&lt;/p&gt;

</description>
      <category>python</category>
      <category>algorithms</category>
      <category>htmx</category>
      <category>django</category>
    </item>
    <item>
      <title>Constant State Detection in Time Series with Python.</title>
      <dc:creator>AndreiKeino</dc:creator>
      <pubDate>Tue, 20 Oct 2026 04:42:43 +0000</pubDate>
      <link>https://dev.to/andreikeino/constant-state-detection-in-time-series-with-python-504e</link>
      <guid>https://dev.to/andreikeino/constant-state-detection-in-time-series-with-python-504e</guid>
      <description>&lt;h2&gt;
  
  
  Constant State Detection in Time Series with Python.
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/AndreiKeino/constant-state-detection-client" rel="noopener noreferrer"&gt;See this code on Github&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  In this article we will detect constant state section in time series with Python.
&lt;/h2&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://figshare.com/articles/preprint/The_effective_algorithm_for_constant_state_detection_in_time_series_V_2_3_/28375532" rel="noopener noreferrer"&gt;You can take a look at the preprint with the introduction to the algorithm here.&lt;/a&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  We will use the package that requires Python 3.10+
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Installation:
&lt;/h2&gt;

&lt;p&gt;Recommended:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Create a virtual environment.
&lt;/h3&gt;

&lt;p&gt;
For Linux: execute the console command
&lt;/p&gt;

&lt;p&gt;
&lt;b&gt;python3 -m venv your_path_to_new_virtual_environment&lt;/b&gt;
&lt;/p&gt;

&lt;p&gt;
for other operating system there could be different command(s)
&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Activate it.
&lt;/h3&gt;

&lt;p&gt;
For Linux: execute the console command
&lt;/p&gt;

&lt;p&gt;
&lt;b&gt;source your_path_to_new_virtual_environment/bin/activate&lt;/b&gt;
&lt;/p&gt;

&lt;p&gt;
for other operating system there could be different command(s)
&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Install the package.
&lt;/h3&gt;

&lt;p&gt;
execute the console command
&lt;/p&gt;

&lt;p&gt;
&lt;b&gt;pip install csd-algo
&lt;/b&gt;&lt;/p&gt;
&lt;b&gt;
&lt;h3&gt;
  
  
  Quick check if it is working
&lt;/h3&gt;

&lt;/b&gt;&lt;p&gt;
now execute the console command
&lt;/p&gt;

&lt;p&gt;
&lt;b&gt;python -m csd_algo.usage_example&lt;/b&gt;
&lt;/p&gt;

&lt;p&gt;
If all have been done correctly, you should see the console output and a couple of plots like this:
&lt;/p&gt;

&lt;p&gt;
&lt;b&gt;Example figure:&lt;/b&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkfhloafd5dke6f3lgly2.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkfhloafd5dke6f3lgly2.jpeg" alt="Example figure" width="639" height="479"&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
Now create the &lt;b&gt;&lt;span&gt;github_example.py
&lt;/span&gt;&lt;/b&gt; file  and paste the following code into it:
&lt;/p&gt;



&lt;pre class="highlight python"&gt;&lt;code&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;matplotlib.pyplot&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;plt&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;csd_algo.client_axiliary&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;report_results&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;__version__&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;csd_algo.models&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MAX_CSD_POINTS_FREE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;CSD_Data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  
                    &lt;span class="n"&gt;to_jsonable_dict&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;csd_algo.generate_timeseries_numpy&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;generate_timseries&lt;/span&gt;

&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;close&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;all&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;url_csd_algo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;https://dazzling-faithful-banteng.anvil.app/constant-state-detection&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;

&lt;span class="n"&gt;ts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;float&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;generate_timseries&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
    &lt;span class="n"&gt;MAX_CSD_POINTS_FREE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;tolist&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# process the timeseries with the default settings:
&lt;/span&gt;
&lt;span class="n"&gt;csd_data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;CSD_Data&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;csd_algo_input&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;ts&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
                    &lt;span class="n"&gt;csd_algo_min_window_width&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
                    &lt;span class="n"&gt;csd_algo_max_window_height&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.08&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# send the data to the server and receive the reply
&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url_csd_algo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
                         &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nf"&gt;to_jsonable_dict&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;csd_data&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="c1"&gt;# validate received data
&lt;/span&gt;&lt;span class="n"&gt;out_data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;CSD_Data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;model_validate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;

&lt;span class="c1"&gt;# print and plot the processing results
&lt;/span&gt;&lt;span class="nf"&gt;report_results&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;out_data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
               &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;CSD plot, Algorithm type: postprocessing&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Client version is &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;__version__&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;



&lt;h3&gt;
Save the file and execute the console command
&lt;/h3&gt;

&lt;p&gt;
&lt;b&gt;python github_example.py&lt;/b&gt;
&lt;/p&gt;

&lt;p&gt; 
Now you should see some console output and just one plot like 
the picture above.
&lt;/p&gt;

&lt;p&gt;
After completing and verifying these steps, you can adjust the input data and algorithm parameters to 
&lt;b&gt;test the algorithm implementation&lt;/b&gt; 
according to your requirements.
&lt;/p&gt;

&lt;h3&gt; 
It might be helpful to take a look at the code for the class used as the webservice input data:
&lt;/h3&gt;



&lt;pre class="highlight python"&gt;&lt;code&gt;
&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;CSD_Data&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BaseModel&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
    class to hold the Constant State Detection algorithm data
    #
    values:
    # 
    csd_algo_input: 
        [in] input timeseries 
    # csd_algo_min_window_width: 
        [in] minimal window width
    # csd_algo_max_window_length: 
        [in] maximal window height
    # Algo_Type: 
        [in] AlgorithmType value
    # Window_Height_Type: 
        [in] WindowHeightType value
    # start: 
        [out] list of start constant section series indexes inclusive
    # finish: 
        [out] list of finish constant section series indexes inclusive
    # start_section_series: 
        [out] list of start continuous constant 
        state section indexes inclusive
    # finish_section_series: 
        [out] list of finish continuous constant 
        state section indexes inclusive
    # api_key: 
        [in] reserved for future use
    # csd_algo_info: 
        [out] list of infromation strings
    # csd_algo_warnings: 
        [out] list of warning strings
    # csd_algo_errors: 
        [out] list of error strings
    # 
    see also: 
    https://figshare.com/articles/preprint/The_effective_algorithm_for_constant_state_detection_in_time_series_V_2_3_/28375532?file=56562641

    &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;

    &lt;span class="n"&gt;csd_algo_input&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;float&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;csd_algo_min_window_width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;
    &lt;span class="n"&gt;csd_algo_max_window_height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;float&lt;/span&gt;
    &lt;span class="n"&gt;Algo_Type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;AlgorithmType&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;AlgorithmType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;POSTPROCESSING_V1&lt;/span&gt;
    &lt;span class="n"&gt;Window_Height_Type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;WindowHeightType&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;WindowHeightType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Relative&lt;/span&gt;
    &lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
    &lt;span class="n"&gt;finish&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
    &lt;span class="n"&gt;start_section_series&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
    &lt;span class="n"&gt;finish_section_series&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
    &lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;''&lt;/span&gt;
    &lt;span class="n"&gt;csd_algo_info&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
    &lt;span class="n"&gt;csd_algo_warnings&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
    &lt;span class="n"&gt;csd_algo_errors&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;



&lt;h3&gt;
  
  
  The main parameters here are:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;csd_algo_input: list[float] - this is the timeseries input data for the algorithm&lt;/li&gt;
&lt;li&gt;csd_algo_min_window_width: int - this is the minimal window width input for the algorithm&lt;/li&gt;
&lt;li&gt;csd_algo_max_window_height: float - this is the maximal window height input for the algorithm&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt; 
It is better to leave the parameters Algo_Type and Window_Height_Type values to have their default 
values for the beginning.
&lt;/h3&gt; 



&lt;h3&gt;
If Algo_Type value is set to the AlgorithmType.POSTPROCESSING_V1 value, it means usage of the advanced algorithm which chooses the 'best' constant state section with the minimal height from sections that have the maximal length from one continuous constant state section series.
&lt;/h3&gt;

&lt;h3&gt; 
It might also be helpful to take a look at the code to create the numpy array used for testing:
&lt;/h3&gt;



&lt;pre class="highlight python"&gt;&lt;code&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;generate_timseries&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;float&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;points_cnt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;256&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
                       &lt;span class="n"&gt;periods&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
                       &lt;span class="n"&gt;phi&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;float&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
        function to generate the test timeseries for the 
        constant state detection algorithm demo. returns the 
        float numpy arrray with the sin(x) + b * sin(2 * x + phi)
        sum of the first and the second harmonic inside.

        input parameters:
        * b - float, the value of the second harmonic
        * points_cnt - int, the count of the points in the output array
        * periods - int, the period count of the first harmonic
        * phi - float, the phase of the second harmonic in the 
         PI * radians, 
        &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;

        &lt;span class="n"&gt;points&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;periods&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;points_cnt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;phase&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;phi&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pi&lt;/span&gt;
        &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;arange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;points&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;2.0&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pi&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;periods&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;points&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;sin2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;4.0&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pi&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;periods&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;points&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;phase&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;sin2&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;



&lt;h3&gt; Using these definitions, one can easily test the algorithm with 
one's own input data; for example load them from a file, just don't forget about the MAX_CSD_POINTS_FREE input point count restriction.
&lt;/h3&gt;

&lt;h1&gt;
    Important note: Unfortunately, I can't guarantee at the moment that the webservice will work with the good uptime 
    and response time, as this is just a free test version of the webservice. 
    There might be times when the webservice will be inaccessible for hours, maybe even for days. 
&lt;/h1&gt;



</description>
      <category>algorithms</category>
      <category>python</category>
      <category>web</category>
    </item>
    <item>
      <title>Will Mojo language ever be cross-platform?</title>
      <dc:creator>AndreiKeino</dc:creator>
      <pubDate>Sun, 21 Jun 2026 02:57:04 +0000</pubDate>
      <link>https://dev.to/andreikeino/will-mojo-language-ever-be-cross-platform-8hb</link>
      <guid>https://dev.to/andreikeino/will-mojo-language-ever-be-cross-platform-8hb</guid>
      <description>&lt;p&gt;Actually I like the idea of Mojo language. Python-like, JIT and AOT support, manual memory management. But it can be run only on macOS &amp;amp;&amp;amp; Linux. I wouldn't even try it until it will support Windows. Android &amp;amp;&amp;amp; iOS support is highly desirable also. &lt;br&gt;
&lt;strong&gt;What do you think?&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>mojo</category>
    </item>
    <item>
      <title>playground demo website on a free hosting for &lt;&lt;The effective algorithm for constant state detection in time series&gt;&gt; article</title>
      <dc:creator>AndreiKeino</dc:creator>
      <pubDate>Sat, 29 Mar 2025 11:36:05 +0000</pubDate>
      <link>https://dev.to/andreikeino/playground-demo-website-on-a-free-hosting-for-the-effective-algorithm-for-constant-state-4n3o</link>
      <guid>https://dev.to/andreikeino/playground-demo-website-on-a-free-hosting-for-the-effective-algorithm-for-constant-state-4n3o</guid>
      <description>&lt;p&gt;Hello, &lt;br&gt;
Just published playground demo website on a free hosting for &amp;lt;
detection in time series&amp;gt;&amp;gt; article. You can test the algorithm on this website and see how it works.&lt;/p&gt;

&lt;p&gt;Playground url:&lt;br&gt;
&lt;a href="http://andreikeino.somee.com/" rel="noopener noreferrer"&gt;http://andreikeino.somee.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Article abstract:&lt;br&gt;
The article introduces a simple and effective algorithm for constant state detection in the time series. &lt;br&gt;
The algorithm, based on the sliding window of variable length, finds all the sections of the time series &lt;br&gt;
which have length greater or equal than some given minimal length and have difference between maximal and &lt;br&gt;
minimal value in the section less or equal than some given value. It is shown that the computational &lt;br&gt;
complexity of the aforementioned algorithm is O(N log N), where N is the length of time series.&lt;/p&gt;

&lt;p&gt;Article url: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://figshare.com/articles/preprint/The_effective_algorithm_for_constant_state_detection_in_time_series_V_2_3_/28375532?file=52535228" rel="noopener noreferrer"&gt;https://figshare.com/articles/preprint/The_effective_algorithm_for_constant_state_detection_in_time_series_V_2_3_/28375532?file=52535228&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv9dvbe4dqdzipa9o06po.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv9dvbe4dqdzipa9o06po.jpg" alt="Image description" width="800" height="568"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>algorithms</category>
    </item>
    <item>
      <title>[Boost]</title>
      <dc:creator>AndreiKeino</dc:creator>
      <pubDate>Thu, 20 Feb 2025 01:37:19 +0000</pubDate>
      <link>https://dev.to/andreikeino/-2l2n</link>
      <guid>https://dev.to/andreikeino/-2l2n</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/andreikeino" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1017845%2F3511fa1d-7a62-46e0-a1e5-72d6cad02e87.png" alt="andreikeino"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/andreikeino/the-effective-algorithm-for-constant-state-detection-in-time-series-2doo" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;The effective algorithm for constant state detection in time series&lt;/h2&gt;
      &lt;h3&gt;AndreiKeino ・ Feb 9&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#algorithms&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>algorithms</category>
    </item>
    <item>
      <title>The effective algorithm for constant state detection in time series</title>
      <dc:creator>AndreiKeino</dc:creator>
      <pubDate>Sun, 09 Feb 2025 05:20:53 +0000</pubDate>
      <link>https://dev.to/andreikeino/the-effective-algorithm-for-constant-state-detection-in-time-series-2doo</link>
      <guid>https://dev.to/andreikeino/the-effective-algorithm-for-constant-state-detection-in-time-series-2doo</guid>
      <description>&lt;p&gt;Hello, &lt;br&gt;
updated description of my effective algorithm for constant state detection in time series is here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://figshare.com/articles/preprint/The_effective_algorithm_for_constant_state_detection_in_time_series_V_2_3_/28375532?file=52219271" rel="noopener noreferrer"&gt;https://figshare.com/articles/preprint/The_effective_algorithm_for_constant_state_detection_in_time_series_V_2_3_/28375532?file=52219271&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The effective algorithm for constant state detection in time series.&lt;/p&gt;

&lt;p&gt;The article introduces simple and effective algorithm for constant state detection in time series. The algorithm, based on sliding window of variable length, searches a sections of time series with some given minimal length, that have all the values in some given range. It is shown that the computational complexity of aforementioned algorithm is O(N log N), where N is the length of time series.&lt;/p&gt;

&lt;p&gt;Thank you,&lt;/p&gt;

&lt;p&gt;Andrei Keino&lt;/p&gt;

</description>
      <category>algorithms</category>
    </item>
    <item>
      <title>Camex (Computational Applied Mathematics EXamples) project on github.</title>
      <dc:creator>AndreiKeino</dc:creator>
      <pubDate>Sat, 18 Feb 2023 04:03:10 +0000</pubDate>
      <link>https://dev.to/andreikeino/camex-computational-applied-mathematics-examples-project-on-github-4ibc</link>
      <guid>https://dev.to/andreikeino/camex-computational-applied-mathematics-examples-project-on-github-4ibc</guid>
      <description>&lt;p&gt;A couple of years ago I've submitted a project on github. It's called Camex  (Computational Applied Mathematics EXamples) and is developed with Python/PyQt/PyQtWebKit/Python Console and intended to be a collection of applied math or algorithm processing examples with GUI for user input, web browser to show documentation to explain the essence of given example and python console to show algorithm output.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eLKCilv7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dony2nyevv9ednzve9wf.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eLKCilv7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dony2nyevv9ednzve9wf.jpg" alt="Camex image" width="871" height="853"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The code isn't great but it works; also the code is easy to understand. If somebody is interested to add some plugins/examples to it, you're welcome!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/AndreiKeino/camex"&gt;The repo is here&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>CSharp-like-properties-in-python</title>
      <dc:creator>AndreiKeino</dc:creator>
      <pubDate>Tue, 31 Jan 2023 05:24:19 +0000</pubDate>
      <link>https://dev.to/andreikeino/csharp-like-properties-in-python-2i1i</link>
      <guid>https://dev.to/andreikeino/csharp-like-properties-in-python-2i1i</guid>
      <description>&lt;p&gt;&lt;strong&gt;Properties in python that looks a bit like C# ones&lt;/strong&gt;&lt;br&gt;
These can be though of as an alternative implementation of the @property decorator.&lt;br&gt;
&lt;strong&gt;Pros:&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;1. A bit less of typing.&lt;/em&gt;&lt;br&gt;
&lt;em&gt;2. Better code structuring.&lt;/em&gt;&lt;br&gt;
&lt;em&gt;3. More error-prone, as getter/setter/deleter names are predetermined.&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;Cons:&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;1. The implementation can miss something that can be done with good old property declaration.&lt;/em&gt;&lt;br&gt;
&lt;em&gt;2. A lot of things works "behind the scene", i.e. implicitly.&lt;/em&gt;&lt;br&gt;
&lt;a href="https://github.com/AndreiKeino/CSharp-like-properties-in-python" rel="noopener noreferrer"&gt;github page&lt;/a&gt;&lt;/p&gt;

</description>
      <category>crypto</category>
      <category>web3</category>
      <category>blockchain</category>
      <category>offers</category>
    </item>
  </channel>
</rss>
